Less problematic regexes for MsSQL errors

This commit is contained in:
Miroslav Stampar 2016-07-05 09:32:08 +02:00
parent d9315830f9
commit 7ad49f4185
3 changed files with 5 additions and 3 deletions

View File

@ -19,7 +19,7 @@ from lib.core.enums import OS
from lib.core.revision import getRevisionNumber from lib.core.revision import getRevisionNumber
# sqlmap version (<major>.<minor>.<month>.<monthly commit>) # sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.0.7.6" VERSION = "1.0.7.7"
REVISION = getRevisionNumber() REVISION = getRevisionNumber()
STABLE = VERSION.count('.') <= 2 STABLE = VERSION.count('.') <= 2
VERSION_STRING = "sqlmap/%s#%s" % (VERSION, "stable" if STABLE else "dev") VERSION_STRING = "sqlmap/%s#%s" % (VERSION, "stable" if STABLE else "dev")

View File

@ -42,6 +42,8 @@ class HTMLHandler(ContentHandler):
elif name == "error": elif name == "error":
regexp = attrs.get("regexp") regexp = attrs.get("regexp")
if "SQL" in regexp:
print regexp
if regexp not in kb.cache.regex: if regexp not in kb.cache.regex:
keywords = re.findall("\w+", re.sub(r"\\.", " ", regexp)) keywords = re.findall("\w+", re.sub(r"\\.", " ", regexp))
keywords = sorted(keywords, key=len) keywords = sorted(keywords, key=len)

View File

@ -29,10 +29,10 @@
<error regexp="OLE DB.* SQL Server"/> <error regexp="OLE DB.* SQL Server"/>
<error regexp="\bSQL Server[^&lt;&quot;]+Driver"/> <error regexp="\bSQL Server[^&lt;&quot;]+Driver"/>
<error regexp="Warning.*(mssql|sqlsrv)_"/> <error regexp="Warning.*(mssql|sqlsrv)_"/>
<error regexp="\bSQL Server.*[0-9a-fA-F]{8}"/> <error regexp="\bSQL Server[^&lt;&quot;]+[0-9a-fA-F]{8}"/>
<error regexp="(?s)Exception.*\WSystem\.Data\.SqlClient\."/> <error regexp="(?s)Exception.*\WSystem\.Data\.SqlClient\."/>
<error regexp="(?s)Exception.*\WRoadhouse\.Cms\."/> <error regexp="(?s)Exception.*\WRoadhouse\.Cms\."/>
<error regexp="Microsoft SQL Native Client.*[0-9a-fA-F]{8}"/> <error regexp="Microsoft SQL Native Client error '[0-9a-fA-F]{8}"/>
<error regexp="com\.microsoft\.sqlserver\.jdbc\.SQLServerException"/> <error regexp="com\.microsoft\.sqlserver\.jdbc\.SQLServerException"/>
<error regexp="ODBC SQL Server Driver"/> <error regexp="ODBC SQL Server Driver"/>
<error regexp="SQLServer JDBC Driver"/> <error regexp="SQLServer JDBC Driver"/>