3 ms·
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
by tiatia 12y ago
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