Skip to content

Commit

Permalink
Fix whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoles committed Jan 25, 2020
1 parent ef3e3e0 commit 6cb4560
Show file tree
Hide file tree
Showing 118 changed files with 340 additions and 340 deletions.
2 changes: 1 addition & 1 deletion modules/sfp__stor_stdout.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def output(self, event):
if self.firstEvent:
self.firstEvent = False
else:
print(",")
print(",")
print(json.dumps(d), end='')

# Handle events sent to this module
Expand Down
2 changes: 1 addition & 1 deletion modules/sfp_abusech.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def resourceList(self, id, target, targetType):
# If we're looking at netblocks
if targetType == "netblock":
iplist = list()
# Get the regex, replace {0} with an IP address matcher to
# Get the regex, replace {0} with an IP address matcher to
# build a list of IP.
# Cycle through each IP and check if it's in the netblock.
if 'regex' in malchecks[check]:
Expand Down
4 changes: 2 additions & 2 deletions modules/sfp_abuseipdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def setup(self, sfc, userOpts=dict()):
# What events is this module interested in for input
# * = be notified about all events.
def watchedEvents(self):
return ["IP_ADDRESS", "AFFILIATE_IPADDR", "NETBLOCK_OWNER", "NETBLOCK_MEMBER"]
return ["IP_ADDRESS", "AFFILIATE_IPADDR", "NETBLOCK_OWNER", "NETBLOCK_MEMBER"]

# What events this module produces
# This is to support the end user in selecting modules based on events
Expand Down Expand Up @@ -108,7 +108,7 @@ def resourceQuery(self, id, target, targetType):
if id == cid and malchecks[check]['type'] == "query":
url = str(malchecks[check]['url'])
res = self.sf.fetchUrl(url.format(target, apikey, daysback),
timeout=self.opts['_fetchtimeout'],
timeout=self.opts['_fetchtimeout'],
useragent=self.opts['_useragent'])
if res['content'] is None:
self.sf.error("Unable to fetch " + url.format(target, "masked", daysback), False)
Expand Down
6 changes: 3 additions & 3 deletions modules/sfp_accounts.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# -------------------------------------------------------------------------------
# Name: sfp_accounts
# Purpose: Identify the existence of a given acount on various sites thanks
# Purpose: Identify the existence of a given acount on various sites thanks
# to Micah Hoffman's (https://github.com/WebBreacher) list.
#
# Author: Steve Micallef <steve@binarypool.com>
Expand Down Expand Up @@ -118,7 +118,7 @@ def checkSite(self, name, site):
if site['account_existence_code']:
if site['account_existence_code'] == res['code']:
found = True
if site['account_missing_code']:
if site['account_missing_code']:
if site['account_missing_code'] == res['code']:
found = False
if site['account_existence_string']:
Expand Down Expand Up @@ -174,7 +174,7 @@ def threadSites(self, name, siteList):
if not found:
running = False

time.sleep(0.25)
time.sleep(0.25)

# Return once the scanning has completed
return self.siteResults
Expand Down
4 changes: 2 additions & 2 deletions modules/sfp_ahmia.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# -------------------------------------------------------------------------------
# Name: sfp_ahmia
# Purpose: Searches the Tor search engine 'Ahmia' for content related
# Purpose: Searches the Tor search engine 'Ahmia' for content related
# to the domain in question.
#
# Author: Steve Micallef <steve@binarypool.com>
Expand Down Expand Up @@ -78,7 +78,7 @@ def handleEvent(self, event):
if self.checkForStop():
return None

