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

Skip to content

Commit e80a66a

Browse files
committed
minor update
1 parent 1e9ae40 commit e80a66a

1 file changed

Lines changed: 9 additions & 12 deletions

File tree

lib/utils/parenthesis.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"""
2424

2525
from lib.core.agent import agent
26+
from lib.core.common import getInjectionCase
2627
from lib.core.common import randomInt
2728
from lib.core.common import randomStr
2829
from 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

Comments
 (0)