hackertarget_reverseip
Discover all domains hosted on an IP address using reverse IP lookup.
Instructions
Reverse IP lookup via HackerTarget — find all domains hosted on an IP. Free tier: 50 queries/day.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ip | Yes | IP address for reverse lookup |
Implementation Reference
- src/hackertarget/index.ts:44-48 (handler)The actual implementation of hackertargetReverseIp — calls htFetch with 'reverseiplookup' endpoint, parses newline-separated results into an array of domain strings.
export async function hackertargetReverseIp(ip: string): Promise<string[]> { const text = await htFetch("reverseiplookup", ip); if (!text) return []; return text.split("\n").filter(Boolean).map((l) => l.trim()); } - src/hackertarget/index.ts:20-28 (helper)Shared HTTP helper htFetch used by all HackerTarget functions — handles rate limiting via RateLimiter, calls the HackerTarget API, and checks for error responses.
async function htFetch(endpoint: string, query: string): Promise<string> { await limiter.acquire(); const res = await fetch(`https://api.hackertarget.com/${endpoint}/?q=${encodeURIComponent(query)}`); if (!res.ok) throw new Error(`HackerTarget returned ${res.status}`); const text = await res.text(); if (text.startsWith("error")) throw new Error(`HackerTarget: ${text}`); if (text.includes("API count exceeded")) throw new Error("HackerTarget daily API limit exceeded (50/day free tier)"); return text.trim(); } - src/protocol/tools.ts:417-424 (schema)ToolDef registration of hackertarget_reverseip with name, description, zod schema (ip: string), and execute handler.
const hackertargetReverseIpTool: ToolDef = { name: "hackertarget_reverseip", description: "Reverse IP lookup via HackerTarget — find all domains hosted on an IP. Free tier: 50 queries/day.", schema: { ip: z.string().describe("IP address for reverse lookup"), }, execute: async (args) => json(await hackertargetReverseIp(args.ip as string)), }; - src/protocol/tools.ts:524-524 (registration)The hackertargetReverseIpTool is included in the tools array for registration.
hackertargetReverseIpTool, - src/index.ts:33-33 (registration)The tool is listed in the HackerTarget provider group at the top-level index for UI display.
{ label: "HackerTarget", env: null, tools: ["hackertarget_hostsearch", "hackertarget_reverseip", "hackertarget_aslookup"] },