Skip to content

Comment on What we give away when we log on to a public Wi-Fi network

Comments

Don't like your MAC? get a new one...

import random

import os

mac=''

# os.system('/etc/init.d/networking stop')

os.system('ifconfig wlan1 down')

os.system('ifconfig eth1 down')

for i in range(0,3):

r=random.randint(16, 256)

mac=mac+":"+str(hex(r))[2:]

mac="00:07:E9"+mac

print mac

os.system('ifconfig wlan1 hw ether '+mac)

os.system('ifconfig eth1 hw ether '+mac)

os.system('ifconfig wlan1 up')

os.system('ifconfig eth1 up')

# os.system('/etc/init.d/networking stop')

os.system('/etc/init.d/networking start')

os.system('ifconfig')

print "echo 'MAC changed..."

print "new random MAC "+mac

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.