Skip to content

Commit

Permalink
Removes Tor support for connections
Browse files Browse the repository at this point in the history
We don't have the time to fully develop this. PATHspider is more useful
for layer 3/4 protocols anyway, and Tor is restricted to only layer 7.
Tools such as exitmap provide similar functionality, or you can hack up
a tool with txtorcon/stem easily enough.
  • Loading branch information
irl committed Aug 26, 2018
1 parent d882ca4 commit 95e85b7
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 71 deletions.
2 changes: 1 addition & 1 deletion Vagrantfile
Expand Up @@ -4,7 +4,7 @@
$setup_pathspider = <<SCRIPT
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y python3-libtrace python3-sphinx python3-straight.plugin python3-setuptools pylint3 python3-pep8 python3-pyroute2 python3-pip unzip python3-nose python3-stem
apt-get install -y python3-libtrace python3-sphinx python3-straight.plugin python3-setuptools pylint3 python3-pep8 python3-pyroute2 python3-pip unzip python3-nose
apt-get build-dep -y python3-pycurl
pip3 install 'pycurl>=7.43.0.1'
cd /home/vagrant/pathspider
Expand Down
4 changes: 0 additions & 4 deletions doc/plugindev/desync.rst
Expand Up @@ -31,8 +31,6 @@ framework:
return connect_http(self.source, job, self.args.timeout)
if self.args.connect == "https":
return connect_http(self.source, job, self.args.timeout)
if self.args.connect == "torhttp":
return connect_tor_http(self.controller, self.args.tor_path, job, self.args.timeout)
else:
raise RuntimeError("Unknown connection mode specified")
Expand All @@ -43,8 +41,6 @@ framework:
return connect_http(self.source, job, self.args.timeout, curlopts, curlinfos)
if self.args.connect == "https":
return connect_https(self.source, job, self.args.timeout, curlopts, curlinfos)
if self.args.connect == "torhttp":
return connect_tor_http(self.controller, self.args.tor_path, job, self.args.timeout, curlopts, curlinfos)
else:
raise RuntimeError("Unknown connection mode specified")
Expand Down
6 changes: 0 additions & 6 deletions pathspider/base.py
Expand Up @@ -94,12 +94,6 @@ def __init__(self, worker_count, libtrace_uri, args, server_mode):

self.__logger = logging.getLogger('pathspider')

if hasattr(self.args, 'connect') and self.args.connect.startswith('tor'):
logging.getLogger("stem").setLevel(logging.ERROR)
import stem.control
self.controller = stem.control.Controller.from_port()
self.controller.authenticate()

def __initialize_queues(self):
# TODO: These could be initialized closer to where they are used?
self.jobqueue = queue.Queue(QUEUE_SIZE)
Expand Down
53 changes: 0 additions & 53 deletions pathspider/helpers/tor_http.py

This file was deleted.

7 changes: 1 addition & 6 deletions pathspider/plugins/h2.py
Expand Up @@ -7,7 +7,6 @@
from pathspider.desync import DesynchronizedSpider
from pathspider.helpers.http import connect_http
from pathspider.helpers.http import connect_https
from pathspider.helpers.tor_http import connect_tor_http
from pathspider.chains.basic import BasicChain
from pathspider.chains.tcp import TCPChain

Expand All @@ -17,15 +16,13 @@ class H2(DesynchronizedSpider, PluggableSpider):
description = "HTTP/2"
version = pathspider.base.__version__
chains = [BasicChain, TCPChain]
connect_supported = ["http", "https", "torhttp"]
connect_supported = ["http", "https"]

def conn_no_h2(self, job, config): # pylint: disable=unused-argument
if self.args.connect == "http":
return connect_http(self.source, job, self.args.timeout)
if self.args.connect == "https":
return connect_http(self.source, job, self.args.timeout)
if self.args.connect == "torhttp":
return connect_tor_http(self.controller, self.args.tor_path, job, self.args.timeout)
else:
raise RuntimeError("Unknown connection mode specified")

Expand All @@ -36,8 +33,6 @@ def conn_h2(self, job, config): # pylint: disable=unused-argument
return connect_http(self.source, job, self.args.timeout, curlopts, curlinfos)
if self.args.connect == "https":
return connect_https(self.source, job, self.args.timeout, curlopts, curlinfos)
if self.args.connect == "torhttp":
return connect_tor_http(self.controller, self.args.tor_path, job, self.args.timeout, curlopts, curlinfos)
else:
raise RuntimeError("Unknown connection mode specified")

Expand Down
1 change: 0 additions & 1 deletion requirements.txt
@@ -1,7 +1,6 @@
straight.plugin
pyroute2
scapy
stem
dnslib
pycurl
nose

0 comments on commit 95e85b7

Please sign in to comment.