OSINT and leaks
- Noise
- Passive
- Reads
org/domains.txtsubs/all.txt- Writes
osint/dorks.mdosint/github.mdosint/secrets/osint/people.md
Mistakes that employees publish stay online for years, and they are free to find. This phase uses open-source intelligence (OSINT) to find what the company and its people published by accident. Typical finds are indexed documents, code with credentials, public API collections, and old pages that the Wayback Machine kept. None of this touches the target’s servers, so you can do it on any program, any time.
| Tool | Noise | Role | Status |
|---|---|---|---|
| Google dorks and the GHDB | Passive | Search operators for exposed files and panels | Online service |
| GitHub code search | Passive | Hostnames, keys and configs in public code | Online service |
| GitDorker | Passive | Runs many GitHub dorks with your tokens | Rarely updated |
| truffleHog | Passive | Scans repos and history for secrets, verifies many key types | Maintained |
| gitleaks | Passive | Fast secret scanner for repos and directories | Maintained |
| Postman public workspaces | Passive | Public API collections, sometimes with tokens | Online service |
| theHarvester | Passive | Emails, names, hosts from public sources | Maintained |
| SpiderFoot | Passive | Automated OSINT with many modules and a web UI | Open-source version rarely updated |
| recon-ng | Passive | Modular framework with a module marketplace | Maintained |
| Maltego | Passive | Graph link analysis, free community edition | Commercial |
| Hunter.io | Passive | Corporate email formats and addresses | Online service |
| Wayback Machine | Passive | Old versions of pages, files and robots.txt | Online service |
| OSINT Framework | Passive | Directory of OSINT tools by category | Online reference |
Some modules in SpiderFoot, recon-ng and theHarvester do resolve or contact hosts. Check module descriptions if a program is strict.
What a public leak proves
Section titled “What a public leak proves”Verified cloud key
Section titled “Verified cloud key”Detector: AWSVerification: SuccessfulFile: deploy/terraform/main.tfCommit: a1b2c3d4e5f6truffleHog verified an AWS key in deploy/terraform/main.tf. The provider accepted the key at scan time. It does not mean the key belongs to the company’s production account. It may be a personal account or a sandbox. It also does not say which permissions are attached. Report the leak. Do not explore the account.
Postman variable
Section titled “Postman variable”Workspace: Example Mobile Core, publicVariable: STAGING_AUTH_TOKENURL: https://billing-staging.internal.example.comA public workspace published a token and an internal hostname. The collection was world-readable. The token may already be dead. The hostname may not resolve on the public internet. Resolve it in phase 4 before you add it to live hosts.
Archived debug path
Section titled “Archived debug path”https://api.example.com/v1/debug/pprof 200 20220412153022The CDX API says that path returned 200 in April 2022. The archive saw it then. It does not mean the route is mounted today. Request it once. A 404 means it is gone. A 401 means it moved behind a login.
Convincing duds
Section titled “Convincing duds”Revoked key in a test file
Section titled “Revoked key in a test file”cypress.env.json or .env.test in a personal repo holds a key-shaped string next to https://api.example.com. The API answers 401 and the body says the token was revoked. The repo is a test suite, and the string is dead. Keys copied from a vendor’s docs fail the same check.
Hostname that only exists on paper
Section titled “Hostname that only exists on paper”A code search finds internal.example.com, and the name resolves to a loopback address or a private range. You found a string. You did not find a host you can reach. Keep it in your notes. Do not file it as an exposed server.
Step by step
Section titled “Step by step”-
Google dorks. Start with the Google Hacking Database for ideas, then adapt them.
# Exposed files on the target's hostssite:example.com ext:log | ext:env | ext:sql | ext:bak | ext:conf# Subdomains other than wwwsite:*.example.com -www# Login and admin pagessite:example.com inurl:login | inurl:admin | inurl:signin# API documentation that maps the whole surfacesite:example.com inurl:swagger | inurl:api-docs | inurl:openapi.json# Documents that may hold internal datasite:example.com ext:pdf | ext:docx | ext:xlsx "internal" | "confidential"# Third-party sites that mention the targetsite:trello.com "example.com"site:pastebin.com "example.com"site:s3.amazonaws.com "example"Record useful queries and hits in
osint/dorks.md.An API-docs hit is worth chasing because the document lists every route and parameter at once. When the dork finds nothing, probe the common paths directly on each live host, as a light-active check in phase 11:
/swagger.json/swagger/v1/swagger.json/swagger-ui//swagger-ui/index.html/v2/api-docs/v3/api-docs/openapi.json/api-docs/redoc -
GitHub code search. Search for hostnames rather than the company name. Engineers rarely type “Example Inc” in code, but they paste
api.internal.example.comall the time.# Internal hosts mentioned in public code"internal.example.com"# Config files that mention the domain"example.com" path:*.env"example.com" language:YAML password# Code in the company's own GitHub orgorg:example-inc "api_key"# CI pipelines, where deploy tokens and internal hostnames collectorg:example-inc path:.github/workflows"example.com" filename:.gitlab-ci.ymlCheck the company’s GitHub org, then the personal accounts of employees who list the company in their profile. Personal repos are where work code leaks. CI files such as
.github/workflows/*.ymland.gitlab-ci.ymlare worth opening first: they name internal registries, deploy hosts, and the secret names the pipeline expects, even when the values are masked. -
Scan repos for secrets. truffleHog verifies many key types against the provider’s API, which removes most false positives.
Terminal window # Every public repo in the company's GitHub org, verified secrets onlytrufflehog github --org=example-inc --results=verified > osint/secrets/trufflehog-org.txtTerminal window # One repo including full git historytrufflehog git https://github.com/example-inc/legacy-app --results=verifiedTerminal window # gitleaks on a cloned repo, with a JSON reportgit clone https://github.com/example-inc/legacy-app /tmp/legacy-appgitleaks git -v --report-path osint/secrets/gitleaks-legacy-app.json /tmp/legacy-appGitDorker automates many dork queries but has not been updated in years; GitHub’s own search syntax now covers most of what it did.
-
Postman public workspaces. Search postman.com/explore for the domain and the company name. Look at environments and collection variables, where tokens often sit.
-
People and email formats. theHarvester and Hunter.io show the email pattern (
first.last@example.com) and names. In a pentest this helps build username lists. In bug bounty, social engineering is almost always out of scope, so use it only to understand the org.Terminal window # Emails and hosts from a couple of free sourcestheHarvester -d example.com -b crtsh,duckduckgo -f osint/harvester -
Frameworks for automated OSINT. SpiderFoot runs a local web UI; recon-ng is a console with installable modules.
Terminal window # Start SpiderFoot's web UI on localhostpython3 sf.py -l 127.0.0.1:5001Terminal window # Start recon-ng in a workspace named after the targetrecon-ng -w exampleMaltego’s community edition draws the same kind of data as a graph, which helps on large orgs with many brands.
-
The Wayback Machine. Old
robots.txtfiles list paths the company wanted hidden. Old JS files show APIs that may still exist.Terminal window # Every archived URL for the domain that returned 200, deduplicated by URLcurl -s "https://web.archive.org/cdx/search/cdx?url=example.com/*&output=txt&fl=original&filter=statuscode:200&collapse=urlkey" > osint/wayback-cdx.txt# Old robots.txt versions, opened in a browserhttps://web.archive.org/web/2018*/example.com/robots.txtOld JavaScript is the richer seam. A bundle from two years ago often calls APIs the live site has since dropped but never decommissioned. Pull the archived
.jswith the CDX API, download a few old snapshots, and grep them the same way as phase 9.Terminal window # List every archived JS capture for the domain, newest copy per URLcurl -s "https://web.archive.org/cdx/search/cdx?url=example.com/*&output=txt&fl=original,timestamp&filter=mimetype:application/javascript&collapse=urlkey" > osint/wayback-js.txtTerminal window # Fetch one archived version by timestamp (the id_ suffix returns the raw file)curl -s "https://web.archive.org/web/20220412153022id_/https://app.example.com/static/main.js" -o osint/old-js/main.jsGrep the downloaded copies for endpoints and key shapes, then resolve any new hostnames through phase 4.
-
When stuck, browse the OSINT Framework for a source type you have not tried.
How the output feeds the next phase
Section titled “How the output feeds the next phase”- Hostnames from GitHub, dorks and Wayback go into
subs/all.txtand back through phase 4. - Old paths and files from Wayback go into
urls/raw.txtand through phase 8. - Bucket names and cloud references feed phase 15.
Common mistakes
Section titled “Common mistakes”- Searching only for the company name. Search for hostnames and internal project names.
- Ignoring employees’ personal repos and gists.
- Reporting keys without checking whether they are live or meant to be public.
- Using leaked credentials beyond what the policy allows.
.env,config.yml,application.properties,docker-compose.ymlfiles in public repos that mention the domain- CI files (
.github/workflows,.gitlab-ci.yml) with hardcoded tokens - Postman environments with
Authorizationheaders orapi_keyvariables - Internal hostnames, IPs and project code names in public issues or wikis
- Paths in old
robots.txtthat still respond today
Next, check the cloud storage the target owns in phase 15.
Open local graph around this page
Linked from here
Recon AtlasFor authorized testing only. Your scope is the map edge.