• This repository has been archived on 16/Oct/2023
  • Stars
    star
    454
  • Rank 96,373 (Top 2 %)
  • Language
    Python
  • License
    GNU General Publi...
  • Created about 11 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A fast and modular scanner for Tor exit relays. The canonical repository (including issue tracker) is at https://gitlab.torproject.org/tpo/network-health/exitmap

exitmap logo

Build Status

Overview

Exitmap is a fast and modular Python-based scanner for Tor exit relays. Exitmap modules implement tasks that are run over (a subset of) all exit relays. If you have a background in functional programming, think of exitmap as a map() interface for Tor exit relays: Modules can perform any TCP-based networking task like fetching a web page, uploading a file, connecting to an SSH server, or joining an IRC channel.

In practice, exitmap is useful to monitor the reliability and trustworthiness of exit relays. The Tor Project uses exitmap to check for false negatives on the Tor Project's check service and to find malicious exit relays. It is easy to develop new modules for exitmap; just have a look at the file HACKING in the doc/ directory or check out one of the existing modules.

Exitmap uses Stem to create circuits to all given exit relays. Each time tor notifies exitmap of an established circuit, a module is invoked for the newly established circuit. Modules can be pure Python scripts or executables. For executables, torsocks is necessary.

Finally, note that exitmap is a network measurement tool and of little use to ordinary Tor users. The Tor Project is already running the tool regularly. More exitmap scans just cause unnecessary network load. The only reason exitmap is publicly available is because its source code and design might be of interest to some.

Installation

Exitmap uses the library Stem to communicate with Tor. There are plenty of ways to install Stem. The easiest might be to use pip in combination with the provided requirements.txt file:

$ pip install -r requirements.txt

Running exitmap

The only argument exitmap requires is the name of a module. For example, you can run exitmap with the checktest module by running:

$ ./bin/exitmap checktest

The command line output will then show you how Tor bootstraps, the output of the checktest module, and a scan summary. If you don't need three hops and prefer to use two hops with a static first hop, run:

$ ./bin/exitmap --first-hop 1234567890ABCDEF1234567890ABCDEF12345678 checktest

To run the same test over German exit relays only, execute:

$ ./bin/exitmap --country DE --first-hop 1234567890ABCDEF1234567890ABCDEF12345678 checktest

If you want to pause for five seconds in between circuit creations to reduce the load on the Tor network and the scanning destination, run:

$ ./bin/exitmap --build-delay 5 checktest

Note that 1234567890ABCDEF1234567890ABCDEF12345678 is a pseudo fingerprint that you should replace with an exit relay that you control.

To learn more about all of exitmap's options, run:

$ ./bin/exitmap --help

Exitmap comes with batteries included, providing the following modules:

  • testfds: Tests if an exit relay is able to fetch the content of a simple web page. If an exit relay is unable to do that, it might not have enough file descriptors available.
  • checktest: Attempts to find false negatives in the Tor Project's check service.
  • dnspoison: Attempts to resolve several domains and compares the received DNS A records to the expected records.
  • dnssec: Detects exit relays whose resolver does not validate DNSSEC.
  • patchingCheck: Checks for file tampering.
  • cloudflared: Checks if a web site returns a CloudFlare CAPTCHA.
  • rtt: Measure round-trip times through an exit to various destinations.

Configuration

By default, exitmap tries to read the file .exitmaprc in your home directory. The file accepts all command line options, but you have to replace minuses with underscores. Here is an example:

[Defaults]
first_hop = 1234567890ABCDEF1234567890ABCDEF12345678
verbosity = debug
build_delay = 1
analysis_dir = /path/to/exitmap_scans

Alternatives

Don't like exitmap? Then have a look at tortunnel, SoaT, torscanner, DetecTor, or SelekTOR.

Tests

Before submitting pull requests, please make sure that all unit tests pass by running:

$ pip install -r requirements-dev.txt
$ py.test --cov-report term-missing --cov-config .coveragerc --cov=src test

Feedback

Contact: Philipp Winter [email protected]
OpenPGP fingerprint: B369 E7A2 18FE CEAD EB96 8C73 CF70 89E3 D7FD C0D0

More Repositories

1

brdgrd

Protects Tor bridges from being scanned (and as a result blocked) by GFW probes.
C
227
star
2

censorbib

The Internet censorship bibliography.
TeX
132
star
3

scramblesuit

The ScrambleSuit traffic obfuscation protocol.
Python
91
star
4

zoossh

Parsing library for Tor-specific data formats.
Go
44
star
5

sybilhunter

Hunting for Sybils and anomalies in archived Tor network data.
Go
43
star
6

hping3

Forks git://git.debian.org/collab-maint/hping3.git
C
36
star
7

tor-dns

Repository for Tor's DNS-related issues.
TeX
17
star
8

backlogscans

Side channel-based network measurement tools.
Python
17
star
9

blockpages

Block pages hosted on censorship sites all around the world.
HTML
13
star
10

active-probing-tools

Python tools for targeted pcap analysis.
Python
13
star
11

tcis

Simulates the initiation of a Tor connection.
C
12
star
12

ddptr

DNS delegation path traceroute
Python
12
star
13

atlas_tools

Tools to use RIPE Atlas from the command line.
Python
11
star
14

trnnr

Tor relay nearest neighbour ranking
Python
10
star
15

bibliograpy

Converts BibTeX files to HTML bibliographies.
Python
8
star
16

internet-freedom-jobs

Jobs in the space of Internet freedom.
6
star
17

torbutton

Forks https://gitweb.torproject.org/torbutton.git
JavaScript
6
star
18

mlgo

Automatically exported from code.google.com/p/mlgo
Go
5
star
19

obfsproxy

Forked from https://gitweb.torproject.org/pluggable-transports/obfsproxy.git
Python
5
star
20

docker-obfs4-bridge

This repository implements a Docker image that provides an obfs4 bridge.
Shell
4
star
21

genpwd

A simple and pure-Python password generator with safe defaults.
Python
3
star
22

obfs4PortScan

Tests if a Tor bridge's obfs4 port is publicly reachable.
Go
2
star
23

exit-pinning

Exit relay pinning for network services.
2
star
24

emma

Go
2
star
25

tor-dns-tools

Data processing tools for a research project.
Python
2
star
26

tor-android-service

C
1
star
27

onionperf

Fork of https://gitweb.torproject.org/onionperf.git/
Python
1
star
28

snmp_kraken

Downloads MIB of multiple SNMP-enabled devices.
Shell
1
star
29

bridgeauth-obfs4-scanner

Scans the TCP port of obfs4 bridges known to the bridge authority.
Python
1
star
30

bfi

A lightweight brainfuck interpreter.
C
1
star
31

tracemap

Visualises and runs traceroutes to a given set of IP addresses.
Python
1
star
32

otel-example

Example application for distributed tracing using OpenTelemetry
Go
1
star
33

torspec

Fork of https://gitweb.torproject.org/torspec.git/
Python
1
star
34

relayfilter

Filters a Tor network consensus.
Go
1
star
35

sybil-paper

Source for the paper "Identifying and characterizing Sybils in the Tor network"
TeX
1
star
36

rdsys

Resource distribution system for censorship circumvention proxies.
Go
1
star