links = re.findall("redirect_url=(.[^\"]+)\"",
links = re.findall("redirect_url=(.[^\"]+)\"",
data['content'], re.IGNORECASE | re.DOTALL)

reported = False
Expand Down
4 changes: 2 additions & 2 deletions modules/sfp_alienvault.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def setup(self, sfc, userOpts=dict()):

# What events is this module interested in for input
def watchedEvents(self):
return ["IP_ADDRESS", "AFFILIATE_IPADDR",
return ["IP_ADDRESS", "AFFILIATE_IPADDR",
"NETBLOCK_OWNER", "NETBLOCK_MEMBER"]

# What events this module produces
Expand All @@ -87,7 +87,7 @@ def query(self, qry, querytype):
'Accept': 'application/json',
'X-OTX-API-KEY': self.opts['api_key']
}
res = self.sf.fetchUrl(url, timeout=self.opts['_fetchtimeout'],
res = self.sf.fetchUrl(url, timeout=self.opts['_fetchtimeout'],
useragent="SpiderFoot", headers=headers)

if res['code'] == "403":
Expand Down
2 changes: 1 addition & 1 deletion modules/sfp_alienvaultiprep.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def resourceList(self, id, target, targetType):
# If we're looking at netblocks
if targetType == "netblock":
iplist = list()
# Get the regex, replace {0} with an IP address matcher to
# Get the regex, replace {0} with an IP address matcher to
# build a list of IP.
# Cycle through each IP and check if it's in the netblock.
if 'regex' in malchecks[check]:
Expand Down
2 changes: 1 addition & 1 deletion modules/sfp_apility.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def queryBadIp(self, qry):

return self.parseApiResponse(res)


# Query IP REST API
# https://apility.io/apidocs/#full-ip-address-reputation
# Note: currently unused
Expand Down
6 changes: 3 additions & 3 deletions modules/sfp_archiveorg.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ def watchedEvents(self):
# This is to support the end user in selecting modules based on events
# produced.
def producedEvents(self):
return ["INTERESTING_FILE_HISTORIC", "URL_PASSWORD_HISTORIC",
return ["INTERESTING_FILE_HISTORIC", "URL_PASSWORD_HISTORIC",
"URL_FORM_HISTORIC", "URL_FLASH_HISTORIC",
"URL_STATIC_HISTORIC", "URL_JAVA_APPLET_HISTORIC",
"URL_STATIC_HISTORIC", "URL_JAVA_APPLET_HISTORIC",
"URL_UPLOAD_HISTORIC", "URL_WEB_FRAMEWORK_HISTORIC",
"URL_JAVASCRIPT_HISTORIC"]

Expand Down Expand Up @@ -112,7 +112,7 @@ def handleEvent(self, event):

url = "https://archive.org/wayback/available?url=" + eventData + \
"&timestamp=" + maxDate
res = self.sf.fetchUrl(url, timeout=self.opts['_fetchtimeout'],
res = self.sf.fetchUrl(url, timeout=self.opts['_fetchtimeout'],
useragent=self.opts['_useragent'])

if res['content'] == None:
Expand Down
6 changes: 3 additions & 3 deletions modules/sfp_arin.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# -------------------------------------------------------------------------------
# Name: sfp_arin
# Purpose: Queries the ARIN internet registry to get netblocks and other
# Purpose: Queries the ARIN internet registry to get netblocks and other
# bits of info.
#
# Author: Steve Micallef <steve@binarypool.com>
Expand Down Expand Up @@ -134,7 +134,7 @@ def handleEvent(self, event):
# the names are separated in the content and sfp_names
# won't recognise it. So we submit this and see if it
# really is considered a name.
evt = SpiderFootEvent("RAW_RIR_DATA", "Possible full name: " + name,
evt = SpiderFootEvent("RAW_RIR_DATA", "Possible full name: " + name,
self.__name__, self.currentEventSrc)
self.notifyListeners(evt)

Expand All @@ -158,5 +158,5 @@ def handleEvent(self, event):
# We just want the raw data so we can get potential
# e-mail addresses.
self.query("contact", p['$'])

# End of sfp_arin class
2 changes: 1 addition & 1 deletion modules/sfp_azureblobstorage.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# -------------------------------------------------------------------------------
# Name: sfp_azureblobstorage
# Purpose: SpiderFoot plug-in for identifying potential Azure blobs related
# Purpose: SpiderFoot plug-in for identifying potential Azure blobs related
# to the target.
#
# Author: Steve Micallef <steve@binarypool.com>
Expand Down
2 changes: 1 addition & 1 deletion modules/sfp_badipscom.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def resourceList(self, id, target, targetType):
# If we're looking at netblocks
if targetType == "netblock":
iplist = list()
# Get the regex, replace {0} with an IP address matcher to
# Get the regex, replace {0} with an IP address matcher to
# build a list of IP.
# Cycle through each IP and check if it's in the netblock.
if 'regex' in malchecks[check]:
Expand Down
2 changes: 1 addition & 1 deletion modules/sfp_bambenek.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def resourceList(self, id, target, targetType):
# If we're looking at netblocks
if targetType == "netblock":
iplist = list()
# Get the regex, replace {0} with an IP address matcher to
# Get the regex, replace {0} with an IP address matcher to
# build a list of IP.
# Cycle through each IP and check if it's in the netblock.
if 'regex' in malchecks[check]:
Expand Down
2 changes: 1 addition & 1 deletion modules/sfp_bgpview.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def queryAsnPeers(self, qry):
return None

return data

def queryIp(self, qry):
res = self.sf.fetchUrl("https://api.bgpview.io/ip/" + qry,
useragent=self.opts['_useragent'],
Expand Down
8 changes: 4 additions & 4 deletions modules/sfp_binaryedge.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ def setup(self, sfc, userOpts=dict()):

# What events is this module interested in for input
def watchedEvents(self):
return ["IP_ADDRESS", "DOMAIN_NAME", "EMAILADDR",
return ["IP_ADDRESS", "DOMAIN_NAME", "EMAILADDR",
"NETBLOCK_OWNER", "NETBLOCK_MEMBER" ]

# What events this module produces
def producedEvents(self):
return ["INTERNET_NAME", "VULNERABILITY", "TCP_PORT_OPEN",
"TCP_PORT_OPEN_BANNER", "EMAILADDR_COMPROMISED",
"TCP_PORT_OPEN_BANNER", "EMAILADDR_COMPROMISED",
"UDP_PORT_OPEN", "UDP_PORT_OPEN_INFO", "DOMAIN_NAME",
"CO_HOSTED_SITE", "MALICIOUS_IPADDR"]

Expand All @@ -103,13 +103,13 @@ def query(self, qry, querytype, page=1):
queryurl = "/v2/query/domains/subdomain/{0}?page={1}"
if querytype == "passive":
queryurl = "/v2/query/domains/ip/{0}?page={1}"

binaryedgeurl = "https://api.binaryedge.io"
headers = {
'X-Key': self.opts['binaryedge_api_key']
}
url = binaryedgeurl + queryurl.format(qry.encode('utf-8', errors='replace'), page)
res = self.sf.fetchUrl(url, timeout=self.opts['_fetchtimeout'],
res = self.sf.fetchUrl(url, timeout=self.opts['_fetchtimeout'],
useragent="SpiderFoot", headers=headers)

if res['code'] in [ "429", "500" ]:
Expand Down
8 changes: 4 additions & 4 deletions modules/sfp_binstring.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def getStrings(self, content):

if accept:
words.append(result)

result = ""

if len(words) == 0:
Expand Down Expand Up @@ -125,11 +125,11 @@ def handleEvent(self, event):
res = None
for fileExt in self.opts['fileexts']:
if eventData.lower().endswith("." + fileExt.lower()) or "." + fileExt + "?" in eventData.lower():
res = self.sf.fetchUrl(eventData,
useragent=self.opts['_useragent'],
res = self.sf.fetchUrl(eventData,
useragent=self.opts['_useragent'],
dontMangle=True,
sizeLimit=self.opts['maxfilesize'])

if res:
self.sf.debug("Searching for strings")
words = self.getStrings(res['content'])
Expand Down
4 changes: 2 additions & 2 deletions modules/sfp_bitcoin.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def to_bytes(self, n, length):
h = '%x' % n
s = codecs.decode(('0'*(len(h) % 2) + h).zfill(length*2), "hex")
return s

def decode_base58(self, bc, length):
digits58 = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
n = 0
Expand All @@ -56,7 +56,7 @@ def decode_base58(self, bc, length):
def check_bc(self, bc):
bcbytes = self.decode_base58(bc, 25)
return bcbytes[-4:] == sha256(sha256(bcbytes[:-4]).digest()).digest()[:4]

# Handle events sent to this module
def handleEvent(self, event):
eventName = event.eventType
Expand Down
2 changes: 1 addition & 1 deletion modules/sfp_blockchain.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# -------------------------------------------------------------------------------
# Name: sfp_blockchain
# Purpose: SpiderFoot plug-in to look up a bitcoin wallet's balance by
# Purpose: SpiderFoot plug-in to look up a bitcoin wallet's balance by
# querying blockchain.info.
#
# Author: Steve Micallef <steve@binarypool.com>
Expand Down
4 changes: 2 additions & 2 deletions modules/sfp_blocklistde.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def watchedEvents(self):
# This is to support the end user in selecting modules based on events
# produced.
def producedEvents(self):
return ["MALICIOUS_IPADDR", "MALICIOUS_AFFILIATE_IPADDR",
return ["MALICIOUS_IPADDR", "MALICIOUS_AFFILIATE_IPADDR",
"MALICIOUS_SUBNET", "MALICIOUS_NETBLOCK"]

# Check the regexps to see whether the content indicates maliciousness
Expand Down Expand Up @@ -138,7 +138,7 @@ def resourceList(self, id, target, targetType):
# If we're looking at netblocks
if targetType == "netblock":
iplist = list()
# Get the regex, replace {0} with an IP address matcher to
# Get the regex, replace {0} with an IP address matcher to
# build a list of IP.
# Cycle through each IP and check if it's in the netblock.
if 'regex' in malchecks[check]:
Expand Down
6 changes: 3 additions & 3 deletions modules/sfp_botscout.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# -------------------------------------------------------------------------------
# Name: sfp_botscout
# Purpose: SpiderFoot plug-in to search botsout.com using their API, for
# Purpose: SpiderFoot plug-in to search botsout.com using their API, for
# potential malicious IPs and e-mail addresses.
#
# Author: Steve Micallef <steve@binarypool.com>
Expand Down Expand Up @@ -36,7 +36,7 @@ def setup(self, sfc, userOpts=dict()):

# What events is this module interested in for input
def watchedEvents(self):
return ['IP_ADDRESS','EMAILADDR']
return ['IP_ADDRESS', 'EMAILADDR']

# What events this module produces
# This is to support the end user in selecting modules based on events
Expand Down Expand Up @@ -73,7 +73,7 @@ def handleEvent(self, event):
url = "http://botscout.com/test/?all="

res = self.sf.fetchUrl(url + eventData,
timeout=self.opts['_fetchtimeout'],
timeout=self.opts['_fetchtimeout'],
useragent=self.opts['_useragent'])
if res['content'] is None or "|" not in res['content']:
self.sf.error("Error encountered processing " + eventData, False)
Expand Down
12 changes: 6 additions & 6 deletions modules/sfp_builtwith.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class sfp_builtwith(SpiderFootPlugin):


# Default options
opts = {
opts = {
"api_key": "",
"maxage": 30
}
Expand Down Expand Up @@ -54,15 +54,15 @@ def watchedEvents(self):

# What events this module produces
def producedEvents(self):
return [ "INTERNET_NAME", "EMAILADDR", "RAW_RIR_DATA",
return [ "INTERNET_NAME", "EMAILADDR", "RAW_RIR_DATA",
"WEBSERVER_TECHNOLOGY", "PHONE_NUMBER", "DOMAIN_NAME" ]

def query(self, t):
ret = None

url = "https://api.builtwith.com/v11/api.json?LOOKUP=" + t + "&KEY=" + self.opts['api_key']

res = self.sf.fetchUrl(url, timeout=self.opts['_fetchtimeout'],
res = self.sf.fetchUrl(url, timeout=self.opts['_fetchtimeout'],
useragent="SpiderFoot")

if res['code'] == "404":
Expand Down Expand Up @@ -95,7 +95,7 @@ def handleEvent(self, event):
self.errorState = True
return None

# Don't look up stuff twice
# Don't look up stuff twice
if eventData in self.results:
self.sf.debug("Skipping " + eventData + " as already mapped.")
return None
Expand All @@ -111,12 +111,12 @@ def handleEvent(self, event):
pat = re.compile("([\%a-zA-Z\.0-9_\-\+]+@[a-zA-Z\.0-9\-]+\.[a-zA-Z\.0-9\-]+)")
if data['Meta'].get("Names", []):
for nb in data['Meta']['Names']:
e = SpiderFootEvent("RAW_RIR_DATA", "Possible full name: " + nb['Name'],
e = SpiderFootEvent("RAW_RIR_DATA", "Possible full name: " + nb['Name'],
self.__name__, event)
self.notifyListeners(e)
if nb.get('Email', None):
if (re.match(pat, nb['Email'])):
e = SpiderFootEvent("EMAILADDR", nb['Email'],
e = SpiderFootEvent("EMAILADDR", nb['Email'],
self.__name__, event)
self.notifyListeners(e)

Expand Down
Loading

0 comments on commit 6cb4560

Please sign in to comment.