Skip to content

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

Quote http.html filter query

bcoles3a6f23dc39d5
diff --git a/modules/sfp_shodan.py b/modules/sfp_shodan.py
index f95e8407..1d600315 100644
--- a/modules/sfp_shodan.py
+++ b/modules/sfp_shodan.py
@@ -11,6 +11,7 @@
# -------------------------------------------------------------------------------
import json
+import urllib
from netaddr import IPNetwork
from sflib import SpiderFoot, SpiderFootPlugin, SpiderFootEvent
@@ -89,8 +90,12 @@ class sfp_shodan(SpiderFootPlugin):
return info
def searchHtml(self, qry):
- res = self.sf.fetchUrl("https://api.shodan.io/shodan/host/search?query=http.html:" + qry +
- "&key=" + self.opts['api_key'],
+ params = {
+ 'query': 'http.html:"' + qry.encode('raw_unicode_escape') + '"',
+ 'key': self.opts['api_key']
+ }
+
+ res = self.sf.fetchUrl("https://api.shodan.io/shodan/host/search?" + urllib.urlencode(params),
timeout=self.opts['_fetchtimeout'], useragent="SpiderFoot")
if res['content'] is None:
self.sf.info("No SHODAN info found for " + qry)