Builds

13 repos

Showing 13 of 13 projects

Screenshot of Tori CLI

~/builds/tori-cli

10

Tori CLI

A SOCKS4 client in C that tunnels TCP connections through Tor

Source

Tori CLI is a small command-line tool that opens a TCP connection to a destination host and port by speaking the SOCKS4 protocol directly to a local Tor proxy at 127.0.0.1:9050. It's aimed at people who want to see the raw mechanics of a SOCKS handshake rather than use a library for it.

The client hand-builds the SOCKS4 request struct (version, command, destination port/IP, user id) in a single header file, sends it over a POSIX socket, and reads back the proxy's reply to check the connect code before reporting success or failure.

Highlights

  • Implements the SOCKS4 handshake by hand: builds proxy_request/proxy_response structs over a raw POSIX socket
  • Takes host and port as CLI args; reports whether the Tor proxy bridged the connection (reply code 90)
  • Single C file plus a header, built with a one-line Makefile (gcc tori.c -o tori)