Skip to content
Back to search

OpenOSINT

AI-powered OSINT agent with interactive REPL, MCP server, and CLI. 20 tools. Works with Claude, GPT-4, or local models. For authorized security research only.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/OpenOSINT/OpenOSINT with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/OpenOSINT/OpenOSINT'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/openosint--openosint/badge.svg)](/listings/openosint--openosint)

HTML

<a href="/listings/openosint--openosint"><img src="/api/listings/openosint--openosint/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Needs [`uv`](https://docs.astral.sh/uv/). No API keys for the default flow.

**Claude Code plugin** (skills plus a passive MCP server):

/plugin marketplace add OpenOSINT/OpenOSINT
/plugin install openosint@openosint
/openosint:osint example.com

**Any agent** (Codex, Gemini CLI, Cursor and other Agent Skills clients):

npx skills add OpenOSINT/OpenOSINT

**MCP server or pip** ([other clients](https://openosint.tech/docs/mcp/)):

claude mcp add openosint -- uvx --from openosint openosint-mcp
pip install openosint && openosint exposure example.com

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/marketplace.json · Manifest · 15 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. {
  2. "name": "openosint",
  3. "owner": {
  4. "name": "OpenOSINT",
  5. "url": "https://github.com/OpenOSINT"
  6. },
  7. "description": "OpenOSINT: passive OSINT and exposure checks for Claude Code.",
  8. "plugins": [
  9. {
  10. "name": "openosint",
  11. "source": "./",
  12. "description": "Skills /osint and /exposure plus the OpenOSINT MCP server (passive by default, no API keys needed)."
  13. }
  14. ]
  15. }
README.md · README · 186 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. <!-- mcp-name: io.github.OpenOSINT/openosint -->
  2. <div align="center">
  3. <img src="https://raw.githubusercontent.com/OpenOSINT/OpenOSINT/main/docs/assets/logo.svg" alt="OpenOSINT" width="270">
  4. <p><strong>OpenOSINT is an open-source OSINT agent for investigators and security researchers: 21 public-source tools behind a natural-language interface, with an MCP server.</strong></p>
  5. </div>
  6. <div align="center">
  7. [![Release](https://img.shields.io/github/v/release/OpenOSINT/OpenOSINT?style=flat-square)](https://github.com/OpenOSINT/OpenOSINT/releases)
  8. [![PyPI downloads](https://img.shields.io/pypi/dm/openosint?style=flat-square&label=PyPI%20downloads)](https://pypi.org/project/openosint/)
  9. [![License MIT](https://img.shields.io/badge/license-MIT-green?style=flat-square)](LICENSE)
  10. [![MCP Registry](https://img.shields.io/badge/MCP_Registry-published-blueviolet?style=flat-square)](https://registry.modelcontextprotocol.io/servers/io.github.OpenOSINT/openosint)
  11. [![Sponsored by IP2Location](https://img.shields.io/badge/sponsored%20by-IP2Location.io-FF6B35?style=flat-square)](https://www.ip2location.io/?utm_source=openosint&utm_medium=readme&utm_campaign=ip2location)
  12. [![Sponsored by TestMu AI](https://img.shields.io/badge/sponsored%20by-TestMu%20AI-000000?style=flat-square)](https://www.testmuai.com/?utm_source=openosint&utm_medium=opensourcecollab)
  13. <img src="https://raw.githubusercontent.com/OpenOSINT/OpenOSINT/main/docs/assets/demo-chat.gif" width="720" alt="OpenOSINT answering a question about a company in chat: tool calls with their times, then an answer with a source on every claim">
  14. **Run it yourself:** `uvx openosint web` (one command, no keys)<br>
  15. **No terminal?** Use [OpenOSINT Cloud](https://app.openosint.tech/?utm_source=github&utm_medium=readme&utm_campaign=hero) in your browser, first check free
  16. [Docs](https://openosint.tech/docs/) · [Claude Code plugin](#use-it-from-claude-code-or-any-mcp-client) · [MCP server](https://openosint.tech/docs/mcp/)
  17. </div>
  18. ## Quickstart
  19. Needs [`uv`](https://docs.astral.sh/uv/). No API keys for these commands.
  20. ```bash
  21. # Local web app with chat, graph and globe
  22. uvx openosint web
  23. # Or one direct check, no AI involved
  24. uvx openosint exposure example.com
  25. ```
  26. ```text
  27. Grade: B Score: 88/100
  28. Checks: email OK, registration OK (passive)
  29. tls OK, http_headers OK (these touch the target)
  30. [LOW] DMARC has no aggregate report address (dmarc_no_rua)
  31. [LOW] Strict-Transport-Security header missing (hsts_missing)
  32. ```
  33. Real output, trimmed and re-wrapped. More commands: [CLI reference](https://openosint.tech/docs/cli/) · [install guide](https://openosint.tech/docs/install/).
  34. ## What you can do
  35. Moved to [Quickstart](#quickstart) above and the [CLI reference](https://openosint.tech/docs/cli/).
  36. ## Tools
  37. What it can look up. Per-tool docs: [openosint.tech/tools](https://openosint.tech/tools/). Only passive tools are on by default.
  38. | Tool | What it finds | Key needed |
  39. |---|---|---|
  40. | [`search_dns`](https://openosint.tech/tools/#search_dns) | DNS records, SPF, DMARC | No |
  41. | [`search_rdap`](https://openosint.tech/tools/#search_rdap) | Registrar, dates, name servers (RDAP) | No |
  42. | [`search_whois`](https://openosint.tech/tools/#search_whois) | WHOIS registration data | No |
  43. | [`search_ip`](https://openosint.tech/tools/#search_ip) | Hostname, ASN, city for an IP | Optional |
  44. | [`search_ip2location`](https://openosint.tech/tools/#search_ip2location) | Geolocation, ISP, proxy/VPN/Tor flags *(sponsored)* | Yes |
  45. | [`search_gdelt_geo`](https://openosint.tech/tools/#search_gdelt_geo) | Geolocated news mentions (GDELT) | No |
  46. | [`generate_dorks`](https://openosint.tech/tools/#generate_dorks) | Search-dork URLs for a target | No |
  47. | [`search_paste`](https://openosint.tech/tools/#search_paste) | Paste-site mentions | No |
  48. | [`search_github`](https://openosint.tech/tools/#search_github) | Repos, code and users | Optional |
  49. | [`search_breach`](https://openosint.tech/tools/#search_breach) | Breaches for an email (HaveIBeenPwned) | Yes |
  50. | [`search_shodan`](https://openosint.tech/tools/#search_shodan) | Open ports and banners | Yes |
  51. | [`search_censys`](https://openosint.tech/tools/#search_censys) | Hosts and certificates | Yes |
  52. | [`search_virustotal`](https://openosint.tech/tools/#search_virustotal) | URL, domain and IP reputation | Yes |
  53. | [`search_abuseipdb`](https://openosint.tech/tools/#search_abuseipdb) | IP abuse reports | Yes |
  54. | [`search_dorks_live`](https://openosint.tech/tools/#search_dorks_live) | Live dork results via [Bright Data SERP API](https://get.brightdata.com/jx2wfi?sid1=readme&sid2=setup&sid3=search_dorks_live&utm_source=openosint&utm_medium=readme&utm_campaign=setup&utm_content=search_dorks_live)¹ | Yes |
  55. | [`search_footprint`](https://openosint.tech/tools/#search_footprint) | Web footprint via [Bright Data SERP API](https://get.brightdata.com/jx2wfi?sid1=readme&sid2=setup&sid3=search_footprint&utm_source=openosint&utm_medium=readme&utm_campaign=setup&utm_content=search_footprint)¹ | Yes |
  56. | [`scrape_url`](https://openosint.tech/tools/#scrape_url) | Page content via [Bright Data Web Unlocker](https://get.brightdata.com/openosint-unlocker?sid1=readme&sid2=setup&sid3=scrape_url&utm_source=openosint&utm_medium=readme&utm_campaign=setup&utm_content=scrape_url)¹ (touches target) | Yes |
  57. | [`search_username`](https://openosint.tech/tools/#search_username) | Username across platforms (sherlock; noisy) | No |
  58. | [`search_email`](https://openosint.tech/tools/#search_email) | Accounts tied to an email (holehe; noisy) | No |
  59. | [`search_domain`](https://openosint.tech/tools/#search_domain) | Subdomains (sublist3r; noisy) | No |
  60. | [`search_phone`](https://openosint.tech/tools/#search_phone) | Carrier and country (phoneinfoga; unverified) | No |
  61. Sherlock, holehe, sublist3r and phoneinfoga run as local binaries you install yourself. Setting up the Bright Data tools: [Using OpenOSINT with Bright Data](https://openosint.tech/docs/bright-data/).
  62. ## Why OpenOSINT
  63. Tools run as real Python code and every finding cites the call that produced it. Compared with SpiderFoot, OpenOSINT has far fewer modules and is built to be driven by an agent. See the [comparison](https://openosint.tech/docs/#compared-with-other-tools).
  64. ## Passive by default
  65. Agents and MCP clients are only offered tools that query third-party sources or compute locally. Anything that touches the target or sends many requests from your IP is off until you opt in (`--allow-active`) and is not listed in an MCP client's `tools/list`. Passive is not private: every service you query sees the query. Details: [Safety](https://openosint.tech/docs/safety/).
  66. ## Use it from Claude Code or any MCP client
  67. ```text
  68. /plugin marketplace add OpenOSINT/OpenOSINT
  69. /plugin install openosint@openosint
  70. /openosint:osint example.com
  71. ```
  72. ```bash
  73. claude mcp add openosint -- uvx --from openosint openosint-mcp
  74. # Codex, Gemini CLI, Cursor and other Agent Skills clients
  75. npx skills add OpenOSINT/OpenOSINT
  76. ```
  77. ![OpenOSINT in Claude Code: add the marketplace, install the plugin, run /openosint:osint example.com and get a report where every finding cites its tool call](https://raw.githubusercontent.com/OpenOSINT/OpenOSINT/main/assets/demo/skill-demo.gif)
  78. Other clients: [MCP docs](https://openosint.tech/docs/mcp/) · [Agent Skill](https://openosint.tech/docs/agent-skill/).
  79. ## Go deeper
  80. - **Web UI:** `openosint web`, streaming chat, a news globe and a graph view. [Docs](https://openosint.tech/docs/web-ui/)
  81. - **REPL:** `openosint` with no arguments. [CLI reference](https://openosint.tech/docs/cli/)
  82. - **MCP server:** `uvx --from openosint openosint-mcp`. [Client configs](https://openosint.tech/docs/mcp/)
  83. ### Web UI + globe
  84. An agent investigation lands as a point on a 3D globe; click it to pivot. [Docs](https://openosint.tech/docs/web-ui/)
  85. ### Entity graph
  86. A FollowTheMoney graph with statement-level provenance and a review queue for `same_as` candidates. [Docs](https://openosint.tech/docs/entity-graph/)
  87. ### External exposure report (beta)
  88. `openosint exposure example.com` grades email authentication, TLS, registration and security headers A to F. [Docs](https://openosint.tech/docs/exposure/)
  89. ### Installation
  90. `pip install openosint` or `uvx openosint web`. Python 3.10+. [Install guide](https://openosint.tech/docs/install/)
  91. ### MCP Server
  92. Works in Claude Desktop, Claude Code, Cursor and any MCP client. [Client configs](https://openosint.tech/docs/mcp/)
  93. ### Configuration
  94. Keys go in the web UI Settings, `~/.openosint/config.env` or the environment. [All variables](https://openosint.tech/docs/configuration/) · [CLI reference](https://openosint.tech/docs/cli/)
  95. ### Docker
  96. `docker compose up --build`, then open <http://localhost:8080>. [Docker notes](https://openosint.tech/docs/web-ui/#docker)
  97. ## OpenOSINT Cloud
  98. The same engine as a hosted chat for a domain, an IP address or a company, with a source on every claim. [First check free, no account](https://app.openosint.tech/?utm_source=github&utm_medium=readme&utm_campaign=cloud). Hosted REST and MCP API by request: [commercial@openosint.tech](mailto:commercial@openosint.tech).
  99. ## Sponsors
  100. <!-- SPONSORS:START -->
  101. ### Featured Integrations
  102. <a href="https://www.ip2location.io/?utm_source=openosint&utm_medium=readme&utm_campaign=ip2location" rel="noopener sponsored"><img src="https://raw.githubusercontent.com/OpenOSINT/OpenOSINT/main/assets/sponsors/ip2location-logo.png" alt="IP2Location.io logo" height="40"></a>
  103. **[IP2Location.io](https://www.ip2location.io/?utm_source=openosint&utm_medium=readme&utm_campaign=ip2location)** — powers `search_ip2location` · [Integration guide](docs/integrations/ip2location.md)
  104. > Enhanced IP geolocation, ISP, VPN/Proxy/Tor, and datacenter detection
  105. <a href="https://www.testmuai.com/?utm_source=openosint&utm_medium=opensourcecollab" rel="noopener sponsored"><picture><source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/OpenOSINT/OpenOSINT/main/assets/sponsors/testmu-ai-white.svg"><img src="https://raw.githubusercontent.com/OpenOSINT/OpenOSINT/main/assets/sponsors/testmu-ai.svg" alt="TestMu AI logo" width="353"></picture></a>
  106. **[TestMu AI](https://www.testmuai.com/?utm_source=openosint&utm_medium=opensourcecollab)**
  107. > TestMu AI (formerly LambdaTest) is an AI-native testing cloud platform built for modern engineering teams. It covers everything from autonomous test creation and fast execution to testing AI agents, chatbots and voice assistants.
  108. _Open: Breach / Compromised-Credential Data · Email / Identity Lookup · Residential Proxies — see [SPONSORSHIP.md](SPONSORSHIP.md)._
  109. <!-- SPONSORS:END -->
  110. Sponsor on [Open Collective](https://opencollective.com/openosint_oss) · tiers in [SPONSORSHIP.md](SPONSORSHIP.md) · commercial license and support: [COMMERCIAL.md](./COMMERCIAL.md).
  111. ## Contributing
  112. Issues and pull requests are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md). Maintainer: [Tommaso Bertocchi](https://x.com/SonoTommy_) · [@openosint_oss](https://x.com/openosint_oss). Contributors: [@consocio](https://github.com/consocio) ([#6](https://github.com/OpenOSINT/OpenOSINT/pull/6)).
  113. ## Legal Disclaimer
  114. For authorized security research and educational use only. Only investigate targets you own or are permitted to assess. Passive does not mean anonymous. Full text: [DISCLAIMER.md](DISCLAIMER.md).
  115. ## License
  116. MIT. See [LICENSE](./LICENSE).
  117. ¹ Bright Data links in this README are affiliate/referral links: OpenOSINT earns a commission if you sign up through them, at no extra cost to you.
  118. ## Star History
  119. [![Star History Chart](https://api.star-history.com/svg?repos=OpenOSINT/OpenOSINT&type=Date)](https://star-history.com/#OpenOSINT/OpenOSINT&Date)
openosint/tools/search_paste.py · Bundled script · 104 lines · 2 findings marked
  1. # openosint/tools/search_paste.py
  2. """
  3. Pastebin dump search module.
  4. Queries the psbdmp.ws public API to find pastes mentioning a target email
  5. address or username. Returns a formatted string; never raises on failure.
  6. """
  7. from __future__ import annotations
  8. import asyncio
  9. import logging
  10. import requests
  11. from openosint.proxy import get_requests_proxies
  12. from openosint.tools.exceptions import OSINTError, ToolExecutionError
  13. logger = logging.getLogger(__name__)
  14. _PSBDMP_URL = "https://psbdmp.ws/api/search/{query}"
  15. _DEFAULT_TIMEOUT = 15
  16. _MAX_RESULTS = 10
  17. def _fetch_paste_data(query: str, timeout_seconds: int) -> list[dict]:
  18. """
  19. Query psbdmp.ws for pastes mentioning query.
  20. Raises
  21. ------
  22. OSINTError
  23. On network failures.
  24. ToolExecutionError
  25. On unexpected HTTP status codes.
  26. """
  27. try:
  28. response = requests.get(
  29. _PSBDMP_URL.format(query=query),
  30. timeout=timeout_seconds,
  31. proxies=get_requests_proxies(),
  32. )
  33. except requests.RequestException as exc:
  34. raise OSINTError(f"Network error querying psbdmp.ws: {exc}") from exc
  35. if response.status_code == 404:
  36. return []
  37. if response.status_code != 200:
  38. raise ToolExecutionError(f"psbdmp.ws returned HTTP {response.status_code}.")
  39. data = response.json()
  40. return data.get("data", []) if isinstance(data, dict) else []
  41. def _format_paste_results(pastes: list[dict], query: str) -> str:
  42. """Return a structured string describing paste search findings."""
  43. if not pastes:
  44. return f"No pastes found mentioning '{query}'."
  45. count = len(pastes)
  46. shown = pastes[:_MAX_RESULTS]
  47. lines = [f"Found in {count} paste(s) for '{query}':\n"]
  48. for paste in shown:
  49. paste_id = paste.get("id", "unknown")
  50. date = paste.get("time", "unknown date")
  51. lines.append(f"[+] https://pastebin.com/{paste_id} ({date})")
    • Dismissed after review: Quoted as data in code: Links to a paste site (pastebin.com), a common place to stage installer commands or send stolen data
    • Dismissed after review: Talks to a raw IP address or throwaway host, where malware is often staged
    • Line 66 on GitHub
  52. if count > _MAX_RESULTS:
  53. lines.append(f"\n... and {count - _MAX_RESULTS} more.")
  54. return "\n".join(lines)
  55. async def run_paste_osint(
  56. query: str,
  57. timeout_seconds: int = _DEFAULT_TIMEOUT,
  58. ) -> str:
  59. """
  60. Search Pastebin dumps for query via psbdmp.ws.
  61. Returns a descriptive error string on failure rather than raising.
  62. Parameters
  63. ----------
  64. query:
  65. Email address or username to search for.
  66. timeout_seconds:
  67. HTTP request timeout in seconds.
  68. Returns
  69. -------
  70. str
  71. Formatted result string or a descriptive error message.
  72. """
  73. logger.info("Starting paste search for: %s", query)
  74. try:
  75. pastes = await asyncio.to_thread(_fetch_paste_data, query, timeout_seconds)
  76. result = _format_paste_results(pastes, query)
  77. logger.info("Paste search complete for: %s", query)
  78. return result
  79. except OSINTError as exc:
  80. logger.warning("Paste search failed: %s", exc)
  81. return f"Scan error: {exc}"
  82. except Exception as exc:
  83. logger.exception("Unexpected error during paste search.")
  84. return f"Internal error: {exc}"
openosint/web/static/entity-graph.js · Bundled script · 608 lines · 2 findings marked
  1. /**
  2. * entity-graph.js — Entity normalizer registry.
  3. * Pure data in, pure data out. No DOM, no rendering.
  4. *
  5. * Node: { id, type, label, data }
  6. * id = "${type}:${value.toLowerCase()}" — stable dedupe key
  7. * data.isRoot = true marks the target node (visual hint only, not a separate namespace)
  8. *
  9. * Edge: { source, target, label }
  10. *
  11. * Entity types: email, username, domain, subdomain, ip, phone,
  12. * org, social_account, breach, paste, asn
  13. *
  14. * Every extractor is wrapped in try/catch; any parse failure degrades
  15. * gracefully to a generic target-linked node (never throws).
  16. */
  17. // ---------------------------------------------------------------------------
  18. // Target-type inference
  19. // ---------------------------------------------------------------------------
  20. const _IPv4_RE = /^(\d{1,3}\.){3}\d{1,3}$/;
  21. const _IPv6_RE = /^[0-9a-f:]{4,}$/i;
  22. const _DOMAIN_RE = /^[a-z0-9][a-z0-9\-._]*\.[a-z]{2,}$/i;
  23. const _PHONE_RE = /^\+?\d[\d\s\-().]{6,}$/;
  24. function _inferType(value) {
  25. const v = (value || '').trim();
  26. if (v.includes('@')) return 'email';
  27. if (_IPv4_RE.test(v)) return 'ip';
  28. if (_IPv6_RE.test(v) && v.includes(':')) return 'ip';
  29. if (_PHONE_RE.test(v) && !v.includes('.')) return 'phone';
  30. if (_DOMAIN_RE.test(v)) return 'domain';
  31. return 'username';
  32. }
  33. // ---------------------------------------------------------------------------
  34. // Node / edge constructors
  35. // ---------------------------------------------------------------------------
  36. function _node(type, value, data = {}) {
  37. const v = String(value).trim();
  38. return { id: `${type}:${v.toLowerCase()}`, type, label: v, data };
  39. }
  40. function _edge(sourceId, targetId, label) {
  41. return { source: sourceId, target: targetId, label };
  42. }
  43. // ---------------------------------------------------------------------------
  44. // Text parsing helpers
  45. // ---------------------------------------------------------------------------
  46. /** Extract the first value matching a prefixed line, e.g. "[+] Org: Google". */
  47. function _val(text, prefixPattern) {
  48. const re = new RegExp(`${prefixPattern}\\s*(.+)$`, 'm');
  49. const m = re.exec(text);
  50. return m ? m[1].trim() : null;
  51. }
  52. /** Extract ALL values matching a prefixed line. */
  53. function _vals(text, prefixPattern) {
  54. const re = new RegExp(`${prefixPattern}\\s*(.+)$`, 'gm');
  55. const results = [];
  56. let m;
  57. while ((m = re.exec(text)) !== null) results.push(m[1].trim());
  58. return results;
  59. }
  60. // ---------------------------------------------------------------------------
  61. // Normalizer registry — one entry per tool
  62. // Verbatim output samples are reproduced in tests/test_entity_graph.mjs.
  63. // ---------------------------------------------------------------------------
  64. const _REGISTRY = {
  65. /** search_ip output example:
  66. * IP intelligence for '8.8.8.8':
  67. * [+] Ip: 8.8.8.8
  68. * [+] Hostname: dns.google
  69. * [+] Org: AS15169 Google LLC
  70. * [+] City: Mountain View
  71. * [+] Country: US
  72. */
  73. search_ip(target, output) {
  74. const nodes = [], edges = [];
  75. const rootId = `ip:${target.toLowerCase().trim()}`;
  76. const org = _val(output, '\\[\\+\\] Org:');
  77. const hostname = _val(output, '\\[\\+\\] Hostname:');
  78. if (org) {
  79. const n = _node('org', org, {});
  80. nodes.push(n); edges.push(_edge(rootId, n.id, 'hosted by'));
  81. }
  82. if (hostname) {
  83. const n = _node('domain', hostname, {});
  84. nodes.push(n); edges.push(_edge(rootId, n.id, 'hostname'));
  85. }
  86. return { nodes, edges };
  87. },
  88. /** search_whois output example:
  89. * WHOIS results for 'example.com':
  90. * [+] Domain: EXAMPLE.COM
  91. * [+] Registrar: RESERVED-Internet Assigned Numbers Authority
  92. * [+] Emails: abuse@iana.org
  93. * [+] Org: Internet Assigned Numbers Authority
  94. * [+] Name Servers: a.iana-servers.net, b.iana-servers.net
  95. */
  96. search_whois(target, output) {
  97. const nodes = [], edges = [];
  98. const rootId = `domain:${target.toLowerCase().trim()}`;
  99. const registrar = _val(output, '\\[\\+\\] Registrar:');
  100. const org = _val(output, '\\[\\+\\] Org:');
  101. const emailRaw = _val(output, '\\[\\+\\] Emails:');
  102. const nsRaw = _val(output, '\\[\\+\\] Name Servers:');
  103. if (registrar) {
  104. const n = _node('org', registrar, { role: 'registrar' });
  105. nodes.push(n); edges.push(_edge(rootId, n.id, 'registered by'));
  106. }
  107. if (org) {
  108. const n = _node('org', org, { role: 'registrant' });
  109. nodes.push(n); edges.push(_edge(rootId, n.id, 'owned by'));
  110. }
  111. if (emailRaw) {
  112. emailRaw.split(',').forEach(e => {
  113. const em = e.trim();
  114. if (em.includes('@')) {
  115. const n = _node('email', em, {});
  116. nodes.push(n); edges.push(_edge(rootId, n.id, 'contact'));
  117. }
  118. });
  119. }
  120. if (nsRaw) {
  121. nsRaw.split(',').forEach(ns => {
  122. const d = ns.trim();
  123. if (d) {
  124. const n = _node('domain', d, { role: 'nameserver' });
  125. nodes.push(n); edges.push(_edge(rootId, n.id, 'ns'));
  126. }
  127. });
  128. }
  129. return { nodes, edges };
  130. },
  131. /** search_breach output example:
  132. * Found in 2 breach(es) for 'test@example.com':
  133. * [+] Adobe (2013-10-04) — leaked: Email addresses, Passwords, Usernames
  134. * [+] LinkedIn (2012-05-05) — leaked: Email addresses, Passwords
  135. */
  136. search_breach(target, output) {
  137. const nodes = [], edges = [];
  138. const rootId = `email:${target.toLowerCase().trim()}`;
  139. const re = /^\[\+\] ([^\s(]+)\s*\(([^)]+)\)/gm;
  140. let m;
  141. while ((m = re.exec(output)) !== null) {
  142. const n = _node('breach', m[1], { date: m[2] });
  143. nodes.push(n); edges.push(_edge(rootId, n.id, 'breached in'));
  144. }
  145. return { nodes, edges };
  146. },
  147. /** search_dns output example:
  148. * [DNS] Domain: example.com
  149. * [DNS] A: 93.184.216.34
  150. * [DNS] MX records:
  151. * • 0 mail.example.com.
  152. * [DNS] NS: a.iana-servers.net, b.iana-servers.net
  153. */
  154. search_dns(target, output) {
  155. const nodes = [], edges = [];
  156. const rootId = `domain:${target.toLowerCase().trim()}`;
  157. const aRaw = _val(output, '\\[DNS\\] A:');
  158. if (aRaw) {
  159. aRaw.split(/[,\s]+/).forEach(ip => {
  160. ip = ip.trim();
  161. if (_IPv4_RE.test(ip)) {
  162. const n = _node('ip', ip, {});
  163. nodes.push(n); edges.push(_edge(rootId, n.id, 'resolves to'));
  164. }
  165. });
  166. }
  167. const lines = output.split('\n');
  168. let inMx = false;
  169. for (const line of lines) {
  170. if (line.includes('[DNS] MX records:')) { inMx = true; continue; }
  171. if (/^\[DNS\]/.test(line) || /^\[!]/.test(line)) {
  172. if (line.includes('[DNS] NS:')) {
  173. const nsRaw = line.replace(/.*\[DNS\] NS:/, '').trim();
  174. nsRaw.split(',').forEach(ns => {
  175. const d = ns.trim().replace(/\.$/, '');
  176. if (d) {
  177. const n = _node('domain', d, { role: 'ns' });
  178. nodes.push(n); edges.push(_edge(rootId, n.id, 'ns'));
  179. }
  180. });
  181. }
  182. inMx = false;
  183. continue;
  184. }
  185. if (inMx && line.trim().startsWith('•')) {
  186. const host = line.replace('•', '').trim().split(/\s+/).pop()?.replace(/\.$/, '');
  187. if (host && _DOMAIN_RE.test(host)) {
  188. const n = _node('domain', host, { role: 'mx' });
  189. nodes.push(n); edges.push(_edge(rootId, n.id, 'mail server'));
  190. }
  191. }
  192. }
  193. return { nodes, edges };
  194. },
  195. /** search_ip2location output example:
  196. * [IP2Location] IP: 8.8.8.8
  197. * [IP2Location] ISP: Google LLC
  198. * [IP2Location] Domain: google.com
  199. * [IP2Location] ASN: AS15169
  200. */
  201. search_ip2location(target, output) {
  202. const nodes = [], edges = [];
  203. const rootId = `ip:${target.toLowerCase().trim()}`;
  204. const isp = _val(output, '\\[IP2Location\\] ISP:');
  205. const asn = _val(output, '\\[IP2Location\\] ASN:');
  206. const domain = _val(output, '\\[IP2Location\\] Domain:');
  207. if (isp && isp !== 'N/A') {
  208. const n = _node('org', isp, { role: 'isp' });
  209. nodes.push(n); edges.push(_edge(rootId, n.id, 'hosted by'));
  210. }
  211. if (asn && asn !== 'N/A') {
  212. const n = _node('asn', asn, {});
  213. nodes.push(n); edges.push(_edge(rootId, n.id, 'belongs to'));
  214. }
  215. if (domain && domain !== 'N/A') {
  216. const n = _node('domain', domain, {});
  217. nodes.push(n); edges.push(_edge(rootId, n.id, 'reverse domain'));
  218. }
  219. return { nodes, edges };
  220. },
  221. /** search_abuseipdb output example:
  222. * [AbuseIPDB] IP: 8.8.8.8
  223. * [AbuseIPDB] Abuse Confidence Score: 0%
  224. * [AbuseIPDB] ISP: Google LLC
  225. * [AbuseIPDB] Domain: google.com
  226. * [AbuseIPDB] Country: US
  227. */
  228. search_abuseipdb(target, output) {
  229. const nodes = [], edges = [];
  230. const rootId = `ip:${target.toLowerCase().trim()}`;
  231. const isp = _val(output, '\\[AbuseIPDB\\] ISP:');
  232. const domain = _val(output, '\\[AbuseIPDB\\] Domain:');
  233. const score = _val(output, '\\[AbuseIPDB\\] Abuse Confidence Score:');
  234. if (isp && isp !== 'N/A') {
  235. const n = _node('org', isp, { role: 'isp' });
  236. nodes.push(n); edges.push(_edge(rootId, n.id, 'hosted by'));
  237. }
  238. if (domain && domain !== 'N/A') {
  239. const n = _node('domain', domain, { abuseScore: score });
  240. nodes.push(n); edges.push(_edge(rootId, n.id, 'reverse domain'));
  241. }
  242. return { nodes, edges };
  243. },
  244. /** search_shodan (host) output example:
  245. * Shodan host data for '8.8.8.8':
  246. * [+] IP: 8.8.8.8
  247. * [+] Org: Google LLC
  248. * [+] Hostnames: dns.google, 8888.google
  249. * [+] Open ports: 53, 443
  250. *
  251. * search_shodan (search) output example:
  252. * Shodan search results for 'nginx' (1000 total, showing 3):
  253. * [+] 1.2.3.4:80 — Acme Corp — United States
  254. */
  255. search_shodan(target, output) {
  256. const nodes = [], edges = [];
  257. const inferredType = _inferType(target);
  258. const rootId = `${inferredType}:${target.toLowerCase().trim()}`;
  259. const org = _val(output, '\\[\\+\\] Org:');
  260. if (org) {
  261. const n = _node('org', org, {});
  262. nodes.push(n); edges.push(_edge(rootId, n.id, 'hosted by'));
  263. }
  264. const hostsRaw = _val(output, '\\[\\+\\] Hostnames:');
  265. if (hostsRaw) {
  266. hostsRaw.split(',').forEach(h => {
  267. h = h.trim();
  268. if (h) {
  269. const n = _node('domain', h, {});
  270. nodes.push(n); edges.push(_edge(rootId, n.id, 'hostname'));
  271. }
  272. });
  273. }
  274. // Search-result bullets: "[+] 1.2.3.4:80 — Org — Country"
  275. const searchRe = /^\[\+\] ([\d.]+):\d+ — (.+?) — .+$/gm;
  276. let m;
  277. while ((m = searchRe.exec(output)) !== null) {
  278. const ipNode = _node('ip', m[1], {});
  279. nodes.push(ipNode); edges.push(_edge(rootId, ipNode.id, 'found'));
  280. const orgName = m[2];
  281. if (orgName && orgName !== 'unknown') {
  282. const orgNode = _node('org', orgName, {});
  283. nodes.push(orgNode); edges.push(_edge(ipNode.id, orgNode.id, 'hosted by'));
  284. }
  285. }
  286. return { nodes, edges };
  287. },
  288. /** search_virustotal output example:
  289. * [VirusTotal] Malicious: 2
  290. * [VirusTotal] ASN: AS15169 Google LLC
  291. * [VirusTotal] Country: US
  292. * [VirusTotal] Registrar: MarkMonitor Inc.
  293. */
  294. search_virustotal(target, output) {
  295. const nodes = [], edges = [];
  296. const inferredType = _inferType(target);
  297. const rootId = `${inferredType}:${target.toLowerCase().trim()}`;
  298. const asn = _val(output, '\\[VirusTotal\\] ASN:');
  299. const registrar = _val(output, '\\[VirusTotal\\] Registrar:');
  300. if (asn) {
  301. const n = _node('asn', asn, {});
  302. nodes.push(n); edges.push(_edge(rootId, n.id, 'belongs to'));
  303. }
  304. if (registrar) {
  305. const n = _node('org', registrar, { role: 'registrar' });
  306. nodes.push(n); edges.push(_edge(rootId, n.id, 'registered by'));
  307. }
  308. return { nodes, edges };
  309. },
  310. /** search_github output example (direct profile):
  311. * [GitHub] Login: octocat
  312. * [GitHub] Name: The Octocat
  313. * [GitHub] Company: GitHub
  314. * [GitHub] Email (profile): N/A
  315. * [GitHub] Profile URL: https://github.com/octocat
  316. * [GitHub] Emails found in commits: octocat@github.com
  317. *
  318. * search_github output example (search results):
  319. * [GitHub] Search results for 'johndoe' (2 match(es)):
  320. * • johndoe — https://github.com/johndoe (type: User)
  321. */
  322. search_github(target, output) {
  323. const nodes = [], edges = [];
  324. const login = _val(output, '\\[GitHub\\] Login:');
  325. const rootId = `username:${(login || target).toLowerCase().trim()}`;
  326. const email = _val(output, '\\[GitHub\\] Email \\(profile\\):');
  327. const company = _val(output, '\\[GitHub\\] Company:');
  328. const profileUrl = _val(output, '\\[GitHub\\] Profile URL:');
  329. const commitEmails = _val(output, '\\[GitHub\\] Emails found in commits:');
  330. if (profileUrl) {
  331. const n = _node('social_account', profileUrl, { platform: 'github', login: login || target });
  332. nodes.push(n); edges.push(_edge(rootId, n.id, 'found on'));
  333. }
  334. if (email && email !== 'N/A') {
  335. const n = _node('email', email, {});
  336. nodes.push(n); edges.push(_edge(rootId, n.id, 'email'));
  337. }
  338. if (company && company !== 'N/A') {
  339. const n = _node('org', company, {});
  340. nodes.push(n); edges.push(_edge(rootId, n.id, 'works at'));
  341. }
  342. if (commitEmails) {
  343. commitEmails.split(',').forEach(e => {
  344. const em = e.trim();
  345. if (em.includes('@')) {
  346. const n = _node('email', em, { source: 'commit' });
  347. nodes.push(n); edges.push(_edge(rootId, n.id, 'commit email'));
  348. }
  349. });
  350. }
  351. // Search-result bullets: " • johndoe — https://github.com/johndoe (type: User)"
  352. const searchRe = /•\s+(\S+)\s+—\s+(https?:\/\/\S+)/gm;
  353. let m;
  354. while ((m = searchRe.exec(output)) !== null) {
  355. const n = _node('social_account', m[2], { platform: 'github', login: m[1] });
  356. nodes.push(n); edges.push(_edge(rootId, n.id, 'found on'));
  357. }
  358. return { nodes, edges };
  359. },
  360. /** search_censys output example (IP):
  361. * [Censys] Type: ip
  362. * [Censys] IP: 8.8.8.8
  363. * [Censys] ASN: AS15169 GOOGLE
  364. * [Censys] Country: US
  365. *
  366. * search_censys output example (domain/cert):
  367. * [Censys] Domain: example.com
  368. * [Censys] Certificates Found: 3
  369. * [Censys] SANs: example.com, www.example.com, api.example.com
  370. */
  371. search_censys(target, output) {
  372. const nodes = [], edges = [];
  373. const inferredType = _inferType(target);
  374. const rootId = `${inferredType}:${target.toLowerCase().trim()}`;
  375. const ip = _val(output, '\\[Censys\\] IP:');
  376. const asn = _val(output, '\\[Censys\\] ASN:');
  377. const sansRaw = _val(output, '\\[Censys\\] SANs:');
  378. if (ip && ip.toLowerCase() !== target.toLowerCase().trim()) {
  379. const n = _node('ip', ip, {});
  380. nodes.push(n); edges.push(_edge(rootId, n.id, 'resolves to'));
  381. }
  382. if (asn) {
  383. const n = _node('asn', asn, {});
  384. nodes.push(n); edges.push(_edge(rootId, n.id, 'belongs to'));
  385. }
  386. if (sansRaw) {
  387. sansRaw.split(',').forEach(d => {
  388. d = d.trim();
  389. if (d && d.toLowerCase() !== target.toLowerCase().trim()) {
  390. const n = _node('domain', d, { role: 'san' });
  391. nodes.push(n); edges.push(_edge(rootId, n.id, 'certificate san'));
  392. }
  393. });
  394. }
  395. return { nodes, edges };
  396. },
  397. /** search_paste output example:
  398. * Found in 2 paste(s) for 'test@example.com':
  399. * [+] https://pastebin.com/abc12345 (2023-01-15)
    • Note: Quoted as data in code: Links to a paste site (pastebin.com), a common place to stage installer commands or send stolen data
    • Line 439 on GitHub
  400. * [+] https://pastebin.com/xyz98765 (2022-08-03)
    • Note: Quoted as data in code: Links to a paste site (pastebin.com), a common place to stage installer commands or send stolen data
    • Line 440 on GitHub
  401. */
  402. search_paste(target, output) {
  403. const nodes = [], edges = [];
  404. const inferredType = _inferType(target);
  405. const rootId = `${inferredType}:${target.toLowerCase().trim()}`;
  406. const re = /^\[\+\] (https?:\/\/\S+)\s*\(([^)]+)\)/gm;
  407. let m;
  408. while ((m = re.exec(output)) !== null) {
  409. const n = _node('paste', m[1], { date: m[2] });
  410. nodes.push(n); edges.push(_edge(rootId, n.id, 'found in'));
  411. }
  412. return { nodes, edges };
  413. },
  414. /** search_footprint output example:
  415. * [Footprint] URL: https://twitter.com/johndoe
  416. * [Footprint] Domain: twitter.com
  417. * [Footprint] URL: https://linkedin.com/in/johndoe
  418. * [Footprint] Domain: linkedin.com
  419. */
  420. search_footprint(target, output) {
  421. const nodes = [], edges = [];
  422. const inferredType = _inferType(target);
  423. const rootId = `${inferredType}:${target.toLowerCase().trim()}`;
  424. _vals(output, '\\[Footprint\\] URL:').forEach(url => {
  425. const n = _node('social_account', url, { source: 'footprint' });
  426. nodes.push(n); edges.push(_edge(rootId, n.id, 'links to'));
  427. });
  428. _vals(output, '\\[Footprint\\] Domain:').forEach(d => {
  429. const n = _node('domain', d, {});
  430. nodes.push(n); edges.push(_edge(rootId, n.id, 'found at'));
  431. });
  432. return { nodes, edges };
  433. },
  434. // ---- Type-B demo stubs (verbatim patterns from agent-loop.js _TYPE_B_DEMO) ----
  435. /** search_email Type-B demo stub:
  436. * [DEMO DATA — install holehe: pip install holehe]
  437. * [+] github.com — demo@example.com registered (sample)
  438. * [+] spotify.com — demo@example.com registered (sample)
  439. * [-] twitter.com — not found (sample)
  440. */
  441. search_email(target, output) {
  442. const nodes = [], edges = [];
  443. const rootId = `email:${target.toLowerCase().trim()}`;
  444. const re = /^\[\+\] (\S+)\s+—\s+\S+\s+registered/gm;
  445. let m;
  446. while ((m = re.exec(output)) !== null) {
  447. const n = _node('social_account', m[1], { platform: m[1] });
  448. nodes.push(n); edges.push(_edge(rootId, n.id, 'found on'));
  449. }
  450. return { nodes, edges };
  451. },
  452. /** search_username Type-B demo stub:
  453. * [DEMO DATA — install sherlock: pip install sherlock-project]
  454. * [+] GitHub https://github.com/demouser (sample)
  455. * [+] Reddit https://reddit.com/u/demouser (sample)
  456. * [-] Instagram not found (sample)
  457. */
  458. search_username(target, output) {
  459. const nodes = [], edges = [];
  460. const rootId = `username:${target.toLowerCase().trim()}`;
  461. const re = /^\[\+\] (\S+)\s+(https?:\/\/\S+)\s+\(sample\)/gm;
  462. let m;
  463. while ((m = re.exec(output)) !== null) {
  464. const n = _node('social_account', m[2], { platform: m[1] });
  465. nodes.push(n); edges.push(_edge(rootId, n.id, 'found on'));
  466. }
  467. return { nodes, edges };
  468. },
  469. /** search_domain Type-B demo stub:
  470. * [DEMO DATA — install sublist3r: pip install sublist3r]
  471. * [+] www.example.com (sample subdomain)
  472. * [+] mail.example.com (sample subdomain)
  473. * [+] api.example.com (sample subdomain)
  474. */
  475. search_domain(target, output) {
  476. const nodes = [], edges = [];
  477. const rootId = `domain:${target.toLowerCase().trim()}`;
  478. const re = /^\[\+\] (\S+)\s+\(sample subdomain\)/gm;
  479. let m;
  480. while ((m = re.exec(output)) !== null) {
  481. const n = _node('subdomain', m[1], {});
  482. nodes.push(n); edges.push(_edge(rootId, n.id, 'subdomain'));
  483. }
  484. return { nodes, edges };
  485. },
  486. /** search_phone Type-B demo stub:
  487. * [DEMO DATA — install phoneinfoga: github.com/sundowndev/phoneinfoga/releases]
  488. * [+] Number: +14155550100 (sample)
  489. * [+] Country: US
  490. * [+] Carrier: Sample Carrier LLC (sample)
  491. * [+] Line type: mobile (sample)
  492. */
  493. search_phone(target, output) {
  494. const nodes = [], edges = [];
  495. const rootId = `phone:${target.toLowerCase().trim()}`;
  496. const carrier = _val(output, '\\[\\+\\] Carrier:');
  497. const country = _val(output, '\\[\\+\\] Country:');
  498. if (carrier) {
  499. const carrierClean = carrier.replace(/\s*\(sample\)\s*$/, '').trim();
  500. const n = _node('org', carrierClean, { role: 'carrier', country });
  501. nodes.push(n); edges.push(_edge(rootId, n.id, 'carrier'));
  502. }
  503. return { nodes, edges };
  504. },
  505. // Informational / dork tools produce no meaningful graph nodes
  506. generate_dorks() { return { nodes: [], edges: [] }; },
  507. search_dorks_live() { return { nodes: [], edges: [] }; },
  508. scrape_url() { return { nodes: [], edges: [] }; },
  509. };
  510. // ---------------------------------------------------------------------------
  511. // Public API
  512. // ---------------------------------------------------------------------------
  513. export function inferEntityType(value) {
  514. return _inferType(value);
  515. }
  516. /**
  517. * Build the root target node with the same id scheme as normalizers use,
  518. * so tools that rediscover the same entity merge into one node.
  519. * data.isRoot = true marks it visually — NOT a separate id namespace.
  520. */
  521. export function makeTargetNode(target) {
  522. const v = (target || '').trim();
  523. const type = _inferType(v);
  524. return {
  525. id: `${type}:${v.toLowerCase()}`,
  526. type,
  527. label: v,
  528. data: { isRoot: true },
  529. };
  530. }
  531. /**
  532. * Extract graph nodes and edges from a tool result.
  533. * Never throws — any parse failure returns a single generic node linked to the target.
  534. */
  535. export function extractEntities(toolName, target, output) {
  536. const inferredType = _inferType(target);
  537. const rootId = `${inferredType}:${(target || '').toLowerCase().trim()}`;
  538. const extractor = _REGISTRY[toolName];
  539. if (!extractor) {
  540. const n = _node('social_account', `${toolName}:${target}`, { tool: toolName });
  541. return { nodes: [n], edges: [_edge(rootId, n.id, 'found by ' + toolName)] };
  542. }
  543. try {
  544. const result = extractor(target, output || '');
  545. return {
  546. nodes: Array.isArray(result?.nodes) ? result.nodes : [],
  547. edges: Array.isArray(result?.edges) ? result.edges : [],
  548. };
  549. } catch {
  550. const n = _node('social_account', `${toolName}:${target}:error`, { tool: toolName, parseError: true });
  551. return { nodes: [n], edges: [_edge(rootId, n.id, 'found by ' + toolName)] };
  552. }
  553. }

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.