Information Disclosure
Understand how applications unintentionally reveal sensitive information to attackers.
TRANSMIT CRAFTED REQUEST
Client sends targeted probe for Information Disclosure
The client prepares and sends a crafted request targeting the implementation of Information Disclosure. Header attributes and payload parameters are manipulated to test validation boundaries.
POST /api/v1/modules/information-disclosure HTTP/1.1
Host: target.internal
Content-Type: application/json
{
"action": "probe",
"test_vector": "information-disclosure_exploit_vector"
}PACKET FLOW (WIRESHARK INSPECTOR)
| NO. | TIME | SOURCE | DESTINATION | PROTOCOL | INFO | SIZE |
|---|---|---|---|---|---|---|
| 1 | 0.000s | 192.168.1.10 | 192.168.1.1 | HTTP | POST /api/v1/modules/information-disclosure [Test Probe] | 164 B |
| 2 | 0.012s | 192.168.1.1 | 203.0.113.10 | TLS | TLS 1.3 Forwarding downstream to internal service | 188 B |
| 3 | 0.025s | 203.0.113.10 | 10.0.2.80 | SQL | EXECUTE: Processing Information Disclosure operation | 220 B |
| 4 | 0.039s | 10.0.2.80 | 203.0.113.10 | SQL | INTERNAL_RESPONSE: State transition confirmed | 312 B |
| 5 | 0.054s | 203.0.113.10 | 192.168.1.10 | HTTP | HTTP/1.1 200 OK [Exploit Output Verified] | 284 B |
POST /api/v1/modules/information-disclosure HTTP/1.1
Host: target.internal
Content-Type: application/json
{
"action": "probe",
"test_vector": "information-disclosure_exploit_vector"
}What is Information Disclosure?
Root Cause Analysis
// BAD: Untrusted execution or unhardened configuration
const config = { debug: true, allowUnauthenticated: true };
app.use('/api', createService(config));
// GOOD: Strict hardening and defense-in-depth
const config = { debug: false, allowUnauthenticated: false, authRequired: true };
app.use('/api', authenticate, createService(config));Detection & Penetration Testing Methodology
Information Disclosure
Tools Used in This Manual
| Tool | Purpose |
|---|---|
| Nikto | Flags error-triggering paths, sensitive files, version banners in one pass |
| ffuf / gobuster | Directory/file discovery for .git/, .env, backups, admin paths |
| git-dumper / GitTools | Reconstructs a full repo from an exposed .git/ directory |
| TruffleHog / Gitleaks | Scans JS bundles, repos, and page source for API keys/secrets automatically |
| crt.sh / Subfinder / Amass | Certificate-transparency and subdomain reconnaissance |
| Google/Shodan dorking | Search-engine reconnaissance for indexed sensitive content |
This lab covers 5 steps:
- Trigger errors and inspect responses for stack traces/paths/query text
- Request well-known sensitive paths
- Review page source, JS bundles, and headers for secrets/banners
- Use search-engine and certificate-transparency recon for further exposed assets
- Document each disclosed item and its source
Step 1 - Trigger Errors and Inspect Responses
Goal: Malformed input often produces a verbose error page in a misconfigured app - check what it reveals.
1.1 Let Nikto trigger and flag this automatically
nikto -h https://target.com
Nikto's scan includes requests designed to provoke error responses, and flags anything resembling a stack trace, path disclosure, or SQL error text directly in its output.
1.2 Manually trigger one error via Burp Repeater, to read the full detail
Capture any request, send to Repeater, and break it deliberately - an extra unexpected parameter, a broken Content-Type, an invalid ID format. Read the response for file paths, framework/library version numbers, or raw query text.
1.3 What to look for
- Full file system paths (
/var/www/html/app/controllers/...) - Framework name + exact version (useful later for checking known CVEs)
- Raw SQL fragments in the error text
- Internal variable names or function names
Step 2 - Well-Known Sensitive Paths
Goal: Check for files that should never be publicly served - version control directories, environment files, backups, forgotten admin panels.
2.1 Run a focused ffuf scan with a sensitive-files wordlist
ffuf -u https://target.com/FUZZ -w sensitive-files.txt -mc 200
SecLists' Discovery/Web-Content directory has ready-made wordlists for exactly this (.git, .env, .DS_Store, backup.zip, wp-config.php.bak, etc.) - no need to build your own list.
2.2 If .git/ is exposed, reconstruct the whole repository instead of guessing file-by-file
git-dumper https://target.com/.git/ ./dumped-repo
This tool detects the exposed .git directory and automatically pulls down the full repository history - far more thorough than manually requesting individual git object files.
2.3 Scan the dumped repo for secrets automatically
trufflehog filesystem ./dumped-repo
TruffleHog scans the entire repo history (not just the current files) for API keys, credentials, and tokens that may have been committed and later removed - catching secrets that wouldn't be visible in the live site at all.
2.4 Nikto also flags many of these same sensitive paths as part of its standard scan
The Step 1.1 scan already checks for several of these (.env, common backup extensions) - cross-reference its output before running a separate dedicated pass.
Step 3 - Page Source, JS Bundles, and Headers
Goal: Client-side code and HTTP headers often leak more than intended - version banners, internal hostnames, hardcoded keys, leftover developer comments.
3.1 Scan all JS files for secrets automatically
trufflehog filesystem /path/to/downloaded/js/files
Or point Gitleaks at the same files:
gitleaks detect --source=/path/to/downloaded/js/files --no-git
Both tools use regex/entropy-based detection tuned for exactly this - API keys, AWS credentials, private keys, internal URLs - far faster and more reliable than manually reading minified JS.
3.2 Download the JS bundles first, if not already saved
wget -r -l1 -A.js https://target.com/
Or use Burp's HTTP history - right-click any .js response β "Save item" for each bundle the app loaded while you browsed it.
3.3 Check HTTP headers for version banners
curl -s -I https://target.com/
Look for Server:, X-Powered-By:, and similar headers revealing exact software versions - note these for cross-referencing against known CVEs later.
3.4 Check HTML source comments directly
curl -s https://target.com/ | grep -A 2 "<!--"
Developer comments left in production HTML sometimes include internal notes, TODOs referencing internal systems, or even commented-out credentials.
Step 4 - Search-Engine and Certificate-Transparency Recon
Goal: Find exposed assets that exist outside the main app entirely - forgotten subdomains, indexed sensitive pages, documents search engines have crawled.
4.1 Certificate transparency logs - find subdomains via crt.sh
curl -s "https://crt.sh/?q=%.target.com&output=json" | jq -r '.[].name_value' | sort -u
Certificate transparency logs record every SSL certificate ever issued for the domain - this often reveals subdomains (staging, internal, dev environments) that were never meant to be discoverable, since a cert had to be issued for them at some point regardless of whether DNS/robots.txt hides them.
4.2 Automated subdomain enumeration, combining multiple sources at once
subfinder -d target.com -silent
or
amass enum -passive -d target.com
Both aggregate crt.sh plus many other passive sources (DNS databases, search engines) in one run - much broader than checking crt.sh alone.
4.3 Google dorking for indexed sensitive content
Run these searches directly in Google (or via a dorking tool like Pagodo, which automates a whole dork list against a target):
site:target.com filetype:pdf
site:target.com filetype:env
site:target.com intitle:"index of"
site:target.com inurl:admin
site:target.com ext:log
pagodo -d target.com -g dorks.txt -l 50 -s
4.4 Shodan for exposed infrastructure beyond the web app itself
shodan search hostname:target.com
Reveals any additional exposed services (databases, admin panels, IoT devices) tied to the organization's IP ranges that might not be linked from the main site at all.
Step 5 - Document Each Disclosed Item
Goal: Export directly from each tool's native output.
5.1 Nikto report
nikto -h https://target.com -o evidence_nikto.html -Format html
5.2 ffuf results
ffuf -u https://target.com/FUZZ -w sensitive-files.txt -mc 200 -o evidence_ffuf_sensitive.json -of json
5.3 TruffleHog/Gitleaks findings
Both print found secrets directly to the terminal with file location and line number - redirect to a file:
trufflehog filesystem ./dumped-repo --json > evidence_trufflehog.json
5.4 Subdomain/certificate transparency results
subfinder -d target.com -silent -o evidence_subdomains.txt
5.5 Manual confirmations
For anything confirmed by hand (a specific error page, a header), save the raw curl output or Burp Repeater request/response pair.
Evidence Table Template
| No. | Item Disclosed |
|---|---|
| 1 | Full stack trace with file paths |
| 2 | .git/ directory exposed, full repo reconstructed |
| 3 | AWS access key in committed repo history |
| 4 | API key hardcoded in JS bundle |
| 5 | Server version banner |
| 6 | Internal staging subdomain |
| 7 | Indexed internal PDF with employee data |
| No. | Source |
|---|---|
| 1 | Malformed API request |
| 2 | /.git/ |
| 3 | Reconstructed repo |
| 4 | /static/app.js |
| 5 | Response headers |
| 6 | Certificate transparency |
| 7 | Google search |
| No. | Tool Used | Sensitivity | Conclusion |
|---|---|---|---|
| 1 | Burp Repeater | Medium | Confirmed |
| 2 | git-dumper | High | Confirmed |
| 3 | TruffleHog | Critical | Confirmed |
| 4 | Gitleaks | Critical | Confirmed |
| 5 | curl -I | Low | Confirmed (minor, useful for CVE lookup) |
| 6 | crt.sh / subfinder | Medium-High | Confirmed |
| 7 | Dork: site:target.com filetype:pdf |
High | Confirmed |
Information Disclosure Hands-on Lab
Launch your local laboratory environment to verify this vulnerability.