Python Script Change Mac Address Periodically

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/python-script-change-mac-address-periodically/
PINTEREST
PINTEREST
INSTAGRAM

In this tutorial we will look a simple but useful code that changes windows operating system Mac address. Mac address is the unique address that specifies the network interface. A general thought that mac addresses can be changed. But is it not true. Mac addressee is provided by the network card to the operations system network stack. But can be changed by operating system with sufficient privileges.

Download Periodic-Mac-Changer From Github

The code can be downloaded with the following git command.

OR we can download from following link as compressed archive.

https://github.com/ibaydan/periodic-mac-changer/archive/master.zip

Macshift.exe

In order to do low level mac change operations we will use macshift.exe .macshift.exe as its name suggest changes the mac address of given interface. It is provided by git repository so we do not need to download explicitly.

Timer.py

The periodic operations are managed by Timer.py python file. Here the simply code provided by Timer.py

  • We import time and os libraries in order to use related functions and API’s
  • We create a while loop which is infinite python while loop in order to never end the process except CTR+C
  • time.sleep(5) function is used  to sleep current loop for 5 seconds in every step.
  • os.system('macshift.exe -i "Local Connection 3"') is used provide macshift command to the operationg system whit related interface information which is Local Connection 3 in this example.
RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/python-script-change-mac-address-periodically/
PINTEREST
PINTEREST
INSTAGRAM

LEARN MORE  How To Fix Dns Lookup Failed

You may also like...

Leave a Reply

Your email address will not be published.

Enjoy this blog? Please spread the word :)