hackertarget_hostsearch
Discover subdomains and their IP addresses for any domain using HackerTarget's API to map attack surfaces and identify potential security risks.
Instructions
Find subdomains and their IPs for a domain via HackerTarget. Free tier: 50 queries/day.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domain | Yes | Domain to search hosts for |
Implementation Reference
- src/hackertarget/index.ts:32-40 (handler)The core implementation of the host search logic, which fetches data from the HackerTarget API and parses the resulting CSV output.
export async function hackertargetHostsearch(domain: string): Promise<HostEntry[]> { const text = await htFetch("hostsearch", domain); if (!text) return []; return text.split("\n").filter(Boolean).map((line) => { const [hostname, ip] = line.split(","); return { hostname: hostname?.trim() ?? "", ip: ip?.trim() ?? "" }; }); } - src/protocol/tools.ts:408-415 (registration)Registration of the tool, defining its name, schema, and linking the execution to the implementation function.
const hackertargetHostsearchTool: ToolDef = { name: "hackertarget_hostsearch", description: "Find subdomains and their IPs for a domain via HackerTarget. Free tier: 50 queries/day.", schema: { domain: z.string().describe("Domain to search hosts for"), }, execute: async (args) => json(await hackertargetHostsearch(args.domain as string)), };