[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [ooni-probe/master] Randomise URLs when testing web_connectivity
commit 9cb4aa444ec2131f9fba77e9e67a13695d90db2e
Author: Arturo Filastò <arturo@xxxxxxxxxxx>
Date: Fri May 26 22:00:25 2017 +0000
Randomise URLs when testing web_connectivity
This is aimed at reducing fingerprintabiliy of ooniprobe
Fixes: https://github.com/TheTorProject/ooni-probe/issues/480
---
ooni/__init__.py | 2 +-
ooni/nettests/blocking/web_connectivity.py | 9 +++++++++
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/ooni/__init__.py b/ooni/__init__.py
index abca74c1..804f1359 100644
--- a/ooni/__init__.py
+++ b/ooni/__init__.py
@@ -1,7 +1,7 @@
# -*- encoding: utf-8 -*-
__author__ = "Open Observatory of Network Interference"
-__version__ = "2.2.0"
+__version__ = "2.2.1-dev"
__all__ = [
'agent',
diff --git a/ooni/nettests/blocking/web_connectivity.py b/ooni/nettests/blocking/web_connectivity.py
index 600a9e4e..3807a0de 100644
--- a/ooni/nettests/blocking/web_connectivity.py
+++ b/ooni/nettests/blocking/web_connectivity.py
@@ -1,6 +1,7 @@
# -*- encoding: utf-8 -*-
import csv
+import random
from urlparse import urlparse
from twisted.internet import defer
@@ -36,6 +37,9 @@ class UsageOptions(usage.Options):
['retries', 'r', 1, 'Number of retries for the HTTP request'],
['timeout', 't', 240, 'Total timeout for this test'],
]
+ optFlags = [
+ ['no-shuffle', '', 'Disable shuffling of URLs'],
+ ]
class WebConnectivityTest(httpt.HTTPTest, dnst.DNSTest):
@@ -123,6 +127,11 @@ class WebConnectivityTest(httpt.HTTPTest, dnst.DNSTest):
else:
fh.seek(0)
generator = simple_file_generator(fh)
+ if self.localOptions['no-shuffle'] != True:
+ input_list = list(generator)
+ random.shuffle(input_list)
+ generator = input_list
+
for i in generator:
if (not i.startswith("http://") and
not i.startswith("https://")):
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits