Tshark is optional, falls-back to Wash for WPS-detection.

Should resolve #77
This commit is contained in:
derv82
2018-03-31 18:40:39 -04:00
parent 528741f89f
commit 1ad17472b2
4 changed files with 91 additions and 11 deletions

View File

@@ -10,6 +10,10 @@ class Tshark(object):
def __init__(self):
pass
@staticmethod
def exists():
return Process.exists('tshark')
@staticmethod
def check_for_wps_and_update_targets(capfile, targets):
'''
@@ -21,9 +25,9 @@ class Tshark(object):
capfile - .cap file from airodump containing packets
targets - list of Targets from scan, to be updated
'''
# Tshark is required to detect WPS networks
if not Process.exists('tshark'):
return
if not Tshark.exists():
raise Exception('Cannot detect WPS networks: Tshark does not exist')
command = [
'tshark',
@@ -38,7 +42,6 @@ class Tshark(object):
]
p = Process(command)
try:
p.wait()
lines = p.stdout()