(targets, cap_file, verbose=True)
Uses reaver's "walsh" (or wash) program to check access points in cap_file
        for WPS functionality. Sets "wps" field of targets that match to True.
Uses reaver's "walsh" (or wash) program to check access points in cap_file
        for WPS functionality. Sets "wps" field of targets that match to True.
Uses reaver s walsh ( or wash ) program to check access points in cap_file for WPS functionality . Sets wps field of targets that match to True .
def wps_check_targets(targets, cap_file, verbose=True):
    """
        Uses reaver's "walsh" (or wash) program to check access points in cap_file
        for WPS functionality. Sets "wps" field of targets that match to True.
    """
    global RUN_CONFIG
    
    if not program_exists('walsh') and not program_exists('wash'):
        RUN_CONFIG.WPS_DISABLE = True # Tell 'scan' we were unable to execute walsh
        return
    program_name = 'walsh' if program_exists('walsh') else 'wash'
    
    if len(targets) == 0 or not os.path.exists(cap_file): return
    if verbose:
        print GR+' [+]'+W+' checking for '+G+'WPS compatibility'+W+'...',
        stdout.flush()
    
    cmd = [program_name,
           '-f', cap_file,
           '-C'] # ignore Frame Check Sum errors
    proc_walsh = Popen(cmd, stdout=PIPE, stderr=DN)
    proc_walsh.wait()
    for line in proc_walsh.communicate()[0].split('\n'):
        if line.strip() == '' or line.startswith('Scanning for'): continue
        bssid = line.split(' ')[0]
        
        for t in targets:
            if t.bssid.lower() == bssid.lower():
                t.wps = True
    if verbose:
        print 'done'
    removed = 0
    if not RUN_CONFIG.WPS_DISABLE and RUN_CONFIG.WPA_DISABLE:
        i = 0
        while i < len(targets):
            if not targets[i].wps and targets[i].encryption.find('WPA') != -1:
                removed += 1
                targets.pop(i)
            else: i += 1
        if removed > 0 and verbose: print GR+' [+]'+O+' removed %d non-WPS-enabled targets%s' % (removed, W)
def wps_check_targets ( targets , cap_file , verbose = True ) : global RUN_CONFIG if not program_exists ( 'walsh' ) and not program_exists ( 'wash' ) : RUN_CONFIG . WPS_DISABLE = True # Tell 'scan' we were unable to execute walsh return program_name = 'walsh' if program_exists ( 'walsh' ) else 'wash' if len ( targets ) == 0 or not os . path . exists ( cap_file ) : return if verbose : print GR + ' [+]' + W + ' checking for ' + G + 'WPS compatibility' + W + '...' , stdout . flush ( ) cmd = [ program_name , '-f' , cap_file , '-C' ] # ignore Frame Check Sum errors proc_walsh = Popen ( cmd , stdout = PIPE , stderr = DN ) proc_walsh . wait ( ) for line in proc_walsh . communicate ( ) [ 0 ] . split ( '\n' ) : if line . strip ( ) == '' or line . startswith ( 'Scanning for' ) : continue bssid = line . split ( ' ' ) [ 0 ] for t in targets : if t . bssid . lower ( ) == bssid . lower ( ) : t . wps = True if verbose : print 'done' removed = 0 if not RUN_CONFIG . WPS_DISABLE and RUN_CONFIG . WPA_DISABLE : i = 0 while i < len ( targets ) : if not targets [ i ] . wps and targets [ i ] . encryption . find ( 'WPA' ) != - 1 : removed += 1 targets . pop ( i ) else : i += 1 if removed > 0 and verbose : print GR + ' [+]' + O + ' removed %d non-WPS-enabled targets%s' % ( removed , W )