| Home > CAPEC List > CAPEC-7: Blind SQL Injection (Version 3.9) |
|
High
High
| Nature | Type | ID | Name |
|---|---|---|---|
| ChildOf | Standard Attack PatternStandard Attack Pattern - A standard level attack pattern in CAPEC is focused on a specific methodology or technique used in an attack. It is often seen as a singular piece of a fully executed attack. A standard attack pattern is meant to provide sufficient details to understand the specific technique and how it attempts to accomplish a desired goal. A standard level attack pattern is a specific type of a more abstract meta level attack pattern. | 66 | SQL Injection |
| View Name | Top Level Categories |
|---|---|
| Domains of Attack | Software |
| Mechanisms of Attack | Inject Unexpected Items |
Hypothesize SQL queries in application:
| Techniques |
|---|
| Research types of SQL queries and determine which ones could be used at various places in an application. |
Determine how to inject information into the queries:
| Techniques |
|---|
| Add clauses to the SQL queries such that the query logic does not change. |
| Add delays to the SQL queries in case server does not provide clear error messages (e.g. WAITFOR DELAY '0:0:10' in SQL Server or BENCHMARK(1000000000,MD5(1) in MySQL). If these can be injected into the queries, then the length of time that the server takes to respond reveals whether the query is injectable or not. |
Determine user-controllable input susceptible to injection: Determine the user-controllable input susceptible to injection. For each user-controllable input that the adversary suspects is vulnerable to SQL injection, attempt to inject the values determined in the previous step. If an error does not occur, then the adversary knows that the SQL injection was successful.
| Techniques |
|---|
| Use web browser to inject input through text fields or through HTTP GET parameters. |
| Use a web application debugging tool such as Tamper Data, TamperIE, WebScarab,etc. to modify HTTP POST parameters, hidden fields, non-freeform fields, etc. |
| Use network-level packet injection tools such as netcat to inject input |
| Use modified client (modified by reverse engineering) to inject input. |
Determine database type: Determines the type of the database, such as MS SQL Server or Oracle or MySQL, using logical conditions as part of the injected queries
| Techniques |
|---|
| Try injecting a string containing char(0x31)=char(0x31) (this evaluates to 1=1 in SQL Server only) |
| Try injecting a string containing 0x313D31 (this evaluates to 1=1 in MySQL only) |
| Inject other database-specific commands into input fields susceptible to SQL Injection. The adversary can determine the type of database that is running by checking whether the query executed successfully or not (i.e. whether the adversary received a normal response from the server or not). |
Extract information about database schema: Extract information about database schema by getting the database to answer yes/no questions about the schema.
| Techniques |
|---|
| Automatically extract database schema using a tool such as Absinthe. |
| Manually perform the blind SQL Injection to extract desired information about the database schema. |
Exploit SQL Injection vulnerability: Use the information obtained in the previous steps to successfully inject the database in order to bypass checks or modify, add, retrieve or delete data from the database
| Techniques |
|---|
| Use information about how to inject commands into SQL queries as well as information about the database schema to execute attacks such as dropping tables, inserting records, etc. |
| Scope | Impact | Likelihood |
|---|---|---|
Integrity | Modify Data | |
Confidentiality | Read Data | |
Confidentiality Integrity Availability | Execute Unauthorized Commands |
An adversary may try entering something like "username' AND 1=1; --" in an input field. If the result is the same as when the adversary entered "username" in the field, then the adversary knows that the application is vulnerable to SQL Injection. The adversary can then ask yes/no questions from the database server to extract information from it. For example, the adversary can extract table names from a database using the following types of queries:
If the above query executes properly, then the adversary knows that the first character in a table name in the database is a letter between m and z. If it doesn't, then the adversary knows that the character must be between a and l (assuming of course that table names only contain alphabetic characters). By performing a binary search on all character positions, the adversary can determine all table names in the database. Subsequently, the adversary may execute an actual attack and send something like:
| CWE-ID | Weakness Name |
|---|---|
| 89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') |
| 209 | Generation of Error Message Containing Sensitive Information |
| 74 | Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') |
| 20 | Improper Input Validation |
| 697 | Incorrect Comparison |
| 707 | Improper Neutralization |
| Entry Name |
|---|
| Blind SQL Injection |
| Submissions | ||
|---|---|---|
| Submission Date | Submitter | Organization |
| 2014年06月23日 (Version 2.6) | CAPEC Content Team | The MITRE Corporation |
| Modifications | ||
| Modification Date | Modifier | Organization |
| 2017年01月09日 (Version 2.9) | CAPEC Content Team | The MITRE Corporation |
| Updated Related_Attack_Patterns | ||
| 2017年08月04日 (Version 2.11) | CAPEC Content Team | The MITRE Corporation |
| Updated Attack_Phases, Description, Description Summary, Examples-Instances, Payload_Activation_Impact, Resources_Required | ||
| 2018年07月31日 (Version 2.12) | CAPEC Content Team | The MITRE Corporation |
| Updated References, Related_Weaknesses | ||
| 2020年07月30日 (Version 3.3) | CAPEC Content Team | The MITRE Corporation |
| Updated Execution_Flow | ||
| 2020年12月17日 (Version 3.4) | CAPEC Content Team | The MITRE Corporation |
| Updated Taxonomy_Mappings | ||
| 2021年06月24日 (Version 3.5) | CAPEC Content Team | The MITRE Corporation |
| Updated Related_Weaknesses | ||
| 2022年09月29日 (Version 3.8) | CAPEC Content Team | The MITRE Corporation |
| Updated Example_Instances, Execution_Flow | ||
|
Use of the Common Attack Pattern Enumeration and Classification (CAPEC), and the associated references from this website are subject to the Terms of Use. Copyright © 2007–2025, The MITRE Corporation. CAPEC and the CAPEC logo are trademarks of The MITRE Corporation. |
||