Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit afc2a42

Browse files
committed
Revisiting regexes for DBMS errors
1 parent 44664dd commit afc2a42

3 files changed

Lines changed: 33 additions & 29 deletions

File tree

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from lib.core.enums import OS
2020

2121
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
22-
VERSION = "1.1.9.20"
22+
VERSION = "1.1.9.21"
2323
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2424
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2525
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

txt/checksum.md5

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ a44d7a4cc6c9a67a72d6af2f25f4ddac lib/core/exception.py
4646
d8e9250f3775119df07e9070eddccd16 lib/core/replication.py
4747
785f86e3f963fa3798f84286a4e83ff2 lib/core/revision.py
4848
40c80b28b3a5819b737a5a17d4565ae9 lib/core/session.py
49-
ef5cf593cd595b00fadb67e5004de5c0 lib/core/settings.py
49+
1b0c524c75375ae969a357cbc9e83b72 lib/core/settings.py
5050
d91291997d2bd2f6028aaf371bf1d3b6 lib/core/shell.py
5151
2ad85c130cc5f2b3701ea85c2f6bbf20 lib/core/subprocessng.py
5252
effc153067a00bd43461bfc1cdec1122 lib/core/target.py
@@ -453,7 +453,7 @@ d989813ee377252bca2103cea524c06b xml/banner/sharepoint.xml
453453
350605448f049cd982554123a75f11e1 xml/banner/x-aspnet-version.xml
454454
817078783e1edaa492773d3b34d8eef0 xml/banner/x-powered-by.xml
455455
fb93505ef0ab3b4a20900f3e5625260d xml/boundaries.xml
456-
535d625cff8418bdc086ab4e1bbf5135 xml/errors.xml
456+
9567590d35dfd9f214b9979e6000b139 xml/errors.xml
457457
a279656ea3fcb85c727249b02f828383 xml/livetests.xml
458458
14a2abeb88b00ab489359d0dd7a3017f xml/payloads/boolean_blind.xml
459459
b5b8b0aebce810e6cdda1b7106c96427 xml/payloads/error_based.xml

xml/errors.xml

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<root>
44
<!-- MySQL -->
55
<dbms value="MySQL">
6-
<error regexp="SQL syntax.*MySQL"/>
7-
<error regexp="Warning.*mysql_.*"/>
6+
<error regexp="SQL syntax.*?MySQL"/>
7+
<error regexp="Warning.*?mysql_"/>
88
<error regexp="MySqlException \(0x"/>
99
<error regexp="valid MySQL result"/>
1010
<error regexp="check the manual that corresponds to your (MySQL|MariaDB) server version"/>
@@ -14,24 +14,24 @@
1414

1515
<!-- PostgreSQL -->
1616
<dbms value="PostgreSQL">
17-
<error regexp="PostgreSQL.*ERROR"/>
18-
<error regexp="Warning.*\Wpg_.*"/>
17+
<error regexp="PostgreSQL.*?ERROR"/>
18+
<error regexp="Warning.*?\Wpg_"/>
1919
<error regexp="valid PostgreSQL result"/>
2020
<error regexp="Npgsql\."/>
2121
<error regexp="PG::SyntaxError:"/>
2222
<error regexp="org\.postgresql\.util\.PSQLException"/>
23-
<error regexp="ERROR:\s\ssyntax error at or near "/>
23+
<error regexp="ERROR:\s\ssyntax error at or near"/>
2424
</dbms>
2525

2626
<!-- Microsoft SQL Server -->
2727
<dbms value="Microsoft SQL Server">
28-
<error regexp="Driver.* SQL[\-\_\ ]*Server"/>
29-
<error regexp="OLE DB.* SQL Server"/>
28+
<error regexp="Driver.*? SQL[\-\_\ ]*Server"/>
29+
<error regexp="OLE DB.*? SQL Server"/>
3030
<error regexp="\bSQL Server[^&lt;&quot;]+Driver"/>
31-
<error regexp="Warning.*(mssql|sqlsrv)_"/>
31+
<error regexp="Warning.*?(mssql|sqlsrv)_"/>
3232
<error regexp="\bSQL Server[^&lt;&quot;]+[0-9a-fA-F]{8}"/>
3333
<error regexp="System\.Data\.SqlClient\.SqlException"/>
34-
<error regexp="(?s)Exception.*\WRoadhouse\.Cms\."/>
34+
<error regexp="(?s)Exception.*?\WRoadhouse\.Cms\."/>
3535
<error regexp="Microsoft SQL Native Client error '[0-9a-fA-F]{8}"/>
3636
<error regexp="com\.microsoft\.sqlserver\.jdbc\.SQLServerException"/>
3737
<error regexp="ODBC SQL Server Driver"/>
@@ -53,24 +53,25 @@
5353
<dbms value="Oracle">
5454
<error regexp="\bORA-\d{5}"/>
5555
<error regexp="Oracle error"/>
56-
<error regexp="Oracle.*Driver"/>
57-
<error regexp="Warning.*\Woci_.*"/>
58-
<error regexp="Warning.*\Wora_.*"/>
56+
<error regexp="Oracle.*?Driver"/>
57+
<error regexp="Warning.*?\Woci_"/>
58+
<error regexp="Warning.*?\Wora_"/>
5959
<error regexp="oracle\.jdbc\.driver"/>
6060
<error regexp="quoted string not properly terminated"/>
61+
<error regexp="SQL command not properly ended"/>
6162
</dbms>
6263

