Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/sh -e
# https://collector.torproject.org/archive/relay-descriptors/server-descriptors/server-descriptors-YYYY-MM.tar.xz
tar xvJf "$1"
basename=`basename "$1" .tar.xz`
grep -lr '^router Unnamed (50\.7|204\.45)\.' "$basename" |
xargs grep -l '^platform Tor 0\.2\.4\.18-rc' > "$basename.descriptors"
xargs grep -h '^fingerprint ' < "$basename.descriptors" |
cut -d ' ' -f 2- | tr -d ' ' |
sort -u > "$basename.fingerprints"
xargs grep -h '^router ' < "$basename.descriptors" |
cut -d ' ' -f 3 |
sort -u > "$basename.ipaddresses"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.