📚 OpenRCE is preserved as a read-only archive. Launched at RECon Montreal in 2005. Registration and posting are disabled.








Flag: Tornado! Hurricane!

Blogs >> cyphunk's Blog

Created: Sunday, January 22 2006 12:15.14 CST Modified: Sunday, January 22 2006 12:15.14 CST
This is an imported entry. View original. Printer Friendly ...
cyphunk
Author: cyphunk # Views: 264


Bugger The Debugger, Pre Interaction Debugger Code Execution
By Brett Moore, CTO Security-Assessment.com. 10 pages of text, 3 of which are code.

This paper describes a method to construct a binary which can run code before control is passed to a debugger. The method requires changing the PE header of an executable to reference your own dll. This could be your own DLL or you could create a malicious version of kernel32.dll. In both cases you will need to edit the import PE header section to reference your DLL. In the case of using a kernel32.dll copy you must change the name of the dll to a unique name and replace the import reference in the PE headers for kernel32.dll to that of your DLL.

The document describes how to impliment both methods, including how to create your own malicious version of kernel32.dll. Edit a copy of kernel32.dll to construct on injection of your own code:

7C598934 FF 15 4C 13 57 7C call dword ptr ds:[7C57134Ch]
7C59893A FF 55 08 call dword ptr [ebp+8]
7C59893D 50 push eax
7C59893E EB 27 jmp 7C598967
7C598940 8B 45 EC mov eax,dword ptr [ebp-14h]

With

7C598934 FF 15 4C 13 57 7C call dword ptr ds:[7C57134Ch]
7C59893A 8B 5D 08 mov ebx,[ebp+08]
7C59893D 66 BB 00 10 mov bx,1000h
7C59893E FF E3 jmp ebx
7C598940 8B 45 EC mov eax,dword ptr [ebp-14h]

The mov bx,1000h sets the place for the start of your malicious code. The document also describes how construct the referenced code so that after injecting itself it reloads the original kernel32.dll should any other DLL’s need to import their own instances of kernel32 functions.



If you wish to comment on this blog entry, please do so on the original site it was imported from.

There are 31,328 total registered users.


Recently Created Topics
[help] Unpacking VMP...
Mar/12
Reverse Engineering ...
Jul/06
let 'IDAPython' impo...
Sep/24
set 'IDAPython' as t...
Sep/24
GuessType return une...
Sep/20
About retrieving the...
Sep/07
How to find specific...
Aug/15
How to get data depe...
Jul/07
Identify RVA data in...
May/06
Question about memor...
Dec/12


Recent Forum Posts
Finding the procedur...
rolEYder
Question about debbu...
rolEYder
Identify RVA data in...
sohlow
let 'IDAPython' impo...
sohlow
How to find specific...
hackgreti
Problem with ollydbg
sh3dow
How can I write olly...
sh3dow
New LoadMAP plugin v...
mefisto...
Intel pin in loaded ...
djnemo
OOP_RE tool available?
Bl4ckm4n


Recent Blog Entries
halsten
Mar/14
Breaking IonCUBE VM

oleavr
Oct/24
Anatomy of a code tracer

hasherezade
Sep/24
IAT Patcher - new tool for ...

oleavr
Aug/27
CryptoShark: code tracer ba...

oleavr
Jun/25
Build a debugger in 5 minutes

More ...


Recent Blog Comments
nieo on:
Mar/22
IAT Patcher - new tool for ...

djnemo on:
Nov/17
Kernel debugger vs user mod...

acel on:
Nov/14
Kernel debugger vs user mod...

pedram on:
Dec/21
frida.github.io: scriptable...

capadleman on:
Jun/19
Using NtCreateThreadEx for ...

More ...


Imagery
SoySauce Blueprint
Jun 6, 2008

[+] expand

View Gallery (11) / Submit