Exploit the Credentials Present in Files and Memory: PowerMemory

ID N0WHERE:147373
Type n0where
Reporter N0where
Modified 2017-01-03T07:03:27


PowerMemory is a PowerShell post-exploitation tool. It uses Microsoft binaries and therefore is able to execute on a machine, even after the Device Guard Policies have been set. In the same way, it will bypass antivirus detection. PowerMemory can retrieve credentials information and manipulate memory. It can execute shellcode and modify process in memory (in userland and kernel land as a rootkit). PowerMemory will access everywhere in user-land and kernel-land by using the trusted Microsoft debugger aka cdb.exe which is digitally signed.

PoweMemory was tested on 2003, 2008r2, 2012, 2012r2 and Windows 7 – 32 and 64 bits, Windows 8 and Windows 10 Home edition.

What’s New?

The method is totally new. It proves that it can be extremely easy to get credentials or any other information from Windows memory without needing to code in C-type languages. In addition, with this method we can modify the user land and kernel land behavior without being caught by antivirus or new defending techniques.

It can actually be done with 4GL language-type or with a script language like PowerShell which is installed everywhere.

With that being said, this technique implies that the detection is made hard due to the fact that we can do pretty much what we want by sending and receiving bytes.

User land attacks

  • Once the Debugger is initialized, PowerMemory interacts with it thanks to PowerShell.

User land features:

  • it’s fully written in PowerShell
  • it can work locally as well as remotely
  • it can get the passwords of virtual machines without having any access to them (works for Hyper-V and VMware)
  • it does not use the operating system .dll to locate credentials address in memory but a Microsoft Signed Debugger
  • it does not use the operating system .dll to decipher passwords collected. PowerMemory maps the keys in the memory and cracks everything by itself (AES, TripleDES, DES-X)
  • it breaks undocumented Microsoft DES-X
  • it works even if you are on a different architecture than the target architecture
  • it leaves no trace in memory
  • a pull request is waiting to be integrated in PowerShell Empire ( https://github.com/PowerShellEmpire/Empire/pull/298 )
  • it can manipulate memory to fool software and operating system
  • it can write the memory to execute shellcode without making any API call, it only sends bytes to write at specific addresses

Advanced shellcode writings

  • PowerMemory executes code by injecting bytes into a remote process and without help of API.

Hypervisor attacks

  • A hypervisor (VMWare or Microsoft Hyper-v) operator who does not own any rights into the Virtual Machines managed by the Hypervisor is, actually, the most powerful person in your organization. PowerMemory can get all the Virtual Machines passwords and lever the concept to get Domain Admin credentials.

Kernel land attacks

  • PowerMemory modifies Kernel structures to get advantages of the Operating System in order to achieve advanced persistence or elevate our privileges.

Real world – weaponization

  • You can use the module waiting to be integrated to leave Wonder Land and launch a crafted advanced attack with PowerShell Empire serving as the vector.

Exploit the Credentials Present in Files and Memory: PowerMemory