[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6AFVNF49JQF9X2HD1X7D8A0":3,"skill-same:01M6AFVNF49JQF9X2HD1X7D8A0":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":47,"linkOnly":48,"markdownContent":49,"markdownBody":50,"frontMatter":51,"refName":67,"commitSha":68,"skillDirectory":69,"forksCount":70,"repositoryHtmlUrl":71,"repositoryHomepageUrl":72,"ownerHtmlUrl":73,"ownerBlogUrl":74,"ownerDescription":75,"updatedAt":76,"install":77,"resources":90},"01M6AFVNF49JQF9X2HD1X7D8A0","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.","mukul975\u002FAnthropic-Cybersecurity-Skills","mukul975","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F42860185?v=4","01M6ADEQR8T5M4EEG6C67BQCWF","Mahipal","01M6ADJPMYWG1E5GM1FWBE3128",35990,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\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],"Shodan","analysis","performing ip reputation analysis with shodan","cybersecurity","threat intelligence","vulnerabilities","triage","services","threat-intelligence","enrichment","reconnaissance","ip-reputation","vulnerability","api","internet-scanning","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":52,"author":54,"domain":35,"license":15,"version":55,"nist_csf":56,"subdomain":40,"description":7,"mitre_attack":61},[53,43,41,40,42,44,45,46],"shodan","mahipal","1.0",[57,58,59,60],"ID.RA-01","ID.RA-05","DE.CM-01","DE.AE-02",[62,63,64,65,66],"T1591","T1592","T1593","T1589","T1595","main","54a798831d2266a3ca61ce68a7acb80b81160d57","skills\u002Fperforming-ip-reputation-analysis-with-shodan",4395,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills","https:\u002F\u002Fmahipal.engineer\u002FAnthropic-Cybersecurity-Skills\u002F","https:\u002F\u002Fgithub.com\u002Fmukul975","Mahipal.engineer","🔐 Cybersecurity | 💻 Dev | 📷 Street Photographer\r\n🎓 MSc | 📚 Research & AI Security","2026-08-31 12:32:44",{"source":8,"skillName":5,"commands":78,"prompt":88,"zipAvailable":89},[79,82,85],{"tool":80,"command":81},"npx","npx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill performing-ip-reputation-analysis-with-shodan",{"tool":83,"command":84},"bunx","bunx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill performing-ip-reputation-analysis-with-shodan",{"tool":86,"command":87},"pnpm","pnpm dlx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill performing-ip-reputation-analysis-with-shodan","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fperforming-ip-reputation-analysis-with-shodan\u002FSKILL.md",true,[91,96,102,108],{"path":92,"resourceType":92,"resourceTypeDesc":93,"sizeBytes":94,"sourceHtmlUrl":95},"LICENSE","许可证",11255,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fperforming-ip-reputation-analysis-with-shodan\u002FLICENSE",{"path":97,"resourceType":98,"resourceTypeDesc":99,"sizeBytes":100,"sourceHtmlUrl":101},"references\u002Fapi-reference.md","REFERENCE","参考文档",1157,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fperforming-ip-reputation-analysis-with-shodan\u002Freferences\u002Fapi-reference.md",{"path":103,"resourceType":104,"resourceTypeDesc":105,"sizeBytes":106,"sourceHtmlUrl":107},"scripts\u002Fagent.py","SCRIPT","脚本",4260,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fperforming-ip-reputation-analysis-with-shodan\u002Fscripts\u002Fagent.py",{"path":109,"resourceType":104,"resourceTypeDesc":105,"sizeBytes":110,"sourceHtmlUrl":111},"scripts\u002Fcollect_repro.py",26983,"https:\u002F\u002Fgithub.com\u002Fjleechanorg\u002Fjleechan-skills\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frepro-developer\u002Fscripts\u002Fcollect_repro.py",[113,140,164,192,218,242],{"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":15,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":120,"publishedAt":47},"01M6AGDM3HJXTKXX15ZZ0ZVCJ3","verifying-build-provenance-with-slsa-sigstore","Verifies artifact signatures and SLSA provenance using Sigstore's cosign (verify, verify-attestation, verify-blob-attestation) and slsa-verifier (verify-artifact), enforcing keyless OIDC builder identity and source repo against SLSA Build levels. Use in CI\u002FCD before deploying artifacts, when consuming third-party attestations, establishing a SLSA Build L3 pipeline, or confirming provenance during incident response or admission control.","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fverifying-build-provenance-with-slsa-sigstore\u002FSKILL.md",[119],{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},[121,122,123,124,125,35,126,127,128,129,130,131,132,133,134,135,136,137,138,139],"sigstore","provenance","slsa","verifying build provenance with slsa sigstore","security","incident response","identity","pr","code","artifacts","ci","supply-chain","pipeline","supply-chain-security","t1195","attestation","code-signing","cosign","keyless",{"skillNo":141,"name":142,"nameZh":6,"description":143,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":144,"categories":145,"keywords":147,"publishedAt":47},"01M6AGDGBPWYVZ2F11GFKJ4HZ9","validating-tpm-measured-boot-attestation","Verifies TPM 2.0 measured-boot integrity and remote attestation with tpm2-tools -- reading PCRs (tpm2_pcrread), replaying the boot event log, generating and checking signed quotes (tpm2_quote\u002Ftpm2_checkquote), and sealing secrets to a PCR policy. Use to confirm a system booted trusted firmware\u002Fkernel for Zero Trust device posture, detect boot-chain tampering via PCR drift, or build a golden-value baseline for fleet attestation.","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fvalidating-tpm-measured-boot-attestation\u002FSKILL.md",[146],{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},[148,136,149,150,125,151,35,128,152,153,154,155,156,157,158,159,160,161,162,163],"boot","TPM","validating tpm measured boot attestation","policy","verification","ZeRO","firmware","Tools","measured-boot","PCR","integrity","secrets","remote-attestation","tpm2-tools","integrity-verification","trusted-computing",{"skillNo":165,"name":166,"nameZh":6,"description":167,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":168,"categories":169,"keywords":174,"publishedAt":47},"01M6AGDCW0Y4FXZ3362GT1941M","validating-backup-integrity-for-recovery","Validates backup integrity through cryptographic hash verification, automated restore testing, corruption detection, and recoverability checks to confirm backups are reliable for disaster recovery and ransomware response. Use before relying on backups for recovery, when building post-backup validation pipelines, auditing backup infrastructure for compliance, or checking immutable\u002Fair-gapped backups for silent corruption or tampering.","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fvalidating-backup-integrity-for-recovery\u002FSKILL.md",[170,173],{"categoryNo":171,"categoryName":172,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},[158,175,176,177,178,35,179,180,152,181,182,183,184,185,186,187,188,189,190,191],"backup","recovery","validating backup integrity for recovery","testing","infrastructure","validation","compliance","hash-verification","incident-response","ransomware","cryptocurrency","detection","t1078","t1490","immutable","disaster-recovery","restore-testing",{"skillNo":193,"name":194,"nameZh":6,"description":195,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":196,"categories":197,"keywords":199,"publishedAt":47},"01M6AGD9GBG2KZ336AE763J3WH","triaging-windows-with-kape","Runs KAPE (Kroll Artifact Parser and Extractor) to collect targeted forensic artifacts (registry hives, $MFT, event logs, prefetch, browser data) via Targets and parse them with Modules wrapping Eric Zimmerman's EZ Tools (PECmd, MFTECmd, RECmd). Use during early incident containment\u002Ftriage when full disk imaging is impractical but a defensible, parseable Windows artifact set is needed quickly, including at-scale remote collection.","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-windows-with-kape\u002FSKILL.md",[198],{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},[200,201,202,35,203,204,205,206,207,208,209,210,211,212,213,214,155,215,216,217],"windows","kape","triaging windows with kape","registry","browser","logs","windows-forensics","dfir","mft","mftecmd","data","prefetch","eric-zimmerman","digital-forensics","SET","collection","pecmd","artifact-collection",{"skillNo":219,"name":220,"nameZh":6,"description":221,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":222,"categories":223,"keywords":225,"publishedAt":47},"01M6AGD5PW5J4EVZM958WD74ZQ","triaging-vulnerabilities-with-ssvc-framework","Triages and prioritizes vulnerabilities with CISA's Stakeholder-Specific Vulnerability Categorization (SSVC) decision tree, weighing exploitation status (via the CISA KEV catalog and FIRST EPSS API), technical impact, automatability, and mission prevalence to output Track\u002FTrack*\u002FAttend\u002FAct decisions. Use when prioritizing vulnerability scan results (OpenVAS, Nessus, Qualys) for remediation planning beyond raw CVSS scores.","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-vulnerabilities-with-ssvc-framework\u002FSKILL.md",[224],{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},[37,226,227,35,228,229,230,231,232,233,234,235,236,237,238,44,45,239,240,241],"framework","triaging vulnerabilities with ssvc framework","status","planning","CISA","vulnerability-management","risk-management","nessus","qualys","openvas","cvss","remediation","risk","prioritization","ssvc","decision-tree",{"skillNo":243,"name":244,"nameZh":6,"description":245,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":246,"categories":247,"keywords":249,"publishedAt":47},"01M6AGD24TTQQM4CXG69E3B9TJ","triaging-security-incident","Performs initial triage of security incidents using the NIST SP 800-61r3 and SANS PICERL frameworks, classifying incident type, assigning priority by business impact, and routing to the appropriate response team. Use when a SIEM\u002FEDR alert needs human classification, concurrent alerts must be prioritized, or a user report or threat-intel IOC match requires initial incident categorization.","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-security-incident\u002FSKILL.md",[248],{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},[125,250,35,251,252,253,254,255,256,257,258,187,259,188,33,260,261,262,263,264],"triaging security incident","siem","file","ioc","soc","NIST-800-61","NIST","severity","edr","execution","classification","severity-classification","incident-triage","SANS-PICERL","SOC-operations"]