diff --git a/doc/README.html b/doc/README.html index 5c89dc433..8031c61ae 100644 --- a/doc/README.html +++ b/doc/README.html @@ -215,19 +215,14 @@ This SQL injection technique is an alternative to the first one. statements support: sqlmap tests if the web application supports stacked queries then, in case it does support, it appends to the affected parameter in the HTTP request, a semi-colon (;) followed by the -SQL statement to be executed. This technique is useful if to run SQL +SQL statement to be executed. This technique is useful to run SQL statements other than SELECT like, for instance, data definition or data manipulation statements possibly leading to file system read and write access and operating system command -execution depending on the underlying back-end database management system. +execution depending on the underlying back-end database management system +and the session user privileges.

-

It is strongly recommended to run at least once sqlmap with the ---union-test option to test if the affected parameter is used -within a for cycle, or similar, and in case use ---union-use option to exploit this vulnerability because it -saves a lot of time and it does not weight down the web server log file -with hundreds of HTTP requests.

2. Features

@@ -2008,6 +2003,13 @@ affected by an inband SQL injection. In case this vulnerability is exploitable it is strongly recommended to use this technique which saves a lot of time.

+

It is strongly recommended to run at least once sqlmap with the +--union-test option to test if the affected parameter is used +within a for cycle, or similar, and in case use +--union-use option to exploit this vulnerability because it +saves a lot of time and it does not weight down the web server log file +with hundreds of HTTP requests.

+

Use the UNION query SQL injection

diff --git a/doc/README.pdf b/doc/README.pdf index 2300c3778..18221bc20 100644 Binary files a/doc/README.pdf and b/doc/README.pdf differ diff --git a/doc/README.sgml b/doc/README.sgml index ff24cc13a..555d23c69 100644 --- a/doc/README.sgml +++ b/doc/README.sgml @@ -172,20 +172,14 @@ This SQL injection technique is an alternative to the first one. statements support: sqlmap tests if the web application supports stacked queries then, in case it does support, it appends to the affected parameter in the HTTP request, a semi-colon (;) followed by the -SQL statement to be executed. This technique is useful if to run SQL +SQL statement to be executed. This technique is useful to run SQL statements other than SELECT like, for instance, data definition or data manipulation statements possibly leading to file system read and write access and operating system command -execution depending on the underlying back-end database management system. +execution depending on the underlying back-end database management system +and the session user privileges. -It is strongly recommended to run at least once sqlmap with the ---union-test option to test if the affected parameter is used -within a for cycle, or similar, and in case use ---union-use option to exploit this vulnerability because it -saves a lot of time and it does not weight down the web server log file -with hundreds of HTTP requests. - Features @@ -1939,6 +1933,14 @@ affected by an inband SQL injection. In case this vulnerability is exploitable it is strongly recommended to use this technique which saves a lot of time. +

+It is strongly recommended to run at least once sqlmap with the +--union-test option to test if the affected parameter is used +within a for cycle, or similar, and in case use +--union-use option to exploit this vulnerability because it +saves a lot of time and it does not weight down the web server log file +with hundreds of HTTP requests. + Use the UNION query SQL injection diff --git a/lib/core/option.py b/lib/core/option.py index a8dbcf2e5..0ffc5ffdd 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -34,6 +34,8 @@ import time import urllib2 import urlparse +from ConfigParser import ConfigParser + from lib.core.common import parseTargetUrl from lib.core.common import paths from lib.core.common import randomRange @@ -657,6 +659,7 @@ def __saveCmdline(): debugMsg = "saving command line options on a sqlmap configuration INI file" logger.debug(debugMsg) + config = ConfigParser() userOpts = {} for family in optDict.keys(): @@ -667,10 +670,8 @@ def __saveCmdline(): if option in optionData: userOpts[family].append((option, value, optionData[option])) - confFP = open(paths.SQLMAP_CONFIG, "w") - for family, optionData in userOpts.items(): - confFP.write("[%s]\n" % family) + config.add_section(family) optionData.sort() @@ -691,12 +692,10 @@ def __saveCmdline(): if isinstance(value, str): value = value.replace("\n", "\n ") - confFP.write("%s = %s\n" % (option, value)) + config.set(family, option, value) - confFP.write("\n") - - confFP.flush() - confFP.close() + confFP = open(paths.SQLMAP_CONFIG, "wb") + config.write(confFP) infoMsg = "saved command line options on '%s' configuration file" % paths.SQLMAP_CONFIG logger.info(infoMsg)