CensorLab: A Generic Testbed for Censorship Emulation

About

Censorlab is a censorship emulation platform.

Configuration

Configuration of the censor is done in TOML files and passed in with the -c flag. See censor.toml for configuration options. You probably want to copy censor.toml to your own config file and pass it in. The default censor.toml uses

Running in tap mode

Censorlab uses netfilter queues to intercept traffic. To start intercepting traffic in this vm, run

cl_nftables.sh start

While this script is started,

Make sure you retain access to this virtual machine using a virtualized display, as SSH may cease to function

To stop forwarding traffic to the queue:

cl_nftables.sh stop

In a system where enp0s3 is the interface you want to tap and 10.0.2.15 is the ip of the client (e.g. this VM), the command to start censorlab using the provided censor.toml is

censorlab -c censor.toml tap 10.0.2.15 enp0s3

You may verify the interface name and IP address of the VM using

ip addr

To list all the configurable options:

censorlab --help
censorlab nfq --help

Python API

Censor programs are operated in two parts:

You likely want to begin your program with

from rust import Packet, Model, regex

to ensure all appropriate methods are in scope

The interfaces that may be accessed to read metadata from each packet are:

packet

model

regex

IPC

TODO: write documentation about this