|
|||||||||||
|
Re: Getting Base Address using the Structured Exception Handler
From: Gerardo Richarte <gera(at)corest.com>
Date: Thu Jun 26 2003 - 10:24:17 EDT Nobody Mind wrote: > I basically am wondering if anyone has links or can
[as you don't ask how, I'm assuming you know how SEH works... anybody else can ask again] Ok, you are asking why using SEH may help in finding the base address of kernel32, not the shellcode itself, right? short answer... I'm not sure why (nor how) :-) I think SEH is used to search for things in memory sometimes, but usually it's used to search for the shellcode, and not kernel32. However, now that you ask about it, I can think of two ways to use SEH to find kernel32 in memory, however, I'm writing realtime, so I'm not sure if it'll work or not (let me know if you try it :-). Oh, and erm... let me get into how, as I said, I don't know the why, and I won't know it unless this hows work :-) 1st trick:
Know an address for each version of kernel32. This address must:
1st not crash, and/or return with a known value for the correct kernel32 versions(*)
2nd crash, and/or return with a different value for all the other kernel32 versions
with this, and using SEH, you could call the known address for each version and
know if it really was the right version, else, try with the next candidate.
(*) versions: only as far as differin versions is needed, if you only need to know the base address of kernel32, it may be enough with just a few entries in your address list, if you need to differentiate between more versions, well, you'd need more entries. 2nd trick:
Now, for the why: if any of the methods here described [specially the second that I like most] works, it's easy to know the why: because it's a nice why to learn gera PS: Now, if you were talking about fs:30 (or any other number) but not fs:0 [SEH], the story is absolutely different Received on Thu Jun 26 12:09:22 2003 This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 14:07:40 EDT |
||||||||||
|
|||||||||||