简体   繁体   中英

Spoofing MAC using Python only?

this is for Windows 10 - wanting help with a little script that just randomizes my MAC every time I run it. Have written code to generate new realistic MACs as well as a debugger thing, eg prints current MAC vs actual MAC, but the problem is I don't know where/how to actually input the new fake MACs? and/or the best module(s) with which to do so.

I'm aware that there are questions addressing MAC spoofing but none of them seem to be with Python only. If it helps with your answer here's a question addressing spoofing using c# that outlines the (seemingly) correct registry location of the current MAC: how to spoof MAC address via code

Is it just a matter of sifting through registry and/or environment variables using os module or am I way off track?

Thank you in advance :)

SpoofMAC is a Python program that allows you to change your MAC address in Windows, Mac, and Linux.

But it's a command line program, not a package. If you want to run the script programmatically you can use os.system to run shell commands in Python.

import os
os.system('spoof-mac.py set 00:00:00:00:00:00 en0')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM