Koding Siber Logo
Koding Siber
Academy CatalogWeb Application SecurityConfiguration, Cryptography and Components
Beginner Level30 minsFree Preview Module
Category: Configuration, Cryptography and Components

Information Disclosure

Understand how applications unintentionally reveal sensitive information to attackers.

EXPLORERINTERACTIVE
Information Disclosure
HTTP
INFO:POST /api/v1/modules/information-disclosure [Test Probe]
Client Workstation(192.168.1.10)
Originating client terminal sending test probes and HTTP request variations to audit system behavior.
SIMULATION CONTROLSStep 1 of 5
Simulation Speed:
Simulation paused (click Play Flow or Next Step)
STEP 1 OF 5

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.

Payload / Code Inspector
POST /api/v1/modules/information-disclosure HTTP/1.1
Host: target.internal
Content-Type: application/json

{
  "action": "probe",
  "test_vector": "information-disclosure_exploit_vector"
}
Defensive Mitigation
Follow defense-in-depth principles, enforce strict input validation, and adhere to OWASP security best practices for Information Disclosure.

PACKET FLOW (WIRESHARK INSPECTOR)

Click any row to jump to step
NO.TIMESOURCEDESTINATIONPROTOCOLINFOSIZE
10.000s192.168.1.10192.168.1.1HTTPPOST /api/v1/modules/information-disclosure [Test Probe]164 B
20.012s192.168.1.1203.0.113.10TLSTLS 1.3 Forwarding downstream to internal service188 B
30.025s203.0.113.1010.0.2.80SQLEXECUTE: Processing Information Disclosure operation220 B
40.039s10.0.2.80203.0.113.10SQLINTERNAL_RESPONSE: State transition confirmed312 B
50.054s203.0.113.10192.168.1.10HTTPHTTP/1.1 200 OK [Exploit Output Verified]284 B
Payload Inspector
STEP 1
Client Workstationβž”Perimeter Router
HTTP
Transmitted Data
164 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"
}
Client sends targeted probe for Information DisclosureINSPECTED
Vulnerability Overview

What is Information Disclosure?

Information disclosure is about anything the app reveals that it shouldn't - error details that expose internals, files that were never meant to be public, secrets left in client-side code, or infrastructure details visible through public records. None of this requires breaking anything; it's mostly about looking carefully at what's already there, which is exactly what these tools automate.
Impact
Assists attackers in reconnaissance and may expose credentials.
Severity
MEDIUM
Technical Mechanism & Code Flaw

Root Cause Analysis

The vulnerability exists because user-controlled data is interpreted as commands or code rather than plain data.
Vulnerable Implementation (Anti-Pattern)UNSAFE
// BAD: Untrusted execution or unhardened configuration
const config = { debug: true, allowUnauthenticated: true };
app.use('/api', createService(config));


Secure Implementation (Hardened)SECURED



// 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

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:

  1. Trigger errors and inspect responses for stack traces/paths/query text
  2. Request well-known sensitive paths
  3. Review page source, JS bundles, and headers for secrets/banners
  4. Use search-engine and certificate-transparency recon for further exposed assets
  5. 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
Hands-on Lab Exercise

Information Disclosure Hands-on Lab

Launch your local laboratory environment to verify this vulnerability.

$ curl -X POST http://127.0.0.1:8080/api/target \ -d "probe=information-disclosure"
β€’ Goal: Verify vulnerable state behavior and apply defense
β€’ Solution: Enforce defense-in-depth and strict validation
Knowledge Check
ASSESSMENT

What is the primary, most effective defense mechanism against Information Disclosure?

Next Module in Configuration, Cryptography and Components
Missing or Weak Security Headers
Continue to Next Module