Implementing option '--dump-file' (#5238)

This commit is contained in:
Miroslav Stampar 2022-11-21 00:03:36 +01:00
parent 62bba470d6
commit 7bc0b08fd6
5 changed files with 9 additions and 2 deletions

View File

@ -449,7 +449,7 @@ class Dump(object):
dumpDbPath = tempDir dumpDbPath = tempDir
dumpFileName = os.path.join(dumpDbPath, re.sub(r'[\\/]', UNSAFE_DUMP_FILEPATH_REPLACEMENT, "%s.%s" % (unsafeSQLIdentificatorNaming(table), conf.dumpFormat.lower()))) dumpFileName = conf.dumpFile or os.path.join(dumpDbPath, re.sub(r'[\\/]', UNSAFE_DUMP_FILEPATH_REPLACEMENT, "%s.%s" % (unsafeSQLIdentificatorNaming(table), conf.dumpFormat.lower())))
if not checkFile(dumpFileName, False): if not checkFile(dumpFileName, False):
try: try:
openFile(dumpFileName, "w+b").close() openFile(dumpFileName, "w+b").close()

View File

@ -215,6 +215,7 @@ optDict = {
"crawlDepth": "integer", "crawlDepth": "integer",
"crawlExclude": "string", "crawlExclude": "string",
"csvDel": "string", "csvDel": "string",
"dumpFile": "string",
"dumpFormat": "string", "dumpFormat": "string",
"encoding": "string", "encoding": "string",
"eta": "boolean", "eta": "boolean",

View File

@ -20,7 +20,7 @@ from thirdparty import six
from thirdparty.six import unichr as _unichr from thirdparty.six import unichr as _unichr
# sqlmap version (<major>.<minor>.<month>.<monthly commit>) # sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.6.11.3" VERSION = "1.6.11.4"
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable" TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34} TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE) VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

View File

@ -661,6 +661,9 @@ def cmdLineParser(argv=None):
general.add_argument("--charset", dest="charset", general.add_argument("--charset", dest="charset",
help="Blind SQL injection charset (e.g. \"0123456789abcdef\")") help="Blind SQL injection charset (e.g. \"0123456789abcdef\")")
general.add_argument("--dump-file", dest="dumpFile",
help="Store dumped data to a custom file")
general.add_argument("--dump-format", dest="dumpFormat", general.add_argument("--dump-format", dest="dumpFormat",
help="Format of dumped data (CSV (default), HTML or SQLITE)") help="Format of dumped data (CSV (default), HTML or SQLITE)")

View File

@ -738,6 +738,9 @@ crawlExclude =
# Default: , # Default: ,
csvDel = , csvDel = ,
# Store dumped data to a custom file.
dumpFile =
# Format of dumped data # Format of dumped data
# Valid: CSV, HTML or SQLITE # Valid: CSV, HTML or SQLITE
dumpFormat = CSV dumpFormat = CSV