Remote Exploit Forums

Go Back   Remote Exploit Forums > Specialist Topics > Pentesting


Pentesting Specific topics related to legal penetration testing

Reply
 
LinkBack Thread Tools Display Modes
  #21 (permalink)  
Old 10-17-2009, 04:50 AM
Lincoln's Avatar
Senior Member
 
Join Date: Apr 2008
Posts: 319
Default

Here is an easy to read pdf from muts about SEH: http://www.remote-exploit.org/adviso...lobalscape.pdf
__________________
Homer: You don't like your job, you don't strike. You go in every day and do it really half-assed. That's the American way.
Reply With Quote
  #22 (permalink)  
Old 10-17-2009, 04:54 AM
Member
 
Join Date: Oct 2008
Posts: 34
Default

Thanks, that's just what I needed. Uh, just a little question, it seems like the 0x00 might be a bad character, but since the other POP POP RET I found that started with 0x77 was in ntdll, so of course...ASLR. Is there anyway to bypass ASLR? If not..uh do I just keep trying to exploit it over and over until it works lol?

Last edited by oib111; 10-17-2009 at 06:33 AM.
Reply With Quote
  #23 (permalink)  
Old 10-17-2009, 06:41 AM
lupin's Avatar
Moderator
 
Join Date: Mar 2009
Location: Australia
Posts: 945
Default

Quote:
Originally Posted by oib111 View Post
Now, if the problem persists, it is possible that 0xEB is a bad character, right?
I suppose its possible, although I dont recall having had \0xeb as a bad character myself. You can confirm using the method I specified above (try sending buffers that are otherwise identical except that one contains \0xeb instead of something like \x41, and confirm that EIP gets overwritten with an identical value each time).

Quote:
Originally Posted by oib111 View Post
I don't know much about SEH, but I feel like that 0x0feb9090 as the pointer to the next SEH record is causing some problems.
The SEH address is used as an exception handler when a program crashes - execution jumps to that address, which usually points to a function that throws up an error message and closes the program.

If you were to trigger an EIP overwrite in Ollydbg, with EIP being overwritten with something like 42424242, and then you pass that exception to the program, the SEH handler should be called next. In this case the SEH value would matter. However, if you are using an EIP overwrite to redirect execution however, with the EIP value set to a valid address that contains valid commands for the CPU to run, then the SEH shouldnt get called.
__________________
Nancy Astor: If I were your wife I would put poison in your coffee!
Winston Churchill: Madam, if I were your husband I would drink it.
Reply With Quote
  #24 (permalink)  
Old 10-17-2009, 07:19 AM
Member
 
Join Date: Oct 2008
Posts: 34
Default

Oh ok, so I don't have to worry about SEH at all. Also, since 0x00 is a bad character and Windows 7 implements ASLR, how exactly can I jump to the POP POP RET in ntdll? Is there any way to bypass ASLR?
Reply With Quote
  #25 (permalink)  
Old 10-17-2009, 07:26 AM
lupin's Avatar
Moderator
 
Join Date: Mar 2009
Location: Australia
Posts: 945
Default

Quote:
Originally Posted by oib111 View Post
Oh ok, so I don't have to worry about SEH at all.
If you can manage to overwrite it you can use it to help make your exploit more stable (if the EIP overwrite crashes the program instead of redirecting execution for example), but no, you dont HAVE to worry about it if the EIP overwrite works.

Quote:
Originally Posted by oib111 View Post
Also, since 0x00 is a bad character and Windows 7 implements ASLR, how exactly can I jump to the POP POP RET in ntdll? Is there any way to bypass ASLR?
I havent had to deal with ASLR myself as yet, so I can't really advise on that. Are you sure you cant find a POP POP RET anywhere else? And you cant try this on Windows XP instead? You probably want to keep things as simple as you can for your first overwrite...
__________________
Nancy Astor: If I were your wife I would put poison in your coffee!
Winston Churchill: Madam, if I were your husband I would drink it.
Reply With Quote
  #26 (permalink)  
Old 10-17-2009, 07:32 AM
Member
 
Join Date: Oct 2008
Posts: 34
Default

Well it seems that the POP POP RETs that don't start with 0x00 are in DLLs so ASLR will always be a problem there. I might do some googling on ASLR bypass, but if not I will just do this on XP.

EDIT:

Trying this on XP but I'm having some problems.



I think I'm overwriting the pointer to next SEH record or the SEH handler or something and so it jumps to a random place in the program and can't fix the exception, hence the "Debugged program was unable to process exception."

Last edited by oib111; 10-17-2009 at 06:35 PM.
Reply With Quote
  #27 (permalink)  
Old 10-20-2009, 08:45 AM
lupin's Avatar
Moderator
 
Join Date: Mar 2009
Location: Australia
Posts: 945
Default

Quote:
Originally Posted by oib111 View Post
Trying this on XP but I'm having some problems.

I think I'm overwriting the pointer to next SEH record or the SEH handler or something and so it jumps to a random place in the program and can't fix the exception, hence the "Debugged program was unable to process exception."
Does that happen when you are feeding the program a simple buffer of all '\x41'?
__________________
Nancy Astor: If I were your wife I would put poison in your coffee!
Winston Churchill: Madam, if I were your husband I would drink it.
Reply With Quote
  #28 (permalink)  
Old 10-21-2009, 01:57 AM
Member
 
Join Date: Oct 2008
Posts: 34
Default

No because then the EIP isn't valid and it just crashes.
Reply With Quote
  #29 (permalink)  
Old 10-21-2009, 04:20 AM
lupin's Avatar
Moderator
 
Join Date: Mar 2009
Location: Australia
Posts: 945
Default

Quote:
Originally Posted by oib111 View Post
No because then the EIP isn't valid and it just crashes.
Can you overwrite EIP with a value you can control? If you can control EIP, then the value of SEH doesn't matter.

What particular piece of 3COM software are you using for this and how are you triggering the overflow? Download link? I may try and reproduce myself if I have a spare moment, because Ive been keen to do another buffer overflow for a while but haven't found a good candidate...
__________________
Nancy Astor: If I were your wife I would put poison in your coffee!
Winston Churchill: Madam, if I were your husband I would drink it.
Reply With Quote
  #30 (permalink)  
Old 10-21-2009, 04:27 AM
Member
 
Join Date: Oct 2008
Posts: 34
Default

Here's a download link: https://www.securinfos.info/old_soft...aemon_2r10.exe

Also, if I overwrite EIP with a valid return address that happens (what's in the picture).
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 09:13 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2