Skip to content

SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.

sflib: remove refreshTorIdent function (#1218)

bcoles174d7460381b
diff --git a/requirements.txt b/requirements.txt
index f2650c15..7b3cd2a9 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -14,7 +14,6 @@ ipaddr>=2.2.0
phonenumbers>=8.12.9
pygexf>=0.2.2
PyPDF2>=1.26.0
-stem>=1.7.1
python-whois>=0.7.1
secure>=0.2.1,<0.3.0
pyOpenSSL>=17.5.0
diff --git a/sf.py b/sf.py
index 375a3c81..0188bd1d 100755
--- a/sf.py
+++ b/sf.py
@@ -94,7 +94,6 @@ def main():
'_socks3port': '',
'_socks4user': '',
'_socks5pwd': '',
- '_torctlport': 9051
}
sfOptdescs = {
@@ -110,7 +109,6 @@ def main():
'_socks3port': 'SOCKS Server TCP Port. Usually 1080 for 4/5, 8080 for HTTP and 9050 for TOR.',
'_socks4user': 'SOCKS Username. Valid only for SOCKS4 and SOCKS5 servers.',
'_socks5pwd': "SOCKS Password. Valid only for SOCKS5 servers.",
- '_torctlport': "The port TOR is taking control commands on. This is necessary for SpiderFoot to tell TOR to re-circuit when it suspects anonymity is compromised.",
'_modulesenabled': "Modules enabled for the scan." # This is a hack to get a description for an option not actually available.
}
diff --git a/sflib.py b/sflib.py
index 5a0a6dc4..589073bc 100644
--- a/sflib.py
+++ b/sflib.py
@@ -40,8 +40,6 @@ import requests
import urllib3
from bs4 import BeautifulSoup, SoupStrainer
from publicsuffixlist import PublicSuffixList
-from stem import Signal
-from stem.control import Controller
# For hiding the SSL warnings coming from the requests lib
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) # noqa: DUO131
@@ -146,24 +144,6 @@ class SpiderFoot:
"""
self._socksProxy = socksProxy
- def refreshTorIdent(self):
- """Tell TOR to re-circuit."""
-
- if self.opts['_socks1type'] != "TOR":
- return
-
- try:
- self.info("Re-circuiting TOR...")
- with Controller.from_port(address=self.opts['_socks2addr'],
- port=self.opts['_torctlport']) as controller:
- controller.authenticate()
- controller.signal(Signal.NEWNYM)
- time.sleep(10)
- except BaseException as e:
- self.fatal(f"Unable to re-circuit TOR: {e}")
-
- return
-
def optValueToData(self, val):
"""Supplied an option value, return the data based on what the
value is. If val is a URL, you'll get back the fetched content,
diff --git a/test/conftest.py b/test/conftest.py
index e8dcaff4..e9706fe7 100644
--- a/test/conftest.py
+++ b/test/conftest.py
@@ -20,7 +20,6 @@ def default_options(request):
'_socks3port': '',
'_socks4user': '',
'_socks5pwd': '',
- '_torctlport': 9051,
'__logstdout': False
}
diff --git a/test/integration/test_sfwebui.py b/test/integration/test_sfwebui.py
index 6a5be518..b20f7281 100644
--- a/test/integration/test_sfwebui.py
+++ b/test/integration/test_sfwebui.py
@@ -29,7 +29,6 @@ class TestSpiderFootWebUiRoutes(helper.CPWebCase):
'_socks3port': '',
'_socks4user': '',
'_socks5pwd': '',
- '_torctlport': 9051,
'__logstdout': False
}
diff --git a/test/unit/test_spiderfoot.py b/test/unit/test_spiderfoot.py
index d9c0efb1..f2d13d49 100644
--- a/test/unit/test_spiderfoot.py
+++ b/test/unit/test_spiderfoot.py
@@ -74,15 +74,6 @@ class TestSpiderFoot(unittest.TestCase):
sf.socksProxy = 'new socket'
self.assertEqual('new socket', sf.socksProxy)
- def test_refresh_tor_ident_should_return_none(self):
- """
- Test refreshTorIdent(self)
- """
- sf = SpiderFoot(self.default_options)
-
- res = sf.refreshTorIdent()
- self.assertEqual(None, res)
-
def test_optValueToData_should_return_data_as_string(self):
"""
Test optValueToData(self, val)