Security Misconfiguration
Learn about common security misconfigurations in web servers, frameworks, and cloud services.
TRANSMIT CRAFTED REQUEST
Client sends targeted probe for Security Misconfiguration
The client prepares and sends a crafted request targeting the implementation of Security Misconfiguration. Header attributes and payload parameters are manipulated to test validation boundaries.
POST /api/v1/modules/security-misconfiguration HTTP/1.1
Host: target.internal
Content-Type: application/json
{
"action": "probe",
"test_vector": "security-misconfiguration_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/security-misconfiguration [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 Security Misconfiguration 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/security-misconfiguration HTTP/1.1
Host: target.internal
Content-Type: application/json
{
"action": "probe",
"test_vector": "security-misconfiguration_exploit_vector"
}What is Security Misconfiguration?
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
Testing Steps / Methodology
- Request common debug/administrative paths and verify whether debug mode, stack traces or framework debug consoles are reachable.
- Attempt directory listing on common asset and upload directories.
- Enumerate accepted HTTP methods per endpoint (OPTIONS, TRACE, PUT, DELETE) and test whether state-changing methods are unintentionally enabled.
- Check for default or sample application pages/accounts left in place after deployment.
- Document each misconfiguration with the request that revealed it.
Security Misconfiguration
Tools Used in This Manual
| Tool | Purpose |
|---|---|
| Nikto | Automated scan for debug paths, default files, sample pages, dangerous HTTP methods, and common misconfigurations in one pass |
| ffuf / gobuster | Directory and path discovery (debug consoles, admin paths, asset directories) |
| Nmap (http-methods, http-enum scripts) | Enumerate allowed HTTP methods and common paths per host |
| Burp Suite (Repeater) | Manual confirmation of anything the scanners flag |
This lab covers 5 steps:
- Check for reachable debug/admin paths and stack traces
- Check for directory listing on asset/upload directories
- Enumerate allowed HTTP methods per endpoint
- Check for default/sample pages and accounts
- Document each misconfiguration with the revealing request
Step 1 - Debug/Administrative Paths and Stack Traces
Goal: Many frameworks ship with a debug console or verbose error page that should be disabled in production - find out if it's still reachable.
1.1 Run Nikto for a broad first pass
nikto -h https://target.com
Nikto's default database already checks for dozens of known debug/admin paths (/phpinfo.php, /.git/, /server-status, framework-specific debug routes) and reports each one it finds reachable, with the exact path and response code - no manual list needed.
1.2 Target framework-specific debug consoles with ffuf, if Nikto doesn't cover a newer framework
ffuf -u https://target.com/FUZZ -w debug_paths.txt -mc 200,500
Where debug_paths.txt is a small curated list for the specific framework identified earlier (Django's /admin/, Rails' /rails/info/properties, Spring Boot's /actuator/, Laravel's /_ignition/health-check) - SecLists' repository has ready-made wordlists for most major frameworks under its "Discovery/Web-Content" category.
1.3 Trigger an error deliberately to check stack trace verbosity
Send an obviously malformed request (via Burp Repeater - e.g. an extra unexpected parameter, a broken content-type) and check whether the resulting error page reveals a full stack trace, file paths, or library version numbers instead of a generic error message.
1.4 Reading results
| Finding | Meaning |
|---|---|
| Debug console loads and allows interaction (e.g. Django admin, Spring Boot actuator with write endpoints) | Confirmed - critical |
| Stack trace reveals file paths, framework version, or query details | Confirmed - information disclosure |
| Generic error page, no console reachable | Properly configured |
Step 2 - Directory Listing
Goal: Check whether common asset/upload directories expose a raw file listing instead of a proper 403/404.
2.1 Nikto already checks this as part of its default scan
The Step 1.1 Nikto run flags directory listing findings automatically if encountered during its crawl - check its output for "Directory indexing found" style entries.
2.2 Target specific common directories directly with ffuf
ffuf -u https://target.com/FUZZ/ -w common_dirs.txt -mc 200
Where common_dirs.txt includes typical candidates: uploads, assets, files, images, backup, tmp, media, static, old, .git.
2.3 Confirm manually
Open any flagged directory URL directly in a browser - a true directory listing shows an auto-generated HTML page with clickable file/folder links (Apache's classic "Index of /..." style page) rather than the app's normal UI or a 403.
Step 3 - Enumerate Allowed HTTP Methods
Goal: Check which HTTP methods each endpoint accepts - OPTIONS, TRACE, PUT, DELETE being unexpectedly enabled can allow unintended actions or information disclosure.
3.1 Nmap's http-methods script - fastest broad check
nmap -p 80,443 --script http-methods --script-args http-methods.url-path='/' target.com
This reports every method the server accepts at the given path in one pass, and specifically flags "potentially risky methods" like PUT, DELETE, TRACE in its output.
3.2 Check OPTIONS directly for a specific endpoint, via curl's simplicity
curl -s -i -X OPTIONS https://target.com/api/users
The Allow: response header lists exactly which methods that specific endpoint accepts - repeat this across your list of important/sensitive endpoints found during earlier recon.
3.3 Test whether a state-changing method actually works, not just whether it's "allowed"
A server reporting PUT in its Allow header doesn't always mean a PUT request has a real effect - confirm in Burp Repeater by actually sending a PUT/DELETE to a test resource and checking whether it succeeds:
curl -s -i -X DELETE https://target.com/api/resource/test123
3.4 Check for TRACE method specifically (XST - Cross-Site Tracing)
curl -s -i -X TRACE https://target.com/ -H "X-Custom: test"
If the response echoes back your custom header exactly, TRACE is enabled - this can be combined with other weaknesses (like inadequate HttpOnly cookie protection) to read cookies via XST in older browsers.
Step 4 - Default/Sample Pages and Accounts
Goal: Check whether content that ships with a framework/server by default - example pages, demo accounts - was left in place after deployment.
4.1 Nikto covers this too, as part of the same scan from Step 1
Nikto's database specifically checks for well-known sample files (Tomcat's /examples/, Apache's default welcome page remnants, phpMyAdmin's setup scripts) as part of its default run - no separate command needed if you already ran Step 1.1.
4.2 Check default credentials - reuse the Step 1 approach from the Broken Authentication manual
nmap -p 80,443,8080 --script http-default-accounts target.com
This is the same tool/script used earlier for default-credential testing - directly relevant here too, since "a default account left in place" is itself a security misconfiguration finding, not just a separate category.
4.3 Check for leftover setup/installer scripts specifically
ffuf -u https://target.com/FUZZ -w installer_paths.txt -mc 200
Common candidates: /install.php, /setup.php, /wp-admin/install.php, /phpmyadmin/setup/.
Step 5 - Document Each Misconfiguration
Goal: Export directly from each scanner's native output format.
5.1 Nikto's built-in reporting
nikto -h https://target.com -o evidence_nikto_report.html -Format html
Nikto generates a clean, readable report in one command - no manual write-up needed for anything it found.
5.2 Nmap script output
nmap -p 80,443,8080 --script http-methods,http-default-accounts target.com -oN evidence_nmap_methods.txt
5.3 ffuf JSON output
ffuf -u https://target.com/FUZZ -w debug_paths.txt -mc 200,500 -o evidence_ffuf_debug.json -of json
5.4 Manual confirmations via Burp
For anything confirmed by hand (actual DELETE working, a stack trace's content), save the Repeater request/response pair directly.
Evidence Table Template:
| No. | Misconfiguration |
|---|---|
| 1 | Debug console reachable |
| 2 | Verbose stack trace |
| 3 | Directory listing |
| 4 | Risky HTTP method enabled |
| 5 | DELETE actually functional |
| 6 | TRACE enabled |
| 7 | Default admin account |
| 8 | Leftover installer script |
| No. | Tool Used |
|---|---|
| 1 | Nikto |
| 2 | Burp Repeater (malformed request) |
| 3 | Nikto + ffuf |
| 4 | Nmap http-methods |
| 5 | Burp Repeater (manual DELETE test) |
| 6 | curl (manual XST check) |
| 7 | Nmap http-default-accounts |
| 8 | ffuf |
| No. | Finding | Conclusion |
|---|---|---|
| 1 | Spring Boot Actuator /actuator/env exposed |
Confirmed - critical |
| 2 | File paths and library versions disclosed | Confirmed |
| 3 | /uploads/ returns raw file index |
Confirmed |
| 4 | PUT and DELETE both listed as allowed |
Confirmed - needs manual impact test |
| 5 | Test resource successfully deleted | Confirmed - critical |
| 6 | Custom header echoed back in response | Confirmed |
| 7 | admin:admin succeeded on Tomcat Manager |
Confirmed - critical |
| 8 | /install.php returns 200, setup wizard loads |
Confirmed |
Security Misconfiguration Hands-on Lab
Launch your local laboratory environment to verify this vulnerability.