def parse_clients(clients_list):

    nclients = len(clients_list)
    
    clhead = clients_list[0]
    
    clients_head = [j.strip() for j in clhead]
    
    clients_data = [clients_list[i] for i in range(1,nclients)]
    
    for i,row in enumerate(clients_data):
    
        c_mac_ix = clients_head.index('BSSID')
        c_pow_ix = clients_head.index('Power')
    
        c_mac = row[c_mac_ix].strip()
        c_pow = row[c_pow_ix].strip()
    
        if c_mac=='(not associated)':
            continue
    
        mac_prefix = c_mac[0:8]
        c_mfg = lookup_hardware(mac_prefix)
    
        ######################
        # Print out some information
        print "="*40
        print "Client MAC:",c_mac
        print "Manufacturer:",c_mfg
        print "Power:",c_pow
        print ""
Example #2
0
def parse_aps(stations_list):

    
    nstations = len(stations_list)
    
    sthead = stations_list[0]
    
    stations_head = [j.strip() for j in sthead]
    
    stations_data = [stations_list[i] for i in range(1,nstations)]
    
    for i,row in enumerate(stations_data):
    
        # get indices
        ap_mac_ix  = stations_head.index('BSSID')
        ap_name_ix = stations_head.index('ESSID')
        ap_sec_ix  = stations_head.index('Privacy')
        ap_pow_ix  = stations_head.index('Power')
        ap_ch_ix   = stations_head.index('channel')
    
        # get values
        ap_mac = row[ap_mac_ix].strip()
        ap_name = row[ap_name_ix].strip()
        ap_sec = row[ap_sec_ix].strip()
        ap_pow = row[ap_pow_ix].strip()
        ap_ch = row[ap_ch_ix].strip()
    
        # other stuff
        mac_prefix = ap_mac[0:8]
        ap_mfg = lookup_hardware(mac_prefix)
    
        if ap_name=='':
            ap_name="unlabeled"
    
        mac_name = re.sub('\:','_',ap_mac)
    
        ######################
        # Print out some information
        print "="*40
        print "Name:",ap_name
        print "Channel:",ap_ch
        print "MAC:",ap_mac
        print "Manufacturer:",ap_mfg
        print "Encryption:",ap_sec
        print "Power:",ap_pow
        print ""
     
        # ##########################
        # # Print out an airodump command
        print ""
        print "Listen to this network..."
        print "  Dump to file named with MAC:"
        print "    airodump-ng","-d",ap_mac,"-c",ap_ch,"-w","'"+mac_name+"'","wlan1"
        print "  Dump to file named with ESSID:"
        print "    airodump-ng","-d",ap_mac,"-c",ap_ch,"-w","'"+ap_name+"'","wlan1"
        print ""
print "        ","Access Point: Summary"
print "* "*35
print ""

for ir,row in stations_df.iterrows():

    ap_mac = ir

    ap_name = row[' ESSID']
    ap_name = ap_name[1:]
    ap_sec = row[' Privacy']
    ap_pow = row[' Power']
    ap_ch = row[' channel']

    mac_prefix = ap_mac[0:8]
    ap_mfg = lookup_hardware(mac_prefix)

    if ap_name=='':
        ap_name="unlabeled"

    ######################
    # Print out some information
    print "="*40
    print "Name:",ap_name
    print "Channel:",ap_ch
    print "MAC:",ap_mac
    print "Manufacturer:",ap_mfg
    print "Encryption:",ap_sec
    print "Power:",ap_pow
    print ""