tor-private-network/bin/circuits
2026-10-07 11:29:30 -06:00

7 lines
548 B
Bash
Executable file

#!/bin/sh
# Asks this client's Tor, through its control port, which circuits it has
# built, and prints web-capable circuits, not which one a request used.
# Use request to connect a particular stream to its actual circuit.
printf 'AUTHENTICATE\r\nGETINFO circuit-status\r\nQUIT\r\n' | nc 127.0.0.1 9051 |
tr -d '\r' | grep ' BUILT ' | grep 'PURPOSE=GENERAL' | grep -v 'IS_INTERNAL' | grep 'exit1' |
sed -e 's/\$[0-9A-F]*~//g' -e 's/ BUILT / guard,middle,exit: /' -e 's/ BUILD_FLAGS.*TIME_CREATED=[0-9-]*T/ built at /' -e 's/\.[0-9]*$//'