Skip to content

Commit abc76f7

Browse files
committed
Bug Fix
1 parent f7929d0 commit abc76f7

6 files changed

Lines changed: 32 additions & 1 deletion

File tree

MonikaHijack/MonikaShellCode1.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
55
2+
48 8B EC
13
E8 00 00 00 00
24
5A
35
48 83 C2 21
@@ -8,4 +10,5 @@ E8 00 00 00 00
810
48 B8 60 E0 94 1A FC 7F 00 00
911
FF D0
1012
C3
11-
90 90 4A 55 53 74 20 4D 6F 6E 69 6B 61 21 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 41 4C 45 52 54 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0
13+
5D
14+
90 90 4A 55 53 74 20 4D 6F 6E 69 6B 61 21 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 41 4C 45 52 54 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 055

MonikaHijack/demo1.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
// Corrected Shellcode to inject
66
const BYTE shellcode[] = {
7+
0x55, // push rbp
8+
0x48, 0x8B, 0xEC, // mov rbp, rsp
79
0xE8, 0x00, 0x00, 0x00, 0x00, // call $+5 (self-relative)
810
0x5A, // pop rdx
911
0x48, 0x83, 0xC2, 0x21, // add rdx, 0x21 (adjust rdx to point to "JUST Monika!")
@@ -13,6 +15,7 @@ const BYTE shellcode[] = {
1315
0x4D, 0x31, 0xC9, // xor r9, r9 (uType = MB_OK)
1416
0x48, 0xB8, 0x60, 0xE0, 0x94, 0x1A, 0xFC, 0x7F, 0x00, 0x00, // mov rax, <MessageBoxA address>
1517
0xFF, 0xD0, // call rax (call MessageBoxA)
18+
0x5D, // pop rbp
1619
0xC3, // ret
1720
0x90, 0x90, // nop nop (padding)
1821
// MessageBox strings (null-terminated)

MonikaHijack/demo1.exe

0 Bytes
Binary file not shown.

MonikaHijack/demo2.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
// Corrected Shellcode to inject
66
const BYTE shellcode[] = {
7+
0x55, // push rbp
8+
0x48, 0x8B, 0xEC, // mov rbp, rsp
79
0xE8, 0x00, 0x00, 0x00, 0x00, // call $+5 (self-relative)
810
0x5A, // pop rdx
911
0x48, 0x83, 0xC2, 0x21, // add rdx, 0x21 (adjust rdx to point to "JUST Monika!")
@@ -13,6 +15,7 @@ const BYTE shellcode[] = {
1315
0x4D, 0x31, 0xC9, // xor r9, r9 (uType = MB_OK)
1416
0x48, 0xB8, 0x60, 0xE0, 0x94, 0x1A, 0xFC, 0x7F, 0x00, 0x00, // mov rax, <MessageBoxA address>
1517
0xFF, 0xD0, // call rax (call MessageBoxA)
18+
0x5D, // pop rbp
1619
0xC3, // ret
1720
0x90, 0x90, // nop nop (padding)
1821
// MessageBox strings (null-terminated)

MonikaHijack/demo2.exe

0 Bytes
Binary file not shown.

MonikaHijack/test.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#include<windows.h>
2+
3+
const char msg[] = "JUST Monika!";
4+
const char title[] = "ALERT";
5+
6+
void display_message_box()
7+
{
8+
MessageBoxA(0, msg, title, MB_OK);
9+
}
10+
11+
int main()
12+
{
13+
HANDLE hThread;
14+
while(1)
15+
{
16+
// create thread to display message box
17+
hThread = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)display_message_box, 0, 0, 0);
18+
// wait for the thread
19+
WaitForSingleObject(hThread, INFINITE);
20+
}
21+
22+
}

0 commit comments

Comments
 (0)