Exetools  

Go Back   Exetools > General > General Discussion

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 04-24-2005, 04:27
KaGra
 
Posts: n/a
ImpRec module User32.dll overwritting buffer overflow

yeah...used also by Armadillo...

check the attachment,and see the matRiX

tested in WinXP SP1,probablly works in other OS
Attached Files
File Type: zip CrashImpRec.zip (13.6 KB, 28 views)
Reply With Quote
  #2  
Old 04-24-2005, 04:55
KaGra
 
Posts: n/a
more...

it is a PoC=proof of concept.So of course easy to bypass in debugger,but if unknown as a trick and inside the packer's code,is harder...
Reply With Quote
  #3  
Old 04-24-2005, 17:51
MaRKuS-DJM's Avatar
MaRKuS-DJM MaRKuS-DJM is offline
Cracker + Unpacker
 
Join Date: Aug 2003
Location: Virtual World / Network
Posts: 553
Rept. Given: 7
Rept. Rcvd 6 Times in 4 Posts
Thanks Given: 3
Thanks Rcvd at 16 Times in 10 Posts
MaRKuS-DJM Reputation: 6
fixed ImpRec. can't guarantee it works on every OS because fix-code is very lame.

EDIT: updated the file because it didn't work on Windows 98!
Attached Files
File Type: zip ImportREC fixed.zip (167.6 KB, 28 views)

Last edited by MaRKuS-DJM; 04-24-2005 at 19:55.
Reply With Quote
  #4  
Old 04-24-2005, 21:24
TQN TQN is offline
VIP
 
Join Date: Apr 2003
Location: Vietnam
Posts: 358
Rept. Given: 143
Rept. Rcvd 24 Times in 13 Posts
Thanks Given: 196
Thanks Rcvd at 168 Times in 51 Posts
TQN Reputation: 24
Hi MaRKus-DJM !
Intead of posting fixed file, can you explain how do you solve it, and how the Karga EXe crash Imprec. I only saw Karga fill the PE header of User32.dll with 0, and the IAT of Karga's EXE contains invalid RVA address.
Regards,
TQN
Reply With Quote
  #5  
Old 04-24-2005, 22:22
MaRKuS-DJM's Avatar
MaRKuS-DJM MaRKuS-DJM is offline
Cracker + Unpacker
 
Join Date: Aug 2003
Location: Virtual World / Network
Posts: 553
Rept. Given: 7
Rept. Rcvd 6 Times in 4 Posts
Thanks Given: 3
Thanks Rcvd at 16 Times in 10 Posts
MaRKuS-DJM Reputation: 6
ImportRec needs to read the header of user32.dll. it does this in the target process. but there the header got destroyed. i included a little check when ReadProcessMemory is called to compare
lpBaseAddress Parameter of ReadProcessMemory to ModuleBase of user32.dll.
if the check succeeds, i wrote a small read-function which reads the user32.dll loaded by ImportRec instead of the user32.dll used by the target process. so it gets a valid header and valid values.
regards

btw, the invalid IAT-value isn't the point it crashes. most of the time IAT-entry isn't needed.
Reply With Quote
  #6  
Old 04-25-2005, 00:02
nikola nikola is offline
Friend
 
Join Date: Jan 2004
Location: Your head
Posts: 115
Rept. Given: 0
Rept. Rcvd 0 Times in 0 Posts
Thanks Given: 0
Thanks Rcvd at 1 Time in 1 Post
nikola Reputation: 0
Then doesnt this bug exist for all dlls that ImpRec reads when resolving them from program?
Reply With Quote
  #7  
Old 04-25-2005, 00:10
MaRKuS-DJM's Avatar
MaRKuS-DJM MaRKuS-DJM is offline
Cracker + Unpacker
 
Join Date: Aug 2003
Location: Virtual World / Network
Posts: 553
Rept. Given: 7
Rept. Rcvd 6 Times in 4 Posts
Thanks Given: 3
Thanks Rcvd at 16 Times in 10 Posts
MaRKuS-DJM Reputation: 6
the bug only affects to user32.dll. tried it also with kernel32.dll and there were no problems.
Reply With Quote
  #8  
Old 04-25-2005, 10:33
MetaCore
 
Posts: n/a
lame tricks used by lame protecter, dose this is an effective way to protect import table?
but this is have some reserch value for us.
Reply With Quote
Reply


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
OllyDBG v1.10 and ImpREC v1.7f export name buffer overflow vulnerability bukkake General Discussion 0 07-28-2008 03:40
Buffer Overflow in SentinelLM Service prt General Discussion 0 03-19-2005 05:20
Creating a buffer overflow ? Rhodium General Discussion 6 08-19-2003 04:39


All times are GMT +8. The time now is 14:51.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( Since 1998 )