(iface, attack_num, target, clients, client_mac)
return cmd
Returns aireplay-ng command line arguments based on parameters.
Returns aireplay-ng command line arguments based on parameters.
Returns aireplay - ng command line arguments based on parameters .
def get_aireplay_command(iface, attack_num, target, clients, client_mac):
    """
        Returns aireplay-ng command line arguments based on parameters.
    """
    global RUN_CONFIG
    cmd = ''
    if attack_num == 0:
        cmd = ['aireplay-ng',
               '--ignore-negative-one',
               '--arpreplay',
               '-b', target.bssid,
               '-x', str(RUN_CONFIG.WEP_PPS)] # Packets per second
        if client_mac != '': 
            cmd.append('-h')
            cmd.append(client_mac)
        elif len(clients) > 0: 
            cmd.append('-h')
            cmd.append(clients[0].bssid)
        cmd.append(iface)
        
    elif attack_num == 1:
        cmd = ['aireplay-ng',
               '--ignore-negative-one',
               '--chopchop',
               '-b', target.bssid,
               '-x', str(RUN_CONFIG.WEP_PPS), # Packets per second
               '-m', '60', # Minimum packet length (bytes)
               '-n', '82', # Maxmimum packet length
               '-F'] # Automatically choose the first packet
        if client_mac != '': 
            cmd.append('-h')
            cmd.append(client_mac)
        elif len(clients) > 0: 
            cmd.append('-h')
            cmd.append(clients[0].bssid)
        cmd.append(iface)
        
    elif attack_num == 2:
        cmd = ['aireplay-ng',
               '--ignore-negative-one',
               '--fragment',
               '-b', target.bssid,
               '-x', str(RUN_CONFIG.WEP_PPS), # Packets per second
               '-m', '100', # Minimum packet length (bytes)
               '-F'] # Automatically choose the first packet
        if client_mac != '': 
            cmd.append('-h')
            cmd.append(client_mac)
        elif len(clients) > 0: 
            cmd.append('-h')
            cmd.append(clients[0].bssid)
        cmd.append(iface)
    
    elif attack_num == 3:
        cmd = ['aireplay-ng',
               '--ignore-negative-one',
               '--caffe-latte',
               '-b', target.bssid]
        if len(clients) > 0:
            cmd.append('-h')
            cmd.append(clients[0].bssid)
        cmd.append(iface)
        
    elif attack_num == 4:
        cmd = ['aireplay-ng',
               '--ignore-negative-one',
               '--interactive',
               '-b', target.bssid,
               '-c', 'ff:ff:ff:ff:ff:ff',
               '-t', '1', # Only select packets with ToDS bit set
               '-x', str(RUN_CONFIG.WEP_PPS), # Packets per second
               '-F',      # Automatically choose the first packet
               '-p', '0841']
        cmd.append(iface)
    
    elif attack_num == 5:
        if len(clients) == 0:
            print R+' [0:00:00] unable to carry out hirte attack: '+O+'no clients'
            return ''
        cmd = ['aireplay-ng',
               '--ignore-negative-one',
               '--cfrag',
               '-h', clients[0].bssid,
               iface]
        
    return cmd
def get_aireplay_command ( iface , attack_num , target , clients , client_mac ) : global RUN_CONFIG cmd = '' if attack_num == 0 : cmd = [ 'aireplay-ng' , '--ignore-negative-one' , '--arpreplay' , '-b' , target . bssid , '-x' , str ( RUN_CONFIG . WEP_PPS ) ] # Packets per second if client_mac != '' : cmd . append ( '-h' ) cmd . append ( client_mac ) elif len ( clients ) > 0 : cmd . append ( '-h' ) cmd . append ( clients [ 0 ] . bssid ) cmd . append ( iface ) elif attack_num == 1 : cmd = [ 'aireplay-ng' , '--ignore-negative-one' , '--chopchop' , '-b' , target . bssid , '-x' , str ( RUN_CONFIG . WEP_PPS ) , # Packets per second '-m' , '60' , # Minimum packet length (bytes) '-n' , '82' , # Maxmimum packet length '-F' ] # Automatically choose the first packet if client_mac != '' : cmd . append ( '-h' ) cmd . append ( client_mac ) elif len ( clients ) > 0 : cmd . append ( '-h' ) cmd . append ( clients [ 0 ] . bssid ) cmd . append ( iface ) elif attack_num == 2 : cmd = [ 'aireplay-ng' , '--ignore-negative-one' , '--fragment' , '-b' , target . bssid , '-x' , str ( RUN_CONFIG . WEP_PPS ) , # Packets per second '-m' , '100' , # Minimum packet length (bytes) '-F' ] # Automatically choose the first packet if client_mac != '' : cmd . append ( '-h' ) cmd . append ( client_mac ) elif len ( clients ) > 0 : cmd . append ( '-h' ) cmd . append ( clients [ 0 ] . bssid ) cmd . append ( iface ) elif attack_num == 3 : cmd = [ 'aireplay-ng' , '--ignore-negative-one' , '--caffe-latte' , '-b' , target . bssid ] if len ( clients ) > 0 : cmd . append ( '-h' ) cmd . append ( clients [ 0 ] . bssid ) cmd . append ( iface ) elif attack_num == 4 : cmd = [ 'aireplay-ng' , '--ignore-negative-one' , '--interactive' , '-b' , target . bssid , '-c' , 'ff:ff:ff:ff:ff:ff' , '-t' , '1' , # Only select packets with ToDS bit set '-x' , str ( RUN_CONFIG . WEP_PPS ) , # Packets per second '-F' , # Automatically choose the first packet '-p' , '0841' ] cmd . append ( iface ) elif attack_num == 5 : if len ( clients ) == 0 : print R + ' [0:00:00] unable to carry out hirte attack: ' + O + 'no clients' return '' cmd = [ 'aireplay-ng' , '--ignore-negative-one' , '--cfrag' , '-h' , clients [ 0 ] . bssid , iface ] return cmd