add sourcecode

This commit is contained in:
Jimmy Xiang
2020-11-12 17:02:10 +08:00
parent bf7c50956c
commit f698082a29
23 changed files with 2746 additions and 0 deletions

22
09/macspoof.py Normal file
View File

@@ -0,0 +1,22 @@
import random
import os
import subprocess
def get_rand():
return random.choice("abcdef0123456789")
def new_mac():
new_ = ""
for i in range(0,5):
new_ += get_rand() + get_rand() + ":"
new_ += get_rand() + get_rand()
return new_
print(os.system("ifconfig eth0 | grep ether | grep -oE [0-9abcdef:]{17}"))
subprocess.call(["sudo","ifconfig","eth0","down"])
new_m = new_mac()
subprocess.call(["sudo","ifconfig","eth0","hw","ether","%s"%new_m])
subprocess.call(["sudo","ifconfig","eth0","up"])
print(os.system("ifconfig eth0 | grep ether | grep -oE [0-9abcdef:]{17}"))