312-39 practice question 31 of 35

Sam, a security analyst with INFOSOL INC., while monitoring and analyzing IIS logs, detected an event matching regex /\\w*((\%27)|(\’))((\%6F)|o|(\%4F))((\%72)|r|(\%52))/ix. What does this event log indicate?

Full set: 100 questions
Answer options
A: SQL Injection Attack Correct answer
B: Parameter Tampering Attack
C: XSS Attack
D: Directory Traversal Attack
Correct Answer:
A. SQL Injection Attack
Explanation

The regular expression /\\w((\%27)|(\’))((\%6F)|o|(\%4F))((\%72)|r|(\%52))/ix is designed to detect a common SQL Injection (SQLi) attack pattern. It specifically looks for the string "'OR" (case-insensitive), which may be URL-encoded. For example, %27 is the URL encoding for a single quote ('), %6F for 'o', and %72 for 'r'. This pattern is characteristic of tautology-based SQLi, used to bypass authentication or extract data by creating a universally true condition in a SQL query's WHERE clause (e.g., ' OR '1'='1).

Why Incorrect

B. Parameter Tampering Attack: This is too general. While SQLi is a form of parameter tampering, the regex identifies the specific SQLi technique, making option A more precise.
C. XSS Attack: This is incorrect. XSS attack patterns typically involve HTML tags like <script> or JavaScript event handlers, which are not present in this regex.
D. Directory Traversal Attack: This is incorrect. Directory traversal attacks use patterns like ../ or ..\\ to access restricted files, which this regex does not match.

References

1. OWASP Foundation. (n.d.). SQL Injection. OWASP Cheat Sheet Series. Retrieved from https://cheatsheetseries.owasp.org/cheatsheets/SQLInjectionPreventionCheatSheet.html (This resource details common SQLi payloads, including the use of ' OR '1'='1 which the regex detects).

2. Microsoft. (2023). iis-log-analyzer-log-parser-studio. Microsoft Learn. In the default ruleset for Log Parser Studio, similar regex patterns are used to identify SQL injection attempts in IIS logs.

Scroll to Top