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

Skip to content

Commit b334b6b

Browse files
committed
Patch for #4199
1 parent aa812ef commit b334b6b

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from thirdparty.six import unichr as _unichr
1919

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

plugins/generic/custom.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from lib.core.data import logger
2020
from lib.core.dicts import SQL_STATEMENTS
2121
from lib.core.enums import AUTOCOMPLETE_TYPE
22+
from lib.core.enums import DBMS
2223
from lib.core.exception import SqlmapNoneDataException
2324
from lib.core.settings import NULL
2425
from lib.core.settings import PARAMETER_SPLITTING_REGEX
@@ -50,6 +51,11 @@ def sqlQuery(self, query):
5051
infoMsg = "fetching %s query output: '%s'" % (sqlType if sqlType is not None else "SQL", query)
5152
logger.info(infoMsg)
5253

54+
if Backend.isDbms(DBMS.MSSQL):
55+
match = re.search(r"(\bFROM\s+)([^\s]+)", query, re.I)
56+
if match and match.group(2).count('.') == 1:
57+
query = query.replace(match.group(0), "%s%s" % (match.group(1), match.group(2).replace('.', ".dbo.")))
58+
5359
output = inject.getValue(query, fromUser=True)
5460

5561
return output

0 commit comments

Comments
 (0)