A technical security audit detailing manual SQL injection testing and automated credential extraction on DVWA.
This assessment confirms deep-seated SQL injection vulnerabilities. By combining manual logic testing with advanced automation, I achieved full data exfiltration and compromise of all user accounts within the target environment.
CRITICAL
Nginx 1.28.0 / MySQL 5.0.12
Credentials + DB Structure
Nginx/1.28.0
MySQL >= 5.0.12 (MariaDB fork)
PHP/8.4-mysql (DVWA)
Identified input vector id. Server headers revealed Nginx/1.28.0 backend.
Manual probes with ' OR 1=1 -- confirmed Boolean response shifts. SQLMap further identified Time-based (SLEEP) and UNION-based vectors.
Exfiltrated schema info, identifying dvwa and information_schema. Mapped table relations for target data.
Recovered 5 administrative records, extracted MD5 hashes, and successfully decrypted them via dictionary attack.
Tested unsanitized input parameters with Boolean and Error-based payloads to map the backend database structure.
Utilized SQLMap to automate schema enumeration and quickly dump administrative user records.
Developed a Python script using requests to automate heuristic vulnerability detection for custom injection verification.
Vulnerability confirmed via response delay payloads.
Full database leakage achieved via UNION results.
Database dump recovered during the final exfiltration phase.
| UID | User | MD5 Hash | Status | Plaintext |
|---|---|---|---|---|
| 1 | admin | 5f4dcc3b5... | CRACKED | password |
| 2 | gordonb | e99a18c42... | CRACKED | abc123 |
| 3 | 1337 | 8d3533d75... | CRACKED | charley |
| 4 | pablo | 0d107d09f... | CRACKED | letmein |
| 5 | smithy | 5f4dcc3b5... | CRACKED | password |
| Type | Payload | Status | Result |
|---|---|---|---|
| Boolean Bypass | 1' OR '1'='1 | VULN | Login Bypass |
| UNION Attack | 1' UNION SELECT null,version() -- | SUCCESS | Version Leak |
| Time-Based | 1' AND SLEEP(5) -- | VULN | Delay Confirmed |
| Error-based | 1' AND extractvalue(1,...) | SUCCESS | Direct Retrieval |
def is_vulnerable(response, baseline, elapsed, payload):
response_lower = response.lower()
for indicator in SUCCESS_INDICATORS:
if indicator in response_lower:
return True, f"Found: {indicator}"
if "sleep" in payload.lower() and elapsed > 1.5:
return True, f"Time-delay confirmed ({elapsed:.2f}s)"
return False, "Safe"
Using parameterized queries to decouple user data from SQL instruction, nullifying injection vectors.
Strict type-enforcement and whitelist validation for every application entry point.