Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # Python Mac Changer BETA....
- # By infodox - credit to Trip from Hak5 for the getmac function, as mine did not work!
- import os
- import commands
- import sys
- # Checking are you r00t
- def amiroot():
- if os.geteuid() != 0:
- print "[-] sorry, you need to run this as root"
- sys.exit(1)
- else:
- pass
- def getmac(iface):
- data = commands.getoutput("ifconfig " + iface)
- words = data.split()
- found = 0
- for x in words:
- #print x
- if found != 0:
- mac = x
- break
- if x == "HWaddr":
- found = 1
- if len(mac) == 0:
- mac = 'Mac not found'
- mac = mac[:17]
- print mac
- print("Welcome to the Pythonized MAC changer v1.0 by infodox")
- print("This code is still under development - I have a lot of work to do!")
- print("Have fun...")
- amiroot()
- print("Using GNU macchanger to change your MAC address...")
- iface = raw_input("what interface are you changing: ") # Sets the interface to fuck with...
- print("[*] Your Current MAC address is: ")
- getmac(iface)
- print("[+] Putting " + iface + " down") # Nice status report
- os.popen("ifconfig " + iface + " down") # Puts interface DOWN
- print("[+] Changing your MAC address to something totally random...") # More statuses
- os.popen("macchanger --random " + iface) # CHANGES MAC ADDRESS!!!!!!!
- print("[+] Putting " + iface + " back up") # Status Report
- os.popen("ifconfig " + iface + " up") # Puts interface back up :)
- print("[*] Your New MAC address is: ")
- getmac(iface)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement