Search
Social Media - Mubix
Login
« Dirty Little Secrets They Didn't Teach You In Pentest Class - Part 2 (Video) | Main | Old School On-target NBNS Spoofing - Part 2 »
Wednesday
Sep052012

Completely In-memory Mimikatz with Metasploit

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:

Screen Shot 2012 09 05 at 10 48 57 PM

(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:

Screen Shot 2012 09 05 at 10 57 45 PM

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

Screen Shot 2012 09 05 at 11 07 35 PM

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:

https://code.google.com/p/mimikatz/source/detail?r=33

Reader Comments (3)

Now available in x64 and your clients choice of dismay or horror: https://github.com/rapid7/metasploit-framework/pull/821

September 22, 2012 | Unregistered Commenterrageltman

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.

October 9, 2012 | Unregistered Commenterjsp

Recompiling meterpreter with your changes worked great. Thanks a lot.

October 11, 2012 | Unregistered Commenterjsp

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>