-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMacChanger.py
63 lines (51 loc) · 2.35 KB
/
MacChanger.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/env python
#############################################################
# #----- Simple Mac Changer anay Interface In Linux ------# #
# #
# #----- Created By : Eng-Mohmed Elsayed ----- # #
# #
#############################################################
import subprocess
import optparse
import time
try:
subprocess.call(["clear"])
print("""
#############################################################
# #----- Simple Mac Changer anay Interface In Linux ------# #
# #
# #----- Created By : Eng-Mohmed Elsayed ----- # #
# #
#############################################################
""")
enter= '-\n-\n-\n-'
len_word="You Must Wtite :==> python MacChanger.py -i [Your Interface as wlan0 or eth0 or wlan1...etc] -m [New Mac But Sure That The Mac Is Valid]"
parser = optparse.OptionParser()
parser.add_option("-i", "--interface", dest="interface", help=" Set interface to change It's MAC Address")
parser.add_option("-m", "--mac", dest="new_mac", help=" Set New MAC Address")
print(len_word)
print(enter)
(options, arguments) = parser.parse_args()
interface = options.interface
new_mac = options.new_mac
print("[+]" + " changing MAC Address For The Interface \"" + interface + "\"" " To : " + new_mac +enter)
subprocess.call(["sudo", "ifconfig", interface, "down"])
i = subprocess.call(["sudo", "ifconfig", interface, "hw", "ether", new_mac])
subprocess.call(["sudo", "ifconfig", interface, "up"])
except Exception as error:
print ("Please wait !")
time.sleep(3)
print("""
Some Error Found ===> """+str(error))
time.sleep(2)
print('Note')
print("----")
print("To Solve all Problem =====>")
time.sleep(2)
print(enter+"Make Sure That You Didn't write : ==>python MacChanger.py")
time.sleep(3)
print(enter+"You Must Wtite :==> python MacChanger.py -i [Your Interface as wlan0 or eth0 or wlan1...etc] -m [New Mac But Sure That The Mac Is Valid]"+enter)
# parser=optparse.OptionParser()
# i = subprocess.call("ifconfig",shell=True)
# for print_all in str(i):
# print('\n'+str(print_all))