Skip to content

Commit d6c9515

Browse files
committed
minor update
1 parent 847b648 commit d6c9515

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

lib/core/settings.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@
7777
# minimum time response set needed for time-comparison based on standard deviation
7878
MIN_TIME_RESPONSES = 15
7979

80+
# minimum comparison ratio set needed for searching valid union column number based on standard deviation
81+
MIN_UNION_RESPONSES = 5
82+
8083
# after these number of blanks at the end inference should stop (just in case)
8184
INFERENCE_BLANK_BREAK = 15
8285

lib/techniques/inband/union/test.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
from lib.core.enums import PAYLOAD
3232
from lib.core.settings import FROM_TABLE
3333
from lib.core.settings import UNION_STDEV_COEFF
34+
from lib.core.settings import MIN_UNION_RESPONSES
3435
from lib.core.unescaper import unescaper
3536
from lib.parse.html import htmlParser
3637
from lib.request.comparison import comparison
@@ -45,9 +46,13 @@ def __findUnionCharCount(comment, place, parameter, value, prefix, suffix, where
4546
pushValue(kb.errorIsNone)
4647
items, ratios = [], []
4748
kb.errorIsNone = False
49+
lowerCount, upperCount = conf.uColsStart, conf.uColsStop
50+
51+
if abs(upperCount - lowerCount) < MIN_UNION_RESPONSES:
52+
upperCount = lowerCount + MIN_UNION_RESPONSES
4853

4954
min_, max_ = None, None
50-
for count in range(conf.uColsStart, conf.uColsStop+1):
55+
for count in range(lowerCount, upperCount+1):
5156
query = agent.forgeInbandQuery('', -1, count, comment, prefix, suffix, conf.uChar)
5257
payload = agent.payload(place=place, parameter=parameter, newValue=query, where=where)
5358
page, _ = Request.queryPage(payload, place=place, content=True, raise404=False)

0 commit comments

Comments
 (0)