-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmacshift.py
More file actions
23 lines (16 loc) · 749 Bytes
/
macshift.py
File metadata and controls
23 lines (16 loc) · 749 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env python
import subprocess
import optparse
from pyfiglet import figlet_format
print(figlet_format("MAC Shift", font = "standard" ))
parser = optparse.OptionParser()
parser.add_option("-i", "--interface ", dest="interface", help="Interface to change its MAC Address")
parser.add_option("-m", "--mac ", dest="new_mac", help="New MAC Address")
(options, arguments) = parser.parse_args()
interface = options.interface
new_mac = options.new_mac
print("[+] Changing MAC address for " + interface + " to " + new_mac + " [+]")
subprocess.call(["ifconfig", interface, "down"])
subprocess.call(["ifconfig", interface, "hw", "ether", new_mac])
subprocess.call(["ifconfig", interface, "up"])
print("[+] MAC Address changed successfully [+]")