SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.
Python attacksurfacecticybersecurityfootprintinghackinginformation-gatheringinformation-securityinfosecintelligence-gatheringosintosint-frameworkosint-reconnaissanceosint-toolpentestingpythonreconsecurity-toolsthreat-intelligencethreatintel
psbdmp.com module to identify potentially hacked/leaked e-mail addresses.
Steveae6f27438ec1
diff --git a/modules/sfp_psbdmp.py b/modules/sfp_psbdmp.pynew file mode 100644index 00000000..c22821db--- /dev/null+++ b/modules/sfp_psbdmp.py@@ -0,0 +1,109 @@+#-------------------------------------------------------------------------------+# Name: sfp_psbdmp+# Purpose: Query psbdmp.com for potentially hacked e-mail addresses.+#+# Author: Steve Micallef <[email protected]>+#+# Created: 21/11/2016+# Copyright: (c) Steve Micallef+# Licence: GPL+#-------------------------------------------------------------------------------++import sys+import json+import time+from sflib import SpiderFoot, SpiderFootPlugin, SpiderFootEvent++class sfp_psbdmp(SpiderFootPlugin):+ """Psbdmp.com:Footprint,Investigate,Passive:Search Engines::Check psbdmp.com (PasteBin Dump) for potentially hacked e-mails and domains."""++ # Default options+ opts = {+ }++ # Option descriptions+ optdescs = {+ }++ # Be sure to completely clear any class variables in setup()+ # or you run the risk of data persisting between scan runs.++ results = dict()++ def setup(self, sfc, userOpts=dict()):+ self.sf = sfc+ self.results = dict()++ # Clear / reset any other class member variables here+ # or you risk them persisting between threads.++ for opt in userOpts.keys():+ self.opts[opt] = userOpts[opt]++ # What events is this module interested in for input+ def watchedEvents(self):+ ret = ["EMAILADDR", "DOMAIN_NAME"]++ return ret++ # What events this module produces+ def producedEvents(self):+ ret = ["LEAKSITE_URL"]++ return ret++ def query(self, qry):+ ret = None++ if "@" in qry:+ url = "http://psbdmp.com/api/search/email/" + qry+ else:+ url = "http://psbdmp.com/api/search/domain/" + qry++ # https://haveibeenpsbdmp.com/API/v2#RateLimiting+ time.sleep(1)+ res = self.sf.fetchUrl(url, timeout=self.opts['_fetchtimeout'],+ useragent="SpiderFoot")++ try:+ ret = json.loads(res['content'])+ except Exception as e:+ self.sf.error("Error processing JSON response from psbdmp.com: " + str(e), False)+ return None++ ids = list()+ if 'count' in ret:+ if ret['count'] > 0:+ for d in ret['data']:+ ids.append("http://psbdmp.com/" + d['id'])+ else:+ return None+ else:+ return None++ return ids++ # Handle events sent to this module+ def handleEvent(self, event):+ eventName = event.eventType+ srcModuleName = event.module+ eventData = event.data++ self.sf.debug("Received event, " + eventName + ", from " + srcModuleName)++ # Don't look up stuff twice+ if self.results.has_key(eventData):+ self.sf.debug("Skipping " + eventData + " as already mapped.")+ return None+ else:+ self.results[eventData] = True++ data = self.query(eventData)+ if data == None:+ return None++ for n in data:+ e = SpiderFootEvent("LEAKSITE_URL", n, self.__name__, event)+ self.notifyListeners(e)++# End of sfp_psbdmp class