(iface)
Changes MAC address of 'iface' to a random MAC.
        Only randomizes the last 6 digits of the MAC, so the vender says the same.
        Stores old MAC address and the interface in ORIGINAL_IFACE_MAC
Changes MAC address of 'iface' to a random MAC.
        Only randomizes the last 6 digits of the MAC, so the vender says the same.
        Stores old MAC address and the interface in ORIGINAL_IFACE_MAC
Changes MAC address of iface to a random MAC . Only randomizes the last 6 digits of the MAC so the vender says the same . Stores old MAC address and the interface in ORIGINAL_IFACE_MAC
def mac_anonymize(iface):
    """
        Changes MAC address of 'iface' to a random MAC.
        Only randomizes the last 6 digits of the MAC, so the vender says the same.
        Stores old MAC address and the interface in ORIGINAL_IFACE_MAC
    """
    global RUN_CONFIG
    if RUN_CONFIG.DO_NOT_CHANGE_MAC: return
    if not program_exists('ifconfig'): return
    
    # Store old (current) MAC address
    proc = Popen(['ifconfig', iface], stdout=PIPE, stderr=DN)
    proc.wait()
    for word in proc.communicate()[0].split('\n')[0].split(' '):
        if word != '': old_mac = word
    RUN_CONFIG.ORIGINAL_IFACE_MAC = (iface, old_mac)
    
    new_mac = generate_random_mac(old_mac)
    
    call(['ifconfig', iface, 'down'])
    
    print GR+" [+]"+W+" changing %s's MAC from %s to %s..." % (G+iface+W, G+old_mac+W, O+new_mac+W),
    stdout.flush()
    
    proc = Popen(['ifconfig', iface, 'hw', 'ether', new_mac], stdout=PIPE, stderr=DN)
    proc.wait()
    call(['ifconfig', iface, 'up'], stdout=DN, stderr=DN)
    print 'done'
def mac_anonymize ( iface ) : global RUN_CONFIG if RUN_CONFIG . DO_NOT_CHANGE_MAC : return if not program_exists ( 'ifconfig' ) : return # Store old (current) MAC address proc = Popen ( [ 'ifconfig' , iface ] , stdout = PIPE , stderr = DN ) proc . wait ( ) for word in proc . communicate ( ) [ 0 ] . split ( '\n' ) [ 0 ] . split ( ' ' ) : if word != '' : old_mac = word RUN_CONFIG . ORIGINAL_IFACE_MAC = ( iface , old_mac ) new_mac = generate_random_mac ( old_mac ) call ( [ 'ifconfig' , iface , 'down' ] ) print GR + " [+]" + W + " changing %s's MAC from %s to %s..." % ( G + iface + W , G + old_mac + W , O + new_mac + W ) , stdout . flush ( ) proc = Popen ( [ 'ifconfig' , iface , 'hw' , 'ether' , new_mac ] , stdout = PIPE , stderr = DN ) proc . wait ( ) call ( [ 'ifconfig' , iface , 'up' ] , stdout = DN , stderr = DN ) print 'done'