WPS max_failures is honored now.

Handshake attack copies .cap file to temp for consistency.
This commit is contained in:
derv82
2015-06-12 22:34:44 -07:00
parent b79025f1dc
commit f839ad4818
2 changed files with 14 additions and 4 deletions

View File

@@ -65,20 +65,26 @@ class AttackWPA(Attack):
# No cap files yet # No cap files yet
continue continue
cap_file = cap_files[0] cap_file = cap_files[0]
# TODO: Copy .cap file to temp for consistency
# Check for Handshake # Copy .cap file to temp for consistency
temp_file = Configuration.temp('handshake.cap.bak')
copy(cap_file, temp_file)
# Check cap file in temp for Handshake
bssid = airodump_target.bssid bssid = airodump_target.bssid
essid = None essid = None
if airodump_target.essid_known: if airodump_target.essid_known:
essid = airodump_target.essid essid = airodump_target.essid
handshake = Handshake(cap_file, bssid=bssid, essid=essid) handshake = Handshake(temp_file, bssid=bssid, essid=essid)
if handshake.has_handshake(): if handshake.has_handshake():
# We got a handshake # We got a handshake
Color.pl('\n\n{+} {G}successfully captured handshake{W}') Color.pl('\n\n{+} {G}successfully captured handshake{W}')
break break
# TODO: Delete copied .cap file in temp to save space # There is no handshake
handshake = None
# Delete copied .cap file in temp to save space
os.remove(temp_file)
# Check status of deauth process # Check status of deauth process
if deauth_proc and deauth_proc.poll() == None: if deauth_proc and deauth_proc.poll() == None:

View File

@@ -197,6 +197,10 @@ class AttackWPS(Attack):
Color.p('{R}%d/%d failures{W}) ' % (failures, \ Color.p('{R}%d/%d failures{W}) ' % (failures, \
Configuration.wps_fail_threshold)) Configuration.wps_fail_threshold))
if failures >= Configuration.wps_fail_threshold:
Color.pl('{R}failed: {O}too many failures{W}' % failures)
break
# Get output # Get output
out = self.get_stdout() out = self.get_stdout()