Detecting Web Censorship by Running OONI on Pi Zero
In 2015 I had put together a simple script to check the status of various websites that were blocked (Censored) by ISPs (Internet Service Providers) in India for various reasons. It was a very simple script based on simple rules. Idea was to get a sense of censorship in India. After a while I didn’t get much time to pursue the idea. Since then Open Observatory of Network Interference (OONI) has added Web Connectivity test, which is designed to detect DNS tampering, TCP/IP blocking and HTTP blocking, exactly what I wanted.
On Debian/Ubuntu you could install ooniprobe using simple apt-get. Installation steps are available for other platforms too. You can run oonideckgen to generate a default OONI deck which will include a set of tests and a global list of URLs, as well as a country specific list of URLs based on IP address. You could then run all the tests using command below. Once the OONI runs the tests, it will upload the results to OONI Explorer
ooniprobe -i /home/username/deck/default-user.deck #your username on computer
But the global or the country list might have URLs that could be illegal to access in your country. Though you wont see any pages yourself. The scripts will access and download the content of the URL. So please be aware.
You can also run the ooniprobe on custom set of URLs which you have gathered.
ooniprobe blocking/web_connectivity -f my_url_list.txt
You can also Opt-out from sending OONI any measurements at all by adding -n option to the ooniprobe. Please refer the documentation before you proceed.
My pain point was the testing of the links take time, specially if you want to run on regular basis (cron job), its difficult to run on your main computer. Also running a full fledged computer for it would be waste of power. So last few months I have been thinking about buying a Raspberry Pi but never got around to buy one. Recently I got a surprise gift from an old friend – A Raspberry Pi Zero with all the things required to start. So I installed Lepidopter, which is an ooniprobe distribution for Raspberry Pis. Installation was easy. Just that I didn’t have a monitor to login to Pi directly so I could configure the WIFI but then I found an old USB to Ethernet adapter in my mystery box 1. So connected that and powered up.
Lepidopter has a web UI for control. But I couldn’t find the device on the local network using the url http://lepidopter.local. Next step was to check DHCP on my local router. Found a device called lepidopter and accessed it using the IP address. The kick started few web tests. Look into settings before you start.. So now Pi Zero has been put into good use. Next step would be build everything into a container so I can gift it to friends. But that’s only after couple of important issues are resolved. Until then I will run it locally and suggest only to them who know what they are doing.
All measurements including India specific measurements are available on OONI website to explore.
- Electronics box where I dump parts which I think will be useful one day! ↩