[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M755JM9W5VG170725KSVMGVP":3,"skill-same:01M755JM9W5VG170725KSVMGVP":73},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":23,"frontMatter":24,"refName":37,"commitSha":38,"skillDirectory":5,"forksCount":14,"repositoryHtmlUrl":39,"repositoryHomepageUrl":6,"ownerHtmlUrl":40,"ownerBlogUrl":41,"ownerDescription":6,"updatedAt":42,"install":43,"resources":56},"01M755JM9W5VG170725KSVMGVP","performing-ip-reputation-analysis-with-shodan",null,"Analyze IP address reputation using the Shodan API to identify open ports, running services, known vulnerabilities, and hosting context for threat intelligence enrichment and incident triage.","SamuelChien\u002Fmega-skills-collection","SamuelChien","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F4652114?v=4","01M74KK34WVHA0P5ZYSJRDDFMG","Samuel Chien","01M74KK35FQN1N9VZ9EPTH3P2S",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fperforming-ip-reputation-analysis-with-shodan\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fperforming-ip-reputation-analysis-with-shodan\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: performing-ip-reputation-analysis-with-shodan\ndescription: Analyze IP address reputation using the Shodan API to identify open ports, running services, known vulnerabilities, and hosting context for threat intelligence enrichment and incident triage.\ndomain: cybersecurity\nsubdomain: threat-intelligence\ntags: [shodan, ip-reputation, enrichment, threat-intelligence, reconnaissance, vulnerability, api, internet-scanning]\nversion: \"1.0\"\nauthor: mahipal\nlicense: Apache-2.0\n---\n# Performing IP Reputation Analysis with Shodan\n\n## Overview\n\nShodan is the world's first search engine for internet-connected devices, continuously scanning the IPv4 and IPv6 address space to catalog open ports, running services, SSL certificates, and known vulnerabilities. This skill covers using the Shodan API and InternetDB free API to enrich IP addresses from security alerts, assess threat levels based on exposed services and vulnerabilities, identify hosting infrastructure patterns, and integrate IP reputation data into SOC triage and threat intelligence workflows.\n\n\n## When to Use\n\n- When conducting security assessments that involve performing ip reputation analysis with shodan\n- When following incident response procedures for related security events\n- When performing scheduled security testing or auditing activities\n- When validating security controls through hands-on testing\n\n## Prerequisites\n\n- Python 3.9+ with `shodan` library (`pip install shodan`)\n- Shodan API key (free tier: limited queries; paid plans for higher limits and streaming)\n- Understanding of TCP\u002FUDP ports, common services, and CVE identifiers\n- Familiarity with ASN, CIDR notation, and IP geolocation concepts\n- Network security knowledge for interpreting scan results\n\n## Key Concepts\n\n### Shodan Data Model\n\nEach IP record in Shodan contains: open ports and protocols, banner data (service responses), SSL\u002FTLS certificate details, known CVE vulnerabilities, hostname(s) and reverse DNS, ASN and ISP information, geographic location, operating system fingerprint, and historical scan data showing changes over time.\n\n### InternetDB API\n\nShodan's free InternetDB API (internetdb.shodan.io) provides quick IP lookups without authentication, returning open ports, hostnames, tags, CPEs, and known vulnerabilities. This is useful for high-volume enrichment where the full Shodan API would hit rate limits.\n\n### Reputation Scoring\n\nIP reputation is assessed by combining: number and type of open ports (unusual ports indicate compromise), vulnerable services (unpatched software with known CVEs), hosting type (residential, cloud, VPN\u002Fproxy, bulletproof hosting), historical activity (past associations with malware, scanning, spam), and geographic context (countries known for specific threat activity).\n\n## Workflow\n\n### Step 1: Basic IP Enrichment with Shodan API\n\n```python\nimport shodan\nimport json\nfrom datetime import datetime\n\nclass ShodanEnricher:\n    def __init__(self, api_key):\n        self.api = shodan.Shodan(api_key)\n        self.info = self.api.info()\n        print(f\"[+] Shodan API initialized. Credits: {self.info.get('scan_credits', 0)}\")\n\n    def enrich_ip(self, ip_address):\n        \"\"\"Full enrichment of an IP address via Shodan.\"\"\"\n        try:\n            host = self.api.host(ip_address)\n            enrichment = {\n                \"ip\": ip_address,\n                \"organization\": host.get(\"org\", \"\"),\n                \"asn\": host.get(\"asn\", \"\"),\n                \"isp\": host.get(\"isp\", \"\"),\n                \"country\": host.get(\"country_name\", \"\"),\n                \"country_code\": host.get(\"country_code\", \"\"),\n                \"city\": host.get(\"city\", \"\"),\n                \"latitude\": host.get(\"latitude\"),\n                \"longitude\": host.get(\"longitude\"),\n                \"os\": host.get(\"os\", \"\"),\n                \"ports\": host.get(\"ports\", []),\n                \"hostnames\": host.get(\"hostnames\", []),\n                \"domains\": host.get(\"domains\", []),\n                \"vulns\": host.get(\"vulns\", []),\n                \"tags\": host.get(\"tags\", []),\n                \"last_update\": host.get(\"last_update\", \"\"),\n                \"services\": [],\n            }\n\n            for service in host.get(\"data\", []):\n                svc = {\n                    \"port\": service.get(\"port\", 0),\n                    \"transport\": service.get(\"transport\", \"tcp\"),\n                    \"product\": service.get(\"product\", \"\"),\n                    \"version\": service.get(\"version\", \"\"),\n                    \"module\": service.get(\"_shodan\", {}).get(\"module\", \"\"),\n                    \"banner\": service.get(\"data\", \"\")[:200],\n                }\n                if \"ssl\" in service:\n                    svc[\"ssl_subject\"] = service[\"ssl\"].get(\"cert\", {}).get(\"subject\", {})\n                    svc[\"ssl_issuer\"] = service[\"ssl\"].get(\"cert\", {}).get(\"issuer\", {})\n                    svc[\"ssl_expires\"] = service[\"ssl\"].get(\"cert\", {}).get(\"expires\", \"\")\n                enrichment[\"services\"].append(svc)\n\n            # Calculate reputation score\n            enrichment[\"reputation\"] = self._calculate_reputation(enrichment)\n            print(f\"[+] {ip_address}: {len(enrichment['ports'])} ports, \"\n                  f\"{len(enrichment['vulns'])} vulns, \"\n                  f\"reputation: {enrichment['reputation']['level']}\")\n            return enrichment\n\n        except shodan.APIError as e:\n            print(f\"[-] Shodan error for {ip_address}: {e}\")\n            return None\n\n    def _calculate_reputation(self, data):\n        \"\"\"Calculate IP reputation score based on Shodan data.\"\"\"\n        score = 0\n        factors = []\n\n        # Vulnerability assessment\n        vuln_count = len(data.get(\"vulns\", []))\n        if vuln_count > 10:\n            score += 40\n            factors.append(f\"{vuln_count} known vulnerabilities\")\n        elif vuln_count > 5:\n            score += 25\n            factors.append(f\"{vuln_count} known vulnerabilities\")\n        elif vuln_count > 0:\n            score += 10\n            factors.append(f\"{vuln_count} known vulnerabilities\")\n\n        # Suspicious port analysis\n        suspicious_ports = {4444, 5555, 6666, 8888, 9090, 1234, 31337,\n                           6667, 6697, 8080, 8443, 3128, 1080}\n        open_ports = set(data.get(\"ports\", []))\n        sus_found = open_ports.intersection(suspicious_ports)\n        if sus_found:\n            score += 15\n            factors.append(f\"suspicious ports: {sus_found}\")\n\n        # Tag-based assessment\n        malicious_tags = {\"self-signed\", \"cloud\", \"vpn\", \"proxy\", \"tor\"}\n        tags = set(data.get(\"tags\", []))\n        mal_tags = tags.intersection(malicious_tags)\n        if mal_tags:\n            score += 10\n            factors.append(f\"tags: {mal_tags}\")\n\n        # Too many open ports\n        port_count = len(data.get(\"ports\", []))\n        if port_count > 20:\n            score += 15\n            factors.append(f\"excessive open ports ({port_count})\")\n\n        level = (\n            \"critical\" if score >= 50\n            else \"high\" if score >= 35\n            else \"medium\" if score >= 15\n            else \"low\"\n        )\n\n        return {\"score\": score, \"level\": level, \"factors\": factors}\n\n    def enrich_ip_free(self, ip_address):\n        \"\"\"Quick IP enrichment using free InternetDB API.\"\"\"\n        import requests\n        resp = requests.get(f\"https:\u002F\u002Finternetdb.shodan.io\u002F{ip_address}\", timeout=10)\n        if resp.status_code == 200:\n            data = resp.json()\n            print(f\"[+] InternetDB: {ip_address} -> \"\n                  f\"{len(data.get('ports', []))} ports, \"\n                  f\"{len(data.get('vulns', []))} vulns\")\n            return data\n        return None\n\nenricher = ShodanEnricher(\"YOUR_SHODAN_API_KEY\")\nresult = enricher.enrich_ip(\"8.8.8.8\")\nprint(json.dumps(result, indent=2, default=str))\n```\n\n### Step 2: Batch IP Reputation Check\n\n```python\nimport time\n\ndef batch_ip_reputation(enricher, ip_list, output_file=\"ip_reputation.json\"):\n    \"\"\"Check reputation for a list of IP addresses.\"\"\"\n    results = []\n    for i, ip in enumerate(ip_list):\n        result = enricher.enrich_ip(ip)\n        if result:\n            results.append(result)\n        if (i + 1) % 10 == 0:\n            print(f\"  [{i+1}\u002F{len(ip_list)}] Processed\")\n            time.sleep(1)  # Rate limiting\n\n    # Sort by reputation score (highest risk first)\n    results.sort(key=lambda x: x.get(\"reputation\", {}).get(\"score\", 0), reverse=True)\n\n    with open(output_file, \"w\") as f:\n        json.dump(results, f, indent=2, default=str)\n\n    # Summary\n    levels = {\"critical\": 0, \"high\": 0, \"medium\": 0, \"low\": 0}\n    for r in results:\n        level = r.get(\"reputation\", {}).get(\"level\", \"low\")\n        levels[level] += 1\n\n    print(f\"\\n=== Batch Reputation Summary ===\")\n    print(f\"Total IPs: {len(results)}\")\n    for level, count in levels.items():\n        print(f\"  {level.upper()}: {count}\")\n\n    return results\n\nsuspicious_ips = [\"203.0.113.1\", \"198.51.100.5\", \"192.0.2.100\"]\nresults = batch_ip_reputation(enricher, suspicious_ips)\n```\n\n### Step 3: Infrastructure Correlation\n\n```python\ndef correlate_infrastructure(enricher, ip_address):\n    \"\"\"Find related infrastructure based on shared attributes.\"\"\"\n    host_data = enricher.enrich_ip(ip_address)\n    if not host_data:\n        return {}\n\n    correlations = {\n        \"same_org\": [],\n        \"same_asn\": [],\n        \"shared_ssl\": [],\n    }\n\n    # Search for same organization\n    org = host_data.get(\"organization\", \"\")\n    if org:\n        try:\n            results = enricher.api.search(f'org:\"{org}\"', limit=20)\n            for match in results.get(\"matches\", []):\n                correlations[\"same_org\"].append({\n                    \"ip\": match.get(\"ip_str\", \"\"),\n                    \"port\": match.get(\"port\", 0),\n                    \"product\": match.get(\"product\", \"\"),\n                })\n        except shodan.APIError:\n            pass\n\n    # Search for same SSL certificate\n    for service in host_data.get(\"services\", []):\n        ssl_subject = service.get(\"ssl_subject\", {})\n        if ssl_subject:\n            cn = ssl_subject.get(\"CN\", \"\")\n            if cn:\n                try:\n                    results = enricher.api.search(f'ssl.cert.subject.CN:\"{cn}\"', limit=20)\n                    for match in results.get(\"matches\", []):\n                        correlations[\"shared_ssl\"].append({\n                            \"ip\": match.get(\"ip_str\", \"\"),\n                            \"cn\": cn,\n                        })\n                except shodan.APIError:\n                    pass\n\n    print(f\"[+] Infrastructure correlations for {ip_address}:\")\n    print(f\"  Same org: {len(correlations['same_org'])} hosts\")\n    print(f\"  Shared SSL: {len(correlations['shared_ssl'])} hosts\")\n    return correlations\n```\n\n## Validation Criteria\n\n- Shodan API queried successfully with proper authentication\n- IP enrichment returns ports, services, vulnerabilities, and geolocation\n- Reputation scoring classifies IPs by threat level\n- Batch enrichment handles rate limiting correctly\n- Infrastructure correlation identifies related hosts\n- InternetDB free API used for high-volume lookups\n\n## References\n\n- [Shodan Developer API](https:\u002F\u002Fdeveloper.shodan.io\u002Fapi)\n- [Shodan InternetDB API](https:\u002F\u002Finternetdb.shodan.io\u002F)\n- [Shodan Python Library](https:\u002F\u002Fgithub.com\u002Fachillean\u002Fshodan-python)\n- [Query.ai: Leveraging Shodan for Security Research](https:\u002F\u002Fwww.query.ai\u002Fresources\u002Fblogs\u002Fleveraging-shodan-for-security-research\u002F)\n- [Torq: Shodan IP Enrichment Workflow](https:\u002F\u002Fkb.torq.io\u002Fen\u002Farticles\u002F9350284-shodan-ip-address-enrichment-with-cache-workflow-template)\n- [Recorded Future: Shodan Integration](https:\u002F\u002Fsupport.recordedfuture.com\u002Fhc\u002Fen-us\u002Farticles\u002F115001403928-Shodan)\n","# Performing IP Reputation Analysis with Shodan\n\n## Overview\n\nShodan is the world's first search engine for internet-connected devices, continuously scanning the IPv4 and IPv6 address space to catalog open ports, running services, SSL certificates, and known vulnerabilities. This skill covers using the Shodan API and InternetDB free API to enrich IP addresses from security alerts, assess threat levels based on exposed services and vulnerabilities, identify hosting infrastructure patterns, and integrate IP reputation data into SOC triage and threat intelligence workflows.\n\n\n## When to Use\n\n- When conducting security assessments that involve performing ip reputation analysis with shodan\n- When following incident response procedures for related security events\n- When performing scheduled security testing or auditing activities\n- When validating security controls through hands-on testing\n\n## Prerequisites\n\n- Python 3.9+ with `shodan` library (`pip install shodan`)\n- Shodan API key (free tier: limited queries; paid plans for higher limits and streaming)\n- Understanding of TCP\u002FUDP ports, common services, and CVE identifiers\n- Familiarity with ASN, CIDR notation, and IP geolocation concepts\n- Network security knowledge for interpreting scan results\n\n## Key Concepts\n\n### Shodan Data Model\n\nEach IP record in Shodan contains: open ports and protocols, banner data (service responses), SSL\u002FTLS certificate details, known CVE vulnerabilities, hostname(s) and reverse DNS, ASN and ISP information, geographic location, operating system fingerprint, and historical scan data showing changes over time.\n\n### InternetDB API\n\nShodan's free InternetDB API (internetdb.shodan.io) provides quick IP lookups without authentication, returning open ports, hostnames, tags, CPEs, and known vulnerabilities. This is useful for high-volume enrichment where the full Shodan API would hit rate limits.\n\n### Reputation Scoring\n\nIP reputation is assessed by combining: number and type of open ports (unusual ports indicate compromise), vulnerable services (unpatched software with known CVEs), hosting type (residential, cloud, VPN\u002Fproxy, bulletproof hosting), historical activity (past associations with malware, scanning, spam), and geographic context (countries known for specific threat activity).\n\n## Workflow\n\n### Step 1: Basic IP Enrichment with Shodan API\n\n```python\nimport shodan\nimport json\nfrom datetime import datetime\n\nclass ShodanEnricher:\n    def __init__(self, api_key):\n        self.api = shodan.Shodan(api_key)\n        self.info = self.api.info()\n        print(f\"[+] Shodan API initialized. Credits: {self.info.get('scan_credits', 0)}\")\n\n    def enrich_ip(self, ip_address):\n        \"\"\"Full enrichment of an IP address via Shodan.\"\"\"\n        try:\n            host = self.api.host(ip_address)\n            enrichment = {\n                \"ip\": ip_address,\n                \"organization\": host.get(\"org\", \"\"),\n                \"asn\": host.get(\"asn\", \"\"),\n                \"isp\": host.get(\"isp\", \"\"),\n                \"country\": host.get(\"country_name\", \"\"),\n                \"country_code\": host.get(\"country_code\", \"\"),\n                \"city\": host.get(\"city\", \"\"),\n                \"latitude\": host.get(\"latitude\"),\n                \"longitude\": host.get(\"longitude\"),\n                \"os\": host.get(\"os\", \"\"),\n                \"ports\": host.get(\"ports\", []),\n                \"hostnames\": host.get(\"hostnames\", []),\n                \"domains\": host.get(\"domains\", []),\n                \"vulns\": host.get(\"vulns\", []),\n                \"tags\": host.get(\"tags\", []),\n                \"last_update\": host.get(\"last_update\", \"\"),\n                \"services\": [],\n            }\n\n            for service in host.get(\"data\", []):\n                svc = {\n                    \"port\": service.get(\"port\", 0),\n                    \"transport\": service.get(\"transport\", \"tcp\"),\n                    \"product\": service.get(\"product\", \"\"),\n                    \"version\": service.get(\"version\", \"\"),\n                    \"module\": service.get(\"_shodan\", {}).get(\"module\", \"\"),\n                    \"banner\": service.get(\"data\", \"\")[:200],\n                }\n                if \"ssl\" in service:\n                    svc[\"ssl_subject\"] = service[\"ssl\"].get(\"cert\", {}).get(\"subject\", {})\n                    svc[\"ssl_issuer\"] = service[\"ssl\"].get(\"cert\", {}).get(\"issuer\", {})\n                    svc[\"ssl_expires\"] = service[\"ssl\"].get(\"cert\", {}).get(\"expires\", \"\")\n                enrichment[\"services\"].append(svc)\n\n            # Calculate reputation score\n            enrichment[\"reputation\"] = self._calculate_reputation(enrichment)\n            print(f\"[+] {ip_address}: {len(enrichment['ports'])} ports, \"\n                  f\"{len(enrichment['vulns'])} vulns, \"\n                  f\"reputation: {enrichment['reputation']['level']}\")\n            return enrichment\n\n        except shodan.APIError as e:\n            print(f\"[-] Shodan error for {ip_address}: {e}\")\n            return None\n\n    def _calculate_reputation(self, data):\n        \"\"\"Calculate IP reputation score based on Shodan data.\"\"\"\n        score = 0\n        factors = []\n\n        # Vulnerability assessment\n        vuln_count = len(data.get(\"vulns\", []))\n        if vuln_count > 10:\n            score += 40\n            factors.append(f\"{vuln_count} known vulnerabilities\")\n        elif vuln_count > 5:\n            score += 25\n            factors.append(f\"{vuln_count} known vulnerabilities\")\n        elif vuln_count > 0:\n            score += 10\n            factors.append(f\"{vuln_count} known vulnerabilities\")\n\n        # Suspicious port analysis\n        suspicious_ports = {4444, 5555, 6666, 8888, 9090, 1234, 31337,\n                           6667, 6697, 8080, 8443, 3128, 1080}\n        open_ports = set(data.get(\"ports\", []))\n        sus_found = open_ports.intersection(suspicious_ports)\n        if sus_found:\n            score += 15\n            factors.append(f\"suspicious ports: {sus_found}\")\n\n        # Tag-based assessment\n        malicious_tags = {\"self-signed\", \"cloud\", \"vpn\", \"proxy\", \"tor\"}\n        tags = set(data.get(\"tags\", []))\n        mal_tags = tags.intersection(malicious_tags)\n        if mal_tags:\n            score += 10\n            factors.append(f\"tags: {mal_tags}\")\n\n        # Too many open ports\n        port_count = len(data.get(\"ports\", []))\n        if port_count > 20:\n            score += 15\n            factors.append(f\"excessive open ports ({port_count})\")\n\n        level = (\n            \"critical\" if score >= 50\n            else \"high\" if score >= 35\n            else \"medium\" if score >= 15\n            else \"low\"\n        )\n\n        return {\"score\": score, \"level\": level, \"factors\": factors}\n\n    def enrich_ip_free(self, ip_address):\n        \"\"\"Quick IP enrichment using free InternetDB API.\"\"\"\n        import requests\n        resp = requests.get(f\"https:\u002F\u002Finternetdb.shodan.io\u002F{ip_address}\", timeout=10)\n        if resp.status_code == 200:\n            data = resp.json()\n            print(f\"[+] InternetDB: {ip_address} -> \"\n                  f\"{len(data.get('ports', []))} ports, \"\n                  f\"{len(data.get('vulns', []))} vulns\")\n            return data\n        return None\n\nenricher = ShodanEnricher(\"YOUR_SHODAN_API_KEY\")\nresult = enricher.enrich_ip(\"8.8.8.8\")\nprint(json.dumps(result, indent=2, default=str))\n```\n\n### Step 2: Batch IP Reputation Check\n\n```python\nimport time\n\ndef batch_ip_reputation(enricher, ip_list, output_file=\"ip_reputation.json\"):\n    \"\"\"Check reputation for a list of IP addresses.\"\"\"\n    results = []\n    for i, ip in enumerate(ip_list):\n        result = enricher.enrich_ip(ip)\n        if result:\n            results.append(result)\n        if (i + 1) % 10 == 0:\n            print(f\"  [{i+1}\u002F{len(ip_list)}] Processed\")\n            time.sleep(1)  # Rate limiting\n\n    # Sort by reputation score (highest risk first)\n    results.sort(key=lambda x: x.get(\"reputation\", {}).get(\"score\", 0), reverse=True)\n\n    with open(output_file, \"w\") as f:\n        json.dump(results, f, indent=2, default=str)\n\n    # Summary\n    levels = {\"critical\": 0, \"high\": 0, \"medium\": 0, \"low\": 0}\n    for r in results:\n        level = r.get(\"reputation\", {}).get(\"level\", \"low\")\n        levels[level] += 1\n\n    print(f\"\\n=== Batch Reputation Summary ===\")\n    print(f\"Total IPs: {len(results)}\")\n    for level, count in levels.items():\n        print(f\"  {level.upper()}: {count}\")\n\n    return results\n\nsuspicious_ips = [\"203.0.113.1\", \"198.51.100.5\", \"192.0.2.100\"]\nresults = batch_ip_reputation(enricher, suspicious_ips)\n```\n\n### Step 3: Infrastructure Correlation\n\n```python\ndef correlate_infrastructure(enricher, ip_address):\n    \"\"\"Find related infrastructure based on shared attributes.\"\"\"\n    host_data = enricher.enrich_ip(ip_address)\n    if not host_data:\n        return {}\n\n    correlations = {\n        \"same_org\": [],\n        \"same_asn\": [],\n        \"shared_ssl\": [],\n    }\n\n    # Search for same organization\n    org = host_data.get(\"organization\", \"\")\n    if org:\n        try:\n            results = enricher.api.search(f'org:\"{org}\"', limit=20)\n            for match in results.get(\"matches\", []):\n                correlations[\"same_org\"].append({\n                    \"ip\": match.get(\"ip_str\", \"\"),\n                    \"port\": match.get(\"port\", 0),\n                    \"product\": match.get(\"product\", \"\"),\n                })\n        except shodan.APIError:\n            pass\n\n    # Search for same SSL certificate\n    for service in host_data.get(\"services\", []):\n        ssl_subject = service.get(\"ssl_subject\", {})\n        if ssl_subject:\n            cn = ssl_subject.get(\"CN\", \"\")\n            if cn:\n                try:\n                    results = enricher.api.search(f'ssl.cert.subject.CN:\"{cn}\"', limit=20)\n                    for match in results.get(\"matches\", []):\n                        correlations[\"shared_ssl\"].append({\n                            \"ip\": match.get(\"ip_str\", \"\"),\n                            \"cn\": cn,\n                        })\n                except shodan.APIError:\n                    pass\n\n    print(f\"[+] Infrastructure correlations for {ip_address}:\")\n    print(f\"  Same org: {len(correlations['same_org'])} hosts\")\n    print(f\"  Shared SSL: {len(correlations['shared_ssl'])} hosts\")\n    return correlations\n```\n\n## Validation Criteria\n\n- Shodan API queried successfully with proper authentication\n- IP enrichment returns ports, services, vulnerabilities, and geolocation\n- Reputation scoring classifies IPs by threat level\n- Batch enrichment handles rate limiting correctly\n- Infrastructure correlation identifies related hosts\n- InternetDB free API used for high-volume lookups\n\n## References\n\n- [Shodan Developer API](https:\u002F\u002Fdeveloper.shodan.io\u002Fapi)\n- [Shodan InternetDB API](https:\u002F\u002Finternetdb.shodan.io\u002F)\n- [Shodan Python Library](https:\u002F\u002Fgithub.com\u002Fachillean\u002Fshodan-python)\n- [Query.ai: Leveraging Shodan for Security Research](https:\u002F\u002Fwww.query.ai\u002Fresources\u002Fblogs\u002Fleveraging-shodan-for-security-research\u002F)\n- [Torq: Shodan IP Enrichment Workflow](https:\u002F\u002Fkb.torq.io\u002Fen\u002Farticles\u002F9350284-shodan-ip-address-enrichment-with-cache-workflow-template)\n- [Recorded Future: Shodan Integration](https:\u002F\u002Fsupport.recordedfuture.com\u002Fhc\u002Fen-us\u002Farticles\u002F115001403928-Shodan)\n",{"name":5,"tags":25,"author":34,"domain":35,"license":15,"version":36,"subdomain":29,"description":7},[26,27,28,29,30,31,32,33],"shodan","ip-reputation","enrichment","threat-intelligence","reconnaissance","vulnerability","api","internet-scanning","mahipal","cybersecurity","1.0","main","c2b1fdccc779e99ac814e55fb69ca8d71215dd0f","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection","https:\u002F\u002Fgithub.com\u002FSamuelChien","http:\u002F\u002Fsamuelchien.com\u002F","2026-05-26 08:27:14",{"source":8,"skillName":5,"commands":44,"prompt":54,"zipAvailable":55},[45,48,51],{"tool":46,"command":47},"npx","npx skills add SamuelChien\u002Fmega-skills-collection --skill performing-ip-reputation-analysis-with-shodan",{"tool":49,"command":50},"bunx","bunx skills add SamuelChien\u002Fmega-skills-collection --skill performing-ip-reputation-analysis-with-shodan",{"tool":52,"command":53},"pnpm","pnpm dlx skills add SamuelChien\u002Fmega-skills-collection --skill performing-ip-reputation-analysis-with-shodan","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fperforming-ip-reputation-analysis-with-shodan\u002FSKILL.md",true,[57,61,67],{"path":58,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":60,"sourceHtmlUrl":16},"LICENSE","许可证",11255,{"path":62,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":65,"sourceHtmlUrl":66},"references\u002Fapi-reference.md","REFERENCE","参考文档",1157,"https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fperforming-ip-reputation-analysis-with-shodan\u002Freferences\u002Fapi-reference.md",{"path":68,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":71,"sourceHtmlUrl":72},"scripts\u002Fagent.py","SCRIPT","脚本",4260,"https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fperforming-ip-reputation-analysis-with-shodan\u002Fscripts\u002Fagent.py",[74,82,89,96,103,110],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":78,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":20},"01M76R4WZQZAXGGXMQCA0FZ716","zustand-store-ts","Create Zustand stores with TypeScript, subscribeWithSelector middleware, and proper state\u002Faction separation. Use when building React state management, creating global stores, or implementing reactive state patterns with Zustand.","MIT","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fzustand-store-ts\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":78,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":20},"01M76R4T9KENDH7FENGZQHBW4G","zustand-store-creator","Zustand Store Creator - Auto-activating skill for Frontend Development.\nTriggers on: zustand store creator, zustand store creator\nPart of the Frontend Development skill category.","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fzustand-store-creator\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":78,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":20},"01M76R3YWN84B7SANJ52X799ZE","zero-trust-config-helper","Zero Trust Config Helper - Auto-activating skill for Security Advanced.\nTriggers on: zero trust config helper, zero trust config helper\nPart of the Security Advanced skill category.","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fzero-trust-config-helper\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":78,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":20},"01M76R3HNSV2AEYSKHM915GJ58","zapier-integration-helper","Zapier Integration Helper - Auto-activating skill for Business Automation.\nTriggers on: zapier integration helper, zapier integration helper\nPart of the Business Automation skill category.","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fzapier-integration-helper\u002FSKILL.md",[],[],{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":20},"01M76R3DJSKAT4FA7DV4BF3GCE","zai-cli","Execute z.AI CLI providing vision, search, reader, and GitHub exploration via CLI and MCP.\nUse when user needs image\u002Fvideo analysis, OCR, UI-to-code conversion, error diagnosis,\nreal-time web search, web page to markdown extraction, or GitHub code exploration.\nTrigger with phrases like \"analyze this image\", \"search the web for\", \"read this page\",\n\"explore this repo\", or \"use zai\". Requires Z_AI_API_KEY.","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fzai-cli\u002FSKILL.md",[],[],{"skillNo":111,"name":112,"nameZh":6,"description":113,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":78,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":116,"publishedAt":20},"01M76R2KAM699XE9AJVAWE4H2E","yt-research","Research competitor YouTube channels, niches, and trending topics for your content strategy.\nUse this skill whenever the user says \"research channels\", \"analyze competitors\", \"find trending topics\",\n\"niche analysis\", \"competitive research\", \"what are other creators doing\", \"scrape YouTube channels\",\nor wants to understand the competitive landscape for a specific tool or topic area. Use when working with yt research. Trigger with 'yt', 'research'.","https:\u002F\u002Fgithub.com\u002FSamuelChien\u002Fmega-skills-collection\u002Fblob\u002Fmain\u002Fyt-research\u002FSKILL.md",[],[]]