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

Security Misconfiguration

Learn about common security misconfigurations in web servers, frameworks, and cloud services.

EXPLORERINTERACTIVE
Security Misconfiguration
HTTP
INFO:POST /api/v1/modules/security-misconfiguration [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 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.

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

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

PACKET FLOW (WIRESHARK INSPECTOR)

Click any row to jump to step
NO.TIMESOURCEDESTINATIONPROTOCOLINFOSIZE
10.000s192.168.1.10192.168.1.1HTTPPOST /api/v1/modules/security-misconfiguration [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 Security Misconfiguration 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/security-misconfiguration HTTP/1.1
Host: target.internal
Content-Type: application/json

{
  "action": "probe",
  "test_vector": "security-misconfiguration_exploit_vector"
}
Client sends targeted probe for Security MisconfigurationINSPECTED
Vulnerability Overview

What is Security Misconfiguration?

Security misconfiguration covers the "low-hanging fruit" category - things that aren't a flaw in the application's logic, but a flaw in how it was deployed: debug consoles left reachable, directory listing exposing files it shouldn't, dangerous HTTP methods left enabled, or sample/default content never cleaned up after setup. These are exactly the kind of findings automated scanners excel at, since they're pattern-matchable against known file paths and known default configurations.
Impact
Exposes internal details and expands the attack surface.
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

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:

  1. Check for reachable debug/admin paths and stack traces
  2. Check for directory listing on asset/upload directories
  3. Enumerate allowed HTTP methods per endpoint
  4. Check for default/sample pages and accounts
  5. 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
Hands-on Lab Exercise

Security Misconfiguration 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=security-misconfiguration"
• 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 Security Misconfiguration?

Next Module in Configuration, Cryptography and Components
Information Disclosure
Continue to Next Module