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

Skip to content

Commit 1c44d6d

Browse files
committed
Fixed annoying bug that prevented proper checkBooleanExpression() function to work with direct connection (-d). Now DBMS fingerprint should work properly with -d
1 parent 23cc8b6 commit 1c44d6d

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

lib/request/inject.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,19 @@ def getValue(expression, blind=True, inband=True, error=True, time=True, fromUse
404404
getCurrentThreadData().disableStdOut = suppressOutput
405405

406406
try:
407+
if expected == EXPECTED.BOOL:
408+
forgeCaseExpression = booleanExpression = expression
409+
410+
if expression.upper().startswith("SELECT "):
411+
booleanExpression = expression[len("SELECT "):]
412+
else:
413+
forgeCaseExpression = agent.forgeCaseStatement(expression)
414+
407415
if conf.direct:
408-
value = direct(expression)
416+
if expected == EXPECTED.BOOL:
417+
value = direct(forgeCaseExpression)
418+
else:
419+
value = direct(expression)
409420

410421
elif any(map(isTechniqueAvailable, getPublicTypeMembers(PAYLOAD.TECHNIQUE, onlyValues=True))):
411422
query = cleanQuery(expression)
@@ -418,14 +429,6 @@ def getValue(expression, blind=True, inband=True, error=True, time=True, fromUse
418429

419430
count = 0
420431

421-
if expected == EXPECTED.BOOL:
422-
forgeCaseExpression = booleanExpression = expression
423-
424-
if expression.upper().startswith("SELECT "):
425-
booleanExpression = expression[len("SELECT "):]
426-
else:
427-
forgeCaseExpression = agent.forgeCaseStatement(expression)
428-
429432
if inband and isTechniqueAvailable(PAYLOAD.TECHNIQUE.UNION):
430433
kb.technique = PAYLOAD.TECHNIQUE.UNION
431434

0 commit comments

Comments
 (0)