OWASP WSTG: Part 3 - Configuration and Deployment Management
WSTG v4.2 section 4.2 explained: infrastructure and platform configuration, sensitive file extensions, backup and unreferenced files, admin interfaces, HTTP methods, HSTS, cross-domain policies, file permissions, subdomain takeover and cloud storage.
A perfectly written application can still be compromised by how it is deployed: a backup file left in the web root, an admin console reachable from the internet, PUT enabled on the server, a DNS record pointing to a deleted cloud service, or a storage bucket open to everyone.
Configuration and Deployment Management testing (WSTG section 4.2, IDs WSTG-CONF-*) checks the platform around the code. These issues are common, easy to exploit and often critical, which is why “Security Misconfiguration” has been in the OWASP Top 10 for years.
Source: WSTG v4.2 §4.2 Configuration and Deployment Management Testing (CC BY-SA 4.0), explained and expanded. Only test systems you are authorised to test.
Key Takeaways
- Defaults are dangerous: sample apps, default pages, debug modes and default credentials ship with almost every platform.
- Files you forgot are files attackers find:
.bak,.old,~,.swp,.git/,.env, archives of the web root. - Restrict HTTP methods to what the application needs, and check that access controls apply to every method.
- HSTS, DNS hygiene and cloud storage permissions are part of the application’s security, not “someone else’s problem”.
- Most fixes are configuration, not code: hardening baselines (CIS Benchmarks) and automated checks in deployment pipelines prevent regressions.
Where Configuration Issues Live
flowchart TD
DNS["DNS<br/>dangling CNAME / NS records (CONF-10)"] --> EDGE
EDGE["Edge: TLS, HSTS (CONF-07),<br/>HTTP methods (CONF-06)"] --> WS
WS["Web server<br/>known CVEs, admin tools (CONF-01),<br/>defaults & logging (CONF-02)"] --> APP
APP["Application files<br/>extensions (CONF-03), backups (CONF-04),<br/>admin interfaces (CONF-05), permissions (CONF-09)"]
APP --> CLOUD["Cloud storage<br/>S3 / Azure Blob / GCS ACLs (CONF-11)"]
APP --> RIA["Cross-domain policies<br/>crossdomain.xml (CONF-08)"]
WSTG-CONF-01: Test Network Infrastructure Configuration
What it checks: that every component the application depends on (web server, application server, reverse proxy, database, admin tools) is maintained, patched and not exposed unnecessarily.
How to test:
- Known server vulnerabilities: take the versions you fingerprinted in Part 2 and look them up.
1
2
3
nmap -sV --script vulners -p 80,443,8080,8443 example.com
searchsploit apache 2.4.49
nuclei -u https://example.com -t cves/
Be careful with automated results: version-based matches produce false positives (back-ported patches) and false negatives (hidden banners). Confirm before reporting.
- Administrative tools: look for management interfaces of the infrastructure itself: Tomcat Manager (
/manager/html), JBoss/WildFly consoles, WebLogic, cPanel/Plesk, phpMyAdmin, Jenkins, Kibana, Grafana.
What a finding looks like: Apache 2.4.49 with path traversal (CVE-2021-41773) exposed to the internet, or a Tomcat manager with default credentials.
Fix: patch management with an inventory of every component, remove or firewall management interfaces, and change all default credentials.
WSTG-CONF-02: Test Application Platform Configuration
What it checks: that default files, sample applications and debug features have been removed, and that logging is adequate.
How to test (black box):
- Sample and default files:
/examples/,/docs/,/manual/,/server-status,/server-info,/phpinfo.php,/test.php, IISiisstart.htm, Tomcat examples.
1
2
3
nikto -h https://example.com
curl -s https://example.com/server-status | head
curl -s https://example.com/phpinfo.php | grep -i "PHP Version"
- Debug modes: a Django or Laravel debug page, ASP.NET detailed errors, Spring Boot Actuator endpoints (
/actuator/env,/actuator/heapdump), Symfony profiler (/_profiler). - Comments in configuration-generated pages that reveal paths or versions.
How to test (gray box): review the server and framework configuration against a hardening baseline, and review logging:
- What is logged (authentication events, access-control failures, input-validation failures) and what must not be logged (passwords, session tokens, full card numbers).
- Where logs are stored, whether they are rotated, who can read them, and whether anyone reviews them.
What a finding looks like: /actuator/env exposing database credentials, or DEBUG = True showing settings and environment variables on error pages.
Fix: remove default and sample content, disable debug features in production, apply CIS Benchmarks or vendor hardening guides, and log security events to a protected, centralised store.
WSTG-CONF-03: Test File Extensions Handling for Sensitive Information
What it checks: how the server handles different file extensions, and whether files with “non-executable” extensions expose source code or data.
Why it matters: if config.inc is served as plain text instead of being executed, its database password is readable:
1
2
3
<?php
mysql_connect("127.0.0.1", "root", "password") or die("Could not connect");
?>
How to test:
1
2
# Forced browsing for interesting extensions
ffuf -u https://example.com/FUZZ -w words.txt -e .inc,.bak,.old,.txt,.config,.sql,.log,.zip,.tar.gz,.asa,.java,.py
Extensions that should never be served to users include: .asa, .inc, .config, .sql, .log, .bak, .old, .java, .py, .zip, .tar.gz, .pdf/.docx with internal content. Also test upload functionality: can you upload a file with one of these extensions and have the server process it (see Part 11, BUSL-08/09)?
Fix: map every extension explicitly (execute or deny), deny-list sensitive extensions at the web server, and keep include files outside the web root.
WSTG-CONF-04: Review Old Backup and Unreferenced Files
What it checks: forgotten copies of files: editor backups, renamed old versions, archives of the site, version control folders.
How to test:
- Infer names from what exists. If
/login.phpexists, trylogin.php.bak,login.php.old,login.php~,.login.php.swp,login_old.php,Copy of login.php,login.php.save. - Look for clues in content: commented-out links and client-side code revealing hidden pages:
1
<!-- <a href="uploadfile.jsp">Upload a document</a> link removed while bugs are fixed -->
1
2
var adminUser = false;
if (adminUser) menu.add(new menuItem("Maintain users", "/admin/useradmin.jsp"));
- Blind guessing with wordlists, including whole-site archives (
site.zip,www.tar.gz,backup.sql) and VCS metadata:
1
2
3
curl -s https://example.com/.git/HEAD # ref: refs/heads/main = exposed repo
curl -s https://example.com/.env | head -3
ffuf -u https://example.com/FUZZ -w /usr/share/seclists/Discovery/Web-Content/raft-medium-files.txt -mc 200
An exposed .git/ folder can be downloaded entirely (e.g. with git-dumper) to recover the full source code and history, often including old secrets.
Fix: never edit files on production servers, deploy through a pipeline that only ships build artefacts, block access to dotfiles (/.git, /.env, /.svn), and remove backups from the web root.
WSTG-CONF-05: Enumerate Infrastructure and Application Admin Interfaces
What it checks: hidden administrator interfaces and functions, and whether normal users can reach them.
How to test:
- Directory and file guessing:
/admin,/administrator,/admin.php,/manage,/console,/cms,/backend,/wp-admin,/phpmyadmin. - Source code comments and JavaScript referencing admin routes (see CONF-04).
- Parameter tampering: hidden fields or cookies that switch on admin features:
1
<input type="hidden" name="admin" value="no">
Change no to yes, or try ?admin=true, role=admin, and observe.
- Alternative ports for server administration (Tomcat on
8080, WebLogic on7001, cPanel on2083). - Gray box: read the documentation and routing configuration for admin endpoints.
Fix: put admin interfaces on a separate host or path restricted by network (VPN, IP allow-list), require strong authentication with MFA, and enforce authorization on the server for every admin action (see Part 6).
WSTG-CONF-06: Test HTTP Methods
What it checks: which HTTP methods the server accepts, and whether dangerous ones (PUT, DELETE, TRACE, CONNECT) or method-based access-control bypasses exist.
How to test:
- Discover supported methods:
1
2
nmap -p 443 --script http-methods --script-args http-methods.url-path='/index.php' example.com
curl -si -X OPTIONS https://example.com/ | grep -i allow
OPTIONS responses are not always truthful, so test each method directly.
PUT: can you upload a file?
1
2
curl -si -X PUT https://example.com/test.html -d '<p>PUT is enabled</p>'
curl -s https://example.com/test.html
- Access control bypass: if
/adminreturns403forGET, try other verbs; some configurations only protect specific methods:
1
2
3
for m in GET POST HEAD PUT DELETE PATCH OPTIONS FOO; do
printf '%-8s ' $m; curl -s -o /dev/null -w '%{http_code}\n' -X $m https://example.com/admin/
done
- Cross-Site Tracing (XST):
TRACEechoes the request, including cookies; combined with XSS it was used to stealHttpOnlycookies. Modern browsers block it, butTRACEshould still be disabled. - Method overriding: frameworks may honour
X-HTTP-Method-Override: DELETEor_method=DELETEon aPOST, bypassing method-based rules.
Fix: allow only the methods each endpoint needs, disable TRACE/TRACK, apply authorization independent of the method, and disable method-override headers unless required.
WSTG-CONF-07: Test HTTP Strict Transport Security
What it checks: that the Strict-Transport-Security header is present and correct, so browsers never connect over plain HTTP.
How to test:
1
2
curl -s -D- -o /dev/null https://example.com | grep -i strict-transport-security
# Good: Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
Check that:
max-ageis long (at least six months, ideally one year or more).includeSubDomainsis set if all subdomains support HTTPS.- The header is only sent over HTTPS, and HTTP redirects to HTTPS.
- For maximum protection, the domain is on the browser HSTS preload list (hstspreload.org), which protects even the very first visit.
What a finding looks like: no HSTS header, so a user on public Wi-Fi typing example.com can be downgraded to HTTP by an SSL-stripping attacker.
Fix: send Strict-Transport-Security: max-age=31536000; includeSubDomains on every HTTPS response, redirect HTTP to HTTPS, and consider preloading.
WSTG-CONF-08: Test RIA Cross Domain Policy
What it checks: cross-domain policy files used by Flash, Silverlight and Java applets (crossdomain.xml, clientaccesspolicy.xml).
How to test:
1
2
curl -s https://example.com/crossdomain.xml
curl -s https://example.com/clientaccesspolicy.xml
A wildcard policy lets any site read authenticated data from the domain:
1
2
3
<cross-domain-policy>
<allow-access-from domain="*" />
</cross-domain-policy>
These technologies are end-of-life, but the files still exist on many legacy sites. The modern equivalent is CORS, tested in Part 12 (CLNT-07).
Fix: remove the files if the technologies are not used; otherwise allow only specific, trusted domains.
WSTG-CONF-09: Test File Permission
What it checks: that files and directories on the server are not more accessible than required (configuration files readable by everyone, scripts writable by the web server user, logs readable by other users).
How to test (gray box, on the server):
1
2
3
4
5
6
# World-writable files and directories under the web root
find /var/www -perm -o+w -ls
# Readability of a sensitive file along its whole path
namei -l /var/www/app/config/database.yml
# Files owned by the web server user that should be read-only
find /var/www -user www-data -type f -perm -u+w
On Windows use Sysinternals AccessChk and AccessEnum.
Fix: least privilege: application code read-only for the web server user, secrets readable only by the service account, upload directories non-executable, and no world-writable paths.
WSTG-CONF-10: Test for Subdomain Takeover
What it checks: DNS records that point to resources that no longer exist (a deleted Heroku app, an unclaimed S3 bucket, an expired domain), which an attacker could claim.
How it works: shop.example.com has a CNAME to example-shop.herokuapp.com. The Heroku app is deleted but the DNS record stays. An attacker creates an app with that name and now serves content on shop.example.com, with the company’s cookies and reputation.
How to test:
1
2
3
4
5
6
7
8
9
10
11
# 1. Enumerate subdomains (current and historical)
amass enum -passive -d example.com -o subs.txt
subfinder -d example.com >> subs.txt
# 2. Look for CNAMEs to third-party services and dead targets
dig CNAME shop.example.com +short
dig shop.example.com # NXDOMAIN on the target = candidate
# 3. Fingerprint known takeover responses
subjack -w subs.txt -t 50 -ssl
nuclei -l subs.txt -t takeovers/
The response body often gives it away: “There isn’t a GitHub Pages site here”, “NoSuchBucket”, “No such app”. The can-i-take-over-xyz project lists which services are vulnerable. NS record takeover (a delegated zone whose name servers are no longer controlled) is rarer but more severe: the attacker controls all records.
Fix: remove DNS records when decommissioning services (delete the record first, then the resource), monitor DNS continuously, and keep an inventory of third-party services.
WSTG-CONF-11: Test Cloud Storage
What it checks: access control on cloud storage (Amazon S3, Azure Blob Storage, Google Cloud Storage) used by the application.
How to test:
- Find the buckets: they appear in HTML, JavaScript, API responses and DNS:
1
2
3
4
https://example-assets.s3.amazonaws.com/...
https://s3.eu-west-1.amazonaws.com/example-assets/...
https://exampleassets.blob.core.windows.net/...
https://storage.googleapis.com/example-assets/...
- Test anonymous read, list and write:
1
2
3
curl -s https://example-assets.s3.amazonaws.com/ # list objects?
aws s3 ls s3://example-assets --no-sign-request # list without credentials
aws s3 cp proof.txt s3://example-assets/proof.txt --no-sign-request # write? (only with permission)
- Test with any authenticated AWS account: “authenticated users” in old S3 ACLs means any AWS customer, not only your organisation.
What a finding looks like: a bucket that lists every customer invoice, or that accepts uploads, letting an attacker replace JavaScript served to every user.
Fix: block public access at the account level, grant access with narrowly scoped IAM policies, serve private files through signed URLs, and audit buckets regularly (AWS Config, Azure Policy, Prowler, ScoutSuite).
Worked Example: An Exposed .git Folder → Full Source + Secrets
Deploying by running git pull on the server is convenient and dangerous: it leaves a .git/ directory in the web root. Anyone can reconstruct the entire source history, including secrets that were committed and later “removed” (they stay in history).
1. Detect the exposed repository (CONF-04):
1
2
$ curl -s https://example.com/.git/HEAD
ref: refs/heads/main # <-- the repo is served
2. Dump it with a tool that walks the git objects over HTTP:
1
2
git-dumper https://example.com/.git/ ./loot
cd loot && git log --oneline | head
3. Harvest secrets from history — the payoff is usually in old commits:
1
2
3
# scan the whole history, not just the current tree
trufflehog git file://./loot --only-verified
git log -p -- config/database.yml | grep -iE 'password|secret|key'
A single .git leak often yields database credentials, API keys and the exact application version for a targeted CVE search.
The fix is configuration, not code. Block dotfiles at the edge and deploy artifacts, not repositories:
1
2
# nginx: deny access to VCS metadata and other dotfiles
location ~ /\.(git|svn|hg|env|aws)(/|$) { deny all; return 404; }
1
2
3
4
# Apache: same idea
<DirectoryMatch "/\.(git|svn|hg)">
Require all denied
</DirectoryMatch>
Real-world case — Capital One (2019). A misconfigured WAF allowed an SSRF that reached AWS instance metadata, exposing credentials to an S3 bucket with ~100 million records. It is the textbook example of how a single deployment/config mistake (over-permissive IAM + reachable metadata + public-ish storage) cascades into a breach. It ties CONF-11 (cloud storage), INPV-19 (SSRF) and cloud IAM together.
Hands-on Practice
- PortSwigger Academy — HTTP Host header attacks and the information-disclosure labs cover CONF-06/07 and backup files.
- Juice Shop — “Deprecated Interface” and “Access a confidential document” map to file-handling and backup findings.
- Local lab — enable
PUT/TRACEon a test nginx/Apache and practise the method tests; drop a.gitfolder in a container’s web root and dump it withgit-dumper. - gitls / DotGit browser extension — flags exposed
.gitfolders as you browse (useful during recon).
Checklist: Configuration and Deployment Management
| ID | Test | Main tools |
|---|---|---|
| WSTG-CONF-01 | Network infrastructure configuration | nmap (vulners), nuclei, searchsploit |
| WSTG-CONF-02 | Application platform configuration | nikto, curl, config review |
| WSTG-CONF-03 | File extensions handling | ffuf with extension lists |
| WSTG-CONF-04 | Old, backup and unreferenced files | ffuf, git-dumper, wordlists |
| WSTG-CONF-05 | Admin interfaces | ffuf, Burp, parameter tampering |
| WSTG-CONF-06 | HTTP methods | nmap http-methods, curl |
| WSTG-CONF-07 | HTTP Strict Transport Security | curl, hstspreload.org |
| WSTG-CONF-08 | RIA cross-domain policy | curl |
| WSTG-CONF-09 | File permissions | find, namei, AccessChk |
| WSTG-CONF-10 | Subdomain takeover | amass, subfinder, dig, subjack, nuclei |
| WSTG-CONF-11 | Cloud storage | aws cli, curl, ScoutSuite |
Previous: Part 2 - Information Gathering · Next: Part 4 - Identity Management
References
- WSTG-CONF-01 Network Infrastructure Configuration
- WSTG-CONF-02 Application Platform Configuration
- WSTG-CONF-03 File Extensions Handling
- WSTG-CONF-04 Old, Backup and Unreferenced Files
- WSTG-CONF-05 Admin Interfaces
- WSTG-CONF-06 HTTP Methods
- WSTG-CONF-07 HTTP Strict Transport Security
- WSTG-CONF-08 RIA Cross Domain Policy
- WSTG-CONF-09 File Permission
- WSTG-CONF-10 Subdomain Takeover
- WSTG-CONF-11 Cloud Storage
- can-i-take-over-xyz
- CIS Benchmarks
Further reading & tooling
- git-dumper · trufflehog · gitleaks — recovering source and secrets.
- ScoutSuite · Prowler — cloud configuration auditing (CONF-11).
- Mozilla Observatory — quick header/config grade for a site.
- The Web Application Hacker’s Handbook — ch. 18, “Attacking the Application Server”.
Comments
Questions, corrections or another approach? Comment with your GitHub account.