another nice site:
http://www.metasploit.com/
;)
Windows Shellcode#17 Guest_archphase_*Posted 12 February 2004 - 06:26 PM nazinofix, on Feb 12 2004, 02:20 AM, said: The 'Understanding Windows Shellcode' paper cited earlier in this thread covers the technique of walking down in increments of 16 pages (64KB) to locate the MZ header associated with kernel32 by taking an address that is known to be inside kernel32. It applies this technique with both walking the SEH list to the last handler as well as using a known offset from the top of the stack which is in the TEB. The latter ends up being about 25 bytes all told. Is this what you're describing? Naw..i mailed HDM but havent got a response. When windows spawns a new process it calls CreateProcess which makes a call after the pe loader has done everything. So that means esp on entry is = to somewhere in kernel32. So if the compiler builds a stack frame like most vc++ apps then it'll do like: push ebp mov ebp, esp which means that you can do: mov eax, [esp+4]; account for push ebp and youll find somewhere in kernel32 where i just decriment 1 byte and check for MZ signiture then you can go from there. like that code above i think would generate 15 bytes vs. 25 if you were trying to find the base.
#18
|
Our Sponsors: |

Sign In
Register
Help
MultiQuote