mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-02-03 13:14:13 +03:00
Finishing first usable prototype for an Issue #8
This commit is contained in:
parent
ff5ec48abd
commit
c0a6e1c3a7
|
@ -479,12 +479,16 @@ class Dump(object):
|
|||
blank = " " * (maxlength - len(value))
|
||||
self._write("| %s%s" % (value, blank), newline=False, console=console)
|
||||
|
||||
#if len(value) > 10 and r'\x' in value:
|
||||
# mimetype = magic.from_buffer(value, mime=True)
|
||||
# if mimetype.startswith("application") or mimetype.startswith("image"):
|
||||
# with codecs.open("%s%s%s" % (dumpDbPath, os.sep, "%s-%d.bin" % (column, randomInt(8))), "wb", UNICODE_ENCODING) as f:
|
||||
# _ = safechardecode(value, True)
|
||||
# f.write(_)
|
||||
if len(value) > 10 and r'\x' in value:
|
||||
mimetype = magic.from_buffer(value, mime=True)
|
||||
if any(mimetype.startswith(_) for _ in ("application", "image")):
|
||||
filepath = os.path.join(dumpDbPath, "%s-%d.bin" % (column, randomInt(8)))
|
||||
warnMsg = "writing binary ('%s') content to file '%s' " % (mimetype, filepath)
|
||||
logger.warn(warnMsg)
|
||||
|
||||
with open(filepath, "wb") as f:
|
||||
_ = safechardecode(value, True)
|
||||
f.write(_)
|
||||
|
||||
if conf.dumpFormat == DUMP_FORMAT.CSV:
|
||||
if field == fields:
|
||||
|
|
Loading…
Reference in New Issue
Block a user