2323"""
2424
2525from lib .core .agent import agent
26+ from lib .core .common import getInjectionCase
2627from lib .core .common import randomInt
2728from lib .core .common import randomStr
2829from lib .core .data import conf
@@ -42,6 +43,10 @@ def checkForParenthesis():
4243 logger .info (logMsg )
4344
4445 count = 0
46+ case = getInjectionCase (kb .injType )
47+
48+ if case is None :
49+ raise sqlmapNoneDataException , "unsupported injection type"
4550
4651 if kb .parenthesis is not None :
4752 return
@@ -57,18 +62,10 @@ def checkForParenthesis():
5762 randInt = randomInt ()
5863 randStr = randomStr ()
5964
60- if kb .injType == "numeric" :
61- query += "%d=%d" % (randInt , randInt )
62- elif kb .injType == "stringsingle" :
63- query += "'%s'='%s" % (randStr , randStr )
64- elif kb .injType == "likesingle" :
65- query += "'%s' LIKE '%s" % (randStr , randStr )
66- elif kb .injType == "stringdouble" :
67- query += "\" %s\" =\" %s" % (randStr , randStr )
68- elif kb .injType == "likedouble" :
69- query += "\" %s\" LIKE \" %s" % (randStr , randStr )
70- else :
71- raise sqlmapNoneDataException , "unsupported injection type"
65+ if case .usage .postfix ._has_key ('value' ):
66+ query += case .usage .postfix .value
67+ elif case .usage .postfix ._has_key ('format' ):
68+ query += case .usage .postfix .format % eval (case .usage .postfix .params )
7269
7370 payload = agent .payload (newValue = query )
7471 result = Request .queryPage (payload )
0 commit comments