r/HowToHack • • Jan 20 '19

Change Your MAC Address Using a Python Script

https://www.youtube.com/watch?v=foDD46pl77g
199 Upvotes

15 comments sorted by

23

u/BetTheYacht Jan 20 '19

Can’t you just use Mac changer in terminal ?

9

u/[deleted] Jan 20 '19

Everytime i use it my wifi does not work anymore I never understood why (never searched neither tho)

4

u/iOSh4cktiV8or Pentesting Jan 20 '19

Is the firewall using a whitelist?

4

u/[deleted] Jan 20 '19

Didnt think about it, ill check for it someday. Ty for the advice

4

u/iOSh4cktiV8or Pentesting Jan 20 '19

Yw. U should be able to login from the browser bar by typing in your IP address and username/password and if your router has Mac filtering enabled it may be blocking your spoofed address.

32

u/SCAND1UM Jan 20 '19

I thought you could just go into settings and change your MAC address super easily

8

u/MattJaccino Jan 20 '19

With the shibang in the first line, isn’t calling “python3” before the file redundant?

Can’t you just cd to where the file is and ./mac_changer.py after chmod 755?

4

u/[deleted] Jan 21 '19

This is literally all it takes in bash.

# echo a random mac addy
alias rand_mac="openssl rand -hex 6 | sed 's/\(..\)/\1:/g;s/.$//'"

# changes the mac address, this will be reset back to factory Mac upon reboot
# the parameter is the interface you want to change(typically en0)
spoof_mac(){
    NEW_MAC=`rand_mac`
    sudo ifconfig $1 ether $NEW_MAC
    echo "New mac addy: $NEW_MAC"
}
alias spoof_mac=spoof_mac

2

u/unixage Jan 21 '19

the script doesn't work in macos

2

u/Ryanthatch Jan 21 '19

Is there a "how to" guide for this but in windows? I don't own a mac.

2

u/dmeow Jan 21 '19

There's a ubuntu term you can install on Win 10. Not sure how well it interfaces with the network chip though.

2

u/djingrain Script Kiddie Jan 21 '19

Linux my dude. Not sure if it worked work in a VM, but it's worth a try. Honestly I have so much trouble using tools in Windows, it's worth looking into switching if you're serious

2

u/martor33 Jan 21 '19

Why not use os.system?

And why not use the ip commands, they are way more intuitive

2

u/dear_volgk Jan 21 '19 edited Jan 21 '19

This is a MAC/IP changer for Linux. Bypasses the problems that one encounters when changing MAC/IP. For example, the regeneration of the routing table, or the coincidence of addresses in the local network. https://github.com/volgk/mich

5

u/[deleted] Jan 21 '19

Or you can change you mac with any of the simple networking tools in linux. Script KIddies lol