diff --git a/lib/core/settings.py b/lib/core/settings.py index 27eec8c4a..1f45295d6 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.0.10.35" +VERSION = "1.0.10.36" 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) @@ -544,6 +544,9 @@ HASHDB_FLUSH_THRESHOLD = 32 # Number of retries for unsuccessful HashDB flush attempts HASHDB_FLUSH_RETRIES = 3 +# Number of retries for unsuccessful HashDB retrieve attempts +HASHDB_RETRIEVE_RETRIES = 3 + # Number of retries for unsuccessful HashDB end transaction attempts HASHDB_END_TRANSACTION_RETRIES = 3 diff --git a/lib/utils/hashdb.py b/lib/utils/hashdb.py index 248179ae4..8d2b7de54 100644 --- a/lib/utils/hashdb.py +++ b/lib/utils/hashdb.py @@ -21,6 +21,7 @@ from lib.core.exception import SqlmapDataException from lib.core.settings import HASHDB_END_TRANSACTION_RETRIES from lib.core.settings import HASHDB_FLUSH_RETRIES from lib.core.settings import HASHDB_FLUSH_THRESHOLD +from lib.core.settings import HASHDB_RETRIEVE_RETRIES from lib.core.settings import UNICODE_ENCODING from lib.core.threads import getCurrentThreadData from lib.core.threads import getCurrentThreadName @@ -76,16 +77,18 @@ class HashDB(object): hash_ = HashDB.hashKey(key) retVal = self._write_cache.get(hash_) if not retVal: - while True: + for _ in xrange(HASHDB_RETRIEVE_RETRIES): try: for row in self.cursor.execute("SELECT value FROM storage WHERE id=?", (hash_,)): retVal = row[0] except sqlite3.OperationalError, ex: - if not any(_ in getSafeExString(ex) for _ in ("locked", "no such table")): - raise - else: + if any(_ in getSafeExString(ex) for _ in ("locked", "no such table")): warnMsg = "problem occurred while accessing session file '%s' ('%s')" % (self.filepath, getSafeExString(ex)) singleTimeWarnMessage(warnMsg) + elif "Could not decode" in getSafeExString(ex): + break + else: + raise except sqlite3.DatabaseError, ex: errMsg = "error occurred while accessing session file '%s' ('%s'). " % (self.filepath, getSafeExString(ex)) errMsg += "If the problem persists please rerun with `--flush-session`" diff --git a/txt/checksum.md5 b/txt/checksum.md5 index bd5cf9625..c970a7c89 100644 --- a/txt/checksum.md5 +++ b/txt/checksum.md5 @@ -45,7 +45,7 @@ e60456db5380840a586654344003d4e6 lib/core/readlineng.py 5ef56abb8671c2ca6ceecb208258e360 lib/core/replication.py 99a2b496b9d5b546b335653ca801153f lib/core/revision.py 7c15dd2777af4dac2c89cab6df17462e lib/core/session.py -ebb5826abf7715ff85c4c55de3f0a12f lib/core/settings.py +6a8ec9fbc9d35126fb23488262b6c5b4 lib/core/settings.py 7af83e4f18cab6dff5e67840eb65be80 lib/core/shell.py 23657cd7d924e3c6d225719865855827 lib/core/subprocessng.py c3ace7874a536d801f308cf1fd03df99 lib/core/target.py @@ -103,7 +103,7 @@ f5d6884cdeed28281187c111d3e49e3b lib/techniques/union/test.py 8cdc8c1e663c3b92a756fb7b02cc3c02 lib/utils/crawler.py 84604ae4cf0f31602b412036b51f5dae lib/utils/deps.py 4dfd3a95e73e806f62372d63bc82511f lib/utils/getch.py -b1e83fc549334fae8f60552dcdad28cb lib/utils/hashdb.py +e6c2695577b9ca40087621f561e9776b lib/utils/hashdb.py 0330607242d4f704ae6d7bba5f52ccae lib/utils/hash.py a3e885f7d4c6ff05db1156244bb84158 lib/utils/htmlentities.py cc9c82cfffd8ee9b25ba3af6284f057e lib/utils/__init__.py