Evasion Techniques

5 minutes 5 Questions

SQL Injection Evasion Techniques: A Comprehensive Guide

Why SQL Injection Evasion Techniques Are Important

Understanding SQL injection evasion techniques is crucial for any cybersecurity professional, especially those preparing for the CEH (Certified Ethical Hacker) certification. These techniques represent advanced methods attackers use to bypass security controls and successfully execute SQL injection attacks. Security professionals must comprehend these evasion strategies to:

• Design effective defense mechanisms
• Properly assess application vulnerabilities
• Recognize attack patterns in logs and monitoring systems
• Implement comprehensive security testing

What Are SQL Injection Evasion Techniques?

SQL injection evasion techniques are specialized methods attackers employ to circumvent security controls like WAFs (Web Application Firewalls), input validation, and other protective measures. These techniques modify the standard SQL injection syntax while preserving the malicious functionality, allowing attackers to "slip past" detection mechanisms.

Common SQL Injection Evasion Techniques

1. Comment-Based Evasion
Using inline comments (/* */, --, #) to break up SQL keywords that might be detected by security filters.
Example: SEL/**/ECT instead of SELECT

2. Case Variation
Altering the case of SQL keywords since some filters only check for specific cases.
Example: sElEcT instead of SELECT

3. URL Encoding
Converting characters to their URL encoded equivalents to bypass filters.
Example: %53%45%4C%45%43%54 instead of SELECT

4. Character Encoding
Using different character encodings like Unicode or hex encoding.
Example: 0x53454c454354 (hex for SELECT)

5. String Concatenation
Breaking strings into multiple parts to evade pattern matching.
Example: CONCAT('SEL','ECT') which evaluates to SELECT

6. Alternative Expressions
Using equivalent expressions that produce the same result.
Example: Using CHAR(49) instead of '1'

7. Whitespace Manipulation
Adding extra spaces, tabs, or line breaks to confuse detection systems.
Example: SELECT[TAB][TAB][TAB]name[RETURN]FROM users

8. Null Byte Injection
Using null bytes (%00) to terminate strings in certain programming languages.
Example: SELECT%00 FROM users

How SQL Injection Evasion Works

To understand how evasion techniques work, it's important to recognize that most security mechanisms rely on pattern matching or signature-based detection. Evasion techniques exploit limitations in these defensive systems:

1. Pattern Disruption: By breaking up known patterns (like SQL keywords), attackers prevent direct matches against security signatures.

2. Filter Blind Spots: Many security controls focus on specific patterns but miss variations or encodings of the same attack.

3. Context Manipulation: Changing how data is presented while preserving its functional meaning when processed by the database.

4. Exploiting Parser Differences: Taking advantage of differences between how security tools and database engines parse and interpret SQL code.

Example Attack Scenario

Consider a login form protected by a WAF that blocks requests containing the word "UNION":

Original attack: username=' UNION SELECT username, password FROM users--

Evaded attack: username=' UN/**/ION sELeCt username, password FROM users--

The WAF might not detect the modified syntax, but the database server will still interpret and execute it as a UNION SELECT statement.

Exam Tips: Answering Questions on Evasion Techniques

When facing CEH exam questions about SQL injection evasion techniques, keep these strategies in mind:

1. Identify the Evasion Method: Questions often describe a scenario and ask you to identify which evasion technique is being employed. Look for clues about character manipulation, encoding types, or syntax alterations.

2. Understand the Purpose: Remember that each evasion technique serves to bypass a specific type of protection. Connect the evasion method to the security control it's attempting to circumvent.

3. Focus on Context: Pay attention to whether the question is addressing:
• Detection of evasion techniques
• Implementation of evasion techniques
• Prevention methods against evasion
• Impact of specific evasion techniques

4. Know Database Specifics: Some evasion techniques work only on specific database systems. Be familiar with database-specific syntax variations (MySQL vs. MS SQL vs. Oracle).

5. Identify the Most Effective Defense: For prevention-focused questions, prioritize:
• Parameterized queries/prepared statements
• ORM frameworks
• Input validation combined with context-aware escaping
• Principle of least privilege for database accounts

6. Remember the Attack Chain: Evasion techniques are just one part of the SQL injection attack process. Consider how they fit into the broader attack methodology.

7. Practice Recognition: Study examples of obfuscated SQL queries and practice identifying which techniques are being used.

Sample Exam Question Scenarios

1. An attacker submits admin' OR 1=(/*comment*/)1-- to a login form. Which evasion technique is demonstrated?
Correct answer: Comment insertion evasion

2. Which of these is most effective against SQL injection evasion techniques?
Correct answer: Prepared statements/parameterized queries

3. An attacker uses EXEC('SEL'+'ECT * FROM users') to perform SQL injection. What evasion technique is this?
Correct answer: String concatenation

Remember that the CEH exam focuses on practical application of knowledge. When studying SQL injection evasion techniques, make sure you understand not just what they are, but how they're used in real-world attack scenarios and how to properly defend against them.

Test mode:
Go Premium

Certified Ethical Hacker Preparation Package (2025)

  • 2372 Superior-grade Certified Ethical Hacker practice questions.
  • Accelerated Mastery: Deep dive into critical topics to fast-track your mastery.
  • Unlock Effortless CEH preparation: 5 full exams.
  • 100% Satisfaction Guaranteed: Full refund with no questions if unsatisfied.
  • Bonus: If you upgrade now you get upgraded access to all courses
  • Risk-Free Decision: Start with a 7-day free trial - get premium features at no cost!
More Evasion Techniques questions
15 questions (total)