/$$$$$$
/$$__ $$
/$$$$$$/$$$$ /$$$$$$ /$$$$$$$ /$$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$ | $$ \__//$$$$$$ /$$$$$$
| $$_ $$_ $$ |____ $$ /$$_____/ /$$_____/ /$$__ $$ /$$__ $$ /$$__ $$| $$$$ /$$__ $$ /$$__ $$
| $$ \ $$ \ $$ /$$$$$$$| $$ | $$$$$$ | $$ \ $$| $$ \ $$| $$ \ $$| $$_/ | $$$$$$$$| $$ \__/
| $$ | $$ | $$ /$$__ $$| $$ \____ $$| $$ | $$| $$ | $$| $$ | $$| $$ | $$_____/| $$
| $$ | $$ | $$| $$$$$$$| $$$$$$$ /$$$$$$$/| $$$$$$$/| $$$$$$/| $$$$$$/| $$ | $$$$$$$| $$
|__/ |__/ |__/ \_______/ \_______/|_______/ | $$____/ \______/ \______/ |__/ \_______/|__/
| $$
| $$
|__/
A dependency-free Bash script to manually change your network interface MAC address on any Linux distro.
- Zero Dependencies: It does not require installing third-party tools. It uses standard commands found on almost every Linux distribution (
ip,od,sed,grep). - Universal Compatibility: Works on Arch, Debian, Fedora, Alpine, and others out of the box.
- Privacy Focused: Helps maintain anonymity on public Wi-Fi networks by masking your hardware address.
- Safe Randomization: Automatically handles the "Locally Administered" and "Unicast" bits (sets the first byte to
02) to ensure the generated MAC address is valid and accepted by drivers. - Transparent: The code is minimal and easy to audit, unlike complex compiled binaries.
- Arch Linux (and derivatives: Manjaro, EndeavourOS)
- Debian / Ubuntu (and derivatives: Linux Mint, Pop!_OS)
- Fedora
- openSUSE
- Kali Linux
- Void Linux
- Clone the repository:
git clone https://github.com/Kerlooo/macspoofer
- Enter the macspoofer directory:
cd macspoofer - Make the script executable:
chmod +x spoofer.sh
- Run the script (you need root privileges):
sudo ./spoofer.sh
- Random MAC Address
- Manual Mode
- Install as command
The script interacts directly with the Linux kernel via the ip command. For random generation, it reads raw bytes from /dev/urandom. To prevent connectivity issues, the script ensures the first octet follows IEEE 802 standards for local addresses (setting the second least significant bit to 1), resulting in a prefix like 02, 06, 0A, or 0E.
Current development status and planned features:
- Random MAC Generator: Fully functional with safe bit handling (unicast/local).
- Dependency Free: Zero external tools required, pure Bash implementation.
- Manual Mode: Implement custom MAC input with regex format validation.
- Restore Function: Option to revert to the original hardware address without rebooting.
- CLI Arguments: Support non-interactive mode (e.g.,
./spoofer.sh --random wlan0) for automation. - Persistence: Systemd service integration to spoof address at boot.
This guide is distributed under the Creative Commons Attribution 4.0 International (CC BY 4.0) license.
You are free to:
- Share — copy and redistribute the material in any medium or format.
- Adapt — remix, transform, and build upon the material for any purpose, even commercially.
Under the following terms:
- Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made.
For more details, see the LICENSE file or visit creativecommons.org.