mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-06 12:41:30 +00:00
be more specific in standard output message as to whether or not the read file is same as remote file
This commit is contained in:
@@ -19,6 +19,7 @@ from lib.core.common import isListLike
|
||||
from lib.core.common import normalizeUnicode
|
||||
from lib.core.common import openFile
|
||||
from lib.core.common import prioritySortColumns
|
||||
from lib.core.common import randomInt
|
||||
from lib.core.common import safeCSValue
|
||||
from lib.core.common import unsafeSQLIdentificatorNaming
|
||||
from lib.core.data import conf
|
||||
@@ -34,6 +35,7 @@ from lib.core.settings import HTML_DUMP_CSS_STYLE
|
||||
from lib.core.settings import METADB_SUFFIX
|
||||
from lib.core.settings import TRIM_STDOUT_DUMP_SIZE
|
||||
from lib.core.settings import UNICODE_ENCODING
|
||||
from thirdparty.magic import magic
|
||||
|
||||
class Dump(object):
|
||||
"""
|
||||
@@ -63,7 +65,7 @@ class Dump(object):
|
||||
kb.dataOutputFlag = True
|
||||
|
||||
def setOutputFile(self):
|
||||
self._outputFile = "%s%slog" % (conf.outputPath, os.sep)
|
||||
self._outputFile = "%s%sstdout" % (conf.outputPath, os.sep)
|
||||
try:
|
||||
self._outputFP = codecs.open(self._outputFile, "ab", UNICODE_ENCODING)
|
||||
except IOError, ex:
|
||||
@@ -476,6 +478,13 @@ class Dump(object):
|
||||
blank = " " * (maxlength - len(value))
|
||||
self._write("| %s%s" % (value, blank), newline=False, console=console)
|
||||
|
||||
mimetype = magic.from_buffer(value, mime=True)
|
||||
|
||||
if mimetype.startswith("application") or mimetype.startswith("image"):
|
||||
singleFP = open("%s%s%s" % (dumpDbPath, os.sep, "%s-%d.bin" % (column, randomInt(8))), "wb")
|
||||
singleFP.write(value.encode("utf8"))
|
||||
singleFP.close()
|
||||
|
||||
if conf.dumpFormat == DUMP_FORMAT.CSV:
|
||||
if field == fields:
|
||||
dataToDumpFile(dumpFP, "%s" % safeCSValue(value))
|
||||
|
||||
Reference in New Issue
Block a user