def testAnalyze(self): hs_file = self.getFile('handshake_exists.cap') hs = Handshake(hs_file, bssid='A4:2B:8C:16:6B:3A') try: hs.analyze() except Exception, e: fail()
def check_handshake(self, capfile): ''' Analyzes .cap file for handshake ''' Color.pl('{+} checking for handshake in .cap file {C}%s{W}' % capfile) if not os.path.exists(capfile): Color.pl('{!} {O}.cap file {C}%s{O} not found{W}' % capfile) return hs = Handshake(capfile) hs.analyze()
def check_handshake(self, capfile): ''' Analyzes .cap file for handshake ''' Color.pl('{+} checking for handshake in .cap file {C}%s{W}' % capfile) if not os.path.exists(capfile): Color.pl('{!} {O}.cap file {C}%s{O} not found{W}' % capfile) return hs = Handshake(capfile, bssid=Configuration.target_bssid, essid=Configuration.target_essid) hs.analyze()
if x.endswith('.cap') ] except OSError, e: capfiles = [] if len(capfiles) == 0: Color.pl('{!} {R}no .cap files found in {O}"./hs"{W}\n') else: capfiles = [capfile] for capfile in capfiles: Color.pl('{+} checking for handshake in .cap file {C}%s{W}' % capfile) if not os.path.exists(capfile): Color.pl('{!} {O}.cap file {C}%s{O} not found{W}' % capfile) return hs = Handshake(capfile, bssid=Configuration.target_bssid, essid=Configuration.target_essid) hs.analyze() Color.pl('') def run(self): ''' Main program. 1) Scans for targets, asks user to select targets 2) Attacks each target ''' s = Scanner() if s.target: # We found the target we want targets = [s.target] else:
if capfile == '<all>': Color.pl('{+} checking all handshakes in {G}"./hs"{W} directory\n') try: capfiles = [os.path.join('hs', x) for x in os.listdir('hs') if x.endswith('.cap')] except OSError, e: capfiles = [] if len(capfiles) == 0: Color.pl('{!} {R}no .cap files found in {O}"./hs"{W}\n') else: capfiles = [capfile] for capfile in capfiles: Color.pl('{+} checking for handshake in .cap file {C}%s{W}' % capfile) if not os.path.exists(capfile): Color.pl('{!} {O}.cap file {C}%s{O} not found{W}' % capfile) return hs = Handshake(capfile, bssid=Configuration.target_bssid, essid=Configuration.target_essid) hs.analyze() Color.pl('') def run(self): ''' Main program. 1) Scans for targets, asks user to select targets 2) Attacks each target ''' s = Scanner() if s.target: # We found the target we want targets = [s.target] else:
def testHandshakeAircrack(self): hs_file = self.getFile('handshake_exists.cap') hs = Handshake(hs_file, bssid='A4:2B:8C:16:6B:3A') assert (len(hs.aircrack_handshakes()) > 0)
def testHandshakeCowpatty(self): hs_file = self.getFile('handshake_exists.cap') hs = Handshake(hs_file, bssid='A4:2B:8C:16:6B:3A') hs.divine_bssid_and_essid() assert (len(hs.cowpatty_handshakes()) > 0)
def testHandshakeAircrack(self): hs_file = self.getFile('handshake_exists.cap') hs = Handshake(hs_file, bssid='A4:2B:8C:16:6B:3A') assert(len(hs.aircrack_handshakes()) > 0)
def testHandshakeCowpatty(self): hs_file = self.getFile('handshake_exists.cap') hs = Handshake(hs_file, bssid='A4:2B:8C:16:6B:3A') hs.divine_bssid_and_essid() assert(len(hs.cowpatty_handshakes()) > 0)