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

https://github.com/grassleaff/iptorch

iptorch is a IP rotator tool for periodically change Tor exit IP, written in Bash and with multiple utils built-in to turn everything more easy to you.
https://github.com/grassleaff/iptorch

anonymize anonymous bash-script ethical-hacking ethical-hacking-tools ip-changer ipchanger network socks5 tor-network

Last synced: 19 days ago
JSON representation

iptorch is a IP rotator tool for periodically change Tor exit IP, written in Bash and with multiple utils built-in to turn everything more easy to you.

Awesome Lists containing this project

README

          


iptorch-frame-white

---

![Bash Script](https://img.shields.io/badge/bash_script-%23121011.svg?style=for-the-badge&logo=gnu-bash&logoColor=white)
[![Tor](https://img.shields.io/badge/Tor-7D4698?style=for-the-badge&logo=Tor-Browser&logoColor=white)](https://www.torproject.org/)
[![Licence](https://img.shields.io/badge/GPL--2.0-red?style=for-the-badge)](./LICENSE)

**iptorch** is a Bash CLI tool that automates IP rotation through the Tor network using the ControlPort protocol. The script sends the SIGNAL NEWNYM command to Tor to request a new circuit, and consequently a new IP, at user-configurable intervals.

Communication with ControlPort is done via **netcat (nc)** or **socat**, with automatic fallback to service reload if authentication fails. The script supports authentication via password (HashedControlPassword) or via cookie (control.authcookie), detecting the default paths used by Tor.

The tool exposes a classic command line interface via getopts, allowing you to specify:

| Flag | Function |
| :---: | :---: |
| `-s` | **SECONDS** - Interval between IP changes |
| `-c` | **COUNT** - Number of rotations (0 = infinite) |
| `-p` | **CONTROL_PORT** - Tor ControlPort port (default: 9051) |
| `-P` | **PASSWORD** - Password set in torrc |
| `-t` | **SOCKS_PORT** - Tor SOCKS port (default: 9050) |
| `-S` | **SERVICE STAND MODE** - Does not terminate the Tor service when exiting |
| `-C / -w` | Displays **COPYRIGHT** and **WARRANTY** information (GPLv2) |

During execution, the script:

- **Checks root privileges** (required to manipulate services).
- **Detects the active service manager** (`systemd`, `sysvinit`, `openrc`, `runit`, `s6`) and starts Tor.
- **Attempts to authenticate on ControlPort**, prioritising `AUTHENTICATE` with password or cookie.
- **Repeatedly sends SIGNAL NEWNYM**, respecting the configured interval.
- Optionally, displays the current IP and geolocation via `curl + jq` using Tor's SOCKS proxy.

The script uses trap to capture shutdowns (SIGINT, SIGTERM) and ensure a clean shutdown of the Tor service, except when the -S flag is used.

## 📦 Dependencies

To ensure the script works properly, the following dependencies are recommended:

| Dependency | Reason |
| :---: | :---: |
| `tor` | Tor service for IP rotation |
| `curl` | IP query via Tor proxy |
| `jq` | JSON parser for geolocation |
| `nc` *(netcat)* or `socat` | Communication with ControlPort |
| `xxd` or `od` | Conversion of authentication cookie to HEX |
| `systemctl` / `service` / `rc-service` / `sv` / `s6-rc` | Tor service control |

> **NOTE:** Without `nc` or `socat`, the script enters fallback mode, attempting to `reload` Tor instead of `SIGNAL NEWNYM`.

## Installation

Clone the repository and grant execution permission:

```
git clone https://github.com/letterfenceglasses/iptorch.git
cd iptorch
chmod +x src/iptorch
sudo cp src/iptorch /usr/local/bin/iptorch
```

## Licence

Distributed under **GNU GPLv2**. Free to modify and redistribute, without warranty, see `iptorch -C` and `iptorch -w` to display the licence and warranty notices directly via the CLI.

---