An open API service indexing awesome lists of open source software.

https://github.com/pusheandoando/mini_macchanger

MAC and IP rotation utility for Linux
https://github.com/pusheandoando/mini_macchanger

address cpp debian ip linux mac utilities utility

Last synced: 3 months ago
JSON representation

MAC and IP rotation utility for Linux

Awesome Lists containing this project

README

          

# mini_macchanger
MAC and IP rotation utility for Linux. Focused, minimal, and straightforward. Written by **Christian (@pusheandoando)**

## Proof of concept
mini_macchanger rotates MAC addresses and renews DHCP leases on Linux network interfaces.
It handles NetworkManager, interface cycling, and DHCP negotiation automatically.
Original MACs are saved on first use so you can always restore them.

> **NetworkManager note:** when NM is active and re-manages an interface it issues its own DHCP request using the system machine-id as client-id. The DHCP anonymization above applies to the direct `dhclient`/`dhcpcd` call that precedes NM re-management. For full DHCP anonymization under NM, configure `ipv4.dhcp-send-hostname=false` and `ipv4.dhcp-client-id` in the connection profile, or keep NM unmanaged for the interface.

## Requirements
Debian/Ubuntu:
```bash
sudo apt update
```
```bash
sudo apt install -y build-essential cmake g++ iproute2 isc-dhcp-client
```

Verify kernel headers are present (usually satisfied by `build-essential`):
```bash
sudo apt install -y linux-headers-$(uname -r)
```

## Build (from code)
```bash
git clone https://github.com/pusheandoando/mini_macchanger.git && cd mini_macchanger/
```
```bash
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
```

## Usage
```
mini_macchanger -n mac Rotate MAC on interface
mini_macchanger -n mac '*' Rotate MAC on ALL interfaces
mini_macchanger -n ip [interface] Rotate MAC + renew DHCP (anonymized)
mini_macchanger -n ip '*' Rotate MAC + DHCP on ALL interfaces
mini_macchanger --reset [interface] Restore original MAC and renew IP
mini_macchanger --reset '*' Restore ALL original MACs
mini_macchanger --purge Erase history and DHCP lease files
mini_macchanger --purge-all Erase everything including originals
mini_macchanger -l List all network interfaces
mini_macchanger --credits Show author information
mini_macchanger --version Show version
mini_macchanger -h / --help Show help
```

`-n` and `--new` are interchangeable. Quote the wildcard to prevent shell expansion.
MAC and IP changes require root (`sudo`).

## About cleanup
`--purge` removes `history.log`, `used_ips.log`, and any DHCP lease files found under `/var/lib/dhcp` and `/var/lib/dhcpcd`. Files are zeroed before deletion. `originals.log` is preserved so that `--reset` still works.

`--purge-all` additionally removes `originals.log` and the `~/.mini_macchanger` directory. Run `--reset` before `--purge-all` if you want to restore original MACs first.