minor update

This commit is contained in:
Miroslav Stampar 2010-10-07 12:21:59 +00:00
parent 1e9ae40397
commit e80a66acc5

View File

@ -23,6 +23,7 @@ Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
""" """
from lib.core.agent import agent from lib.core.agent import agent
from lib.core.common import getInjectionCase
from lib.core.common import randomInt from lib.core.common import randomInt
from lib.core.common import randomStr from lib.core.common import randomStr
from lib.core.data import conf from lib.core.data import conf
@ -42,6 +43,10 @@ def checkForParenthesis():
logger.info(logMsg) logger.info(logMsg)
count = 0 count = 0
case = getInjectionCase(kb.injType)
if case is None:
raise sqlmapNoneDataException, "unsupported injection type"
if kb.parenthesis is not None: if kb.parenthesis is not None:
return return
@ -57,18 +62,10 @@ def checkForParenthesis():
randInt = randomInt() randInt = randomInt()
randStr = randomStr() randStr = randomStr()
if kb.injType == "numeric": if case.usage.postfix._has_key('value'):
query += "%d=%d" % (randInt, randInt) query += case.usage.postfix.value
elif kb.injType == "stringsingle": elif case.usage.postfix._has_key('format'):
query += "'%s'='%s" % (randStr, randStr) query += case.usage.postfix.format % eval(case.usage.postfix.params)
elif kb.injType == "likesingle":
query += "'%s' LIKE '%s" % (randStr, randStr)
elif kb.injType == "stringdouble":
query += "\"%s\"=\"%s" % (randStr, randStr)
elif kb.injType == "likedouble":
query += "\"%s\" LIKE \"%s" % (randStr, randStr)
else:
raise sqlmapNoneDataException, "unsupported injection type"
payload = agent.payload(newValue=query) payload = agent.payload(newValue=query)
result = Request.queryPage(payload) result = Request.queryPage(payload)