✅ Cross-Platform Support: This is a modernized fork of the original
spoofproject, updated for compatibility with modern macOS (Sequoia 15.4+, Tahoe 26+), Windows 10/11, and Linux. All platforms are now fully supported!
A Node.js utility for changing MAC addresses and DHCPv6 DUIDs across all major platforms. Features reliable macOS support, modern Windows PowerShell integration, and Linux ip link commands. This fork includes enhanced error handling, automatic verification, retry logic, and improved cross-platform compatibility.
This repository (TT5H/spoof-d) is a fork of basedbytes/spoofy, which itself is a fork of the original spoof project. This fork extends the functionality with full cross-platform support and enhanced features.
- ✅ Full Cross-Platform Support: Complete Windows 10/11 and Linux support (not just macOS)
- Modern macOS Support: Fixed MAC spoofing for macOS Sequoia 15.4+ and Tahoe 26+
- Windows Support: Full Windows 10/11 support using PowerShell and registry methods with automatic fallback
- Linux Support: Modern Linux support using
ip linkcommands (replaces deprecatedifconfig) - DUID Spoofing: DHCPv6 DUID spoofing with automatic original preservation and cross-platform support
- Enhanced Error Handling: Custom error classes with actionable suggestions and better error messages
- Automatic Verification: Verifies MAC address changes after setting them
- Retry Logic: Automatic retry with exponential backoff for transient failures
- Timeout Handling: Prevents hanging operations with configurable timeouts
- Better Validation: Comprehensive input validation with helpful error messages
- Removed
airportdependency: The deprecatedairport -zcommand has been replaced with modernnetworksetupcommands - Timing-sensitive MAC changes: WiFi MAC addresses are now changed in the brief window after power-on but before network connection
- Improved interface detection: Better cross-platform interface detection using modern system commands
- Cleaner codebase: Removed deprecated code paths and unnecessary constants
- Custom error classes with specific error types (ValidationError, PermissionError, NetworkError, etc.)
- Actionable suggestions provided with every error message
- Better error context to help diagnose issues quickly
- Automatic verification of MAC address changes after setting them
- Retry logic with exponential backoff for transient failures
- Timeout handling to prevent hanging operations
- Comprehensive validation of inputs before attempting changes
- Windows: PowerShell integration with registry fallback
- macOS: Modern networksetup commands with WiFi timing handling
- Linux: Modern ip link commands with ifconfig fallback
- Unified API across all platforms
- Progress indicators with animated spinners for long-running operations
- Verbose mode (
--verbose) for detailed debugging output - JSON output (
--json) for scripting and automation - Configuration file support (
.spoofyrcin home directory) - MAC address vendor lookup using OUI database
- Change history tracking for both MAC and DUID changes with ability to view history
- Batch operations for changing multiple interfaces at once
- DUID (DHCPv6) spoofing for complete IPv6 network identity management
- Automatic verification of DUID changes with retry logic
- Node.js: Version 12.0.0 or higher
- Operating System: macOS, Windows 10/11, or Linux
- Privileges: Administrator/root access required for MAC and DUID changes
npm install -g spoof-d
After installation, use the spoofy command (the package name is spoof-d, but the command is still spoofy).
After installation, you can use the spoofy command from anywhere.
git clone https://github.com/TT5H/spoof-d.git
cd spoof-d
npm install
npm install -g .
This gives you the latest development version with all the latest features.
spoof-d includes shell completion support for bash, zsh, fish, and PowerShell, making it easier to use the CLI with tab completion.
The easiest way to install completions is using the built-in command:
spoofy completion
This will automatically detect your shell and install the appropriate completion file. You can also specify a shell explicitly:
spoofy completion --shell=bash
spoofy completion --shell=zsh
spoofy completion --shell=fish
spoofy completion --shell=powershell
# Copy completion file
mkdir -p ~/.bash_completion.d
cp completions/spoofy.bash ~/.bash_completion.d/spoofy
# Add to ~/.bashrc
echo "source ~/.bash_completion.d/spoofy" >> ~/.bashrc
source ~/.bashrc
Or install globally (requires root):
sudo cp completions/spoofy.bash /etc/bash_completion.d/spoofy
# Copy completion file
mkdir -p ~/.zshrc.d
cp completions/spoofy.zsh ~/.zshrc.d/_spoofy
# Add to ~/.zshrc
echo "fpath=(~/.zshrc.d \$fpath)" >> ~/.zshrc
echo "autoload -U compinit && compinit" >> ~/.zshrc
source ~/.zshrc
Or install globally (requires root):
sudo cp completions/spoofy.zsh /usr/local/share/zsh/site-functions/_spoofy
# Copy completion file
mkdir -p ~/.config/fish/completions
cp completions/spoofy.fish ~/.config/fish/completions/spoofy.fish
Fish will automatically load completions from ~/.config/fish/completions/. Just restart your fish shell.
Or install globally (requires root):
sudo cp completions/spoofy.fish /usr/share/fish/completions/spoofy.fish
# Copy completion file
New-Item -ItemType Directory -Force -Path (Split-Path $PROFILE)
Copy-Item completions/spoofy.ps1 $PROFILE
# Add to PowerShell profile
Add-Content $PROFILE ". $PROFILE"
# Reload profile
. $PROFILE
Or add manually to your profile:
. C:\path\to\completions\spoofy.ps1
- Command completion: Tab-complete all available commands (
list,set,randomize,duid, etc.) - Interface name completion: Automatically suggests available network interfaces
- Option completion: Tab-complete all flags and options (
--wifi,--verbose, etc.) - DUID subcommand completion: Full completion support for DUID commands
- Context-aware: Completions adapt based on the current command and position
macOS/Linux:
spoofy list
Windows (run PowerShell as Administrator):
spoofy list
macOS (WiFi is typically en0):
sudo spoofy randomize en0
Windows:
# Run PowerShell as Administrator
spoofy randomize "Ethernet"
Linux:
sudo spoofy randomize eth0
Note: WiFi will disconnect briefly and may need to reconnect to networks. On Windows, ensure you're running as Administrator.
You can always see up-to-date usage instructions by running spoofy --help.
spoofy list
Output:
- "Ethernet" on device "en4" with MAC address 70:56:51:BE:B3:00
- "Wi-Fi" on device "en0" with MAC address 70:56:51:BE:B3:01 currently set to 70:56:51:BE:B3:02
- "Bluetooth PAN" on device "en1"
spoofy list --wifi
Using hardware port name:
sudo spoofy randomize wi-fi
Or using device name:
sudo spoofy randomize en0
sudo spoofy set 00:11:22:33:44:55 en0
sudo spoofy reset wi-fi
Note: On macOS, restarting your computer will also reset your MAC address to the original hardware address.
spoof-d also supports DHCPv6 DUID (DHCP Unique Identifier) spoofing for complete IPv6 network identity management.
A DUID (DHCP Unique Identifier) is used in DHCPv6 to uniquely identify a client on IPv6 networks. Unlike MAC addresses which identify network interfaces, DUIDs identify DHCP clients across all interfaces and persist across reboots.
The first time you spoof your DUID, your original DUID is automatically saved to:
- macOS:
/var/db/dhcpclient/DUID.original - Linux:
/var/lib/spoofy/duid.original - Windows:
%PROGRAMDATA%\spoofy\duid.original
This allows you to restore to your pre-spoofing state at any time using spoofy duid restore.
spoofy duid list
Generate and set a random DUID (automatically saves your original on first use):
sudo spoofy duid randomize en0
You can specify the DUID type:
sudo spoofy duid randomize en0 --type=LLT
sudo spoofy duid set 00:03:00:01:aa:bb:cc:dd:ee:ff en0
Match DUID to the current MAC address of an interface (useful after MAC spoofing):
sudo spoofy duid sync en0
With specific type:
sudo spoofy duid sync en0 --type=LLT
Typical workflow for complete identity spoofing:
sudo spoofy randomize en0 # Spoof MAC first
sudo spoofy duid sync en0 # Then sync DUID to match
This ensures both layers show the same spoofed identity on IPv6 networks.
Return to your original (pre-spoofing) DUID:
sudo spoofy duid restore en0
Delete current DUID and let the system generate a NEW random one:
sudo spoofy duid reset en0
Important: reset generates a NEW DUID, while restore returns to your ORIGINAL.
| Type | Name | Description |
|---|---|---|
| 1 | DUID-LLT | Link-layer address + timestamp (most common) |
| 2 | DUID-EN | Enterprise number + identifier |
| 3 | DUID-LL | Link-layer address only (default) |
| 4 | DUID-UUID | UUID-based identifier |
spoofy info en0
Shows detailed information about an interface including hardware MAC, current MAC, vendor information, and change history.
spoofy validate 00:11:22:33:44:55
Validates and normalizes a MAC address, showing vendor information if available.
spoofy vendor 00:11:22:33:44:55
Looks up the vendor/manufacturer of a MAC address using the OUI database.
Create a batch file (e.g., batch.json):
[
{
"type": "randomize",
"device": "en0",
"local": true
},
{
"type": "set",
"device": "eth0",
"mac": "00:11:22:33:44:55"
},
{
"type": "reset",
"device": "wlan0"
}
]
Then run:
sudo spoofy batch batch.json
spoofy history
View all MAC address changes, or filter by device:
spoofy history en0
spoofy duid history
View all DUID changes, or filter by device:
spoofy duid history en0
Get detailed debugging information:
spoofy list --verbose
spoofy randomize en0 --verbose
Output results in JSON format for scripting:
spoofy list --json
spoofy randomize en0 --json
Example JSON output:
{
"success": true,
"device": "en0",
"mac": "00:11:22:33:44:55",
"message": "MAC address changed successfully"
}
Create a configuration file at ~/.spoofyrc (or %USERPROFILE%\.spoofyrc on Windows):
{
"randomize": {
"local": true
},
"defaults": {
"verbose": false,
"json": false
}
}
The configuration file allows you to set default options that will be used automatically.
All MAC address and DUID changes are automatically logged to ~/.spoofy_history.json. You can:
- View MAC history:
spoofy history - View MAC history for specific device:
spoofy history en0 - View DUID history:
spoofy duid history - View DUID history for specific device:
spoofy duid history en0 - History includes timestamp, device, old/new values, and operation type
- Both MAC and DUID changes are tracked in the same history file
The tool includes an OUI (Organizationally Unique Identifier) database to identify device vendors:
- Automatically shown in
spoofy listoutput - Available via
spoofy vendor <mac>command - Helps identify device types and manufacturers
Long-running operations show progress indicators:
⏳ Changing MAC address... ✓ Successfully set MAC address
Install the package as spoof-d; the CLI command is spoofy.
const spoofy = require('spoof-d');
// Get current DUID
const current = spoofy.duid.getCurrentDUID();
console.log('Current DUID:', spoofy.duid.formatDUID(current));
// Parse DUID info
const info = spoofy.duid.parseDUID(current);
console.log('Type:', info.typeName);
console.log('MAC:', info.lladdr);
// Check if original is stored
if (spoofy.duid.hasOriginalDUID()) {
const original = spoofy.duid.getOriginalDUID();
console.log('Original DUID:', spoofy.duid.formatDUID(original));
}
// Generate a random DUID
const newDuid = spoofy.duid.generateDUID(spoofy.duid.DUID_TYPES.DUID_LL);
console.log('Generated:', spoofy.duid.formatDUID(newDuid));
// Set DUID (requires root) - automatically saves original on first call
spoofy.duid.setDUID(newDuid, 'en0');
// Randomize DUID
spoofy.duid.randomizeDUID(spoofy.duid.DUID_TYPES.DUID_LLT, 'en0');
// Sync DUID to current MAC address
spoofy.duid.syncDUID('en0', spoofy.duid.DUID_TYPES.DUID_LL);
// Restore to original DUID
spoofy.duid.restoreDUID('en0');
For complete identity change on IPv6 networks, you should change both MAC and DUID.
Recommended workflow using sync:
sudo spoofy randomize en0 # Spoof MAC first
sudo spoofy duid sync en0 # Sync DUID to match spoofed MAC
The sync command automatically matches the DUID to your current (spoofed) MAC address.
Alternative - randomize both separately:
sudo spoofy randomize en0
sudo spoofy duid randomize en0
Manual sync for advanced use:
When using DUID-LL or DUID-LLT types, the DUID includes the MAC address. For consistent spoofing, ensure the MAC in your DUID matches your spoofed MAC:
const spoofy = require('spoof-d');
// Spoof MAC
const newMac = '00:11:22:33:44:55';
spoofy.setInterfaceMAC('en0', newMac, 'Wi-Fi');
// Create matching DUID
const duid = spoofy.duid.generateDUID(spoofy.duid.DUID_TYPES.DUID_LL, newMac);
spoofy.duid.setDUID(duid, 'en0');
- ✅ Fully supported and tested on macOS Tahoe 26.2
- ✅ Works on macOS Sequoia 15.4+
⚠️ Older versions may work but are untested- Uses
networksetupandifconfigcommands - Special handling for WiFi interfaces on modern macOS
- ✅ Fully supported on Windows 10 and Windows 11
- ✅ Uses PowerShell
Get-NetAdapterandSet-NetAdaptercommands - ✅ Falls back to registry method for compatibility
⚠️ Requires Administrator privileges (run PowerShell/CMD as Administrator)- Some network adapters may not support MAC address changes (hardware limitation)
Windows Usage:
# Run PowerShell or CMD as Administrator
spoofy list
spoofy randomize "Ethernet"
spoofy set 00:11:22:33:44:55 "Wi-Fi"
- ✅ Fully supported using modern
ip linkcommands - ✅ Falls back to
ifconfigifipcommand is not available ⚠️ Requires root privileges (usesudo)- Works with most modern Linux distributions
Linux Usage:
sudo spoofy list
sudo spoofy randomize eth0
sudo spoofy set 00:11:22:33:44:55 wlan0
- WiFi will briefly disconnect when changing MAC address
- Some network restrictions or hardware may prevent MAC spoofing
- Requires sudo/root privileges for all MAC address and DUID changes
- DUID changes may require DHCPv6 lease renewal to take effect
On Linux systems using NetworkManager, MAC address changes may be immediately overwritten by NetworkManager if the interface is managed. spoof-d includes NetworkManager detection and integration to help prevent this issue.
When changing MAC addresses on Linux, spoof-d automatically:
- Detects if NetworkManager is present and running
- Checks if the target interface is managed by NetworkManager
- Warns you if the interface is managed (MAC changes may be overwritten)
To automatically reconnect the NetworkManager device after a MAC change:
sudo spoofy randomize eth0 --nm-reconnect
This will:
- Change the MAC address
- Disconnect the device from NetworkManager
- Reconnect the device to apply the new MAC address
If normal reconnection doesn't work, you can force NetworkManager to restart networking (use with caution):
sudo spoofy randomize eth0 --nm-reconnect --force
Warning: The --force flag will temporarily disable all NetworkManager networking, which may disconnect all network interfaces briefly.
If you prefer to manage NetworkManager manually:
-
Temporarily disconnect the device:
nmcli dev disconnect eth0 sudo spoofy randomize eth0 nmcli dev connect eth0 -
Mark device as unmanaged (persistent): Edit
/etc/NetworkManager/NetworkManager.conf:[keyfile] unmanaged-devices=interface-name:eth0Then restart NetworkManager:
sudo systemctl restart NetworkManager -
Disable NetworkManager for specific interface (temporary):
nmcli device set eth0 managed no sudo spoofy randomize eth0 nmcli device set eth0 managed yes
Use --verbose to see detailed NetworkManager status:
sudo spoofy randomize eth0 --verbose
This will show:
- NetworkManager detection method (nmcli, systemctl, etc.)
- Device management status
- Raw nmcli output for debugging
The project includes test suites for core functionality:
Test DUID generation, parsing, and conversion:
# Run all DUID tests
npm run test:duid
# or
node test/test-duid.js
# Run specific test
node test/test-duid.js --test=generation
node test/test-duid.js --test=parsing
Test NetworkManager detection and device status parsing:
# Run all NetworkManager tests
npm run test:nm
# or
node test/test-networkmanager.js
# Run specific test (parsing tests work on any platform)
node test/test-networkmanager.js --test=parsing
npm run test:all
Note: NetworkManager tests require a Linux system with NetworkManager installed. Parsing tests work on any platform.
- Make sure you're running with
sudo(required for network changes) - Ensure WiFi is turned on before attempting to change MAC
- On modern macOS, you may need to reconnect to WiFi after the change
- Try running
networksetup -detectnewhardwareif changes don't take effect - For DUID changes, you may need to disable/re-enable IPv6 or renew DHCPv6 lease
- Run as Administrator: Right-click PowerShell or Command Prompt and select "Run as Administrator"
- Some network adapters don't support MAC address changes (hardware limitation)
- If
Set-NetAdapterfails, the tool will automatically try the registry method - You may need to disable and re-enable the adapter manually if changes don't take effect
- Check adapter compatibility: Some virtual adapters and certain hardware may not support MAC spoofing
- Make sure you're running with
sudo(required for network changes) - Ensure the
ipcommand is available (usually iniproute2package) - NetworkManager conflicts: If NetworkManager is managing your interface, MAC changes may be overwritten
- Use
--nm-reconnectto automatically reconnect after MAC change - Or manually disconnect/reconnect:
nmcli dev disconnect <iface>thennmcli dev connect <iface> - Or mark interface as unmanaged in NetworkManager config (see NetworkManager Integration section)
- Use
- Virtual interfaces and certain hardware may not support MAC address changes
- If MAC changes don't persist, check NetworkManager status:
nmcli device status
This is an active fork. Contributions, bug reports, and feature requests are welcome!
To contribute:
- Fork this repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT License (inherited from original project)
- This fork: TT5H/spoof-d - Enhanced cross-platform support with improved error handling
- Parent fork: basedbytes/spoofy - Modernized macOS support
- Original project:
spoofby Feross Aboukhadijeh
This fork maintains compatibility with modern operating systems and extends support to Windows and Linux.