The Mac_Changer is a Python script designed to change the Media Access Control (MAC) address of a network interface on a Linux system. This tool is useful for testing, privacy protection, or troubleshooting network issues. It uses the ifconfig
command to modify the MAC address temporarily.
- Change the MAC address of a specified network interface.
- Generate a random MAC address.
- Restore the original MAC address.
- List all available network interfaces.
- Check the status (up/down) of a network interface.
- Spoof the system hostname.
- Comprehensive manual with usage instructions.
- Operating System: Linux (tested on Ubuntu, Debian, and similar distributions).
- Python Version: Python 3.x.
- Permissions: Root privileges (required to change the MAC address).
- Dependencies: The
ifconfig
command must be installed (part of thenet-tools
package).
-
Install Python 3: Ensure Python 3 is installed on your system. You can check by running:
python3 --version
-
If not installed , install it using:
sudo apt update sudo apt install python3
-
Install net-tools: The script relies on the ifconfig command, which is part of the net-tools package. Install it using:
sudo apt install net-tools
-
Download the Script: Save the script to a file, e.g., mac_changer.py.
-
Make the Script Executable: Run the following command to make the script executable:
chmod +x mac_changer.py
Command Syntax
sudo python3 mac_changer.py [options]
Option | Description |
---|---|
-i , --interface |
Specify the network interface (e.g., eth0 ). |
-m , --mac |
Specify the new MAC address. |
-r , --random |
Generate a random MAC address. |
-ro , --restore |
Restore the original MAC address. |
-l , --list |
List all available network interfaces. |
-s , --status |
Check the status of an interface (up/down). |
-hn , --hostname |
Spoof the system hostname. |
-info |
Display the manual. |
-h , --help |
Show the help menu. |
-
Change MAC Address:
sudo python3 mac_changer.py -i eth0 -m 00:11:22:33:44:55
-
Generate Random MAC Address:
sudo python3 mac_changer.py -i eth0 -r
-
Restore Original MAC Address:
sudo python3 mac_changer.py -i eth0 -ro
-
List Available Interfaces:
sudo python3 mac_changer.py -l
-
Check Interface Status:
sudo python3 mac_changer.py -s eth0
-
Spoof Hostname:
sudo python3 mac_changer.py -hn newhostname
-
Display Manual:
sudo python3 mac_changer.py -info
-
Root Privileges: This tool requires root privileges to change the MAC address.
-
Temporary Change: The MAC address change is not persistent across reboots.
-
Legal Use: Use this tool responsibly and only on networks you own or have permission to test on.
This tool is open-source and distributed under the MIT License. Feel free to modify and distribute it as needed.
Name: Kouam Parfait J
Contact: kouamparfait5@gmail.com
GitHub: my github
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on the GitHub repository.
This tool is intended for educational and legitimate purposes only. Misuse of this tool, such as unauthorized access (without permission) to networks or illegal activities, is prohibited. The authors are not responsible for any misuse or damage caused by this tool.