rapid7 / rex-powershell

Rex library for dealing with Powershell Scripts
Other
53 stars 34 forks source link

Implement MSIL payload in Rex gem via template #9

Closed sempervictus closed 7 years ago

sempervictus commented 7 years ago

The MSIL JIT execution approach demonstrated by Matt Graeber back in 2013 provides a shellcode injection vector without explicit use of unmanaged memory or even marshalling the associated primitives.

Original post @ Exploit Monday:

PowerShell Empire full-fledged ps1:

Port the Util::EXE version from local fork, reduce size, implement template-based approach with the RandomIdentifier::Generator. Use conditional evaluation to determine if the address of the target method is expressed as UInt32 or Int64 since UInt64 (as used in prior work) does not cast to IntPtr in native 64bit execution.

Testing:

Notes: