diff --git a/lib/parse/cmdline.py b/lib/parse/cmdline.py index 1e4c90858..6b54170e9 100644 --- a/lib/parse/cmdline.py +++ b/lib/parse/cmdline.py @@ -583,6 +583,11 @@ def cmdLineParser(argv=None): help="Remote absolute path of temporary files " "directory") + takeover.add_option("--rw-dirs", dest="rwDirs", + help="Remote absolute path of writable " + "directories for overriding defaults " + "(comma separated if multiple)") + # Windows registry options windows = OptionGroup(parser, "Windows registry access", "These " "options can be used to access the back-end " diff --git a/lib/takeover/web.py b/lib/takeover/web.py index 5f5526068..b3d1ba778 100644 --- a/lib/takeover/web.py +++ b/lib/takeover/web.py @@ -196,7 +196,13 @@ class Web: self.webApi = choices[int(choice) - 1] break - directories = list(arrayizeValue(getManualDirectories())) + # If specified in the conf file/cmd line then use those, else ask/use defaults for them + if conf.rwDirs: + logger.info("Trying to upload to user supplied dirs: %s" % conf.rwDirs) + directories = conf.rwDirs.split(',') + else: + directories = list(arrayizeValue(getManualDirectories())) + directories.extend(getAutoDirectories()) directories = list(oset(directories)) diff --git a/sqlmap.conf b/sqlmap.conf index 0a3d8e26b..4e88fe487 100644 --- a/sqlmap.conf +++ b/sqlmap.conf @@ -624,6 +624,12 @@ msfPath = # Valid: absolute file system path tmpPath = +# Remote absolute path of writable directories +# for overriding defaults (comma separated if +# multiple) +# E.g.: /var/www/html/uploads,/var/www/wordpress/images +rwDirs = + # These options can be used to access the back-end database management # system Windows registry.