6364
<!-- IBM DB2 -->
6465
<dbms value="IBM DB2">
65-
<error regexp="CLI Driver.*DB2"/>
66+
<error regexp="CLI Driver.*?DB2"/>
6667
<error regexp="DB2 SQL error"/>
6768
<error regexp="\bdb2_\w+\("/>
6869
<error regexp="SQLSTATE.+SQLCODE"/>
6970
</dbms>
7071

7172
<!-- Informix -->
7273
<dbms value="Informix">
73-
<error regexp="Exception.*Informix"/>
74+
<error regexp="Exception.*?Informix"/>
7475
<error regexp="Informix ODBC Driver"/>
7576
<error regexp="com\.informix\.jdbc"/>
7677
<error regexp="weblogic\.jdbc\.informix"/>
@@ -79,51 +80,54 @@
7980
<!-- Interbase/Firebird -->
8081
<dbms value="Firebird">
8182
<error regexp="Dynamic SQL Error"/>
82-
<error regexp="Warning.*ibase_.*"/>
83+
<error regexp="Warning.*?ibase_"/>
8384
</dbms>
8485

8586
<!-- SQLite -->
8687
<dbms value="SQLite">
8788
<error regexp="SQLite/JDBCDriver"/>
8889
<error regexp="SQLite\.Exception"/>
89-
<error regexp="System\.Data\.SQLite\.SQLiteException"/>
90-
<error regexp="Warning.*sqlite_.*"/>
91-
<error regexp="Warning.*SQLite3::"/>
90+
<error regexp="(Microsoft|System)\.Data\.SQLite\.SQLiteException"/>
91+
<error regexp="Warning.*?sqlite_"/>
92+
<error regexp="Warning.*?SQLite3::"/>
9293
<error regexp="\[SQLITE_ERROR\]"/>
94+
<error regexp="SQLite error \d+:"/>
95+
<error regexp="sqlite3.OperationalError:"/>
9396
</dbms>
9497

9598
<!-- SAP MaxDB -->
9699
<dbms value="SAP MaxDB">
97-
<error regexp="SQL error.*POS([0-9]+).*"/>
98-
<error regexp="Warning.*maxdb.*"/>
100+
<error regexp="SQL error.*?POS([0-9]+)"/>
101+
<error regexp="Warning.*?maxdb"/>
99102
</dbms>
100103

101104
<!-- Sybase -->
102105
<dbms value="Sybase">
103-
<error regexp="Warning.*sybase.*"/>
106+
<error regexp="Warning.*?sybase"/>
104107
<error regexp="Sybase message"/>
105-
<error regexp="Sybase.*Server message.*"/>
108+
<error regexp="Sybase.*?Server message"/>
106109
<error regexp="SybSQLException"/>
107110
<error regexp="com\.sybase\.jdbc"/>
108111
</dbms>
109112

110113
<!-- Ingres -->
111114
<dbms value="Ingres">
112-
<error regexp="Warning.*ingres_"/>
115+
<error regexp="Warning.*?ingres_"/>
113116
<error regexp="Ingres SQLSTATE"/>
114-
<error regexp="Ingres\W.*Driver"/>
117+
<error regexp="Ingres\W.*?Driver"/>
115118
</dbms>
116119

117120
<!-- Frontbase -->
118121
<dbms value="Frontbase">
119-
<error regexp="Exception (condition )?\d+. Transaction rollback."/>
122+
<error regexp="Exception (condition )?\d+\. Transaction rollback"/>
123+
<error regexp="com\.frontbase\.jdbc"/>
120124
</dbms>
121125

122126
<!-- HSQLDB -->
123127
<dbms value="HSQLDB">
124128
<error regexp="org\.hsqldb\.jdbc"/>
125129
<error regexp="Unexpected end of command in statement \["/>
126-
<error regexp="Unexpected token.*in statement \["/>
130+
<error regexp="Unexpected token.*?in statement \["/>
127131
</dbms>
128132

129133
</root>

0 commit comments

Comments
 (0)