Completely In-memory Mimikatz with Metasploit
Wednesday, September 5, 2012 at 11:16PM Executing WCE.exe in memory as demoed by Egypt here: https://community.rapid7.com/community/metasploit/blog/2012/05/08/eternal-sunshine-of-the-spotless-ram has two issues with it. 1, you leave a file on disk with your hashes and clear text passwords. That just won't do. 2. There is this DLL called WCEAUX.dll that gets written for the briefest second to disk:

(yes I realize I'm running this on disk 'wce32.exe', but it exhibits the same DLL drop when doing in-memory)
Now, don't get me wrong, I love WCE, and Hernan Ochoa does an amazing job with it, but when it comes down to it, it's the best tool for the job. And today, that's now Mimikatz.
Just like WCE to execute it in memory you use the -m flag for execute:
execute -H -i -c -m -d calc.exe -f mimikatz.exe -a '"sekurlsa::logonPasswords full" exit'
For mimikatz to automatically send commands require double quotes in the command line arguments, so we use single quotes in meterpreter to encircle the execute arguments (-a). Running first "sekurlsa::logonPasswords full" then 'exit' to auto-exit mimikatz console. Like so:

And all you get forensically is calc.exe loading a ton of DLLs it has no business loading but no new files touch disk ;-)

The downloads for Mimikatz are were they always are:
http://blog.gentilkiwi.com/mimikatz
Oh, did I mention that Mimikatz is open source and the in-memory goodness has been uploaded to svn:
https://code.google.com/p/mimikatz/
Awesome work @gentilkiwi
If you want to check out the the fix that was implemented to work with Meterpreter's in-memory goodness check here:
Rob Fuller |
3 Comments |
metasploit,
mimikatz
Reader Comments (3)
Now available in x64 and your clients choice of dismay or horror: https://github.com/rapid7/metasploit-framework/pull/821
I'm having trouble using this technique on 64 bit versions of windows 7 and server 2008 R2. I run the command, the channel is created and I see the process in task manager but I can't interact with the channel and I don't get any output. It works perfectly in 32 bit versions of windows that I've tried. I'm using the 64 bit version of mimikatz as well.
Recompiling meterpreter with your changes worked great. Thanks a lot.