-
Notifications
You must be signed in to change notification settings - Fork 0
/
MAC_Changer.py
89 lines (74 loc) · 3.52 KB
/
MAC_Changer.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import subprocess
import os
import optparse
print(" ")
print(" `.-//:://:... ")
print(" `/ymNNNNMNNNNNNNNmo/-` ")
print(" :dNMMMMMMMMMMMMMMMMMNNh ")
print(" /NMMMMMMMMMMMMMMMMMMMMMN. ")
print(" -mMMMMMMMMMMMNNMMMMMMMMMh` ")
print(" hMMMNmhsyyysoooshdNMMMMd. ")
print(" dMMNy+:--.....--:/oyNMMNo ")
print(" sMMm/:-.........--:/hMMMh ")
print(" .Nm+/+/::.````-::/++omMM+ ")
print(" ys:yddddy:``-sddddhs+Nd` ")
print(" `/:-/ssd/::..::/ydsy/:d/` ")
print(" --...---..-..--.-/-:--//: ")
print(" --..`````....--.```..-:/: ")
print(" -:..`````.-`.:-````..-:+. ")
print(" ``.````.----:-.```..--- ")
print(" ```.-::---::::...-. ")
print(" ````.-:--:-::-....` ")
print(" `.....-::-....--` ")
print(" ------------::::- ")
print(" ./--:::///+////:// ")
print(" .---------::::::` ")
print(" `....-------.` ")
print(" `.....-..` ")
print(" --.`.... ")
print(" .sdhhyhmy. ")
print(" -hMmNo` ")
print(" `dNy ")
print(" hms ")
print(" -NmN. Pt.Gaurav ")
# print("\033[0m -NmN. \033[5mPt.Gaurav ")
# print("\033[0m oNdMs \033[5mSharma \033[0m")
# print("\033[0m")
#
print(" oNdMs Sharma ")
print(" ydhMm` ")
print(" `ddhNM- ")
print(" .ddddM/ \033[5m.+` \033[0m ")
print(" ")
print(" 1. Ehernet ")
print(" 2. Wifi ")
connection = "wlan0"
network_type = int(input("Network Type : "))
if network_type == 1:
connection = "eth0"
elif network_type == 2:
connection = "wlan0"
else:
print(" Invalid, Select a valid option")
exit()
new_mac = input("Change the MAC address to : ")
# print("[+] Changing the MAC address to "+ new_mac)
# subprocess.call("sudo su ", shell=True) #Interupting further program execution
subprocess.call("ifconfig " + connection, shell=True)
subprocess.call("ifconfig " + connection +" down", shell=True)
subprocess.call("ifconfig " + connection +" hw ether "+new_mac, shell=True)
subprocess.call("ifconfig " + connection +" up", shell=True)
subprocess.call("ifconfig " + connection, shell=True)
# OS MODULE
# os.system('sudo su')
# os.system('ifconfig')
# os.system('ifconfig ' + connection)
# os.system('ifconfig ' + connection + ' down')
# os.system('ifconfig ' + connection + ' hw ether' + new_mac)
# os.system('ifconfig ' + connection + ' up')
# os.system('ifconfig ' + connection)
# REJECTING EXTRA COMMANDS
# subprocess.call(["ifconfig", connection, "down"])
# subprocess.call(["ifconfig", connection, "hw", "ether", new_mac])
# subprocess.call(["ifconfig", connection, "up"])
# subprocess.call(["ifconfig", connection])