Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #1897 #1900

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, macos-latest]

steps:
Expand Down
Empty file added Docker
Empty file.
Binary file added classes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added local_stuff/classes_spiderfoot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions modules/sfp__stor_stdout.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,20 @@ def watchedEvents(self):

def output(self, event):
d = self.opts['_csvdelim']
if type(event.data) in [list, dict]:
if isinstance(event.data, (list, dict)):
data = str(event.data)
else:
data = event.data

if type(data) != str:
if not isinstance(data, str):
data = str(event.data)

if type(event.sourceEvent.data) in [list, dict]:
if isinstance(event.sourceEvent.data, (list, dict)):
srcdata = str(event.sourceEvent.data)
else:
srcdata = event.sourceEvent.data

if type(srcdata) != str:
if not isinstance(srcdata, str):
srcdata = str(event.sourceEvent.data)

if self.opts['_stripnewline']:
Expand Down
4 changes: 2 additions & 2 deletions modules/sfp_arin.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def handleEvent(self, event):
if "pocRef" in ret['pocs']:
ref = list()
# Might be a list or a dictionary
if type(ret['pocs']['pocRef']) == dict:
if isinstance(ret['pocs']['pocRef'], dict):
ref = [ret['pocs']['pocRef']]
else:
ref = ret['pocs']['pocRef']
Expand All @@ -169,7 +169,7 @@ def handleEvent(self, event):
if "pocRef" in ret['pocs']:
ref = list()
# Might be a list or a dictionary
if type(ret['pocs']['pocRef']) == dict:
if isinstance(ret['pocs']['pocRef'], dict):
ref = [ret['pocs']['pocRef']]
else:
ref = ret['pocs']['pocRef']
Expand Down
4 changes: 2 additions & 2 deletions modules/sfp_fraudguard.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ def query(self, qry):

fraudguard_url = "https://api.fraudguard.io/ip/" + qry
api_key_account = self.opts['fraudguard_api_key_account']
if type(api_key_account) == str:
if isinstance(api_key_account, str):
api_key_account = api_key_account.encode('utf-8')
api_key_password = self.opts['fraudguard_api_key_password']
if type(api_key_password) == str:
if isinstance(api_key_password, str):
api_key_password = api_key_password.encode('utf-8')
token = base64.b64encode(api_key_account + ':'.encode('utf-8') + api_key_password)
headers = {
Expand Down
2 changes: 1 addition & 1 deletion modules/sfp_github.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def handleEvent(self, event):
continue

for item in repret:
if type(item) != dict:
if not isinstance(item, dict):
self.debug("Encountered an unexpected or empty response from Github.")
continue

Expand Down
4 changes: 2 additions & 2 deletions modules/sfp_riskiq.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ def query(self, qry, qtype, opts=dict()):
post = '{"field": "email", "query": "' + qry + '"}'

api_key_login = self.opts['api_key_login']
if type(api_key_login) == str:
if isinstance(api_key_login, str):
api_key_login = api_key_login.encode('utf-8')
api_key_password = self.opts['api_key_password']
if type(api_key_password) == str:
if isinstance(api_key_password, str):
api_key_password = api_key_password.encode('utf-8')
cred = base64.b64encode(api_key_login + ":".encode('utf-8') + api_key_password)
headers = {
Expand Down
2 changes: 1 addition & 1 deletion modules/sfp_spider.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def linkNotify(self, url: str, parentEvent=None):
else:
utype = "LINKED_URL_EXTERNAL"

if type(url) != str:
if not isinstance(url, str):
url = str(url, "utf-8", errors='replace')
event = SpiderFootEvent(utype, url, self.__name__, parentEvent)
self.notifyListeners(event)
Expand Down
2 changes: 1 addition & 1 deletion modules/sfp_tldsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def handleEvent(self, event):
# Look through all TLDs for the existence of this target keyword
targetList = list()
for tld in self.opts['_internettlds']:
if type(tld) != str:
if not isinstance(tld, str):
tld = str(tld.strip(), errors='ignore')
else:
tld = tld.strip()
Expand Down
4 changes: 2 additions & 2 deletions modules/sfp_xforce.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ def query(self, qry, querytype):
xforce_url = "https://api.xforce.ibmcloud.com"

api_key = self.opts['xforce_api_key']
if type(api_key) == str:
if isinstance(api_key, str):
api_key = api_key.encode('utf-8')
api_key_password = self.opts['xforce_api_key_password']
if type(api_key_password) == str:
if isinstance(api_key_password, str):
api_key_password = api_key_password.encode('utf-8')
token = base64.b64encode(api_key + ":".encode('utf-8') + api_key_password)
headers = {
Expand Down
Loading
Loading