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

Skip to content

Commit f021548

Browse files
committed
added inference failsafe (like in for instance Firebirds SUBSTR always returns a string value, no matter which starting index you use)
1 parent c17f444 commit f021548

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

lib/core/settings.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,13 @@
4848

4949
PAYLOAD_DELIMITER = "\x00"
5050
CHAR_INFERENCE_MARK = "%c"
51+
52+
# minimum time response set needed for time-comparison based on standard deviation
5153
MIN_TIME_RESPONSES = 10
5254

55+
# after these number of blanks at the end inference should stop (just in case)
56+
INFERENCE_BLANK_BREAK = 20
57+
5358
# System variables
5459
IS_WIN = subprocess.mswindows
5560
# The name of the operating system dependent module imported. The following

lib/techniques/blind/inference.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
from lib.core.exception import unhandledException
3535
from lib.core.progress import ProgressBar
3636
from lib.core.settings import CHAR_INFERENCE_MARK
37+
from lib.core.settings import INFERENCE_BLANK_BREAK
3738
from lib.core.unescaper import unescaper
3839
from lib.request.connect import Connect as Request
3940

@@ -506,6 +507,9 @@ def downloadThread():
506507
elif conf.verbose in (1, 2):
507508
dataToStdout(val)
508509

510+
if len(finalValue) > INFERENCE_BLANK_BREAK and finalValue[-INFERENCE_BLANK_BREAK:].isspace():
511+
break
512+
509513
if conf.verbose in (1, 2) or showEta:
510514
dataToStdout("\n")
511515

0 commit comments

Comments
 (0)