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

Skip to content

Commit 18d27ca

Browse files
committed
more changes
1 parent 440ff63 commit 18d27ca

5 files changed

Lines changed: 25 additions & 20 deletions

File tree

lib/controller/checks.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ def checkSqlInjection(place, parameter, value, parenthesis):
5454
* Double quoted string injection
5555
"""
5656

57+
logic = conf.logic
5758
randInt = randomInt()
5859
randStr = randomStr()
5960
prefix = ""
@@ -73,7 +74,7 @@ def checkSqlInjection(place, parameter, value, parenthesis):
7374
if not prefix and not postfix and case.name == "custom":
7475
continue
7576

76-
infoMsg = "testing %s injection " % case.desc
77+
infoMsg = "testing %s (%s) injection " % (case.desc, logic)
7778
infoMsg += "on %s parameter '%s'" % (place, parameter)
7879
logger.info(infoMsg)
7980

@@ -86,7 +87,7 @@ def checkSqlInjection(place, parameter, value, parenthesis):
8687
falseResult = Request.queryPage(payload, place)
8788

8889
if not falseResult:
89-
infoMsg = "%s parameter '%s' is %s injectable " % (place, parameter, case.desc)
90+
infoMsg = "%s parameter '%s' is %s (%s) injectable " % (place, parameter, case.desc, logic)
9091
infoMsg += "with %d parenthesis" % parenthesis
9192
logger.info(infoMsg)
9293
return case.name

lib/core/agent.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ def prefixQuery(self, string):
143143
if conf.direct:
144144
return self.payloadDirect(string)
145145

146+
logic = conf.logic
146147
query = str()
147148
case = getInjectionCase(kb.injType)
148149

@@ -172,6 +173,7 @@ def postfixQuery(self, string, comment=None):
172173
if conf.direct:
173174
return self.payloadDirect(string)
174175

176+
logic = conf.logic
175177
case = getInjectionCase(kb.injType)
176178

177179
if case is None:

lib/core/option.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -955,6 +955,7 @@ def __setConfAttributes():
955955
conf.httpHeaders = []
956956
conf.hostname = None
957957
conf.loggedToOut = None
958+
conf.logic = "AND"
958959
conf.matchRatio = None
959960
conf.md5hash = None
960961
conf.multipleTargets = False

lib/utils/parenthesis.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def checkForParenthesis():
4242
logMsg = "testing for parenthesis on injectable parameter"
4343
logger.info(logMsg)
4444

45+
logic = conf.logic
4546
count = 0
4647
case = getInjectionCase(kb.injType)
4748

xml/injections.xml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,62 +3,62 @@
33
<root>
44
<case name="custom" desc="custom">
55
<test>
6-
<positive format="%s%s%s AND %s%d=%d %s" params="value, prefix, &quot;)&quot; * parenthesis, &quot;(&quot; * parenthesis, randInt, randInt, postfix"/>
7-
<negative format="%s%s%s AND %s%d=%d %s" params="value, prefix, &quot;)&quot; * parenthesis, &quot;(&quot; * parenthesis, randInt, randInt + 1, postfix"/>
6+
<positive format="%s%s%s %s %s%d=%d %s" params="value, prefix, &quot;)&quot; * parenthesis, logic, &quot;(&quot; * parenthesis, randInt, randInt, postfix"/>
7+
<negative format="%s%s%s %s %s%d=%d %s" params="value, prefix, &quot;)&quot; * parenthesis, logic, &quot;(&quot; * parenthesis, randInt, randInt + 1, postfix"/>
88
</test>
99
<usage>
1010
<prefix format="%s " params="')' * parenthesis"/>
11-
<postfix format=" AND %s" params="'(' * parenthesis"/>
11+
<postfix format=" %s %s" params="logic, '(' * parenthesis"/>
1212
</usage>
1313
</case>
1414
<case name="numeric" desc="unescaped numeric">
1515
<test>
16-
<positive format="%s%s AND %s%d=%d" params="value, &quot;)&quot; * parenthesis, &quot;(&quot; * parenthesis, randInt, randInt"/>
17-
<negative format="%s%s AND %s%d=%d" params="value, &quot;)&quot; * parenthesis, &quot;(&quot; * parenthesis, randInt, randInt + 1"/>
16+
<positive format="%s%s %s %s%d=%d" params="value, &quot;)&quot; * parenthesis, logic, &quot;(&quot; * parenthesis, randInt, randInt"/>
17+
<negative format="%s%s %s %s%d=%d" params="value, &quot;)&quot; * parenthesis, logic, &quot;(&quot; * parenthesis, randInt, randInt + 1"/>
1818
</test>
1919
<usage>
2020
<prefix format="%s " params="')' * parenthesis"/>
21-
<postfix format=" AND %s%d=%d" params="'(' * parenthesis, randInt, randInt"/>
21+
<postfix format=" %s %s%d=%d" params="logic, '(' * parenthesis, randInt, randInt"/>
2222
</usage>
2323
</case>
2424
<case name="stringsingle" desc="single quoted string">
2525
<test>
26-
<positive format="%s'%s AND %s'%s'='%s" params="value, &quot;)&quot; * parenthesis, &quot;(&quot; * parenthesis, randStr, randStr"/>
27-
<negative format="%s'%s AND %s'%s'='%s" params="value, &quot;)&quot; * parenthesis, &quot;(&quot; * parenthesis, randStr, randStr + randomStr(1)"/>
26+
<positive format="%s'%s %s %s'%s'='%s" params="value, &quot;)&quot; * parenthesis, logic, &quot;(&quot; * parenthesis, randStr, randStr"/>
27+
<negative format="%s'%s %s %s'%s'='%s" params="value, &quot;)&quot; * parenthesis, logic, &quot;(&quot; * parenthesis, randStr, randStr + randomStr(1)"/>
2828
</test>
2929
<usage>
3030
<prefix format="'%s " params="')' * parenthesis"/>
31-
<postfix format=" AND %s'%s'='%s" params="'(' * parenthesis, randStr, randStr"/>
31+
<postfix format=" %s %s'%s'='%s" params="logic, '(' * parenthesis, randStr, randStr"/>
3232
</usage>
3333
</case>
3434
<case name="likesingle" desc="LIKE single quoted string">
3535
<test>
36-
<positive format="%s'%s AND %s'%s' LIKE '%s" params="value, &quot;)&quot; * parenthesis, &quot;(&quot; * parenthesis, randStr, randStr"/>
37-
<negative format="%s'%s AND %s'%s' LIKE '%s" params="value, &quot;)&quot; * parenthesis, &quot;(&quot; * parenthesis, randStr, randStr + randomStr(1)"/>
36+
<positive format="%s'%s %s %s'%s' LIKE '%s" params="value, &quot;)&quot; * parenthesis, logic, &quot;(&quot; * parenthesis, randStr, randStr"/>
37+
<negative format="%s'%s %s %s'%s' LIKE '%s" params="value, &quot;)&quot; * parenthesis, logic, &quot;(&quot; * parenthesis, randStr, randStr + randomStr(1)"/>
3838
</test>
3939
<usage>
4040
<prefix format="'%s " params="')' * parenthesis"/>
41-
<postfix format=" AND %s'%s' LIKE '%s" params="'(' * parenthesis, randStr, randStr"/>
41+
<postfix format=" %s %s'%s' LIKE '%s" params="logic, '(' * parenthesis, randStr, randStr"/>
4242
</usage>
4343
</case>
4444
<case name="stringdouble" desc="double quoted string">
4545
<test>
46-
<positive format="%s\&quot;%s AND %s\&quot;%s\&quot;=\&quot;%s" params="value, &quot;)&quot; * parenthesis, &quot;(&quot; * parenthesis, randStr, randStr"/>
47-
<negative format="%s\&quot;%s AND %s\&quot;%s\&quot;=\&quot;%s" params="value, &quot;)&quot; * parenthesis, &quot;(&quot; * parenthesis, randStr, randStr + randomStr(1)"/>
46+
<positive format="%s\&quot;%s %s %s\&quot;%s\&quot;=\&quot;%s" params="value, &quot;)&quot; * parenthesis, logic, &quot;(&quot; * parenthesis, randStr, randStr"/>
47+
<negative format="%s\&quot;%s %s %s\&quot;%s\&quot;=\&quot;%s" params="value, &quot;)&quot; * parenthesis, logic, &quot;(&quot; * parenthesis, randStr, randStr + randomStr(1)"/>
4848
</test>
4949
<usage>
5050
<prefix format="&quot;%s " params="')' * parenthesis"/>
51-
<postfix format=" AND %s\&quot;%s\&quot;=\&quot;%s" params="'(' * parenthesis, randStr, randStr"/>
51+
<postfix format=" %s %s\&quot;%s\&quot;=\&quot;%s" params="logic, '(' * parenthesis, randStr, randStr"/>
5252
</usage>
5353
</case>
5454
<case name="likedouble" desc="LIKE double quoted string">
5555
<test>
56-
<positive format="%s\&quot;%s AND %s\&quot;%s\&quot; LIKE \&quot;%s" params="value, &quot;)&quot; * parenthesis, &quot;(&quot; * parenthesis, randStr, randStr"/>
57-
<negative format="%s\&quot;%s AND %s\&quot;%s\&quot; LIKE \&quot;%s" params="value, &quot;)&quot; * parenthesis, &quot;(&quot; * parenthesis, randStr, randStr + randomStr(1)"/>
56+
<positive format="%s\&quot;%s %s %s\&quot;%s\&quot; LIKE \&quot;%s" params="value, &quot;)&quot; * parenthesis, logic, &quot;(&quot; * parenthesis, randStr, randStr"/>
57+
<negative format="%s\&quot;%s %s %s\&quot;%s\&quot; LIKE \&quot;%s" params="value, &quot;)&quot; * parenthesis, logic, &quot;(&quot; * parenthesis, randStr, randStr + randomStr(1)"/>
5858
</test>
5959
<usage>
6060
<prefix format="&quot;%s " params="')' * parenthesis"/>
61-
<postfix format=" AND %s\&quot;%s\&quot; LIKE \&quot;%s" params="'(' * parenthesis, randStr, randStr"/>
61+
<postfix format=" %s %s\&quot;%s\&quot; LIKE \&quot;%s" params="logic, '(' * parenthesis, randStr, randStr"/>
6262
</usage>
6363
</case>
6464
</root>

0 commit comments

Comments
 (0)