sfp_shodan.py

spiderfoot · scraping

Shodan API integration for network recon, exposing host, port, and vulnerability intel.

# -*- coding: utf-8 -*-
# -------------------------------------------------------------------------------
# Name:        sfp_shodan
# Purpose:     Search Shodan for information related to the target.
#
# Author:      Steve Micallef <steve@binarypool.com>
#
# Created:     19/03/2014
# Copyright:   (c) Steve Micallef
# Licence:     MIT
# -------------------------------------------------------------------------------

import json
import time
import urllib.error
import urllib.parse
import urllib.request

from netaddr import IPNetwork

from spiderfoot import SpiderFootEvent, SpiderFootPlugin


class sfp_shodan(SpiderFootPlugin):

    meta = {
        'name': "SHODAN",
        'summary': "Obtain information from SHODAN about identified IP addresses.",
        'flags': ["apikey"],
        'useCas

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search 40K more like it.

Get a free API key