Skip to content

FelipeKreulich/phantom-ip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

          .                                                      .
        .n                   .                 .                  n.
  .   .dP                  dP                   9b                 9b.    .
 4    qXb         .       dX                     Xb       .        dXp     t
dX.    9Xb      .dXb    __                         __    dXb.     dXP     .Xb
9XXb._       _.dXXXXb dXXXXbo.                 .odXXXXb dXXXXb._       _.dXXP
 9XXXXXXXXXXXXXXXXXXXVXXXXXXXXOo.           .oOXXXXXXXXVXXXXXXXXXXXXXXXXXXXP
  `9XXXXXXXXXXXXXXXXXXXXX'~   ~`OOO8b   d8OOO'~   ~`XXXXXXXXXXXXXXXXXXXXXP'
    `9XXXXXXXXXXXP' `9XX'   DIE    `98v8P'  HUMAN   `XXP' `9XXXXXXXXXXXP'
        ~~~~~~~       9X.          .db|db.          .XP       ~~~~~~~
                        )b.  .dbo.dP'`v'`9b.odb.  .dX(
                      ,dXXXXXXXXXXXb     dXXXXXXXXXXXb.
                     dXXXXXXXXXXXP'   .   `9XXXXXXXXXXXb
                    dXXXXXXXXXXXXb   d|b   dXXXXXXXXXXXXb
                    9XXb'   `XXXXXb.dX|Xb.dXXXXX'   `dXXP
                     `'      9XXXXXX(   )XXXXXXP      `'
                              XXXX X.`v'.X XXXX
                              XP^X'`b   d'`X^XX
                              X. 9  `   '  P )X
                              `b  `       '  d'
                               `             '

PhantomIP

Rotate your IP from the terminal using Tor or proxy servers.

License: MIT Rust Build


Features

  • Rotate your public IP via Tor (NEWNYM signal), proxy servers, or hybrid mode
  • System-wide mode: routes all PC traffic through Tor via transparent proxy (iptables)
  • Interactive CLI prompts or full command-line argument support
  • Displays old and new IP after each rotation
  • Live status: rotation count, current IP, uptime
  • Configurable via TOML file
  • Colored terminal output with ASCII logo
  • Automatic cleanup: restores iptables and torrc on exit

Requirements

  • Rust 1.75+ (for building from source)
  • Tor installed and running (for tor and hybrid modes)
    • Tor control port enabled (default: 9051)
    • Tor SOCKS proxy running (default: 9050)

Setting up Tor

# Debian/Ubuntu/Kali
sudo apt install tor

Enable the control port and cookie auth in /etc/tor/torrc:

ControlPort 9051
CookieAuthentication 1
CookieAuthFileGroupReadable 1
sudo systemctl enable tor
sudo systemctl start tor

Installation

From source

git clone https://github.com/yourusername/phantomip.git
cd phantomip
cargo build --release

The binary will be at target/release/phantomip.

With cargo install

cargo install --path .

Usage

Quick start (recommended)

Use the included run.sh script — it handles Tor startup automatically:

# Rotate IP via Tor (only phantomip traffic)
./run.sh

# System-wide mode: ALL PC traffic routed through Tor, IPv6 blocked
sudo ./run.sh --system

--system mode:

  1. Adds TransPort and DNSPort to torrc
  2. Saves current iptables rules and redirects all TCP/DNS through Tor
  3. Blocks UDP entirely to prevent WebRTC/STUN leaks (browsers use UDP to discover the real public IP via STUN servers, bypassing any TCP proxy)
  4. Blocks IPv6 entirely to prevent IPv6 leaks (Tor does not support IPv6 exit nodes reliably)
  5. On Ctrl+C, automatically restores iptables, ip6tables, and torrc to their original state

Binary directly

# Interactive mode (prompts for settings)
phantomip

# Rotate via Tor every 30 seconds, run for 5 minutes
phantomip --mode tor --interval 30 --duration 300

# Rotate via proxy list indefinitely every 15 seconds
phantomip --mode proxy --interval 15 --duration 0

# Use a custom config file
phantomip --config ./my-config.toml

CLI Options

Flag Description Default
--mode Rotation mode: tor, proxy, hybrid tor
--interval Seconds between rotations 30
--duration Total runtime in seconds (0=forever) 0
--config Path to a TOML config file

Configuration

Edit config/default.toml:

[tor]
control_host = "127.0.0.1"
control_port = 9051
password = ""
socks_port = 9050

[proxy]
list = [
    "socks5://127.0.0.1:1080",
]

[general]
ip_check_url = "https://api.ipify.org"
interval = 30
duration = 0
mode = "tor"

Tor Limitations

  • Tor enforces a ~10 second cooldown between NEWNYM signals. PhantomIP respects this automatically — if your interval is shorter than 10s in Tor mode, it will wait.
  • The new IP is not guaranteed to be different from the previous one.
  • Tor must be running with the control port enabled and properly authenticated.

Contributing

Contributions are welcome! Here's how to get started:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/my-feature
  3. Make your changes with clear commit messages
  4. Run tests: cargo test
  5. Run clippy: cargo clippy -- -D warnings
  6. Submit a pull request

Please follow the existing code style and add tests for new functionality.

License

This project is dual-licensed under:

Choose whichever fits your needs.

About

PhantomIP is a CLI tool to rotate your IP using Tor or proxies. It features a dragon ASCII logo, configurable interval/duration, real-time IP display, and logging. Modular, extensible, and open source for developers and privacy enthusiasts.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors