MCPcopy Index your code
hub / github.com/NullHypothesis/sybilhunter

github.com/NullHypothesis/sybilhunter @v2016.01.a

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2016.01.a ↗ · + Follow
92 symbols 178 edges 13 files 87 documented · 95%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

sybilhunter logo

Build Status

Overview

sybilhunter implements a number of analysis techniques to find Sybils and other anomalies in archived Tor network data. For example, sybilhunter can tell you when an unusally high amount of relays joined or left the Tor network, which Tor relays changed their identity keys a lot, and which Tor relays appear to be very similar to each other. Ideally, sybilhunter should become a Swiss Army knife for analysing anomalies in network consensuses and relay descriptors.

Get started in 5 minutes

Assuming you have a working Go installation:

$ go get github.com/NullHypothesis/sybilhunter
$ wget https://collector.torproject.org/archive/relay-descriptors/consensuses/consensuses-2015-08.tar.xz
$ tar xvJf consensuses-2015-08.tar.xz
$ sybilhunter -data consensuses-2015-08 -print

Now you have one month worth of consensuses and can proceed to the next section to learn more about analysis examples.

Examples

sybilhunter takes as input data obtained from CollecTor. Let's start by pretty-printing a file containing a network consensus or relay descriptors:

$ sybilhunter -data /path/to/file -print

Next, here's how you can analyse how often relays changed their fingerprint in a set of consensus documents:

$ sybilhunter -data /path/to/consensuses/ -fingerprints

Sybilhunter is also able to create uptime images, visualising the uptime of relays over time. In such an image, every column is a relay and every row is a consensus. Each pixel is either black (relay was offline) or white (relay was online). Red blocks are adjacent relays with identical uptime. You can create an uptime image by running:

$ sybilhunter -data /path/to/consensuses/ -uptime

Sybilhunter then writes an image like the following to disk:

uptime image

You can also put command line arguments into the configuration file ~/.sybilhunterrc. The format is just like command line arguments, one per line. For example:

$ cat ~/.sybilhunterrc
-descdir /path/to/server/descriptors/
-referencerelay 9B94CD0B7B8057EAF21BA7F023B7A1C8CA9CE645

Note that command line arguments overwrite the arguments in the configuration file.

Alternatives

Check out doctor's sybil checker script, and hstools can be useful for finding anomalies in hidden service directories.

Contact

For bugs and requests, please file a ticket in The Tor Project's bug tracker. You can also contact me privately:

Contact: Philipp Winter phw@nymity.ch
OpenPGP fingerprint: B369 E7A2 18FE CEAD EB96 8C73 CF70 89E3 D7FD C0D0

Extension points exported contracts — how you extend this code

AnalysisCallback (FuncType)
AnalysisCallback is a callback function that analyses the given object set.
sybilhunter.go
Distance (FuncType)
Distance quantifies the distance between the two given "Tor objects" (e.g., router statuses or descriptors) as 32-bit fl
distance.go
By (FuncType)
(no doc)
util.go

Core symbols most depended-on inside this repo

String
called by 4
similarity.go
Sort
called by 4
util.go
IsOnline
called by 3
uptime.go
ParseFlagSet
called by 2
sybilhunter.go
parseDate
called by 2
sybilhunter.go
GatherObjects
called by 2
sybilhunter.go
NewMovingAverage
called by 2
churn.go
CalcAvg
called by 2
churn.go

Shape

Function 49
Method 22
Struct 9
TypeAlias 9
FuncType 3

Languages

Go100%

Modules by API surface

uptime.go18 symbols
util.go13 symbols
sybilhunter.go10 symbols
churn.go9 symbols
similarity.go8 symbols
fingerprints.go7 symbols
bwfraction.go6 symbols
distance.go5 symbols
contrib.go5 symbols
printsome.go4 symbols
neighbour.go4 symbols
print.go2 symbols

For agents

$ claude mcp add sybilhunter \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact