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

Skip to content

Commit 0a0c3ed

Browse files
committed
Merge branch 'master' of github.com:sqlmapproject/sqlmap
2 parents 2bdf121 + adc8ac2 commit 0a0c3ed

5 files changed

Lines changed: 22 additions & 17 deletions

File tree

lib/controller/checks.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -719,16 +719,14 @@ def _():
719719
kb.injection = injection
720720

721721
for i in xrange(conf.level):
722-
randInt1, randInt2, randInt3 = (_() for j in xrange(3))
722+
while True:
723+
randInt1, randInt2, randInt3 = (_() for j in xrange(3))
723724

724-
randInt1 = min(randInt1, randInt2, randInt3)
725-
randInt3 = max(randInt1, randInt2, randInt3)
725+
randInt1 = min(randInt1, randInt2, randInt3)
726+
randInt3 = max(randInt1, randInt2, randInt3)
726727

727-
while randInt1 >= randInt2:
728-
randInt2 = _()
729-
730-
while randInt2 >= randInt3:
731-
randInt3 = _()
728+
if randInt3 > randInt2 > randInt1:
729+
break
732730

733731
if not checkBooleanExpression("%d=%d" % (randInt1, randInt1)):
734732
retVal = None

lib/parse/cmdline.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ def cmdLineParser():
694694

695695
miscellaneous.add_option("--identify-waf", dest="identifyWaf",
696696
action="store_true",
697-
help="Make a through testing for a WAF/IPS/IDS protection")
697+
help="Make a thorough testing for a WAF/IPS/IDS protection")
698698

699699
miscellaneous.add_option("--mobile", dest="mobile",
700700
action="store_true",
@@ -710,7 +710,7 @@ def cmdLineParser():
710710

711711
miscellaneous.add_option("--smart", dest="smart",
712712
action="store_true",
713-
help="Conduct through tests only if positive heuristic(s)")
713+
help="Conduct thorough tests only if positive heuristic(s)")
714714

715715
miscellaneous.add_option("--sqlmap-shell", dest="sqlmapShell", action="store_true",
716716
help="Prompt for an interactive sqlmap shell")

lib/request/connect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ def queryPage(value=None, place=None, content=False, getRatioValue=False, silent
701701
payload = payload.replace("'", REPLACEMENT_MARKER).replace('"', "'").replace(REPLACEMENT_MARKER, '"')
702702
value = agent.replacePayload(value, payload)
703703
else:
704-
# GET, POST, URI and Cookie payload needs to be throughly URL encoded
704+
# GET, POST, URI and Cookie payload needs to be thoroughly URL encoded
705705
if place in (PLACE.GET, PLACE.URI, PLACE.COOKIE) and not conf.skipUrlEncode or place in (PLACE.POST, PLACE.CUSTOM_POST) and kb.postUrlEncode:
706706
payload = urlencode(payload, '%', False, place != PLACE.URI) # spaceplus is handled down below
707707
value = agent.replacePayload(value, payload)

lib/utils/api.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
from lib.core.defaults import _defaults
3030
from lib.core.enums import CONTENT_STATUS
3131
from lib.core.enums import PART_RUN_CONTENT_TYPES
32+
from lib.core.exception import SqlmapConnectionException
3233
from lib.core.log import LOGGER_HANDLER
3334
from lib.core.optiondict import optDict
3435
from lib.core.subprocessng import Popen
@@ -66,8 +67,11 @@ def connect(self, who="server"):
6667
logger.debug("REST-JSON API %s connected to IPC database" % who)
6768

6869
def disconnect(self):
69-
self.cursor.close()
70-
self.connection.close()
70+
if self.cursor:
71+
self.cursor.close()
72+
73+
if self.connection:
74+
self.connection.close()
7175

7276
def commit(self):
7377
self.connection.commit()
@@ -252,8 +256,11 @@ def emit(self, record):
252256

253257
def setRestAPILog():
254258
if hasattr(conf, "api"):
255-
conf.database_cursor = Database(conf.database)
256-
conf.database_cursor.connect("client")
259+
try:
260+
conf.database_cursor = Database(conf.database)
261+
conf.database_cursor.connect("client")
262+
except sqlite3.OperationalError, ex:
263+
raise SqlmapConnectionException, "%s ('%s')" % (ex, conf.database)
257264

258265
# Set a logging handler that writes log messages to a IPC database
259266
logger.removeHandler(LOGGER_HANDLER)

sqlmap.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ disableColoring = False
735735
# Default: 1
736736
googlePage = 1
737737

738-
# Make a through testing for a WAF/IPS/IDS protection.
738+
# Make a thorough testing for a WAF/IPS/IDS protection.
739739
# Valid: True or False
740740
identifyWaf = False
741741

@@ -747,7 +747,7 @@ mobile = False
747747
# Valid: True or False
748748
pageRank = False
749749

750-
# Conduct through tests only if positive heuristic(s).
750+
# Conduct thorough tests only if positive heuristic(s).
751751
# Valid: True or False
752752
smart = False
753753

0 commit comments

Comments
 (0)