Skip to main content

MAC Address Spoofer

CI (master) PyPI Version PyPI Downloads

A command-line tool to spoof your network interface's MAC address on Linux systems.

MacSpoofer Demo

What is a MAC Address?

A Media Access Control (MAC) address is a unique identifier assigned to a network interface controller (NIC) for use as a network address in communications within a network segment. This identifier is used in most IEEE 802 networking technologies, including Ethernet, Wi-Fi, and Bluetooth.

Changing your MAC address can be useful for:

  • Privacy - Prevent tracking across networks
  • Testing - Simulate different network devices
  • Bypassing restrictions - Some networks filter by MAC address

MAC Address Structure

A MAC address is a 12-digit hexadecimal number (6 bytes), typically represented in colon-hexadecimal notation (e.g., 00:1A:2B:3C:4D:5E).

Bytes Name Description
First 3 bytes OUI (Organizationally Unique Identifier) Identifies the manufacturer
Last 3 bytes NIC (Network Interface Controller) Device-specific identifier

Features

  • 🎲 Random MAC generation - Generate safe, locally-administered unicast addresses
  • 🏭 Vendor spoofing - Mimic devices from Samsung, Apple, Intel, Microsoft, Huawei, Google, or Cisco
  • 🖥️ Interactive TUI - Easy to use text interface
  • ⚡ Auto mode - Non-interactive operation for scripts
  • 🔧 CI mode - Designed for automated testing pipelines

Installation

pip install macspoofer

From source

chmod +x setup.sh
sudo ./setup.sh

From a CI build artifact

Every run of the MacSpoofer CI workflow builds the package and uploads the resulting wheel as a GitHub Actions artifact named macspoofer-wheel. To install a pre-release build:

  1. Open the relevant workflow run on the Actions tab.
  2. Download the macspoofer-wheel artifact and unzip it.
  3. Install the wheel with pip:
pip install ./macspoofer-*.whl

Usage

Find Your Interface Name

ifconfig -a
# or
ip link show

Interactive Mode (TUI)

sudo -E macspoofer -i <interface>
# or
sudo -E python3 main.py -i <interface>

Auto Mode (Non-Interactive)

sudo -E macspoofer -i <interface> --auto
# or
sudo -E python3 main.py -i <interface> --auto

Command Line Options

Option Description
-i <interface> Network interface name (e.g., wlan0, eth0) [Required]
--auto Non-interactive mode: generate and apply a random unicast MAC
--ci CI mode: for automated testing
--help Show help message and usage examples
--version Show version information

Programmatic Usage

You can also use macspoofer as a Python library:

Generate a Random MAC Address

from macspoofer.utils.random_utils import generate_safe_unicast_mac

mac = generate_safe_unicast_mac()
print(mac)  # e.g. "a6:3f:12:cb:90:01"

Search & Browse Vendors

from macspoofer.utils.vendors import VendorRegistry

# Total vendors in the database
print(VendorRegistry.vendor_count())

# Search by name (case-insensitive)
results = VendorRegistry.search("Raspberry")
print(results)

# Get OUI prefixes for a specific vendor
ouis = VendorRegistry.get_ouis_for_vendor("Apple")
print(ouis[:3])  # ['58:e6:ba', '8c:98:6b', ...]

Generate a Vendor-Specific MAC

from macspoofer.spoofer import generate_mac_for_vendor

mac = generate_mac_for_vendor("Samsung")
print(mac)  # e.g. "e4:7a:11:2f:c8:5d"

Spoof an Interface (requires root)

import asyncio
from macspoofer.modules.interface import NetworkInterface
from macspoofer.spoofer import spoof_mac_address
from macspoofer.utils.random_utils import generate_safe_unicast_mac

async def main():
    interface = NetworkInterface("wlan0")
    mac = generate_safe_unicast_mac()
    await spoof_mac_address(interface, mac, require_confirmation=False)

asyncio.run(main())

License

MIT License


© 2022-2026 Daniel Kirshner. All rights reserved.

Metadata

Release files for macspoofer 1.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for macspoofer 1.0.8
File Size Uploaded
macspoofer-1.0.8.tar.gz 1.6 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for macspoofer 1.0.8
File Interpreter ABI Platform
macspoofer-1.0.8-py3-none-any.whl Python 3 none any Details

Total release size: 1.9 MB

Release files / macspoofer-1.0.8.tar.gz

Download URL macspoofer-1.0.8.tar.gz
Size 1.6 MB
Tags Source
SHA-256 checksum
How to use checksums
e869ad0edfd84c096214e55bd7fe2fea796d9dcae024e8dd46849931ca3464a7
BLAKE2b-256 checksum
How to use checksums
b79568a58e6211c32e50690a58463e5c551a4a202d07fd2e34b42c3033a0ad60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 7, 2026.

Transparency log

Release files / macspoofer-1.0.8-py3-none-any.whl

Download URL macspoofer-1.0.8-py3-none-any.whl
Size 353.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8ff6d3f3d8cb4ebf46b48096d25e6243c4d6933df128b15e7cd82b551b0c1dd1
BLAKE2b-256 checksum
How to use checksums
fe63d87900c3e829aa2c6ccd8e8758c07e1c762d61d701dc0bd4df7250feb779
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 7, 2026.

Transparency log

Release history Release notifications | RSS feed

1.0.10

2 release files

1.0.9

2 release files

This release

1.0.8 This release

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page