Filter *out* by ESSID using -E (--ignore-essid)
More refactoring!
This commit is contained in:
@@ -1 +1,3 @@
|
|||||||
python2.7 -m wifite.wifite $@
|
#!/usr/bin/python
|
||||||
|
from wifite import wifite
|
||||||
|
wifite.run()
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ class Arguments(object):
|
|||||||
action='count',
|
action='count',
|
||||||
default=0,
|
default=0,
|
||||||
dest='verbose',
|
dest='verbose',
|
||||||
help=Color.s('Shows more options (-h) and the executed commands (default: {G}quiet{W})'))
|
help=Color.s('Shows more options ({C}-h -v{W}). Prints tool outputs. (default: {G}quiet{W})'))
|
||||||
|
|
||||||
glob.add_argument('-i',
|
glob.add_argument('-i',
|
||||||
action='store',
|
action='store',
|
||||||
@@ -109,6 +109,15 @@ class Arguments(object):
|
|||||||
help=self._verbose('ESSID (e.g. {GR}NETGEAR07{W}) of access point to attack'))
|
help=self._verbose('ESSID (e.g. {GR}NETGEAR07{W}) of access point to attack'))
|
||||||
glob.add_argument('--essid', help=argparse.SUPPRESS, action='store', dest='target_essid', type=str)
|
glob.add_argument('--essid', help=argparse.SUPPRESS, action='store', dest='target_essid', type=str)
|
||||||
|
|
||||||
|
glob.add_argument('-E',
|
||||||
|
action='store',
|
||||||
|
dest='ignore_essid',
|
||||||
|
metavar='[text]',
|
||||||
|
type=str,
|
||||||
|
default=None,
|
||||||
|
help=self._verbose('Hides targets with ESSIDs that match the given text'))
|
||||||
|
glob.add_argument('--ignore-essid', help=argparse.SUPPRESS, action='store', dest='ignore_essid', type=str)
|
||||||
|
|
||||||
glob.add_argument('--showb',
|
glob.add_argument('--showb',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
dest='show_bssids',
|
dest='show_bssids',
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ class Configuration(object):
|
|||||||
Configuration.target_channel = None # User-defined channel to scan
|
Configuration.target_channel = None # User-defined channel to scan
|
||||||
Configuration.target_essid = None # User-defined AP name
|
Configuration.target_essid = None # User-defined AP name
|
||||||
Configuration.target_bssid = None # User-defined AP BSSID
|
Configuration.target_bssid = None # User-defined AP BSSID
|
||||||
|
Configuration.ignore_essid = None # ESSIDs to ignore
|
||||||
Configuration.five_ghz = False # Scan 5Ghz channels
|
Configuration.five_ghz = False # Scan 5Ghz channels
|
||||||
Configuration.show_bssids = False # Show BSSIDs in targets list
|
Configuration.show_bssids = False # Show BSSIDs in targets list
|
||||||
Configuration.random_mac = False # Should generate a random Mac address at startup.
|
Configuration.random_mac = False # Should generate a random Mac address at startup.
|
||||||
@@ -146,6 +147,9 @@ class Configuration(object):
|
|||||||
if args.target_essid:
|
if args.target_essid:
|
||||||
Configuration.target_essid = args.target_essid
|
Configuration.target_essid = args.target_essid
|
||||||
Color.pl('{+} {C}option:{W} targeting ESSID {G}%s{W}' % args.target_essid)
|
Color.pl('{+} {C}option:{W} targeting ESSID {G}%s{W}' % args.target_essid)
|
||||||
|
if args.ignore_essid is not None:
|
||||||
|
Configuration.ignore_essid = args.ignore_essid
|
||||||
|
Color.pl('{+} {C}option:{W} {O}ignoring ESSIDs that include {R}%s{W}' % args.ignore_essid)
|
||||||
if args.scan_time:
|
if args.scan_time:
|
||||||
Configuration.scan_time = args.scan_time
|
Configuration.scan_time = args.scan_time
|
||||||
Color.pl('{+} {C}option:{W} ({G}pillage{W}) attack all targets after {G}%d{W}s' % args.scan_time)
|
Color.pl('{+} {C}option:{W} ({G}pillage{W}) attack all targets after {G}%d{W}s' % args.scan_time)
|
||||||
|
|||||||
@@ -241,7 +241,9 @@ class Airodump(object):
|
|||||||
essid = Configuration.target_essid
|
essid = Configuration.target_essid
|
||||||
i = 0
|
i = 0
|
||||||
while i < len(result):
|
while i < len(result):
|
||||||
if bssid and result[i].bssid.lower() != bssid.lower():
|
if result[i].essid is not None and Configuration.ignore_essid is not None and Configuration.ignore_essid.lower() in result[i].essid.lower():
|
||||||
|
result.pop(i)
|
||||||
|
elif bssid and result[i].bssid.lower() != bssid.lower():
|
||||||
result.pop(i)
|
result.pop(i)
|
||||||
elif essid and result[i].essid and result[i].essid.lower() != essid.lower():
|
elif essid and result[i].essid and result[i].essid.lower() != essid.lower():
|
||||||
result.pop(i)
|
result.pop(i)
|
||||||
|
|||||||
@@ -227,7 +227,7 @@ class Wifite(object):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
def run():
|
||||||
w = Wifite()
|
w = Wifite()
|
||||||
w.print_banner()
|
w.print_banner()
|
||||||
|
|
||||||
@@ -253,3 +253,6 @@ if __name__ == '__main__':
|
|||||||
Color.pl('\n{!} {O}interrupted, shutting down...{W}')
|
Color.pl('\n{!} {O}interrupted, shutting down...{W}')
|
||||||
|
|
||||||
Configuration.exit_gracefully(0)
|
Configuration.exit_gracefully(0)
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
run()
|
||||||
|
|||||||
Reference in New Issue
Block a user