[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7E5CHG1S6JZ5DF99F75FG3D":3,"skill-same:01M7E5CHG1S6JZ5DF99F75FG3D":103},{"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":65,"commitSha":66,"skillDirectory":67,"forksCount":68,"repositoryHtmlUrl":69,"repositoryHomepageUrl":6,"ownerHtmlUrl":70,"ownerBlogUrl":6,"ownerDescription":71,"updatedAt":72,"install":73,"resources":86},"01M7E5CHG1S6JZ5DF99F75FG3D","performing-ai-driven-osint-correlation",null,"Use AI\u002FLLM-based reasoning with Sherlock, theHarvester, and SpiderFoot to correlate OSINT findings—usernames, emails, social profiles, domain records, breach databases, and dark-web mentions—into unified, confidence-scored intelligence profiles with link analysis. Use when raw OSINT data from multiple sources needs merging into one target profile or resolving identity linkage across platforms.","sanjeevafk\u002Fagent-skills","sanjeevafk","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F230678117?v=4","01M7C540EFY46ETG1NNWKS5X3Q","Sanjeev","01M7C540F366J5C1D587BMKH9Q",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fcollections\u002Fcybersecurity-skills\u002Fskills\u002Fperforming-ai-driven-osint-correlation\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fcollections\u002Fcybersecurity-skills\u002Fskills\u002Fperforming-ai-driven-osint-correlation\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: performing-ai-driven-osint-correlation\ndescription: Use AI\u002FLLM-based reasoning with Sherlock, theHarvester, and SpiderFoot\n  to correlate OSINT findings—usernames, emails, social profiles, domain records,\n  breach databases, and dark-web mentions—into unified, confidence-scored intelligence\n  profiles with link analysis. Use when raw OSINT data from multiple sources needs\n  merging into one target profile or resolving identity linkage across platforms.\ndomain: cybersecurity\nsubdomain: threat-intelligence\ntags:\n- osint\n- ai-correlation\n- threat-intelligence\n- reconnaissance\n- link-analysis\n- target-profiling\n- sherlock\n- theharvester\n- spiderfoot\n- maltego\nversion: '1.0'\nauthor: juliosuas\nlicense: Apache-2.0\natlas_techniques:\n- AML.T0051\n- AML.T0054\n- AML.T0056\nnist_ai_rmf:\n- MEASURE-2.7\n- MEASURE-2.5\n- GOVERN-6.1\n- MAP-5.1\nd3fend_techniques:\n- Identifier Analysis\n- URL Analysis\n- Identifier Reputation Analysis\n- User Behavior Analysis\n- Content Validation\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\n# Performing AI-Driven OSINT Correlation\n\n## When to Use\n\n- You have collected raw OSINT data from multiple tools and sources but need to identify connections, contradictions, and patterns across them.\n- You need to build a unified intelligence profile for a target entity (person, organization, or infrastructure) from fragmented data.\n- Traditional manual correlation is too slow or error-prone for the volume of data collected.\n- You want confidence-scored assessments of identity linkage across platforms rather than simple keyword matching.\n\n## Prerequisites\n\n- Python 3.10+ with `requests`, `json`, and `csv` libraries\n- [Sherlock](https:\u002F\u002Fgithub.com\u002Fsherlock-project\u002Fsherlock) installed (`pip install sherlock-project`)\n- [theHarvester](https:\u002F\u002Fgithub.com\u002Flaramies\u002FtheHarvester) installed (`pip install theHarvester`)\n- [SpiderFoot](https:\u002F\u002Fgithub.com\u002Fsmicallef\u002Fspiderfoot) 4.0+ running on localhost:5001\n- Access to an LLM API (OpenAI, Anthropic, or local model via Ollama)\n- Optional: Maltego CE for graph visualization of correlation results\n- Optional: API keys for Shodan, VirusTotal, HaveIBeenPwned, Hunter.io\n\n## Workflow\n\n### Legal & Ethical Requirements\n\n- Obtain documented written authorization before any investigation\n- Establish lawful basis for data processing (law enforcement, corporate policy, etc.)\n- Define PII retention limits and data handling procedures\n- Comply with local privacy regulations (GDPR, CCPA, etc.)\n\n### Phase 1 — Multi-Source OSINT Collection\n\n0. **Create the working directory for all OSINT outputs:**\n\n   ```bash\n   mkdir -p \u002Ftmp\u002Fosint\n   ```\n\n1. **Enumerate usernames across platforms with Sherlock:**\n\n   ```bash\n   sherlock \"targetusername\" --output \u002Ftmp\u002Fosint\u002Fsherlock-results.txt --csv\n   ```\n\n2. **Harvest emails, subdomains, and hosts with theHarvester:**\n\n   ```bash\n   theHarvester -d targetdomain.com -b all -f \u002Ftmp\u002Fosint\u002Fharvester-results.json\n   ```\n\n3. **Run a SpiderFoot passive scan via REST API:**\n\n   ```bash\n   curl -s http:\u002F\u002Flocalhost:5001\u002Fapi\u002Fscan\u002Fstart \\\n     -d \"scanname=target-recon&scantarget=targetdomain.com&usecase=passive\" \\\n     | jq '.scanid'\n   ```\n\n4. **Export SpiderFoot results when scan completes:**\n\n   ```bash\n   SCAN_ID=\"\u003Cscanid_from_step_3>\"\n   curl -s \"http:\u002F\u002Flocalhost:5001\u002Fapi\u002Fscan\u002F${SCAN_ID}\u002Fresults?type=all\" \\\n     -o \u002Ftmp\u002Fosint\u002Fspiderfoot-results.json\n   ```\n\n5. **Query breach databases for email exposure (example with HIBP API):**\n\n   ```bash\n   curl -s -H \"hibp-api-key: ${HIBP_KEY}\" \\\n     -H \"User-Agent: OSINT-Correlation-Skill\" \\\n     \"https:\u002F\u002Fhaveibeenpwned.com\u002Fapi\u002Fv3\u002Fbreachedaccount\u002Ftarget@example.com\" \\\n     -o \u002Ftmp\u002Fosint\u002Fbreach-results.json\n   ```\n\n### Phase 2 — Data Normalization\n\n6. **Normalize all collected data into a common schema.** Create a unified JSON structure that tags each finding with its source, timestamp, and data type:\n\n   ```bash\n   cat > \u002Ftmp\u002Fosint\u002Fnormalize.py \u003C\u003C 'EOF'\n   import json, csv, sys, os\n   from datetime import datetime\n\n   findings = []\n\n   # Normalize Sherlock CSV results\n   sherlock_path = \"\u002Ftmp\u002Fosint\u002Fsherlock-results.txt\"\n   if os.path.exists(sherlock_path):\n       with open(sherlock_path) as f:\n           for row in csv.DictReader(f):\n               findings.append({\n                   \"source\": \"sherlock\",\n                   \"type\": \"social_profile\",\n                   \"platform\": row.get(\"name\", \"\"),\n                   \"url\": row.get(\"url_user\", \"\"),\n                   \"username\": row.get(\"username\", \"\"),\n                   \"status\": row.get(\"status\", \"\"),\n                   \"collected_at\": datetime.utcnow().isoformat()\n               })\n\n   # Normalize theHarvester JSON results\n   harvester_path = \"\u002Ftmp\u002Fosint\u002Fharvester-results.json\"\n   if os.path.exists(harvester_path):\n       with open(harvester_path) as f:\n           data = json.load(f)\n           for email in data.get(\"emails\", []):\n               findings.append({\n                   \"source\": \"theHarvester\",\n                   \"type\": \"email\",\n                   \"value\": email,\n                   \"collected_at\": datetime.utcnow().isoformat()\n               })\n           for host in data.get(\"hosts\", []):\n               findings.append({\n                   \"source\": \"theHarvester\",\n                   \"type\": \"hostname\",\n                   \"value\": host,\n                   \"collected_at\": datetime.utcnow().isoformat()\n               })\n\n   # Normalize SpiderFoot results\n   sf_path = \"\u002Ftmp\u002Fosint\u002Fspiderfoot-results.json\"\n   if os.path.exists(sf_path):\n       with open(sf_path) as f:\n           for item in json.load(f):\n               findings.append({\n                   \"source\": \"spiderfoot\",\n                   \"type\": item.get(\"type\", \"unknown\"),\n                   \"value\": item.get(\"data\", \"\"),\n                   \"module\": item.get(\"module\", \"\"),\n                   \"collected_at\": datetime.utcnow().isoformat()\n               })\n\n   with open(\"\u002Ftmp\u002Fosint\u002Fnormalized-findings.json\", \"w\") as f:\n       json.dump(findings, f, indent=2)\n\n   print(f\"Normalized {len(findings)} findings from {len(set(f['source'] for f in findings))} sources\")\n   EOF\n   python3 \u002Ftmp\u002Fosint\u002Fnormalize.py\n   ```\n\n### Phase 3 — AI-Driven Correlation\n\n7. **Send normalized findings to an LLM for cross-source correlation analysis:**\n\n   ```bash\n   cat > \u002Ftmp\u002Fosint\u002Fcorrelate.py \u003C\u003C 'PYEOF'\n   import json, os\n   from openai import OpenAI  # or anthropic, ollama, etc.\n\n   client = OpenAI(api_key=os.environ[\"OPENAI_API_KEY\"])\n\n   with open(\"\u002Ftmp\u002Fosint\u002Fnormalized-findings.json\") as f:\n       findings = json.load(f)\n\n   correlation_prompt = f\"\"\"You are an OSINT analyst. Analyze these findings collected\n   from multiple sources and produce a correlation report.\n\n   For each identity or entity you detect:\n   1. List all linked accounts\u002Fprofiles with the evidence connecting them.\n   2. Assign a confidence score (0.0-1.0) for each linkage based on:\n      - Exact username match across platforms (high)\n      - Similar usernames with shared metadata (medium)\n      - Same email in breach data and registration (high)\n      - Co-occurring infrastructure (IP, domain) (medium)\n      - Temporal correlation of account creation dates (low-medium)\n   3. Identify contradictions or potential false positives.\n   4. Flag high-risk exposures (breached credentials, PII leaks, infrastructure overlaps).\n   5. Produce a structured JSON report.\n\n   Raw findings:\n   {json.dumps(findings[:500], indent=2)}\n   \"\"\"\n\n   response = client.chat.completions.create(\n       model=\"gpt-4o\",\n       messages=[\n           {\"role\": \"system\", \"content\": \"You are an expert OSINT analyst specializing in identity correlation and link analysis.\"},\n           {\"role\": \"user\", \"content\": correlation_prompt}\n       ],\n       temperature=0.1,\n       response_format={\"type\": \"json_object\"}\n   )\n\n   report = json.loads(response.choices[0].message.content)\n\n   with open(\"\u002Ftmp\u002Fosint\u002Fcorrelation-report.json\", \"w\") as f:\n       json.dump(report, f, indent=2)\n\n   print(json.dumps(report, indent=2))\n   PYEOF\n   python3 \u002Ftmp\u002Fosint\u002Fcorrelate.py\n   ```\n\n8. **Perform entity resolution — deduplicate and merge related identities:**\n\n   ```bash\n   cat > \u002Ftmp\u002Fosint\u002Fresolve.py \u003C\u003C 'PYEOF'\n   import json\n\n   with open(\"\u002Ftmp\u002Fosint\u002Fcorrelation-report.json\") as f:\n       report = json.load(f)\n\n   # Extract entities and build a link graph\n   entities = report.get(\"entities\", [])\n   print(f\"Identified {len(entities)} distinct entities\")\n   for entity in entities:\n       name = entity.get(\"identifier\", \"unknown\")\n       confidence = entity.get(\"confidence\", 0)\n       links = entity.get(\"linked_accounts\", [])\n       risk = entity.get(\"risk_level\", \"unknown\")\n       print(f\"  [{confidence:.0%}] {name} — {len(links)} linked accounts — risk: {risk}\")\n   PYEOF\n   python3 \u002Ftmp\u002Fosint\u002Fresolve.py\n   ```\n\n### Phase 4 — Reporting and Visualization\n\n9. **Generate a final intelligence profile in Markdown:**\n\n   ```bash\n   cat > \u002Ftmp\u002Fosint\u002Freport.py \u003C\u003C 'PYEOF'\n   import json\n   from datetime import datetime\n\n   with open(\"\u002Ftmp\u002Fosint\u002Fcorrelation-report.json\") as f:\n       report = json.load(f)\n\n   md = f\"# OSINT Correlation Report\\n\\n\"\n   md += f\"**Generated:** {datetime.utcnow().isoformat()}Z\\n\\n\"\n   md += \"## Entity Profiles\\n\\n\"\n\n   for entity in report.get(\"entities\", []):\n       eid = entity.get(\"identifier\", \"Unknown\")\n       conf = entity.get(\"confidence\", 0)\n       md += f\"### {eid} (Confidence: {conf:.0%})\\n\\n\"\n       md += \"| Source | Platform | Evidence |\\n|--------|----------|----------|\\n\"\n       for link in entity.get(\"linked_accounts\", []):\n           md += f\"| {link.get('source','')} | {link.get('platform','')} | {link.get('evidence','')} |\\n\"\n       md += f\"\\n**Risk Level:** {entity.get('risk_level', 'N\u002FA')}\\n\\n\"\n       for flag in entity.get(\"flags\", []):\n           md += f\"- ⚠️ {flag}\\n\"\n       md += \"\\n\"\n\n   with open(\"\u002Ftmp\u002Fosint\u002Fintelligence-profile.md\", \"w\") as f:\n       f.write(md)\n\n   print(\"Report written to \u002Ftmp\u002Fosint\u002Fintelligence-profile.md\")\n   PYEOF\n   python3 \u002Ftmp\u002Fosint\u002Freport.py\n   ```\n\n10. **Optional — Import correlation graph into Maltego for visualization:**\n\n    ```bash\n    # Export entities as Maltego-compatible CSV for manual import\n    cat > \u002Ftmp\u002Fosint\u002Fmaltego_export.py \u003C\u003C 'PYEOF'\n    import json, csv\n\n    with open(\"\u002Ftmp\u002Fosint\u002Fcorrelation-report.json\") as f:\n        report = json.load(f)\n\n    with open(\"\u002Ftmp\u002Fosint\u002Fmaltego-import.csv\", \"w\", newline=\"\") as f:\n        writer = csv.writer(f)\n        writer.writerow([\"Entity Type\", \"Value\", \"Linked To\", \"Link Label\", \"Confidence\"])\n        for entity in report.get(\"entities\", []):\n            for link in entity.get(\"linked_accounts\", []):\n                writer.writerow([\n                    link.get(\"type\", \"Alias\"),\n                    link.get(\"value\", \"\"),\n                    entity.get(\"identifier\", \"\"),\n                    link.get(\"evidence\", \"\"),\n                    link.get(\"confidence\", \"\")\n                ])\n\n    print(\"Maltego CSV exported to \u002Ftmp\u002Fosint\u002Fmaltego-import.csv\")\n    PYEOF\n    python3 \u002Ftmp\u002Fosint\u002Fmaltego_export.py\n    ```\n\n## Key Concepts\n\n| Concept | Description |\n|---------|-------------|\n| Cross-Source Correlation | Matching identifiers (usernames, emails, IPs) across independent OSINT sources to establish entity linkage |\n| Confidence Scoring | Assigning probabilistic confidence (0.0–1.0) to each linkage based on evidence strength and corroboration |\n| Entity Resolution | Deduplicating and merging records that refer to the same real-world entity across fragmented datasets |\n| False Positive Detection | Using AI reasoning to identify coincidental matches versus genuine identity links |\n| Multi-Vector Intelligence | Combining findings from social media, DNS, breach data, and infrastructure into a single threat picture |\n| Link Analysis | Graph-based examination of relationships between entities, accounts, and infrastructure |\n\n## Tools & Systems\n\n| Tool | Role in Workflow |\n|------|-----------------|\n| Sherlock | Username enumeration across 400+ social platforms |\n| theHarvester | Email, subdomain, and host discovery from public sources |\n| SpiderFoot | Automated OSINT collection across 200+ modules |\n| Maltego | Graph-based visualization of entity relationships |\n| LLM API (GPT-4, Claude, Ollama) | Cross-source reasoning, pattern detection, and confidence scoring |\n| HaveIBeenPwned | Breach exposure and credential leak detection |\n\n## Common Scenarios\n\n- **Threat Actor Attribution:** Correlate a suspicious username found in a phishing campaign with social media profiles, domain registrations, and breach data to build an attribution profile.\n- **Attack Surface Mapping:** Link discovered subdomains, emails, and employee social accounts to understand an organization's full external exposure.\n- **Insider Threat Investigation:** Cross-reference an employee's known accounts with dark web marketplace activity and breach databases.\n- **Brand Impersonation Detection:** Identify accounts across platforms mimicking a target brand by correlating registration patterns, naming conventions, and temporal signals.\n\n## Output Format\n\nThe final output is a structured JSON correlation report and a Markdown intelligence profile containing:\n\n```json\n{\n  \"meta\": {\n    \"target\": \"targetdomain.com\",\n    \"sources_used\": [\"sherlock\", \"theHarvester\", \"spiderfoot\", \"hibp\"],\n    \"total_findings\": 247,\n    \"generated_at\": \"2025-01-15T14:30:00Z\"\n  },\n  \"entities\": [\n    {\n      \"identifier\": \"john.target\",\n      \"confidence\": 0.92,\n      \"linked_accounts\": [\n        {\n          \"source\": \"sherlock\",\n          \"platform\": \"GitHub\",\n          \"value\": \"john.target\",\n          \"evidence\": \"Exact username match, bio references targetdomain.com\",\n          \"confidence\": 0.95\n        }\n      ],\n      \"risk_level\": \"high\",\n      \"flags\": [\n        \"Credentials exposed in 2 breaches (2022, 2023)\",\n        \"Admin email for targetdomain.com found in public WHOIS\"\n      ]\n    }\n  ],\n  \"contradictions\": [],\n  \"recommendations\": []\n}\n```\n\n## Verification\n\n- Confirm that each linked account has been independently verified against at least two sources before assigning confidence > 0.8.\n- Cross-check AI-generated correlations manually for a random sample (10–20%) to validate accuracy.\n- Verify that no false positives from common usernames (e.g., \"admin\", \"test\") inflated entity profiles.\n- Ensure breach data timestamps are current and from reputable aggregators.\n- Validate that the final report does not include stale or retracted OSINT data.\n","# Performing AI-Driven OSINT Correlation\n\n## When to Use\n\n- You have collected raw OSINT data from multiple tools and sources but need to identify connections, contradictions, and patterns across them.\n- You need to build a unified intelligence profile for a target entity (person, organization, or infrastructure) from fragmented data.\n- Traditional manual correlation is too slow or error-prone for the volume of data collected.\n- You want confidence-scored assessments of identity linkage across platforms rather than simple keyword matching.\n\n## Prerequisites\n\n- Python 3.10+ with `requests`, `json`, and `csv` libraries\n- [Sherlock](https:\u002F\u002Fgithub.com\u002Fsherlock-project\u002Fsherlock) installed (`pip install sherlock-project`)\n- [theHarvester](https:\u002F\u002Fgithub.com\u002Flaramies\u002FtheHarvester) installed (`pip install theHarvester`)\n- [SpiderFoot](https:\u002F\u002Fgithub.com\u002Fsmicallef\u002Fspiderfoot) 4.0+ running on localhost:5001\n- Access to an LLM API (OpenAI, Anthropic, or local model via Ollama)\n- Optional: Maltego CE for graph visualization of correlation results\n- Optional: API keys for Shodan, VirusTotal, HaveIBeenPwned, Hunter.io\n\n## Workflow\n\n### Legal & Ethical Requirements\n\n- Obtain documented written authorization before any investigation\n- Establish lawful basis for data processing (law enforcement, corporate policy, etc.)\n- Define PII retention limits and data handling procedures\n- Comply with local privacy regulations (GDPR, CCPA, etc.)\n\n### Phase 1 — Multi-Source OSINT Collection\n\n0. **Create the working directory for all OSINT outputs:**\n\n   ```bash\n   mkdir -p \u002Ftmp\u002Fosint\n   ```\n\n1. **Enumerate usernames across platforms with Sherlock:**\n\n   ```bash\n   sherlock \"targetusername\" --output \u002Ftmp\u002Fosint\u002Fsherlock-results.txt --csv\n   ```\n\n2. **Harvest emails, subdomains, and hosts with theHarvester:**\n\n   ```bash\n   theHarvester -d targetdomain.com -b all -f \u002Ftmp\u002Fosint\u002Fharvester-results.json\n   ```\n\n3. **Run a SpiderFoot passive scan via REST API:**\n\n   ```bash\n   curl -s http:\u002F\u002Flocalhost:5001\u002Fapi\u002Fscan\u002Fstart \\\n     -d \"scanname=target-recon&scantarget=targetdomain.com&usecase=passive\" \\\n     | jq '.scanid'\n   ```\n\n4. **Export SpiderFoot results when scan completes:**\n\n   ```bash\n   SCAN_ID=\"\u003Cscanid_from_step_3>\"\n   curl -s \"http:\u002F\u002Flocalhost:5001\u002Fapi\u002Fscan\u002F${SCAN_ID}\u002Fresults?type=all\" \\\n     -o \u002Ftmp\u002Fosint\u002Fspiderfoot-results.json\n   ```\n\n5. **Query breach databases for email exposure (example with HIBP API):**\n\n   ```bash\n   curl -s -H \"hibp-api-key: ${HIBP_KEY}\" \\\n     -H \"User-Agent: OSINT-Correlation-Skill\" \\\n     \"https:\u002F\u002Fhaveibeenpwned.com\u002Fapi\u002Fv3\u002Fbreachedaccount\u002Ftarget@example.com\" \\\n     -o \u002Ftmp\u002Fosint\u002Fbreach-results.json\n   ```\n\n### Phase 2 — Data Normalization\n\n6. **Normalize all collected data into a common schema.** Create a unified JSON structure that tags each finding with its source, timestamp, and data type:\n\n   ```bash\n   cat > \u002Ftmp\u002Fosint\u002Fnormalize.py \u003C\u003C 'EOF'\n   import json, csv, sys, os\n   from datetime import datetime\n\n   findings = []\n\n   # Normalize Sherlock CSV results\n   sherlock_path = \"\u002Ftmp\u002Fosint\u002Fsherlock-results.txt\"\n   if os.path.exists(sherlock_path):\n       with open(sherlock_path) as f:\n           for row in csv.DictReader(f):\n               findings.append({\n                   \"source\": \"sherlock\",\n                   \"type\": \"social_profile\",\n                   \"platform\": row.get(\"name\", \"\"),\n                   \"url\": row.get(\"url_user\", \"\"),\n                   \"username\": row.get(\"username\", \"\"),\n                   \"status\": row.get(\"status\", \"\"),\n                   \"collected_at\": datetime.utcnow().isoformat()\n               })\n\n   # Normalize theHarvester JSON results\n   harvester_path = \"\u002Ftmp\u002Fosint\u002Fharvester-results.json\"\n   if os.path.exists(harvester_path):\n       with open(harvester_path) as f:\n           data = json.load(f)\n           for email in data.get(\"emails\", []):\n               findings.append({\n                   \"source\": \"theHarvester\",\n                   \"type\": \"email\",\n                   \"value\": email,\n                   \"collected_at\": datetime.utcnow().isoformat()\n               })\n           for host in data.get(\"hosts\", []):\n               findings.append({\n                   \"source\": \"theHarvester\",\n                   \"type\": \"hostname\",\n                   \"value\": host,\n                   \"collected_at\": datetime.utcnow().isoformat()\n               })\n\n   # Normalize SpiderFoot results\n   sf_path = \"\u002Ftmp\u002Fosint\u002Fspiderfoot-results.json\"\n   if os.path.exists(sf_path):\n       with open(sf_path) as f:\n           for item in json.load(f):\n               findings.append({\n                   \"source\": \"spiderfoot\",\n                   \"type\": item.get(\"type\", \"unknown\"),\n                   \"value\": item.get(\"data\", \"\"),\n                   \"module\": item.get(\"module\", \"\"),\n                   \"collected_at\": datetime.utcnow().isoformat()\n               })\n\n   with open(\"\u002Ftmp\u002Fosint\u002Fnormalized-findings.json\", \"w\") as f:\n       json.dump(findings, f, indent=2)\n\n   print(f\"Normalized {len(findings)} findings from {len(set(f['source'] for f in findings))} sources\")\n   EOF\n   python3 \u002Ftmp\u002Fosint\u002Fnormalize.py\n   ```\n\n### Phase 3 — AI-Driven Correlation\n\n7. **Send normalized findings to an LLM for cross-source correlation analysis:**\n\n   ```bash\n   cat > \u002Ftmp\u002Fosint\u002Fcorrelate.py \u003C\u003C 'PYEOF'\n   import json, os\n   from openai import OpenAI  # or anthropic, ollama, etc.\n\n   client = OpenAI(api_key=os.environ[\"OPENAI_API_KEY\"])\n\n   with open(\"\u002Ftmp\u002Fosint\u002Fnormalized-findings.json\") as f:\n       findings = json.load(f)\n\n   correlation_prompt = f\"\"\"You are an OSINT analyst. Analyze these findings collected\n   from multiple sources and produce a correlation report.\n\n   For each identity or entity you detect:\n   1. List all linked accounts\u002Fprofiles with the evidence connecting them.\n   2. Assign a confidence score (0.0-1.0) for each linkage based on:\n      - Exact username match across platforms (high)\n      - Similar usernames with shared metadata (medium)\n      - Same email in breach data and registration (high)\n      - Co-occurring infrastructure (IP, domain) (medium)\n      - Temporal correlation of account creation dates (low-medium)\n   3. Identify contradictions or potential false positives.\n   4. Flag high-risk exposures (breached credentials, PII leaks, infrastructure overlaps).\n   5. Produce a structured JSON report.\n\n   Raw findings:\n   {json.dumps(findings[:500], indent=2)}\n   \"\"\"\n\n   response = client.chat.completions.create(\n       model=\"gpt-4o\",\n       messages=[\n           {\"role\": \"system\", \"content\": \"You are an expert OSINT analyst specializing in identity correlation and link analysis.\"},\n           {\"role\": \"user\", \"content\": correlation_prompt}\n       ],\n       temperature=0.1,\n       response_format={\"type\": \"json_object\"}\n   )\n\n   report = json.loads(response.choices[0].message.content)\n\n   with open(\"\u002Ftmp\u002Fosint\u002Fcorrelation-report.json\", \"w\") as f:\n       json.dump(report, f, indent=2)\n\n   print(json.dumps(report, indent=2))\n   PYEOF\n   python3 \u002Ftmp\u002Fosint\u002Fcorrelate.py\n   ```\n\n8. **Perform entity resolution — deduplicate and merge related identities:**\n\n   ```bash\n   cat > \u002Ftmp\u002Fosint\u002Fresolve.py \u003C\u003C 'PYEOF'\n   import json\n\n   with open(\"\u002Ftmp\u002Fosint\u002Fcorrelation-report.json\") as f:\n       report = json.load(f)\n\n   # Extract entities and build a link graph\n   entities = report.get(\"entities\", [])\n   print(f\"Identified {len(entities)} distinct entities\")\n   for entity in entities:\n       name = entity.get(\"identifier\", \"unknown\")\n       confidence = entity.get(\"confidence\", 0)\n       links = entity.get(\"linked_accounts\", [])\n       risk = entity.get(\"risk_level\", \"unknown\")\n       print(f\"  [{confidence:.0%}] {name} — {len(links)} linked accounts — risk: {risk}\")\n   PYEOF\n   python3 \u002Ftmp\u002Fosint\u002Fresolve.py\n   ```\n\n### Phase 4 — Reporting and Visualization\n\n9. **Generate a final intelligence profile in Markdown:**\n\n   ```bash\n   cat > \u002Ftmp\u002Fosint\u002Freport.py \u003C\u003C 'PYEOF'\n   import json\n   from datetime import datetime\n\n   with open(\"\u002Ftmp\u002Fosint\u002Fcorrelation-report.json\") as f:\n       report = json.load(f)\n\n   md = f\"# OSINT Correlation Report\\n\\n\"\n   md += f\"**Generated:** {datetime.utcnow().isoformat()}Z\\n\\n\"\n   md += \"## Entity Profiles\\n\\n\"\n\n   for entity in report.get(\"entities\", []):\n       eid = entity.get(\"identifier\", \"Unknown\")\n       conf = entity.get(\"confidence\", 0)\n       md += f\"### {eid} (Confidence: {conf:.0%})\\n\\n\"\n       md += \"| Source | Platform | Evidence |\\n|--------|----------|----------|\\n\"\n       for link in entity.get(\"linked_accounts\", []):\n           md += f\"| {link.get('source','')} | {link.get('platform','')} | {link.get('evidence','')} |\\n\"\n       md += f\"\\n**Risk Level:** {entity.get('risk_level', 'N\u002FA')}\\n\\n\"\n       for flag in entity.get(\"flags\", []):\n           md += f\"- ⚠️ {flag}\\n\"\n       md += \"\\n\"\n\n   with open(\"\u002Ftmp\u002Fosint\u002Fintelligence-profile.md\", \"w\") as f:\n       f.write(md)\n\n   print(\"Report written to \u002Ftmp\u002Fosint\u002Fintelligence-profile.md\")\n   PYEOF\n   python3 \u002Ftmp\u002Fosint\u002Freport.py\n   ```\n\n10. **Optional — Import correlation graph into Maltego for visualization:**\n\n    ```bash\n    # Export entities as Maltego-compatible CSV for manual import\n    cat > \u002Ftmp\u002Fosint\u002Fmaltego_export.py \u003C\u003C 'PYEOF'\n    import json, csv\n\n    with open(\"\u002Ftmp\u002Fosint\u002Fcorrelation-report.json\") as f:\n        report = json.load(f)\n\n    with open(\"\u002Ftmp\u002Fosint\u002Fmaltego-import.csv\", \"w\", newline=\"\") as f:\n        writer = csv.writer(f)\n        writer.writerow([\"Entity Type\", \"Value\", \"Linked To\", \"Link Label\", \"Confidence\"])\n        for entity in report.get(\"entities\", []):\n            for link in entity.get(\"linked_accounts\", []):\n                writer.writerow([\n                    link.get(\"type\", \"Alias\"),\n                    link.get(\"value\", \"\"),\n                    entity.get(\"identifier\", \"\"),\n                    link.get(\"evidence\", \"\"),\n                    link.get(\"confidence\", \"\")\n                ])\n\n    print(\"Maltego CSV exported to \u002Ftmp\u002Fosint\u002Fmaltego-import.csv\")\n    PYEOF\n    python3 \u002Ftmp\u002Fosint\u002Fmaltego_export.py\n    ```\n\n## Key Concepts\n\n| Concept | Description |\n|---------|-------------|\n| Cross-Source Correlation | Matching identifiers (usernames, emails, IPs) across independent OSINT sources to establish entity linkage |\n| Confidence Scoring | Assigning probabilistic confidence (0.0–1.0) to each linkage based on evidence strength and corroboration |\n| Entity Resolution | Deduplicating and merging records that refer to the same real-world entity across fragmented datasets |\n| False Positive Detection | Using AI reasoning to identify coincidental matches versus genuine identity links |\n| Multi-Vector Intelligence | Combining findings from social media, DNS, breach data, and infrastructure into a single threat picture |\n| Link Analysis | Graph-based examination of relationships between entities, accounts, and infrastructure |\n\n## Tools & Systems\n\n| Tool | Role in Workflow |\n|------|-----------------|\n| Sherlock | Username enumeration across 400+ social platforms |\n| theHarvester | Email, subdomain, and host discovery from public sources |\n| SpiderFoot | Automated OSINT collection across 200+ modules |\n| Maltego | Graph-based visualization of entity relationships |\n| LLM API (GPT-4, Claude, Ollama) | Cross-source reasoning, pattern detection, and confidence scoring |\n| HaveIBeenPwned | Breach exposure and credential leak detection |\n\n## Common Scenarios\n\n- **Threat Actor Attribution:** Correlate a suspicious username found in a phishing campaign with social media profiles, domain registrations, and breach data to build an attribution profile.\n- **Attack Surface Mapping:** Link discovered subdomains, emails, and employee social accounts to understand an organization's full external exposure.\n- **Insider Threat Investigation:** Cross-reference an employee's known accounts with dark web marketplace activity and breach databases.\n- **Brand Impersonation Detection:** Identify accounts across platforms mimicking a target brand by correlating registration patterns, naming conventions, and temporal signals.\n\n## Output Format\n\nThe final output is a structured JSON correlation report and a Markdown intelligence profile containing:\n\n```json\n{\n  \"meta\": {\n    \"target\": \"targetdomain.com\",\n    \"sources_used\": [\"sherlock\", \"theHarvester\", \"spiderfoot\", \"hibp\"],\n    \"total_findings\": 247,\n    \"generated_at\": \"2025-01-15T14:30:00Z\"\n  },\n  \"entities\": [\n    {\n      \"identifier\": \"john.target\",\n      \"confidence\": 0.92,\n      \"linked_accounts\": [\n        {\n          \"source\": \"sherlock\",\n          \"platform\": \"GitHub\",\n          \"value\": \"john.target\",\n          \"evidence\": \"Exact username match, bio references targetdomain.com\",\n          \"confidence\": 0.95\n        }\n      ],\n      \"risk_level\": \"high\",\n      \"flags\": [\n        \"Credentials exposed in 2 breaches (2022, 2023)\",\n        \"Admin email for targetdomain.com found in public WHOIS\"\n      ]\n    }\n  ],\n  \"contradictions\": [],\n  \"recommendations\": []\n}\n```\n\n## Verification\n\n- Confirm that each linked account has been independently verified against at least two sources before assigning confidence > 0.8.\n- Cross-check AI-generated correlations manually for a random sample (10–20%) to validate accuracy.\n- Verify that no false positives from common usernames (e.g., \"admin\", \"test\") inflated entity profiles.\n- Ensure breach data timestamps are current and from reputable aggregators.\n- Validate that the final report does not include stale or retracted OSINT data.\n",{"name":5,"tags":25,"author":36,"domain":37,"license":15,"version":38,"nist_csf":39,"subdomain":28,"description":7,"nist_ai_rmf":44,"mitre_attack":49,"atlas_techniques":55,"d3fend_techniques":59},[26,27,28,29,30,31,32,33,34,35],"osint","ai-correlation","threat-intelligence","reconnaissance","link-analysis","target-profiling","sherlock","theharvester","spiderfoot","maltego","juliosuas","cybersecurity","1.0",[40,41,42,43],"ID.RA-01","ID.RA-05","DE.CM-01","DE.AE-02",[45,46,47,48],"MEASURE-2.7","MEASURE-2.5","GOVERN-6.1","MAP-5.1",[50,51,52,53,54],"T1591","T1592","T1593","T1589","T1595",[56,57,58],"AML.T0051","AML.T0054","AML.T0056",[60,61,62,63,64],"Identifier Analysis","URL Analysis","Identifier Reputation Analysis","User Behavior Analysis","Content Validation","main","4e084e84eb42fc53e144c89c0f7f48b39c8a4b0f","collections\u002Fcybersecurity-skills\u002Fskills\u002Fperforming-ai-driven-osint-correlation",1,"https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills","https:\u002F\u002Fgithub.com\u002Fsanjeevafk","First make it work. Then make it right. Then make it fast.","2026-11-14 13:36:16",{"source":8,"skillName":5,"commands":74,"prompt":84,"zipAvailable":85},[75,78,81],{"tool":76,"command":77},"npx","npx skills add sanjeevafk\u002Fagent-skills --skill performing-ai-driven-osint-correlation",{"tool":79,"command":80},"bunx","bunx skills add sanjeevafk\u002Fagent-skills --skill performing-ai-driven-osint-correlation",{"tool":82,"command":83},"pnpm","pnpm dlx skills add sanjeevafk\u002Fagent-skills --skill performing-ai-driven-osint-correlation","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fcollections\u002Fcybersecurity-skills\u002Fskills\u002Fperforming-ai-driven-osint-correlation\u002FSKILL.md",true,[87,91,97],{"path":88,"resourceType":88,"resourceTypeDesc":89,"sizeBytes":90,"sourceHtmlUrl":16},"LICENSE","许可证",11255,{"path":92,"resourceType":93,"resourceTypeDesc":94,"sizeBytes":95,"sourceHtmlUrl":96},"references\u002Fapi-reference.md","REFERENCE","参考文档",5068,"https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fcollections\u002Fcybersecurity-skills\u002Fskills\u002Fperforming-ai-driven-osint-correlation\u002Freferences\u002Fapi-reference.md",{"path":98,"resourceType":99,"resourceTypeDesc":100,"sizeBytes":101,"sourceHtmlUrl":102},"scripts\u002Fagent.py","SCRIPT","脚本",15667,"https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fcollections\u002Fcybersecurity-skills\u002Fskills\u002Fperforming-ai-driven-osint-correlation\u002Fscripts\u002Fagent.py",[104,112,120,128,136,143],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":108,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":20},"01M7EFHX67M3KKXT1BXVPA5ADT","zarr-python","Chunked N-D arrays for cloud storage (Zarr-Python 3). Compressed arrays, parallel I\u002FO, S3\u002FGCS via fsspec, NumPy\u002FDask\u002FXarray compatible, for large-scale scientific computing pipelines.","MIT","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzarr-python\u002FSKILL.md",[],[],{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":108,"licenseFileUrl":116,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":20},"01M7EFFQGM51TZBGRENXY50ZYM","whiteboard-diagrams","Create accurate, simple, hand-drawn whiteboard diagrams from a user's process, system, architecture, learning workflow, comparison, or causal explanation. Use when the user asks for a scribbly whiteboard visual, educational workflow graphic, hand-drawn explainer, or diagram like the bundled reference; ask one focused clarification question when the subject or relationships are missing, then generate and visually verify the final image.","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwhiteboard-diagrams\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwhiteboard-diagrams\u002FSKILL.md",[],[],{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":124,"sourceHtmlUrl":125,"categories":126,"keywords":127,"publishedAt":20},"01M7EFF1CSQNTDMHFK4ZGY6NYK","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwebapp-testing\u002FSKILL.md",[],[],{"skillNo":129,"name":130,"nameZh":6,"description":131,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":132,"sourceHtmlUrl":133,"categories":134,"keywords":135,"publishedAt":20},"01M7EFE8106X6C28FT8PA74427","web-artifacts-builder","Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn\u002Fui). Use for complex artifacts requiring state management, routing, or shadcn\u002Fui components - not for simple single-file HTML\u002FJSX artifacts.","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fweb-artifacts-builder\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fweb-artifacts-builder\u002FSKILL.md",[],[],{"skillNo":137,"name":138,"nameZh":6,"description":139,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":108,"licenseFileUrl":6,"sourceHtmlUrl":140,"categories":141,"keywords":142,"publishedAt":20},"01M7EFCSNZM9G7ZHS6F127Q71X","verification-loop","A comprehensive verification system for Claude Code sessions.","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fverification-loop\u002FSKILL.md",[],[],{"skillNo":144,"name":145,"nameZh":6,"description":146,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":108,"licenseFileUrl":147,"sourceHtmlUrl":148,"categories":149,"keywords":150,"publishedAt":20},"01M7EFCE7EZMKPRYDDNKBQ9EEH","vercel-deploy","Deploy applications and websites to Vercel. Use when the user requests deployment actions like \"deploy my app\", \"deploy and give me the link\", \"push this live\", or \"create a preview deployment\".","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fvercel-deploy\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fsanjeevafk\u002Fagent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fvercel-deploy\u002FSKILL.md",[],[]]