[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EVWX2DJY9BZVKGCMS2VPDM":3,"skill-same:01M6EVWX2DJY9BZVKGCMS2VPDM":112},{"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":6,"sourceHtmlUrl":16,"categories":17,"keywords":31,"publishedAt":52,"linkOnly":53,"markdownContent":54,"markdownBody":55,"frontMatter":56,"refName":73,"commitSha":74,"skillDirectory":75,"forksCount":14,"repositoryHtmlUrl":76,"repositoryHomepageUrl":77,"ownerHtmlUrl":78,"ownerBlogUrl":6,"ownerDescription":79,"updatedAt":80,"install":81,"resources":94},"01M6EVWX2DJY9BZVKGCMS2VPDM","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.","henriquescastilho\u002Fmy-claude","henriquescastilho","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F153296945?v=4","01M6ESH7EXPXTH9CVQ4K16SRG8","Henrique Scheer","01M6ESH7JHEK2PTNNH4HEH787Z",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fperforming-ip-reputation-analysis-with-shodan\u002FSKILL.md",[18,23,26],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000010","后端与接口","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",{"categoryNo":27,"categoryName":28,"taxonomyType":29,"taxonomyTypeDesc":30},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],"performing ip reputation analysis with shodan","with","ip","reputation","analysis","Shodan","ip-reputation","vulnerability","api","internet-scanning","cybersecurity","open","analyze","ports","reconnaissance","cm","incident","threat-intelligence","id","threat intelligence","2026-11-10 10:12:30",false,"---\nname: performing-ip-reputation-analysis-with-shodan\ndescription: Analyze IP address reputation using the Shodan API to identify open ports,\n  running services, known vulnerabilities, and hosting context for threat intelligence\n  enrichment and incident triage.\ndomain: cybersecurity\nsubdomain: threat-intelligence\ntags:\n- shodan\n- ip-reputation\n- enrichment\n- threat-intelligence\n- reconnaissance\n- vulnerability\n- api\n- internet-scanning\nversion: '1.0'\nauthor: mahipal\nlicense: Apache-2.0\nnist_csf:\n- ID.RA-01\n- ID.RA-05\n- DE.CM-01\n- DE.AE-02\nmitre_attack:\n- T1591\n- T1592\n- T1593\n- T1589\n- T1595\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":57,"author":60,"domain":42,"license":15,"version":61,"nist_csf":62,"subdomain":49,"description":7,"mitre_attack":67},[58,38,59,49,46,39,40,41],"shodan","enrichment","mahipal","1.0",[63,64,65,66],"ID.RA-01","ID.RA-05","DE.CM-01","DE.AE-02",[68,69,70,71,72],"T1591","T1592","T1593","T1589","T1595","main","7925716f065257435fdb12e97f7e52842147d5ad",".claude\u002Fskills\u002Fperforming-ip-reputation-analysis-with-shodan","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude","https:\u002F\u002Fclaude.com\u002Fclaude-code","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho","Software · Applied AI · Quantitative Modeling · Building with Claude.","2026-06-10 12:24:46",{"source":8,"skillName":5,"commands":82,"prompt":92,"zipAvailable":93},[83,86,89],{"tool":84,"command":85},"npx","npx skills add henriquescastilho\u002Fmy-claude --skill performing-ip-reputation-analysis-with-shodan",{"tool":87,"command":88},"bunx","bunx skills add henriquescastilho\u002Fmy-claude --skill performing-ip-reputation-analysis-with-shodan",{"tool":90,"command":91},"pnpm","pnpm dlx skills add henriquescastilho\u002Fmy-claude --skill performing-ip-reputation-analysis-with-shodan","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fperforming-ip-reputation-analysis-with-shodan\u002FSKILL.md",true,[95,100,106],{"path":96,"resourceType":96,"resourceTypeDesc":97,"sizeBytes":98,"sourceHtmlUrl":99},"LICENSE","许可证",11255,"https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fperforming-ip-reputation-analysis-with-shodan\u002FLICENSE",{"path":101,"resourceType":102,"resourceTypeDesc":103,"sizeBytes":104,"sourceHtmlUrl":105},"references\u002Fapi-reference.md","REFERENCE","参考文档",1157,"https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fperforming-ip-reputation-analysis-with-shodan\u002Freferences\u002Fapi-reference.md",{"path":107,"resourceType":108,"resourceTypeDesc":109,"sizeBytes":110,"sourceHtmlUrl":111},"scripts\u002Fagent.py","SCRIPT","脚本",4260,"https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fperforming-ip-reputation-analysis-with-shodan\u002Fscripts\u002Fagent.py",[113,151,160,169,191,216],{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":117,"licenseFileUrl":6,"sourceHtmlUrl":118,"categories":119,"keywords":132,"publishedAt":52},"01M6F0B6XPQ65AX2X0DWK8KT3E","markitdown","Convert files and office documents to Markdown. Supports PDF, DOCX, PPTX, XLSX, images (with OCR), audio (with transcription), HTML, CSV, JSON, XML, ZIP, YouTube URLs, EPubs and more.","MIT","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.codex\u002Fvendor_imports\u002Fclaude\u002Fmarketplaces\u002Fclaude-scientific-writer\u002Fskills\u002Fmarkitdown\u002FSKILL.md",[120,123,126,129],{"categoryNo":121,"categoryName":122,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000002","文档处理",{"categoryNo":124,"categoryName":125,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000003","演示文稿",{"categoryNo":127,"categoryName":128,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000004","电子表格",{"categoryNo":130,"categoryName":131,"taxonomyType":29,"taxonomyTypeDesc":30},"01JBSEEDCAT000000000000034","行政与办公人员",[115,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,33],"docx","PDF","pptx","xlsx","documents","csv","ocr","Audio","Bash","markdown","convert","read","write","edit","html","images","files","youtube",{"skillNo":152,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":117,"licenseFileUrl":6,"sourceHtmlUrl":153,"categories":154,"keywords":159,"publishedAt":52},"01M6F06SBHR9F0SDWE282Y8075","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.codex\u002Fvendor_imports\u002Fclaude\u002Fmarketplaces\u002Fclaude-scientific-writer\u002Fscientific_writer\u002F.claude\u002Fskills\u002Fmarkitdown\u002FSKILL.md",[155,156,157,158],{"categoryNo":121,"categoryName":122,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":124,"categoryName":125,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":127,"categoryName":128,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":130,"categoryName":131,"taxonomyType":29,"taxonomyTypeDesc":30},[115,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,33],{"skillNo":161,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":117,"licenseFileUrl":6,"sourceHtmlUrl":162,"categories":163,"keywords":168,"publishedAt":52},"01M6F02D4R14EJAPBWVDF9J9VQ","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.codex\u002Fvendor_imports\u002Fclaude\u002Fmarketplaces\u002Fclaude-scientific-writer\u002F.claude\u002Fskills\u002Fmarkitdown\u002FSKILL.md",[164,165,166,167],{"categoryNo":121,"categoryName":122,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":124,"categoryName":125,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":127,"categoryName":128,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":130,"categoryName":131,"taxonomyType":29,"taxonomyTypeDesc":30},[115,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,33],{"skillNo":170,"name":171,"nameZh":6,"description":172,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":117,"licenseFileUrl":6,"sourceHtmlUrl":173,"categories":174,"keywords":175,"publishedAt":52},"01M6F000KS6YB4MKS774G4R8ND","zarr-python","Chunked N-D arrays for cloud storage. Compressed arrays, parallel I\u002FO, S3\u002FGCS integration, NumPy\u002FDask\u002FXarray compatible, for large-scale scientific computing pipelines.","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.codex\u002Fvendor_imports\u002Fclaude\u002Fmarketplaces\u002Fclaude-scientific-skills\u002Fscientific-skills\u002Fzarr-python\u002FSKILL.md",[],[176,177,178,179,180,181,182,183,184,185,186,187,188,189,190],"python","zarr python","storage","integration","s3","gcs","cloud","dask","parallel","pipelines","arrays","numpy","scientific computing","scale","scientific",{"skillNo":192,"name":193,"nameZh":6,"description":194,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":117,"licenseFileUrl":6,"sourceHtmlUrl":195,"categories":196,"keywords":198,"publishedAt":52},"01M6EZZJWFXM1GR78KTW6J0DN8","what-if-oracle","Run structured What-If scenario analysis with multi-branch possibility exploration. Use this skill when the user asks speculative questions like \"what if...\", \"what would happen if...\", \"what are the possibilities\", \"explore scenarios\", \"scenario analysis\", \"possibility space\", \"what could go wrong\", \"best case \u002F worst case\", \"risk analysis\", \"contingency planning\", \"strategic options\", or any question about uncertain futures. Also trigger when the user faces a fork-in-the-road decision, wants to stress-test an idea, or needs to think through consequences before committing.","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.codex\u002Fvendor_imports\u002Fclaude\u002Fmarketplaces\u002Fclaude-scientific-skills\u002Fscientific-skills\u002Fwhat-if-oracle\u002FSKILL.md",[197],{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},[199,200,201,202,203,204,36,205,206,207,208,144,145,209,210,211,212,213,214,215],"oracle","what if oracle","go","run","ux","futures","explore","decision","branch","question","idea","exploration","options","stress-test","strategies","scenario","stress",{"skillNo":217,"name":218,"nameZh":6,"description":219,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":117,"licenseFileUrl":6,"sourceHtmlUrl":220,"categories":221,"keywords":232,"publishedAt":52},"01M6EZZCXAEB49RXGQCJX5E8GB","venue-templates","Access comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.codex\u002Fvendor_imports\u002Fclaude\u002Fmarketplaces\u002Fclaude-scientific-skills\u002Fscientific-skills\u002Fvenue-templates\u002FSKILL.md",[222,225,228,229],{"categoryNo":223,"categoryName":224,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000018","写作与文案",{"categoryNo":226,"categoryName":227,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000021","资料检索与研究",{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":230,"categoryName":231,"taxonomyType":29,"taxonomyTypeDesc":30},"01JBSEEDCAT000000000000036","内容创作者",[233,234,235,236,237,238,239,240,141,241,144,145,146,242,243,244,245,246,190,247],"templates","venue templates","research","guidelines","NeurIPS","ICML","LaTeX","science","access","proposals","Academic","requirements","formatting","journal","chi"]