def mac_anonymize(iface):
 global RUN_CONFIG
 if RUN_CONFIG.DO_NOT_CHANGE_MAC:
  return
 if (not program_exists('ifconfig')):
  return
 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 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'
changes mac address of iface to a random mac .