Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0c48d0d

Browse files
committed
Minor update on request
1 parent 5108c2d commit 0c48d0d

3 files changed

Lines changed: 22 additions & 3 deletions

File tree

lib/core/option.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2009,10 +2009,11 @@ def _setKnowledgeBaseAttributes(flushAll=True):
20092009
kb.skipSeqMatcher = False
20102010
kb.smokeMode = False
20112011
kb.reduceTests = None
2012-
kb.tlsSNI = {}
2012+
kb.sslSuccess = False
20132013
kb.stickyDBMS = False
20142014
kb.storeHashesChoice = None
20152015
kb.suppressResumeInfo = False
2016+
kb.tableExistsChoice = None
20162017
kb.tableFrom = None
20172018
kb.technique = None
20182019
kb.tempDir = None
@@ -2022,7 +2023,7 @@ def _setKnowledgeBaseAttributes(flushAll=True):
20222023
kb.testType = None
20232024
kb.threadContinue = True
20242025
kb.threadException = False
2025-
kb.tableExistsChoice = None
2026+
kb.tlsSNI = {}
20262027
kb.uChar = NULL
20272028
kb.udfFail = False
20282029
kb.unionDuplicates = False

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from thirdparty.six import unichr as _unichr
1919

2020
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
21-
VERSION = "1.4.8.14"
21+
VERSION = "1.4.8.15"
2222
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2323
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2424
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

lib/request/httpshandler.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
from lib.core.common import filterNone
1313
from lib.core.common import getSafeExString
14+
from lib.core.compat import xrange
15+
from lib.core.data import conf
1416
from lib.core.data import kb
1517
from lib.core.data import logger
1618
from lib.core.exception import SqlmapConnectionException
@@ -43,6 +45,8 @@ def __init__(self, *args, **kwargs):
4345
_contexts[None] = ssl._create_default_https_context()
4446
kwargs["context"] = _contexts[None]
4547

48+
self.retrying = False
49+
4650
_http_client.HTTPSConnection.__init__(self, *args, **kwargs)
4751

4852
def connect(self):
@@ -101,7 +105,21 @@ def create_sock():
101105
# Reference: https://docs.python.org/2/library/ssl.html
102106
if distutils.version.LooseVersion(PYVERSION) < distutils.version.LooseVersion("2.7.9"):
103107
errMsg += " (please retry with Python >= 2.7.9)"
108+
109+
if kb.sslSuccess and not self.retrying:
110+
self.retrying = True
111+
112+
for _ in xrange(conf.retries):
113+
try:
114+
self.connect()
115+
except SqlmapConnectionException:
116+
pass
117+
else:
118+
return
119+
104120
raise SqlmapConnectionException(errMsg)
121+
else:
122+
kb.sslSuccess = True
105123

106124
class HTTPSHandler(_urllib.request.HTTPSHandler):
107125
def https_open(self, req):

0 commit comments

Comments
 (0)