File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1041,7 +1041,7 @@ def _setSocketPreConnect():
10411041 return
10421042
10431043 def _ ():
1044- while kb .threadContinue and not conf .disablePrecon :
1044+ while kb .get ( " threadContinue" ) and not conf .get ( " disablePrecon" ) :
10451045 try :
10461046 for key in socket ._ready :
10471047 if len (socket ._ready [key ]) < SOCKET_PRE_CONNECT_QUEUE_SIZE :
@@ -1776,6 +1776,17 @@ def _cleanupOptions():
17761776 threadData = getCurrentThreadData ()
17771777 threadData .reset ()
17781778
1779+ def _cleanupEnvironment ():
1780+ """
1781+ Cleanup environment (e.g. from leftovers after --sqlmap-shell).
1782+ """
1783+
1784+ if issubclass (urllib2 .socket .socket , socks .socksocket ):
1785+ socks .unwrapmodule (urllib2 )
1786+
1787+ if hasattr (socket , "_ready" ):
1788+ socket ._ready .clear ()
1789+
17791790def _dirtyPatches ():
17801791 """
17811792 Place for "dirty" Python related patches
@@ -2620,6 +2631,7 @@ def init():
26202631 _saveConfig ()
26212632 _setRequestFromFile ()
26222633 _cleanupOptions ()
2634+ _cleanupEnvironment ()
26232635 _dirtyPatches ()
26242636 _purgeOutput ()
26252637 _checkDependencies ()
You can’t perform that action at this time.
0 commit comments