forked from derv82/wifite
-
Notifications
You must be signed in to change notification settings - Fork 4
/
wifite.py
executable file
·4499 lines (3973 loc) · 204 KB
/
wifite.py
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
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
wifite
author: derv82 at gmail
author: bwall @botnet_hunter ([email protected])
author: drone @dronesec ([email protected])
author: brianpow at gmail
Thanks to everyone that contributed to this project.
If you helped in the past and want your name here, shoot me an email
Licensed under the GNU General Public License Version 2 (GNU GPL v2),
available at: http://www.gnu.org/licenses/gpl-2.0.txt
(C) 2011-2015 Derv Merkler
"""
# ############
# LIBRARIES #
#############
import csv # Exporting and importing cracked aps
import os # File management
import time # Measuring attack intervals
import random # Generating a random MAC address.
import errno # Error numbers
import math
from sys import argv # Command-line arguments
from sys import stdout # Flushing
from shutil import copy # Copying .cap files
# Executing, communicating with, killing processes
from subprocess import Popen, call, PIPE
from signal import SIGINT, SIGTERM
import re # RegEx, Converting SSID to filename
import argparse # arg parsing
import urllib # Check for new versions from the repo
import abc # abstract base class libraries for attack templates
import glob
################################
# GLOBAL VARIABLES IN ALL CAPS #
################################
# Console colors
W = '\033[0m' # white (normal)
R = '\033[31m' # red
G = '\033[32m' # green
O = '\033[33m' # orange
B = '\033[34m' # blue
P = '\033[35m' # purple
C = '\033[36m' # cyan
GR = '\033[37m' # gray
# /dev/null, send output from programs so they don't print to screen.
DN = open(os.devnull, 'w')
ERRLOG = open(os.devnull, 'w')
OUTLOG = open(os.devnull, 'w')
UPDATE_URLS=["https://github.com/derv82/wifite/raw/master/wifite.py","https://github.com/brianpow/wifite/raw/master/wifite.py"]
###################
# DATA STRUCTURES #
###################
class CapFile:
"""
Holds data about an access point's .cap file, including AP's ESSID & BSSID.
"""
def __init__(self, filename, ssid = "", bssid= ""):
self.filename = filename
self.ssid = ssid
self.bssid = bssid
if ssid == "" and bssid == "":
#Guess bssid from filename
if re.match(".*(([A-Za-z0-9]{2}-){5}[A-Za-z0-9]{2}).*",filename):
matches=re.match(".*(([A-Za-z0-9]{2}-){5}[A-Za-z0-9]{2}).*",filename)
results= matches.groups()
bssid =results[0].replace("-",":")
if ssid == "" and bssid != "":
self.ssid=self.get_ssid(bssid)
if bssid == "" and ssid != "":
self.bssid=self.get_bssid(ssid)
def get_ssid(self,bssid):
"""
Attempts to get ESSID from cap file using BSSID as reference.
Returns '' if not found.
"""
if not file_search('tshark'): return ''
cmd = ['tshark',
'-r', self.filename,
'-R', 'wlan.fc.type_subtype == 0x05 && wlan.sa == %s' % bssid,
'-n']
proc = Popen(cmd, stdout=PIPE, stderr=DN)
proc.wait()
for line in proc.communicate()[0].split('\n'):
if line.find('SSID=') != -1:
essid = line[line.find('SSID=') + 5:]
println_info('guessed essid: %s' % (G + essid + W))
return essid
println_error('unable to guess essid!')
return ''
def get_bssid(self,essid):
"""
Returns first BSSID of access point found in cap file.
This is not accurate at all, but it's a good guess.
Returns '' if not found.
"""
global RUN_CONFIG
capfile=self.filename
if not file_search('tshark'): return ''
# Attempt to get BSSID based on ESSID
if essid != '':
cmd = ['tshark',
'-r', capfile,
'-R', 'wlan_mgt.ssid == "%s" && wlan.fc.type_subtype == 0x05' % (essid),
'-n', # Do not resolve MAC vendor names
'-T', 'fields', # Only display certain fields
'-e', 'wlan.sa'] # souce MAC address
proc = Popen(cmd, stdout=PIPE, stderr=DN)
proc.wait()
bssid = proc.communicate()[0].split('\n')[0]
if bssid != '': return bssid
cmd = ['tshark',
'-r', capfile,
'-R', 'eapol',
'-n']
proc = Popen(cmd, stdout=PIPE, stderr=DN)
proc.wait()
for line in proc.communicate()[0].split('\n'):
if line.endswith('Key (msg 1/4)') or line.endswith('Key (msg 3/4)'):
while line.startswith(' ') or line.startswith('\t'): line = line[1:]
line = line.replace('\t', ' ')
while line.find(' ') != -1: line = line.replace(' ', ' ')
return line.split(' ')[2]
elif line.endswith('Key (msg 2/4)') or line.endswith('Key (msg 4/4)'):
while line.startswith(' ') or line.startswith('\t'): line = line[1:]
line = line.replace('\t', ' ')
while line.find(' ') != -1: line = line.replace(' ', ' ')
return line.split(' ')[4]
return ''
class Target:
"""
Holds data for a Target (aka Access Point aka Router)
"""
def __init__(self, bssid, power, data, channel, encryption, ssid, wps = False, key="", wps_locked = False):
self.bssid = bssid
self.power = int(power)
self.data = data
self.channel = channel
self.encryption = encryption
self.ssid = ssid
self.wps = wps # Default to non-WPS-enabled router.
self.wps_locked= wps_locked
self.key = key
def __str__(self):
return re.sub(r'[^a-zA-Z0-9]', '', self.ssid) \
+ '_' + self.bssid.replace(':', '-') + '_' + self.encryption.lower()
def equal(self,target):
#if target is
if target.bssid == self.bssid:
return True
def find_clients(self, clients):
associated_clients=[]
for client in clients:
if client.station == self.bssid:
associated_clients.append(client)
return associated_clients
def count_clients(self, clients):
return len(self.find_clients(clients))
class Client:
"""
Holds data for a Client (device connected to Access Point/Router)
"""
def __init__(self, bssid, station, power, essid = ""):
self.bssid = bssid
self.station = station
self.power = power
self.essid = essid
class RunConfiguration:
"""
Configuration for this rounds of attacks
"""
def __init__(self):
self.REVISION = 103;
self.PRINTED_SCANNING = False
#INTERFACE
self.TX_POWER = 0 # Transmit power for wireless interface, 0 uses default power
self.IFACE_TO_TAKE_DOWN = None # Interface that wifite puts into monitor mode
# It's our job to put it out of monitor mode after the attacks
#self.ORIGINAL_IFACE_MAC = ('', '') # Original interface name[0] and MAC address[1] (before spoofing)
#self.THIS_MAC = '' # The interfaces current MAC address.
self.WIRELESS_IFACE = '' # User-defined interface
#self.MONITOR_IFACE = '' # User-defined interface already in monitor mode
#TARGET
self.SCAN_FILE_LOAD=""
self.SCAN_FILE_SAVE=""
self.SHOW_TARGET=""
self.ATTACK_TARGET=""
self.SCAN_TIMEOUT=0
self.COLUMN = 1 # Numbers of columns in scanning state
self.SPACING = 1 # Spacing between Columns
self.SCAN_MAX_ROW_SHOW = 0
self.SCAN_DEAUTH_TIMEOUT = 10
# WPA variables
#self.WPA_DISABLE = False # Flag to skip WPA handshake capture
self.WPA_ATTACK_DISABLE=False
self.WPA_STRIP_HANDSHAKE = True # Use pyrit or tshark (if applicable) to strip handshake
self.WPA_DEAUTH_COUNT = 5 # Count to send deauthentication packets
self.WPA_DEAUTH_TIMEOUT = 10 # Time to wait between deauthentication bursts (in seconds)
self.WPA_ATTACK_TIMEOUT = 500 # Total time to allow for a handshake attack (in seconds)
self.WPA_HANDSHAKE_DIR = 'hs' # Directory in which handshakes .cap files are stored
# Move old hs folder to wpa folder
if not os.path.exists(self.WPA_HANDSHAKE_DIR):
self.WPA_HANDSHAKE_DIR='wpa'
elif not os.path.exists('wpa'):
call(['mv',self.WPA_HANDSHAKE_DIR,'wpa'])
self.WPA_HANDSHAKE_DIR=add_slash('wpa')
self.WPA_RECAPTURE_HS=False
self.WPA_FINDINGS = [] # List of strings containing info on successful WPA attacks
self.WPA_CRACK = 0 # Flag to skip cracking of handshakes
self.WPA_DICTIONARY = '/pentest/web/wfuzz/wordlist/fuzzdb/wordlists-user-passwd/passwds/phpbb.txt'
if not os.path.exists(self.WPA_DICTIONARY): self.WPA_DICTIONARY = ''
self.WPA_HASH=""
# Various programs to use when checking for a four-way handshake.
# True means the program must find a valid handshake in order for wifite to recognize a handshake.
# Not finding handshake short circuits result (ALL 'True' programs must find handshake)
self.WPA_HANDSHAKE_TSHARK = True # Checks for sequential 1,2,3 EAPOL msg packets (ignores 4th)
self.WPA_HANDSHAKE_PYRIT = False # Sometimes crashes on incomplete dumps, but accurate.
self.WPA_HANDSHAKE_AIRCRACK = True # Not 100% accurate, but fast.
self.WPA_HANDSHAKE_COWPATTY = False # Uses more lenient "nonstrict mode" (-2)
# WEP variables
#self.WEP_DISABLE = False # Flag for ignoring WEP networks
self.WEP_IVS_DIR = add_slash('wep') # Directory in which WEP IVS files are stored
self.WEP_PPS = 600 # packets per second (Tx rate)
self.WEP_TIMEOUT = 600 # Amount of time to give each attack
self.WEP_ARP_REPLAY = True # Various WEP-based attacks via aireplay-ng
self.WEP_CHOPCHOP = True #
self.WEP_FRAGMENT = True #
self.WEP_CAFFELATTE = True #
self.WEP_P0841 = True
self.WEP_HIRTE = True
self.WEP_CRACK_AT_IVS = 10000 # Number of IVS at which we start cracking
self.WEP_IGNORE_FAKEAUTH = True # When True, continues attack despite fake authentication failure
self.WEP_FINDINGS = [] # List of strings containing info on successful WEP attacks.
self.WEP_SAVE = True # Save packets.
self.WEP_SAVE_IV = False # Save packets.
# WPS variables
self.WPS_CHECK_DISABLE = False # Flag to skip WPS scan
self.WPS_PIN_ATTACK_DISABLE=False
self.WPS_DUST_ATTACK_DISABLE=False
self.WPS_FINDINGS = [] # List of (successful) results of WPS attacks
self.WPS_TIMEOUT = 660 # Time to wait (in seconds) for successful PIN attempt
self.WPS_RATIO_THRESHOLD = 0.01 # Lowest percentage of tries/attempts allowed (where tries > 0)
self.WPS_MAX_RETRIES = 0 # Number of times to re-try the same pin before giving up completely.
self.WPS_SESSION_DIR = add_slash('wps') # Directory in which handshakes .cap files are stored
self.WPS_SAVE = True
# Program variables
self.SHOW_ALREADY_CRACKED = False # Says whether to show already cracked APs as options to crack
self.TARGET_CHANNEL = 0 # User-defined channel to scan on
self.TARGET_ESSID = '' # User-defined ESSID of specific target to attack
self.TARGET_BSSID = '' # User-defined BSSID of specific target to attack
self.DO_NOT_CHANGE_MAC = False # Flag for disabling MAC anonymizer
self.TARGETS_REMAINING = 0 # Number of access points remaining to attack
self.WPA_CAPS_TO_CRACK = [] # list of .cap files to crack (full of CapFile objects)
self.SHOW_MAC_IN_SCAN = False # Display MACs of the SSIDs in the list of targets
self.CRACKED_TARGETS = [] # List of targets we have already cracked
self.CRACKED_RECORD="cracked.csv"
self.DECLOAKED_RECORD="decloaked.csv"
#self.ATTACK_ALL_TARGETS = False # Flag for when we want to attack *everyone*
#self.ATTACK_MIN_POWER = 0 # Minimum power (dB) for access point to be considered a target
self.VERBOSE_APS = True # Print access points as they appear
self.CRACKED_TARGETS = self.load_cracked()
self.DECLOAKED_TARGETS = self.load_decloaked()
self.DEBUG = False
old_cracked = self.load_old_cracked()
if len(old_cracked) > 0:
# Merge the results
for OC in old_cracked:
new = True
for NC in self.CRACKED_TARGETS:
if OC.bssid == NC.bssid:
new = False
break
# If Target isn't in the other list
# Add and save to disk
if new:
self.save_cracked(OC)
self.temp = ""
def ConfirmRunningAsRoot(self):
if os.getuid() != 0:
println_error('ERROR:' + G + ' wifite' + O + ' must be run as ' + R + 'root')
println_error('login as root (' + W + 'su root' + O + ') or try ' + W + 'sudo ./wifite.py')
exit(1)
def ConfirmCorrectPlatform(self):
if not 'uname' in dir(os) or not os.uname()[0].startswith("Linux") and not 'Darwin' in os.uname()[0]: # OSX support, 'cause why not?
println_error(G + ' wifite' + W + ' must be run on ' + O + 'linux' + W)
exit(1)
def CreateTempFolder(self):
from tempfile import mkdtemp
self.temp = mkdtemp(prefix='wifite' + str(time.time()))
if not self.temp.endswith(os.sep):
self.temp += os.sep
println_info("temp folder %s" % self.temp)
def load_decloaked(self):
result = []
filename=self.DECLOAKED_RECORD
if not os.path.exists(filename): return result
with open(filename, 'rb') as csvfile:
targetreader = csv.reader(csvfile, delimiter=',', quotechar='"')
for i,target in enumerate(targetreader):
if i != 0 or target[0] != "SSID":
# bssid, power, data, channel, encryption, ssid, wps = False, key=""):
result.append(Target(target[1],0,0,target[2],target[3],target[0],bool(target[4])))
return result
def save_decloaked(self, target):
self.DECLOAKED_TARGETS.append(target)
filename = self.DECLOAKED_RECORD
with open(filename, 'wb') as csvfile:
targetwriter = csv.writer(csvfile, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
try:
targetwriter.writerow(["SSID", "BSSID", "Channel", "Encryption", "WPS?", "Create Date"])
for target in self.DECLOAKED_TARGETS:
targetwriter.writerow([target.ssid, target.bssid, target.channel, target.encryption, target.wps, time.strftime("%Y-%m-%d %H:%M:%S")])
except:
println_error("unable to save decloaked target to %s!" % G + filename + W)
pass
def save_cracked(self, target):
"""
Saves cracked access point key and info to a file.
"""
self.CRACKED_TARGETS.append(target)
filename = self.CRACKED_RECORD
with open(filename, 'wb') as csvfile:
targetwriter = csv.writer(csvfile, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
try:
for target in self.CRACKED_TARGETS:
targetwriter.writerow([target.bssid, target.encryption, target.ssid, target.key, target.wps])
except:
println_error("unable to save cracked target to %s!" % G + filename + W)
pass
def load_cracked(self):
"""
Loads info about cracked access points into list, returns list.
"""
result = []
filename=self.CRACKED_RECORD
if not os.path.exists(filename): return result
with open(filename, 'rb') as csvfile:
targetreader = csv.reader(csvfile, delimiter=',', quotechar='"')
for row in targetreader:
t = Target(row[0], 0, 0, 0, row[1], row[2], row[4],row[3])
result.append(t)
return result
def load_old_cracked(self):
"""
Loads info about cracked access points into list, returns list.
"""
result = []
if not os.path.exists('cracked.txt'):
return result
fin = open('cracked.txt', 'r')
lines = fin.read().split('\n')
fin.close()
for line in lines:
fields = line.split(chr(0))
if len(fields) <= 3:
continue
tar = Target(fields[0], '', '', '', fields[3], fields[1])
tar.key = fields[2]
result.append(tar)
return result
def temp_clean_up(self):
if self.temp != "" and os.path.exists(self.temp):
for f in os.listdir(self.temp):
os.remove(self.temp + f)
os.rmdir(self.temp)
def exit_gracefully(self, code=0):
"""
We may exit the program at any time.
We want to remove the temp folder and any files contained within it.
Removes the temp files/folder and exists with error code "code".
"""
# Remove temp files and folder
self.temp_clean_up()
# Disable monitor mode if enabled by us
if self.IFACE_TO_TAKE_DOWN:
print GR + ' [+]' + W + ' disabling monitor mode on %s...' % (G + self.IFACE_TO_TAKE_DOWN.iface + W),
stdout.flush()
self.IFACE_TO_TAKE_DOWN.disable_monitor_mode()
print 'done'
# Change MAC address back if spoofed
self.IFACE_TO_TAKE_DOWN.set_real_mac()
println_info("quitting") # wifite will now exit"
print ''
# GTFO
exit(code)
def handle_args(self):
"""
Handles command-line arguments, sets global variables.
"""
#set_encrypt = False
set_hscheck = False
set_wep = False
capfile = '' # Filename of .cap file to analyze for handshakes
opt_parser = self.build_opt_parser()
options = opt_parser.parse_args()
try:
'''
if not set_encrypt and (options.wpa or options.wep or options.wps):
self.WPS_DISABLE = True
self.WPA_DISABLE = True
self.WEP_DISABLE = True
set_encrypt = True
'''
if options.recrack:
self.SHOW_ALREADY_CRACKED = True
println_info('including already cracked networks in targets.')
if options.timeout != None:
if options.timeout.isdigit():
if int(options.timeout.isdigit())>=0:
self.SCAN_TIMEOUT=options.timeout
else:
println_error('invalid timeout value %s' % (G + str(options.timeout) + W))
#println_info('criteria to stop scanning state: ' + G + str(options.timeout) + W)
else:
self.SCAN_TIMEOUT=options.timeout
#println_error('invalid timeout value %s' % (G + str(options.timeout) + W))
if options.load != None:
self.SCAN_FILE_LOAD=options.load
if options.save != None:
self.SCAN_FILE_SAVE=options.save
if options.show:
self.SHOW_TARGET=options.show
println_info('filter targets in scanning state: ' + G + options.show)
if options.scan_max_row_show > 0:
self.SCAN_MAX_ROW_SHOW = options.scan_max_row_show
println_info('max rows of targets to show in scanning state: ' + G + str(options.scan_max_row_show))
if options.attack:
self.ATTACK_TARGET=options.attack
if options.wpa:
if self.SHOW_TARGET != "": self.SHOW_TARGET + ","
self.SHOW_TARGET+="wpa"
#if self.ATTACK_TARGET != "": self.ATTACK_TARGET + ","
#self.ATTACK_TARGET+="wpa"
#if options.wps:
if options.wps:
println_info('showing ' + G + 'WPA' + W + ' encrypted networks.')
else:
println_info('showing ' + G + 'WPA' + W + ' encrypted networks (use ' + G + '--wps' + W + ' for WPS scan)')
self.WPS_DUST_ATTACK_DISABLE=true
self.WPS_PIN_ATTACK_DISABLE=true
#self.WPA_ATTACK_DISABLE = False
self.WPA_RECAPTURE_HS = options.recapture
if options.wep:
if self.SHOW_TARGET != "": self.SHOW_TARGET + ","
self.SHOW_TARGET+="wep"
#if self.ATTACK_TARGET != "": self.ATTACK_TARGET + ","
#self.ATTACK_TARGET+="wep"
println_info('showing ' + G + 'WEP' + W + ' encrypted networks')
#self.WEP_DISABLE = False
if options.wps:
if self.SHOW_TARGET != "": self.SHOW_TARGET + ","
self.SHOW_TARGET="wps"
#if self.ATTACK_TARGET != "": self.ATTACK_TARGET + ","
#self.ATTACK_TARGET="wps"
if not options.wpa:
self.WPA_ATTACK_DISABLE = true
println_info('showing ' + G + 'WPS-enabled' + W + ' networks.')
#self.WPS_CHECK_DISABLE = False
#self.WPS_ATTACK_DISABLE = False
if options.nowps:
self.WPS_PIN_ATTACK_DISABLE = True
println_info('wPS PIN attack ' + G + 'disabled')
if options.nopixie:
self.WPS_DUST_ATTACK_DISABLE = True
println_info('wPS pixie dust attack ' + G + 'disabled')
if options.nowpa:
self.WPA_ATTACK_DISABLE = True
println_info('wPS handshake attack ' + G + 'disabled')
if options.channel:
channel=options.channel
if( channel>= 1 and channel<=12):
self.TARGET_CHANNEL = channel
println_info('Filter channel in scanning state: %s' % (G + str(self.TARGET_CHANNEL) + W))
else:
println_warning('invalid channel: ' + O + str(options.channel) + W)
if options.realmac:
println_info('mac address anonymizing ' + G + 'disabled' + W + "\n" +' not: only works if device is not already in monitor mode!' + W)
self.DO_NOT_CHANGE_MAC = True
if options.interface:
self.WIRELESS_IFACE = options.interface
println_info('set interface :%s' % (G + self.WIRELESS_IFACE + W))
if options.monitor_interface:
self.MONITOR_IFACE = options.monitor_interface
println_info('set interface already in monitor mode :%s' % (G + self.MONITOR_IFACE + W))
if options.essid:
#try:
self.TARGET_ESSID = options.essid
#except ValueError:
# println_error('no ESSID given!' + W
#else:
println_info('targeting ESSID "%s"' % (G + self.TARGET_ESSID + W))
if options.bssid:
#try:
self.TARGET_BSSID = options.bssid
#except ValueError:
# println_error('no BSSID given!' + W
#else:
println_info('targeting BSSID "%s"' % (G + self.TARGET_BSSID + W))
if options.showb:
self.SHOW_MAC_IN_SCAN = True
println_info('target MAC address viewing ' + G + 'enabled')
if options.all:
#self.ATTACK_ALL_TARGETS = True
self.ATTACK_TARGET= 'all'
self.SCAN_TIMEOUT = 10
println_info('targeting ' + G + 'all access points')
if options.power:
#try:
if options.power > 0 and options.power <= 100:
if self.SHOW_TARGET!="":
self.SHOW_TARGET+=","
self.SHOW_TARGET+="-p<=" + power
else:
println_error('invalid power level: %s' % (R + str(options.power)+ W))
#except IndexError:
# println_error('no power level given!' + W
#else:
# println_info('minimum target power set to %s' % (G + str(self.ATTACK_MIN_POWER) + W))
if options.two:
self.COLUMN = 2
if options.tx != None:
if options.tx >= 0:
self.TX_POWER = options.tx
println_info('TX power level set to %s' % (G + str(self.TX_POWER) + W))
else:
println_error('invalid TX power leve: %s' % ( R + str(options.tx) + W))
#except IndexError:
# println_error('no TX power level given!')
#else:
self.DEBUG=options.debug
if options.quiet:
self.VERBOSE_APS = False
println_info('listing of found networks during scan ' + O + 'disabled')
if options.check:
try:
capfile = options.check
except IndexError:
println_error('unable to analyze capture file')
println_error('no cap file given!\n')
self.exit_gracefully(1)
else:
if not os.path.exists(capfile):
println_error('unable to analyze capture file!')
println_error('file not found: ' + R + capfile + '\n')
self.exit_gracefully(1)
if options.update:
self.update()
exit(0)
if options.cracked:
if len(self.CRACKED_TARGETS) == 0:
println_error('There are no cracked access points saved to ' + R + 'cracked.db\n')
self.exit_gracefully(1)
println_info('' + W + 'previously cracked access points' + W + ':')
for victim in self.CRACKED_TARGETS:
if victim.wps != False:
println_info(' %s (%s) : "%s" - Pin: %s' % (C + victim.ssid + W, C + victim.bssid + W, G + victim.key + W, G + victim.wps + W))
else:
println_info(' %s (%s) : "%s"' % (C + victim.ssid + W, C + victim.bssid + W, G + victim.key + W))
print ''
self.exit_gracefully(0)
# WPA
if not set_hscheck and (options.tshark or options.cowpatty or options.aircrack or options.pyrit):
self.WPA_HANDSHAKE_TSHARK = False
self.WPA_HANDSHAKE_PYRIT = False
self.WPA_HANDSHAKE_COWPATTY = False
self.WPA_HANDSHAKE_AIRCRACK = False
set_hscheck = True
if options.strip:
self.WPA_STRIP_HANDSHAKE = True
println_info('handshake stripping ' + G + 'enabled')
if options.wpadt != None:
if options.wpadt >= 0:
self.WPA_DEAUTH_TIMEOUT = options.wpadt
println_info('WPA deauth timeout set to %s' % (G + str(self.WPA_DEAUTH_TIMEOUT) + W))
else:
println_error('invalid deauth timeout: %s' % (R + str(options.wpadt) + W))
if options.wpat != None:
if options.wpat >= 0:
self.WPA_ATTACK_TIMEOUT = int(options.wpat)
println_info('WPA attack timeout set to %s' % (G + str(self.WPA_ATTACK_TIMEOUT) + W))
else:
println_error('invalid attack timeout: %s' % (R + str(options.wpat) + W))
#print options
self.WPA_CRACK = options.crack
if self.WPA_CRACK:
println_info('WPA cracking ' + G + 'enabled')
if options.dic:
if os.path.exists(options.dic):
self.WPA_DICTIONARY=options.dic
println_info('WPA dictionary set to %s' % (G + self.WPA_DICTIONARY + W))
else:
println_error('WPA dictionary file not found: %s' % (G + options.dic + W))
if options.hash:
if os.path.exists(options.hash):
self.WPA_HASH=options.hash
println_info('WPA hash table set to %s' % (G + self.WPA_HASH + W))
else:
println_error('WPA hash table not found: %s' % (G + options.hash + W))
if self.WPA_DICTIONARY == "" and file_search('phpbb.txt'):
self.WPA_DICTIONARY=file_search('phpbb.txt')
println_info('WPA dictionary automatically set to %s' % (G + self.WPA_DICTIONARY + W))
if self.WPA_DICTIONARY == "" and self.WPA_HASH == "":
println_error('WPA dictionary file or hash file not provided! WPA crack %sdisabled%s' % (G,W))
self.WPA_CRACK = 0
else:
println_info('WPA cracking ' + G + 'disabled')
if options.tshark:
self.WPA_HANDSHAKE_TSHARK = True
println_info('tshark handshake verification ' + G + 'enabled')
if options.pyrit:
self.WPA_HANDSHAKE_PYRIT = True
println_info('pyrit handshake verification ' + G + 'enabled')
if options.aircrack:
self.WPA_HANDSHAKE_AIRCRACK = True
println_info('aircrack handshake verification ' + G + 'enabled')
if options.cowpatty:
self.WPA_HANDSHAKE_COWPATTY = True
println_info('cowpatty handshake verification ' + G + 'enabled')
# WEP
if not set_wep and options.chopchop or options.fragment or options.caffeelatte or options.arpreplay \
or options.p0841 or options.hirte:
self.WEP_CHOPCHOP = False
self.WEP_ARPREPLAY = False
self.WEP_CAFFELATTE = False
self.WEP_FRAGMENT = False
self.WEP_P0841 = False
self.WEP_HIRTE = False
if options.chopchop:
println_info('WEP chop-chop attack ' + G + 'enabled')
self.WEP_CHOPCHOP = True
if options.fragment:
println_info('WEP fragmentation attack ' + G + 'enabled')
self.WEP_FRAGMENT = True
if options.caffeelatte:
println_info('WEP caffe-latte attack ' + G + 'enabled')
self.WEP_CAFFELATTE = True
if options.arpreplay:
println_info('WEP arp-replay attack ' + G + 'enabled')
self.WEP_ARPREPLAY = True
if options.p0841:
println_info('WEP p0841 attack ' + G + 'enabled')
self.WEP_P0841 = True
if options.hirte:
println_info('WEP hirte attack ' + G + 'enabled')
self.WEP_HIRTE = True
if options.fakeauth:
println_info('ignoring failed fake-authentication ' + R + 'disabled')
self.WEP_IGNORE_FAKEAUTH = False
if options.wepca:
if options.wepca>0:
self.WEP_CRACK_AT_IVS = options.wepca
println_info('Starting WEP cracking when IV\'s surpass %s' % (
G + str(self.WEP_CRACK_AT_IVS) + W))
else:
println_error('invalid number: %s' % ( R + str(options.wepca) + W ))
if options.wept != None:
if options.wept >= 0:
self.WEP_TIMEOUT = options.wept
println_info('WEP attack timeout set to %s' % (
G + str(self.WEP_TIMEOUT) + W + " seconds"))
else:
println_error('invalid timeout: %s' % (R + str(options.wept) + W))
if options.pps != None:
if options.pps>0:
self.WEP_PPS = options.pps
println_info('packets-per-second rate set to %s' % (
G + str(options.pps) + " packets/sec" + W))
else:
println_error('invalid value: %s' % (R + str(options.pps) + W))
if options.wepnosave:
self.WEP_SAVE = False
println_info(('WEP %s.cap%s file saving ' + R + 'disabled' + W)%(G,W))
else:
if options.wepsaveiv:
self.WEP_SAVE_IV = True
println_info(('WEP %s.ivs%s file saving ' + G + 'enabled' + W)%(G,W))
else:
println_info(('WEP %s.cap%s file saving ' + G + 'enabled' + W)%(G,W))
# WPS
if options.wpst != None:
if self.WPS_TIMEOUT >= 0:
self.WPS_TIMEOUT = options.wpst
println_info('WPS attack timeout set to %s' % (
G + str(self.WPS_TIMEOUT) + " seconds" + W))
else:
println_error('invalid WPS timeout: %s' % (R + str(options.wpst) + W))
self.WPS_SAVE = not options.wpsnosave
if not options.wpsnosave:
println_info(('WPS %s.wpc%s file saving ' + G + 'enabled' + W)%(G,W))
if options.wpsratio != None:
if options.wpsratio > 0:
self.WPS_RATIO_THRESHOLD = options.wpsratio
println_info('minimum WPS tries/attempts threshold set to %s' % (G + str(self.WPS_RATIO_THRESHOLD) + W))
else:
println_warning('invalid percentage: %s' % (R + options.wpsratio + W))
if options.wpsretry:
if options.wpsretry >= 0:
self.WPS_MAX_RETRIES = int(options.wpsretry)
println_info('WPS maximum retries set to %s retries' % (
G + str(self.WPS_MAX_RETRIES) + W))
else:
println_error('invalid number: %s' % (R + str(options.wpsretry) + W))
except IndexError:
println_warning('\nIndex Error!\n\n')
if capfile != '':
self.RUN_ENGINE.analyze_capfile(capfile)
#print ''
def build_opt_parser(self):
""" Options are doubled for backwards compatability; will be removed soon and
fully moved to GNU-style
"""
option_parser = argparse.ArgumentParser()
# set commands
command_group = option_parser.add_argument_group('COMMAND')
command_group.add_argument('--check', metavar='[file]', help='Check capfile [file] for handshakes.', action='store', dest='check')
command_group.add_argument('-check', action='store', dest='check', help=argparse.SUPPRESS)
command_group.add_argument('--cracked', help='Display previously cracked access points.', action='store_true',
dest='cracked')
command_group.add_argument('-cracked', help=argparse.SUPPRESS, action='store_true', dest='cracked')
command_group.add_argument('--recrack', help='Include already cracked networks in targets.',
action='store_true', dest='recrack')
command_group.add_argument('-recrack', help=argparse.SUPPRESS, action='store_true', dest='scan')
# set global
interface_group = option_parser.add_argument_group('INTERFACE')
interface_group.add_argument('-i', metavar='[wlanN]', help='Wireless interface for capturing.', action='store', dest='interface')
interface_group.add_argument('--realmac', help='Do not anonymize my MAC address, use my real MAC address.', action='store_true', default=False,
dest='realmac')
interface_group.add_argument('-m','--mon-iface', metavar='[monN]', help='Interface already in monitor mode.', action='store',
dest='monitor_interface')
interface_group.add_argument('--tx', metavar='[N]', help='Set adapter TX power level.', action='store', dest='tx')
interface_group.add_argument('-tx', metavar='[N]', help=argparse.SUPPRESS, action='store', dest='tx')
target_group = option_parser.add_argument_group('TARGET')
target_group.add_argument('-l','--load', metavar='[file]', help='Load airodump csv/cap file instead of scanning.', action='store', dest='load')
target_group.add_argument('-v','--save', metavar='[file]', help='Save airodump csv/cap file.', action='store', dest='save')
target_group.add_argument('-s','--show', metavar='[filters]', help='Filter targets in scanning state.' + 'Syntax: numbers, range (e.g. "1-4"), power level (e.g. "p[>,>=,=,<=,<][POWER]"), channel (e.g. "c[CHANNEL,range])", wps disabled or enabled (e.g. "wps0", "wps1"), Cipher (e.g. "wep" or "wpa", "wep[NUM OF CLIENT]" or "wpa[NUM OF CLIENT]", "wep+" or "wpa+" for network with clients), ESSID (e.g. "e[ESSID]") or BSSID (e.g. "b[11:22:33]"). Multiple filters separated by comma supported. Add "-" or "=" before to remove targets.', action='store', dest='show')
target_group.add_argument('-t','--timeout', metavar='[criteria]', help='Criteria to stop scanning state. Numbers = seconds, e[ESSID][+] or b[BSSID][+]= timeout when target is found, add "+" at the end means "with clients", n[>,>=,=,<=,<][num of targets] = timeout when total targets more/equal/less than certain numbers. Multiple criteria separated by comma supported.', action='store', dest='timeout')
target_group.add_argument('-c','--channel', metavar='[N]', type=int, help='Filter targets with specific channel in scanning state (equivalent to "--show c[N]").', action='store', dest='channel')
target_group.add_argument('--power', metavar='[N]',type=int, help='Filter targets with signal strength > [N] in scanning state (equivalent to "--show p\>[N]").', action='store',
dest='power')
target_group.add_argument('-power', metavar='[N]', type=int, help=argparse.SUPPRESS, action='store', dest='power')
target_group.add_argument('--all', help='Attack all targets (equivalent to "--show all --attack all --timeout 10").', default=False, action='store_true', dest='all')
target_group.add_argument('-all', help=argparse.SUPPRESS, default=False, action='store_true', dest='all')
target_group.add_argument('-r','--row', type=int, metavar='[N]', help='Max numbers of row to show in scanning state.', default=0, action='store', dest='scan_max_row_show')
target_group.add_argument('--showb', help='Show target BSSIDs in scanning state.', action='store_true',
dest='showb')
target_group.add_argument('-showb', help=argparse.SUPPRESS, action='store_true', dest='showb')
target_group.add_argument('-2','--two', help='Show scanning result in two columns.', default=False, action='store_true',
dest='two')
target_group.add_argument('-q','--quiet', help='Do not list found networks during scan.', action='store_true',
dest='quiet')
target_group.add_argument('-a','--attack', metavar='[filters]', help='Automatically select targets after scanning state, same syntas as "--show".', action='store', dest='attack')
#target_group.add_argument('-attack', help=argparse.SUPPRESS, action='store', dest='attack')
target_group.add_argument('-e','--essid', metavar='[SSID]', help='Attack target immediately once ssid (name) is found in scanning state.', action='store',
dest='essid')
#target_group.add_argument('-e', help=argparse.SUPPRESS, action='store', dest='essid')
target_group.add_argument('-b','--bssid', metavar='[BSSID]',help='Attack target immediately once bssid (mac) is found in scanning state.', action='store',
dest='bssid')
#target_group.add_argument('-b', help=argparse.SUPPRESS, action='store', dest='bssid')
# set wpa commands
wpa_group = option_parser.add_argument_group('WPA')
wpa_group.add_argument('--wpa', help='Only show WPA networks in scanning state (works with --wps --wep, equivalent to "--show wpa --nowps").', default=False,
action='store_true', dest='wpa')
wpa_group.add_argument('-wpa', help=argparse.SUPPRESS, default=False, action='store_true', dest='wpa')
wpa_group.add_argument('--wpat', metavar='[secs]', type=int, help='Time to wait for WPA attack to complete (seconds).', action='store',
dest='wpat')
wpa_group.add_argument('--nowpa', help='Disable WPA handshake attack.', default=False,
action='store_true', dest='nowpa')
wpa_group.add_argument('-wpat', help=argparse.SUPPRESS, action='store', dest='wpat')
wpa_group.add_argument('--wpadt', metavar='[secs]', help='Time to wait between sending deauth packets (seconds).', action='store',
dest='wpadt')
wpa_group.add_argument('-wpadt', help=argparse.SUPPRESS, action='store', dest='wpadt')
wpa_group.add_argument('--strip', help='Strip handshake using tshark or pyrit.', default=False,
action='store_true', dest='strip')
wpa_group.add_argument('-strip', help=argparse.SUPPRESS, default=False, action='store_true', dest='strip')
wpa_group.add_argument('--crack', default=0, type=int, help='Crack WPA handshakes using dict/hash file. (0 = disable , 1 = aircrack, 2 = pyrit, 3 = cowpatty)', action='store',
dest='crack')
wpa_group.add_argument('-crack', help=argparse.SUPPRESS, action='store_true', dest='crack')
wpa_group.add_argument('--dict', metavar='[file]', help='Specify dictionary to be used when cracking WPA.', action='store',
dest='dic')
wpa_group.add_argument('--hash', metavar='[file]', help='Specify precomputed hash to be used when cracking WPA.', action='store',
dest='hash')
wpa_group.add_argument('--recapture', help='Recapture handshake even if the cap file exists.', default = False, action='store_true',
dest='recapture')
wpa_group.add_argument('-dict', help=argparse.SUPPRESS, action='store', dest='dic')
wpa_group.add_argument('--aircrack', help='Verify handshake using aircrack.', default=False,
action='store_true', dest='aircrack')
wpa_group.add_argument('-aircrack', help=argparse.SUPPRESS, default=False, action='store_true', dest='aircrack')
wpa_group.add_argument('--pyrit', help='Verify handshake using pyrit.', default=False, action='store_true',
dest='pyrit')
wpa_group.add_argument('-pyrit', help=argparse.SUPPRESS, default=False, action='store_true', dest='pyrit')
wpa_group.add_argument('--tshark', help='Verify handshake using tshark.', default=False, action='store_true',
dest='tshark')
wpa_group.add_argument('-tshark', help=argparse.SUPPRESS, default=False, action='store_true', dest='tshark')
wpa_group.add_argument('--cowpatty', help='Verify handshake using cowpatty.', default=False,
action='store_true', dest='cowpatty')
wpa_group.add_argument('-cowpatty', help=argparse.SUPPRESS, default=False, action='store_true', dest='cowpatty')
# set WEP commands
wep_group = option_parser.add_argument_group('WEP')
wep_group.add_argument('--wep', help='Only show WEP networks in scanning state (equivalent to "--show wep").', default=False, action='store_true',
dest='wep')
wep_group.add_argument('-wep',help=argparse.SUPPRESS, default=False, action='store_true', dest='wep')
wep_group.add_argument('--pps', metavar='[N]' , type=int, help='Set the number of packets per second to inject.', action='store',
dest='pps')
wep_group.add_argument('-pps', type=int, help=argparse.SUPPRESS, action='store', dest='pps')
wep_group.add_argument('--wept', metavar='[secs]', type=int, help='Max time for each attack, 0 implies endless.', action='store',
dest='wept')
wep_group.add_argument('-wept', type=int, help=argparse.SUPPRESS, action='store', dest='wept')
wep_group.add_argument('--chopchop', help='Use chopchop attack.', default=False, action='store_true',
dest='chopchop')
wep_group.add_argument('-chopchop', help=argparse.SUPPRESS, default=False, action='store_true', dest='chopchop')
wep_group.add_argument('--arpreplay', help='Use arpreplay attack.', default=False, action='store_true',
dest='arpreplay')
wep_group.add_argument('-arpreplay', help=argparse.SUPPRESS, default=False, action='store_true',
dest='arpreplay')
wep_group.add_argument('--fragment', help='Use fragmentation attack.', default=False, action='store_true',
dest='fragment')
wep_group.add_argument('-fragment', help=argparse.SUPPRESS, default=False, action='store_true', dest='fragment')
wep_group.add_argument('--caffelatte', help='Use caffe-latte attack.', default=False, action='store_true',
dest='caffeelatte')
wep_group.add_argument('-caffelatte', help=argparse.SUPPRESS, default=False, action='store_true',
dest='caffeelatte')
wep_group.add_argument('--p0841', help='Use P0842 attack.', default=False, action='store_true', dest='p0841')
wep_group.add_argument('-p0841', help=argparse.SUPPRESS, default=False, action='store_true', dest='p0841')
wep_group.add_argument('--hirte', help='Use hirte attack.', default=False, action='store_true', dest='hirte')
wep_group.add_argument('-hirte', help=argparse.SUPPRESS, default=False, action='store_true', dest='hirte')
wep_group.add_argument('--nofakeauth', help='Stop attack if fake authentication fails.', default=False,
action='store_true', dest='fakeauth')
wep_group.add_argument('-nofakeauth', help=argparse.SUPPRESS, default=False, action='store_true',
dest='fakeauth')
wep_group.add_argument('--wepca', metavar='[N]', type=int, help='Start cracking when number of IVs surpass [n].', action='store',
dest='wepca')
wep_group.add_argument('-wepca', type=int, help=argparse.SUPPRESS, default=False, action='store', dest='wepca')
wep_group.add_argument('--wepnosave', help='Don''t save the captured IVs to "wep" folder in current working directory.',
default=False, action='store_true', dest='wepnosave')
wep_group.add_argument('--wepsaveiv', help='Save the captured IVs in form of .ivs to "wep" folder in current working directory. (.ivs is smaller than .cap but NOT compatible with old aircrack-ng)',
action='store_true', dest='wepsaveiv')
#wep_group.add_argument('-wepsave', help=argparse.SUPPRESS, default=False, action='store_true', dest='wepsave')
# set WPS commands
wps_group = option_parser.add_argument_group('WPS')
wps_group.add_argument('--wps', help='Only show WPS networks in scanning state (equivalent to "--show wps --nowpa").', default=False, action='store_true',
dest='wps')
wps_group.add_argument('--nowps', help='Disable WPS PIN Attack.', action='store_true',
dest='nowps')
wps_group.add_argument('--nopixie', help='Disable WPS PixieDust attack.', action='store_true', dest='nopixie')
wps_group.add_argument('-wps', help=argparse.SUPPRESS, default=False, action='store_true', dest='wps')
wps_group.add_argument('--wpst', metavar='[secs]', type=int, help='Max wait for new retry before giving up (0: never).', action='store',
dest='wpst')
wps_group.add_argument('-wpst', type=int, help=argparse.SUPPRESS, action='store', dest='wpst')
wps_group.add_argument('--wpsratio', type=float, metavar='[ratio]', help='Min ratio of successful PIN attempts/total retries.', action='store',
dest='wpsratio')
wps_group.add_argument('-wpsratio', type=float, help=argparse.SUPPRESS, action='store', dest='wpsratio')
wps_group.add_argument('--wpsretry', metavar='[N]' , type=int, help='Max number of retries for same PIN before giving up.',
action='store', dest='wpsretry')
wps_group.add_argument('-wpsretry', type=int,help=argparse.SUPPRESS, action='store', dest='wpsretry')
wps_group.add_argument('--wpsnosave', help='Disable saving progress of WPS PIN attack to "wps" subfolder in current folder.',
default=False, action='store_true', dest='wpsnosave')
others_group = option_parser.add_argument_group('OTHERS')
others_group.add_argument('--update', help='Check and update Wifite.', default=False, action='store_true',
dest='update')
others_group.add_argument('-update', help=argparse.SUPPRESS, default=False, action='store_true', dest='update')
others_group.add_argument('--debug', help='Print lots of debug information.', action='store_true', dest='debug')
return option_parser
def update(self):
"""
Checks for new version, prompts to update, then
replaces this script with the latest from the repo
"""
buffs=[]
revs=[]
try:
println_warning('updating requires an ' + G + 'internet connection' + W)
for url in UPDATE_URLS:
println_info('checking for latest version from "%s"...' % (G + url + W))
buff=get_file(url)
if buff == False:
println_error('unable to access update url')
else:
rev=get_revision(buff)
if rev != -1:
println_info('revision %s%d%s found!' % (G, rev, W))
buffs.append(buff)
revs.append(rev)
latest_rev_index=-1
for i,rev in enumerate(revs):
if rev > self.REVISION:
if latest_rev_index == -1 or (latest_rev_index != -1 and rev > latest_rev_index):
latest_rev_index = i
if latest_rev_index != -1:
print GR + ' [!]' + W + ' a new version is ' + G + 'available!' + W
print GR + ' [-]' + W + ' revision: ' + G + str(rev[latest_rev_index]) + W
response = raw_input(GR + ' [+]' + W + ' do you want to update to the latest version? (y/n): ')
if not response.lower().startswith('y'):
print GR + ' [-]' + W + ' upgrading ' + O + 'aborted' + W
self.exit_gracefully(0)
return
# Download script, replace with this one
print GR + ' [+] ' + G + 'upgrading...' + W
do_update(buff[latest_rev_index])
else:
if(len(buffs)):
println_info('your copy of wifite is ' + G + 'up to date' + W)
else:
println_warning('Unable to access any update sites.')
except KeyboardInterrupt: