← All Threat Hunting ReportsThreat Hunting Exercise

Threat Hunting Exercise: Analyzing Database SQL Injection Mass Data Exfiltration Dataset

This hunt uses a simulated web application/database audit dataset (db_sqli_exfil_2022-07-23T160000.json) capturing T1190: Exploit Public-Facing Application and T1213: Data from Information Repositories, where an adversary exploits an unsanitized input field on a public web application to run UNION-based SQL injection queries, ultimately dumping an entire customer table via a scripted, high-volume series of requests.

Step 1: Hypothesis Formation

Hypothesis: A public-facing web application receives a series of HTTP requests to a single parameter containing SQL injection syntax (UNION SELECT, ' OR '1'='1, time-based blind indicators like SLEEP()/WAITFOR DELAY), from a single source IP, escalating from exploratory single-quote tests to full UNION-based data extraction, correlated with an unusual spike in database-layer SELECT statements against sensitive tables. Indicators:

Null Hypothesis: The requests are from an authorized penetration test or vulnerability scan. Invalidate via the security testing calendar and by confirming the source IP is not on the approved pentest IP allow-list.

Rationale: SQL injection remains one of the most impactful and common web application vulnerabilities; this hunt validates correlating WAF/application-layer signals with database-audit-layer volume anomalies to confirm not just an attempted exploit but successful, large-scale data extraction.

Step 2: Data Sources and Scope

Step 3: Key Findings

Parsed events (7 shown) confirm an escalating SQL injection session culminating in a full customer-table dump via UNION-based extraction.

Timestamp (UTC)Src IPRequestDB CorrelationIOC/Why Suspicious?
2022-07-23 16:02:11194.87.102.33GET /product?id=1'Query error loggedExploratory IOC: single quote injection - classic first-step SQLi probing to trigger a database error and confirm injectability.
2022-07-23 16:04:33194.87.102.33GET /product?id=1 AND SLEEP(5)Response time = 5.02sBlind-SQLi IOC: response delay exactly matches the injected sleep duration - confirms time-based blind SQL injection is viable on this parameter.
2022-07-23 16:10:02194.87.102.33GET /product?id=1 UNION SELECT table_name,NULL FROM information_schema.tables--DB audit: information_schema queried by webapp_svcSchema enumeration - attacker mapping available tables before extraction.
2022-07-23 16:15:47194.87.102.33GET /product?id=1 UNION SELECT username,password FROM customers LIMIT 0,500--DB audit: SELECT against customers, 500 rows returnedExtraction IOC: first UNION-based extraction batch - 500 rows of username/password data returned in a single response.
2022-07-23 16:16-16:38194.87.102.3347 additional paginated UNION SELECT requests (LIMIT n,500)DB audit: cumulative 23,500 rows selected from customersScale IOC: systematic pagination through the entire table - total rows extracted approximates the table's full known row count (23,612), indicating a complete dump.
--(User-Agent)python-requests/2.25.1 on every requestAutomation IOC: non-browser User-Agent used consistently across the entire 40-minute session - scripted attack tool, not manual browsing.
--(pentest calendar)No approved test scheduled for this application/window; source IP not on pentest allow-listLegitimacy check IOC: rules out authorized security testing.

Validation:

Step 4: Recommendations & Next Steps

Hypothesis confirmed - a systematic SQL injection attack successfully extracted the complete customer table (23,500+ rows including credentials) via paginated UNION SELECT queries!