(capfile)
Analyzes given capfile for handshakes using various programs.
        Prints results to console.
Analyzes given capfile for handshakes using various programs.
        Prints results to console.
Analyzes given capfile for handshakes using various programs . Prints results to console .
def analyze_capfile(capfile):
    """
        Analyzes given capfile for handshakes using various programs.
        Prints results to console.
    """
    global RUN_CONFIG
    
    if RUN_CONFIG.TARGET_ESSID == '' and RUN_CONFIG.TARGET_BSSID == '':
        print R+' [!]'+O+' target ssid and bssid are required to check for handshakes'
        print R+' [!]'+O+' please enter essid (access point name) using -e <name>'
        print R+' [!]'+O+' and/or target bssid (mac address) using -b <mac>\n'
        # exit_gracefully(1)
    
    if RUN_CONFIG.TARGET_BSSID == '':
        # Get the first BSSID found in tshark!
        RUN_CONFIG.TARGET_BSSID = get_bssid_from_cap(RUN_CONFIG.TARGET_ESSID, capfile)
        # if TARGET_BSSID.find('->') != -1: TARGET_BSSID == ''
        if RUN_CONFIG.TARGET_BSSID == '':
            print R+' [!]'+O+' unable to guess BSSID from ESSID!'
        else:
            print GR+' [+]'+W+' guessed bssid: %s' % (G+RUN_CONFIG.TARGET_BSSID+W)
    
    if RUN_CONFIG.TARGET_BSSID != '' and RUN_CONFIG.TARGET_ESSID == '':
        RUN_CONFIG.TARGET_ESSID = get_essid_from_cap(RUN_CONFIG.TARGET_BSSID, capfile)
        
    print GR+'\n [+]'+W+' checking for handshakes in %s' % (G+capfile+W)
    
    t = Target(RUN_CONFIG.TARGET_BSSID, '', '', '', 'WPA', RUN_CONFIG.TARGET_ESSID)
    
    if program_exists('pyrit'):
        result = has_handshake_pyrit(t, capfile)
        print GR+' [+]'+W+'    '+G+'pyrit'+W+':\t\t\t %s' % (G+'found!'+W if result else O+'not found'+W)
    else: print R+' [!]'+O+' program not found: pyrit'
    if program_exists('cowpatty'):
        result = has_handshake_cowpatty(t, capfile, nonstrict=True)
        print GR+' [+]'+W+'    '+G+'cowpatty'+W+' (nonstrict):\t %s' % (G+'found!'+W if result else O+'not found'+W)
        result = has_handshake_cowpatty(t, capfile, nonstrict=False)
        print GR+' [+]'+W+'    '+G+'cowpatty'+W+' (strict):\t %s' % (G+'found!'+W if result else O+'not found'+W)
    else: print R+' [!]'+O+' program not found: cowpatty'
    if program_exists('tshark'):
        result = has_handshake_tshark(t, capfile)
        print GR+' [+]'+W+'    '+G+'tshark'+W+':\t\t\t %s' % (G+'found!'+W if result else O+'not found'+W)
    else: print R+' [!]'+O+' program not found: tshark'
    if program_exists('aircrack-ng'):
        result = has_handshake_aircrack(t, capfile)
        print GR+' [+]'+W+'    '+G+'aircrack-ng'+W+':\t\t %s' % (G+'found!'+W if result else O+'not found'+W)
    else: print R+' [!]'+O+' program not found: aircrack-ng'

    print ''

    exit_gracefully(0)
def analyze_capfile ( capfile ) : global RUN_CONFIG if RUN_CONFIG . TARGET_ESSID == '' and RUN_CONFIG . TARGET_BSSID == '' : print R + ' [!]' + O + ' target ssid and bssid are required to check for handshakes' print R + ' [!]' + O + ' please enter essid (access point name) using -e <name>' print R + ' [!]' + O + ' and/or target bssid (mac address) using -b <mac>\n' # exit_gracefully(1) if RUN_CONFIG . TARGET_BSSID == '' : # Get the first BSSID found in tshark! RUN_CONFIG . TARGET_BSSID = get_bssid_from_cap ( RUN_CONFIG . TARGET_ESSID , capfile ) # if TARGET_BSSID.find('->') != -1: TARGET_BSSID == '' if RUN_CONFIG . TARGET_BSSID == '' : print R + ' [!]' + O + ' unable to guess BSSID from ESSID!' else : print GR + ' [+]' + W + ' guessed bssid: %s' % ( G + RUN_CONFIG . TARGET_BSSID + W ) if RUN_CONFIG . TARGET_BSSID != '' and RUN_CONFIG . TARGET_ESSID == '' : RUN_CONFIG . TARGET_ESSID = get_essid_from_cap ( RUN_CONFIG . TARGET_BSSID , capfile ) print GR + '\n [+]' + W + ' checking for handshakes in %s' % ( G + capfile + W ) t = Target ( RUN_CONFIG . TARGET_BSSID , '' , '' , '' , 'WPA' , RUN_CONFIG . TARGET_ESSID ) if program_exists ( 'pyrit' ) : result = has_handshake_pyrit ( t , capfile ) print GR + ' [+]' + W + '    ' + G + 'pyrit' + W + ':\t\t\t %s' % ( G + 'found!' + W if result else O + 'not found' + W ) else : print R + ' [!]' + O + ' program not found: pyrit' if program_exists ( 'cowpatty' ) : result = has_handshake_cowpatty ( t , capfile , nonstrict = True ) print GR + ' [+]' + W + '    ' + G + 'cowpatty' + W + ' (nonstrict):\t %s' % ( G + 'found!' + W if result else O + 'not found' + W ) result = has_handshake_cowpatty ( t , capfile , nonstrict = False ) print GR + ' [+]' + W + '    ' + G + 'cowpatty' + W + ' (strict):\t %s' % ( G + 'found!' + W if result else O + 'not found' + W ) else : print R + ' [!]' + O + ' program not found: cowpatty' if program_exists ( 'tshark' ) : result = has_handshake_tshark ( t , capfile ) print GR + ' [+]' + W + '    ' + G + 'tshark' + W + ':\t\t\t %s' % ( G + 'found!' + W if result else O + 'not found' + W ) else : print R + ' [!]' + O + ' program not found: tshark' if program_exists ( 'aircrack-ng' ) : result = has_handshake_aircrack ( t , capfile ) print GR + ' [+]' + W + '    ' + G + 'aircrack-ng' + W + ':\t\t %s' % ( G + 'found!' + W if result else O + 'not found' + W ) else : print R + ' [!]' + O + ' program not found: aircrack-ng' print '' exit_gracefully ( 0 )