-
Notifications
You must be signed in to change notification settings - Fork 145
Fix old win libloader to work under Win7 and Win8 #84
Conversation
Can one of the admins verify this patch? For more information see: https://github.com/rapid7/meterpreter/wiki/CI-Testing |
jenkins, add to whitelist |
Hey @jvazquez-r7, I'll take a look at this today once the kids have headed out to school! |
jenkins, make me a sandwich On May 29, 2014, at 4:03 PM, OJ Reeves [email protected] wrote:
|
Test PASSED. |
thanks @OJ , btw, gimme a sec, noticed a bug at least... shame... |
OK mate, no worries.! |
f_NtMapViewOfSection p_NtMapViewOfSection; | ||
f_NtClose p_NtClose; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very minor indenting issues here, because the existing source uses tabs instead of spaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mmm I'm using tabs too :?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
damnt it... visual studio.... what are you doing with indention?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@OJ, should I do any configuration in visual studio to make it compatible with the current meterpreter indention?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good question :P I left mine as the default (which I don't usually do, because I prefer spaces over tabs). So whatever is default should be fine.
Visual Studio is an epic troll ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
otherwise I've fixed the bug I just spot. guidance about the full pull request is welcome =)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Roger that! Scan of the code looks fine. Will test when the kids are out the door!
Test PASSED. |
Tested rapid7/metasploit-framework#3403 on Windows 7:
|
@jvazquez-r7 Which version of IE should this work on with Windows 8? And do I need any particular patch level for Windows 8? |
@OJ, you'll need and out of date installation without the MS patches in the modules pull requests. IE10 and IE11 should work.Honestly, on Win8 I just tested the loader was working with a dummy DLL (shame...). |
I don't have an out of date installation of Windows 8 :( Will take me some time to get it set up. @Meatballs1 have you got a VM lying around? |
Any ideas why RDLL didn't work? The process should be sandboxed and the DLL is just loaded within the process? Is the IE User Broker thing not hooking CreateProcess (etc) from the DLL because of the way RDLL is loaded? What about RDLL with REFLECTIVEDLLINJECTION_VIA_LOADREMOTELIBRARYR defined? |
@OJ this PR can be verified with a simple HelloWorld dll? The patches only apply to the exploits but the ability to LoadLibrary isn't patched. |
@Meatballs1 yeah I was just hoping to see an end-to-end "real world" not just "hello world" scenario :) |
@Meatballs1 right about reflective DLL injection. |
This is looking fine to me. |
This pull request tries to update the old windows meterpreter library loader to work under Win7 and Win8 when loading libraries from memory.
Actually meterpreter uses Reflective DLL Loader as its main loader on Windows. The reflective DLL loader avoids using LoadLibrary and the OS loader in order to be stealthy, which is awesome. But I found a particular situation where the old library loader was pretty useful. It was while porting some of the IE Sandbox bypasses from James Forshaw to metasploit:
rapid7/metasploit-framework#3402
rapid7/metasploit-framework#3403
rapid7/metasploit-framework#3404
In order to abuse these policies weaknesses you need the vulnerable process (IE Low Privilege) to load the exploit through LoadLibrary in order to apply the sandboxing. Otherwise policies don't apply and Process Created from the IE are always Low Privilege.
That said, this pull request just tries to fix the old meterpreter library loader to work under Windows 7 and Windows 8 when loading a library from memory, so we don't need to drop the exploit lib to disk. In oder to do it:
Verification steps