How brainfucksec/kalitorify works
Purpose and execution model
Kalitorify is a privileged Bash-based system networking utility for Kali Linux. It configures transparent Tor routing at the host level: local application TCP traffic is redirected through Tor and DNS/network leaks are constrained with iptables. The main executable is kalitorify.sh; installation exposes it as the kalitorify command via Makefile.
Paths: kalitorify.sh, Makefile
CLI control plane
The script is the sole runtime entry point and dispatches command-line modes: enable Tor routing (--tor), restore clearnet rules (--clearnet), inspect service/routing status, show public exit IP, and restart Tor to obtain a new circuit/IP. It must run with sufficient privileges because it manages services, firewall state, and system-installed files.
Paths: kalitorify.sh, Makefile
Tor service and proxy configuration
Tor is an external system dependency, installed through Kali/Debian packages. Kalitorify supplies a Tor configuration intended for transparent proxying; this defines the boundary between application traffic interception and Tor’s SOCKS/transproxy/DNS listener behavior. The active configuration is installed or managed from repository data, while a default copy supports restoration.
Paths: data/torrc, data/torrc.default, kalitorify.sh
Firewall-based traffic enforcement
The core operational stage applies iptables rules that classify traffic and redirect eligible outbound TCP/DNS flows to Tor while allowing the Tor daemon to reach its guard/relay network. This is host-wide policy, not application-specific proxy configuration. The inverse stage flushes/resets the managed rules to return the system to direct clearnet access.
Paths: kalitorify.sh, data/torrc
Operational lifecycle and recovery
Control flow is stateful at the machine level: install → enable transparent routing → inspect/restart as needed → explicitly restore clearnet → uninstall. Firewall interactions are an important boundary: users are instructed to disable or back up pre-existing firewall/DNS/proxy configuration, so Kalitorify should be treated as owning the relevant iptables state while active.
Paths: Makefile, kalitorify.sh
External dependencies and environment
Material runtime dependencies are Bash, Kali Linux, iptables/netfilter, the Tor daemon/service, and curl for public-IP/exit-node checks. It also relies on standard Linux service/process/network tools when reporting or controlling state. The only external network service intrinsically used by its feature set is the Tor network; IP information checks make outbound HTTP requests through the configured routing path.
Paths: kalitorify.sh, data/torrc
Security boundary
The tool protects against accidental direct connections and DNS leakage from misconfigured applications, but it is not an isolation boundary against root-capable malware or fingerprinting data such as hostname/MAC address. Tor Browser is intentionally incompatible while transparent routing is enabled because Tor-over-Tor is unsafe. These constraints shape expected deployment: a dedicated Kali host/VM with deliberate lifecycle control.
Paths: README.md, kalitorify.sh
Main entry points: kalitorify.sh kalitorify CLI · torrc Tor proxy configuration · Makefile Makefile · torrc.default Default Tor configuration
Components 14
Installation
- Makefile · Installs and exposes the kalitorify command.
Makefile
Host control plane
- kalitorify CLI · Dispatches routing, status, IP, restart, and uninstall modes.
kalitorify.sh - Lifecycle operations · Enable Tor, restore clearnet, inspect state, and request a new circuit.
kalitorify.sh
Transparent routing
- Tor proxy configuration · Defines SOCKS, transparent-proxy, and DNS listener behavior.
data/torrc - Default Tor configuration · Fallback configuration used during restoration.
data/torrc.default - Traffic classification · Separates Tor daemon traffic from eligible local application traffic.
kalitorify.sh - TCP redirection · Redirects eligible outbound TCP flows to Tor.
kalitorify.sh - DNS leak controls · Constrains DNS traffic through Tor's configured listener.
kalitorify.sh - Clearnet restoration · Flushes managed routing rules for direct network access.
kalitorify.sh
System and network dependencies
- Tor daemon/service · Provides transparent proxy, DNS, and relay connectivity.
- iptables / netfilter · Enforces the host-wide traffic policy.
- Tor network
- Public exit-IP check · Checks the public address through the active routing path.
kalitorify.sh - Privileged Kali host · Dedicated host or VM owns the affected firewall state.
Connections 19
- Makefile → kalitorify CLI: installs command
- Privileged Kali host → kalitorify CLI: runs as privileged user
- kalitorify CLI → Lifecycle operations: dispatches
- kalitorify CLI → Tor proxy configuration: installs or manages
- kalitorify CLI → Tor daemon/service: controls and inspects
- Lifecycle operations → Traffic classification: enable Tor routing
- Lifecycle operations → Clearnet restoration: restore clearnet
- Tor proxy configuration → Tor daemon/service: configures listeners
- Default Tor configuration → Tor proxy configuration: restores
- Traffic classification → TCP redirection: creates
- Traffic classification → DNS leak controls: creates
- TCP redirection → iptables / netfilter: applied through
- DNS leak controls → iptables / netfilter: applied through
- Clearnet restoration → iptables / netfilter: clears managed rules
- TCP redirection → Tor daemon/service: sends TCP to transproxy
- DNS leak controls → Tor daemon/service: sends DNS to listener
- Tor daemon/service → Tor network: connects through
- kalitorify CLI → Public exit-IP check: requests exit IP
- Public exit-IP check → Tor daemon/service: uses active route