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

Skip to content

Commit 7d6f51f

Browse files
committed
Avoid blank space between prefix and test's payload if it's a stacked queries test
1 parent b0928e0 commit 7d6f51f

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

lib/controller/checks.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
from plugins.dbms.sqlite.syntax import Syntax as SQLite
5555
from plugins.dbms.maxdb.syntax import Syntax as MaxDB
5656

57-
5857
def unescape(string, dbms):
5958
unescaper = {
6059
"Access": Access.unescape,
@@ -244,7 +243,7 @@ def checkSqlInjection(place, parameter, value):
244243
# Forge request payload by prepending with boundary's
245244
# prefix and appending the boundary's suffix to the
246245
# test's ' <payload><comment> ' string
247-
boundPayload = "%s%s %s %s" % (origValue, prefix, fstPayload, suffix)
246+
boundPayload = "%s%s%s%s %s" % (origValue, prefix, (" " if stype != 4 else ""), fstPayload, suffix)
248247
boundPayload = boundPayload.strip()
249248
boundPayload = agent.cleanupPayload(boundPayload, value)
250249
reqPayload = agent.payload(place, parameter, value, boundPayload)
@@ -265,7 +264,7 @@ def checkSqlInjection(place, parameter, value):
265264
# boundary's prefix and appending the boundary's
266265
# suffix to the test's ' <payload><comment> '
267266
# string
268-
boundPayload = "%s%s %s %s" % (origValue, prefix, sndPayload, suffix)
267+
boundPayload = "%s%s%s%s %s" % (origValue, prefix, (" " if stype != 4 else ""), sndPayload, suffix)
269268
boundPayload = boundPayload.strip()
270269
boundPayload = agent.cleanupPayload(boundPayload, value)
271270
cmpPayload = agent.payload(place, parameter, value, boundPayload)

0 commit comments

Comments
 (0)