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

Skip to content

Commit e6f71c2

Browse files
committed
Making 10% less requests in futile higher level/risk runs (using static template payloads for where==NEGATIVE)
1 parent c9d3974 commit e6f71c2

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

lib/controller/checks.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,13 +328,14 @@ def checkSqlInjection(place, parameter, value):
328328
# Use different page template than the original
329329
# one as we are changing parameters value, which
330330
# will likely result in a different content
331+
kb.data.setdefault("randomInt", str(randomInt(10)))
331332
if conf.invalidLogical:
332-
_ = randomInt(2)
333+
_ = int(kb.data.randomInt[:2])
333334
origValue = "%s AND %s=%s" % (value, _, _ + 1)
334335
elif conf.invalidBignum:
335-
origValue = "%d.%d" % (randomInt(6), randomInt(1))
336+
origValue = "%s.%s" % (kb.data.randomInt[:6], kb.data.randomInt[0])
336337
else:
337-
origValue = "-%s" % randomInt()
338+
origValue = "-%s" % kb.data.randomInt[:4]
338339
templatePayload = agent.payload(place, parameter, value="", newValue=origValue, where=where)
339340
elif where == PAYLOAD.WHERE.REPLACE:
340341
origValue = ""

0 commit comments

Comments
 (0)