mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-02-19 21:10:36 +03:00
Related to an Issue #319
This commit is contained in:
parent
0d5d84edc7
commit
0a122ccce4
|
@ -1125,15 +1125,10 @@ def expandAsteriskForColumns(expression):
|
||||||
infoMsg += "sqlmap will retrieve the column names itself"
|
infoMsg += "sqlmap will retrieve the column names itself"
|
||||||
logger.info(infoMsg)
|
logger.info(infoMsg)
|
||||||
|
|
||||||
dbTbl = asterisk.group(1)
|
_ = asterisk.group(1).replace("..", ".")
|
||||||
|
conf.db, conf.tbl = _.split(".", 1) if '.' in _ else (None, _)
|
||||||
if dbTbl and ".." in dbTbl:
|
conf.db = safeSQLIdentificatorNaming(conf.db)
|
||||||
dbTbl = dbTbl.replace('..', '.dbo.')
|
conf.tbl = safeSQLIdentificatorNaming(conf.tbl, True)
|
||||||
|
|
||||||
if dbTbl and "." in dbTbl:
|
|
||||||
conf.db, conf.tbl = dbTbl.split(".", 1)
|
|
||||||
else:
|
|
||||||
conf.tbl = dbTbl
|
|
||||||
|
|
||||||
columnsDict = conf.dbmsHandler.getColumns(onlyColNames=True)
|
columnsDict = conf.dbmsHandler.getColumns(onlyColNames=True)
|
||||||
|
|
||||||
|
|
|
@ -478,13 +478,16 @@ class Dump(object):
|
||||||
blank = " " * (maxlength - len(value))
|
blank = " " * (maxlength - len(value))
|
||||||
self._write("| %s%s" % (value, blank), newline=False, console=console)
|
self._write("| %s%s" % (value, blank), newline=False, console=console)
|
||||||
|
|
||||||
# TODO: this is related to issue #8, but it is not yet working
|
if len(value) > 10 and r'\x' in value:
|
||||||
#mimetype = magic.from_buffer(value, mime=True)
|
mimetype = magic.from_buffer(value, mime=True)
|
||||||
|
if mimetype.startswith("application") or mimetype.startswith("image"):
|
||||||
#if mimetype.startswith("application") or mimetype.startswith("image"):
|
with open("%s%s%s" % (dumpDbPath, os.sep, "%s-%d.bin" % (column, randomInt(8))), "wb") as f:
|
||||||
# singleFP = open("%s%s%s" % (dumpDbPath, os.sep, "%s-%d.bin" % (column, randomInt(8))), "wb")
|
import pdb
|
||||||
# singleFP.write(value.encode("utf8"))
|
pdb.set_trace()
|
||||||
# singleFP.close()
|
from extra.safe2bin.safe2bin import safechardecode
|
||||||
|
_ = _.encode(UNICODE_ENCODING)
|
||||||
|
_ = safechardecode(value)
|
||||||
|
f.write(_)
|
||||||
|
|
||||||
if conf.dumpFormat == DUMP_FORMAT.CSV:
|
if conf.dumpFormat == DUMP_FORMAT.CSV:
|
||||||
if field == fields:
|
if field == fields:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user