diff --git a/lib/controller/controller.py b/lib/controller/controller.py index ad12620c7..16395be1c 100644 --- a/lib/controller/controller.py +++ b/lib/controller/controller.py @@ -56,6 +56,7 @@ from lib.core.exception import SqlmapNoneDataException from lib.core.exception import SqlmapNotVulnerableException from lib.core.exception import SqlmapSilentQuitException from lib.core.exception import SqlmapSkipTargetException +from lib.core.exception import SqlmapSystemException from lib.core.exception import SqlmapValueException from lib.core.exception import SqlmapUserQuitException from lib.core.settings import ASP_NET_CONTROL_REGEX @@ -243,16 +244,20 @@ def _saveToResultsFile(): results[key].extend(injection.data.keys()) - for key, value in results.items(): - place, parameter, notes = key - line = "%s,%s,%s,%s,%s%s" % (safeCSValue(kb.originalUrls.get(conf.url) or conf.url), place, parameter, "".join(techniques[_][0].upper() for _ in sorted(value)), notes, os.linesep) - conf.resultsFP.write(line) + try: + for key, value in results.items(): + place, parameter, notes = key + line = "%s,%s,%s,%s,%s%s" % (safeCSValue(kb.originalUrls.get(conf.url) or conf.url), place, parameter, "".join(techniques[_][0].upper() for _ in sorted(value)), notes, os.linesep) + conf.resultsFP.write(line) - if not results: - line = "%s,,,,%s" % (conf.url, os.linesep) - conf.resultsFP.write(line) + if not results: + line = "%s,,,,%s" % (conf.url, os.linesep) + conf.resultsFP.write(line) - conf.resultsFP.flush() + conf.resultsFP.flush() + except IOError, ex: + errMsg = "unable to write to the results file '%s' ('%s'). " % (conf.resultsFilename, getSafeExString(ex)) + raise SqlmapSystemException(errMsg) @stackedmethod def start(): diff --git a/lib/core/settings.py b/lib/core/settings.py index 8486b1ce6..927437b9b 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -19,7 +19,7 @@ from lib.core.enums import DBMS_DIRECTORY_NAME from lib.core.enums import OS # sqlmap version (...) -VERSION = "1.2.10.11" +VERSION = "1.2.10.12" TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable" 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) diff --git a/txt/checksum.md5 b/txt/checksum.md5 index 01dc26cff..9a0c3e843 100644 --- a/txt/checksum.md5 +++ b/txt/checksum.md5 @@ -24,7 +24,7 @@ b3e60ea4e18a65c48515d04aab28ff68 extra/sqlharvest/sqlharvest.py c1bccc94522d3425a372dcd57f78418e extra/wafdetectify/wafdetectify.py 3459c562a6abb9b4bdcc36925f751f3e lib/controller/action.py 61b66a7c30eb43c6b99ad57e4a8b5b22 lib/controller/checks.py -c414cecdb0472c92cf50ed5b01e4438c lib/controller/controller.py +d6deacb76e1f479b3c690c215fad1c08 lib/controller/controller.py c7443613a0a2505b1faec931cee2a6ef lib/controller/handler.py 1e5532ede194ac9c083891c2f02bca93 lib/controller/__init__.py effd6e6a07b13fd8b3803ed4b89b06e2 lib/core/agent.py @@ -49,7 +49,7 @@ c8c386d644d57c659d74542f5f57f632 lib/core/patch.py 0c3eef46bdbf87e29a3f95f90240d192 lib/core/replication.py a7db43859b61569b601b97f187dd31c5 lib/core/revision.py fcb74fcc9577523524659ec49e2e964b lib/core/session.py -0ad6a2aebce990c7d4a1dd717ad3908a lib/core/settings.py +fe0cffe5cf3eb9de96697f8ba3f0f297 lib/core/settings.py dd68a9d02fccb4fa1428b20e15b0db5d lib/core/shell.py a7edc9250d13af36ac0108f259859c19 lib/core/subprocessng.py 62bc180e3e828949ffb342a8f756c183 lib/core/target.py