Mastering Passive API Reconnaissance: Uncover Hidden Attack Surfaces with OSINT


In API security testing, the first rule is simple: know your target before you touch it. Passive reconnaissance lets you map an API’s attack surface without sending a single probe. By harvesting open-source intelligence (OSINT), you can uncover endpoints, docs, credentials, and even instant wins like leaked API keys— all from public sources. This approach shines in banking audits, where RBI/NPCI compliance demands thorough recon before active scans.

Think of it as scouting a fortress from afar: spot weak walls (exposed endpoints), forgotten gates (zombie APIs), and lost keys (secrets) without alerting the guards.

Mastering Passive API Reconnaissance – Breakthrough

Your goal? Document the API’s business purpose, versions, endpoints, and docs. In FinTech, this reveals logic flaws in payment gateways or KYC flows. High-value finds include:

  • Exposed secrets (API keys, JWTs) for instant admin access.
  • Leaked PII (Aadhaar, PAN, emails) demanding immediate reporting.
  • Version info flagging CVEs, like outdated OAuth in UPI apps.

Report critical exposures right away—they’re often OWASP API Top 10 violations like Broken Authentication.

Technique 1: Google Dorking for Quick Wins

Start with plain searches like “Reddit API docs,” then refine with dorks for precision.

Google DorkPurposeExample Results
inurl:"/wp-json/wp/v2/users"WordPress user APIsPublic user directories
intitle:"index.of" intext:"api.txt"Exposed API filesLeaked key lists
inurl:"/api/v1" intext:"index of /"API directoriesOpen folders with endpoints
ext:php inurl:"api.php?action="XenAPI SQLi vulns141K+ hits (even in 2026)
intitle:"index of" api_key OR "api key" OR apiKey -poolLeaked keysInstant secrets

Pro Tip for India: Dork inurl:"/upi/api" site:*.in to find NPCI-exposed UPI endpoints.

Technique 2: GitDorking on GitHub

Developers leak gold on GitHub. Search [target] "api key" OR token OR "authorization: Bearer", then dive into tabs.

  • Code Tab: Ctrl+F for “secret”; check History for removed keys (use Split view for diffs). Example: Spot a hardcoded Razorpay API key in a commit.
  • Issues Tab: Open issues often flag live bugs, like “API key exposed in frontend.”
  • Pull Requests: Unmerged changes reveal ongoing fixes—test before they merge.

Profile the target: Note languages (Node.js?), endpoints (/v1/payments), and docs.

Automate with TruffleHog:
sudo docker run -it -v "$PWD:/pwd" trufflesecurity/trufflehog:latest github --org=paytm
Scans for secrets across repos; extend to GitLab or S3 for full coverage. (Docs: TruffleHog GitHub)

Technique 3: Shodan for Exposed Services

Shodan indexes internet-facing devices. Search by domain/IP for APIs.

Shodan QueryPurpose
hostname:"paytm.com"Target-specific basics
"content-type: application/json"JSON APIs
"content-type: application/xml" + 200 OKSuccessful XML endpoints
"wp-json"WordPress APIs

Combine for gold: hostname:"phonepe.com" "content-type: application/json" "200 OK". Ideal for auditing exposed RBI-mandated APIs.

Technique 4: Wayback Machine for Zombie APIs

Archive.org snapshots reveal history. Check old landing pages for hidden partner APIs or docs changes. Hunt zombie endpoints (Improper Assets Management, OWASP Top 10)—retired but live paths like /api/v1/old-kyc.

Example Workflow:

  1. Enter target URL.
  2. Compare snapshots (e.g., 2023 vs. 2026).
  3. Test old endpoints actively later.

Key Takeaways and Next Steps

Passive recon builds your API blueprint ethically and efficiently. Tools like these have exposed secrets in major FinTech leaks—use them for RBI audits or pentests.

Next up: Active recon to probe those endpoints. Always document for compliance reports.

What API target or regulation (e.g., NPCI UPI) should I cover in the active recon post?


Leave a Reply

Your email address will not be published. Required fields are marked *