Skip to content

Commit d149c8a

Browse files
Error based enum (#15)
* typo fixed * Align Uppercase to rest of descriptions in table * add error based enum with order by mysql * add how to find amount of columns using union select and added reference in union based description how to get to the amount of columns Co-authored-by: Jacob Reynolds <[email protected]>
1 parent aedab7c commit d149c8a

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

_data/injectionDescriptions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
injectionDetection: Injections can be detected in a number of ways. The simplest being adding a <code>'</code> or <code>"</code> after various parameters and getting a database error returned from the web server. The sections below describe where to find and how to detect these parameters.
22
dbmsIdentification: Detecting what Database Management System (DBMS) is being used is critical in being able to further exploit an injection. Without that knowledge it would not be possible to determine what tables to query, what functions are built-in, and what detections to avoid. A successful response from the below queries identify that the selected DBMS is being used.
33
errorBased: Error based injections are exploited through triggering errors in the database when invalid inputs are passed to it. The error messages can be used to return the full query results, or gain information on how to restructure the query for further exploitation.
4-
unionBased: Union based SQL injection allows an attacker to extract information from the database by extending the results returned by the original query. The Union operator can only be used if the original/new queries have the same structure (number and data type of columns).
4+
unionBased: Union based SQL injection allows an attacker to extract information from the database by extending the results returned by the original query. The Union operator can only be used if the original/new queries have the same structure (number and data type of columns). You can try to enumerate the amount of columns using error based enumeration (see error based injection).
55
blindBased: Blind SQL injection is one of the more advanced methods of injection. The Partial-Blind and Full-Blind methods are detailed below. Use care when performing these queries, as they can overload a server if performed through heavy automation.
66
conditionalStatements: Conditional statements are beneficial for creating complex queries and aiding in Blind Injection.
77
injectionPlacement: SQL injection is always a hassle when it isn't apparent where the injection is taking place. It is helpful to have a few ways to exploit injections in various parts of the query.

injectionTypes/errorBased/mysql.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,24 @@ <h3>Error Based</h3>
1111
</tr>
1212
</thead>
1313
<tbody>
14+
<tr>
15+
<td>Amount of columns using ORDER BY</td>
16+
<td>ORDER BY 1
17+
<br>
18+
<em>Add this at the end of your query</em>
19+
<em>If you get no error you know ordering is working</em>
20+
<em>Increment the number from 1 until you get an error. Then you know the amount of columns for this table</em>
21+
</td>
22+
</tr>
23+
<tr>
24+
<td>Amount of columns using UNION SELECT</td>
25+
<td>UNION SELECT 1,2
26+
<br>
27+
<em>Add this at the end of your query</em>
28+
<em>Add increment until you see a valid response, e.g. UNION SELECT 1,2,3</em>
29+
<em>If you get no error you know union select is working. You can try to find the values on the page to see where the output goes.</em>
30+
</td>
31+
</tr>
1432
<tr>
1533
<td>XML Parse Error</td>
1634
<td>SELECT extractvalue(rand(),concat(0x3a,(select version())))</td>

0 commit comments

Comments
 (0)