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

Skip to content

Commit bb99bd2

Browse files
committed
one more commit related to the issue with displaying of garbled characters
1 parent 04986be commit bb99bd2

4 files changed

Lines changed: 6 additions & 5 deletions

File tree

lib/core/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
from lib.core.settings import VERSION_STRING
7373
from lib.core.settings import SITE
7474
from lib.core.settings import ERROR_PARSING_REGEXES
75-
from lib.core.settings import NON_PRINTABLE_CHAR_REGEX
75+
from lib.core.settings import PRINTABLE_CHAR_REGEX
7676
from lib.core.settings import SQL_STATEMENTS
7777
from lib.core.settings import SUPPORTED_DBMS
7878
from lib.core.settings import UNKNOWN_DBMS_VERSION
@@ -2131,7 +2131,7 @@ def filterControlChars(value):
21312131
Returns string value with control chars being supstituted with ' '
21322132
"""
21332133

2134-
return filterStringValue(value, NON_PRINTABLE_CHAR_REGEX, ' ')
2134+
return filterStringValue(value, PRINTABLE_CHAR_REGEX, ' ')
21352135

21362136
def isDBMSVersionAtLeast(version):
21372137
"""

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757

5858
PAYLOAD_DELIMITER = "\x00"
5959
CHAR_INFERENCE_MARK = "%c"
60-
NON_PRINTABLE_CHAR_REGEX = r'[^\x00-\x1f\x7f-\xff]'
60+
PRINTABLE_CHAR_REGEX = r'[^\x00-\x1f\x7e-\xff]'
6161

6262
# dumping characters used in GROUP_CONCAT MySQL technique
6363
CONCAT_ROW_DELIMITER = ','

lib/techniques/error/use.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def __errorFields(expression, expressionFields, expressionFieldsList, expected=N
136136
output = __oneShotErrorUse(expressionReplaced, field)
137137

138138
if output is not None:
139-
dataToStdout("[%s] [INFO] retrieved: %s\r\n" % (time.strftime("%X"), safecharencode(replaceNewlineTabs(output, stdout=True))))
139+
dataToStdout("[%s] [INFO] retrieved: %s\r\n" % (time.strftime("%X"), safecharencode(output)))
140140

141141
if isinstance(num, int):
142142
expression = origExpr

lib/techniques/inband/union/use.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
from lib.core.common import listToStrValue
2525
from lib.core.common import parseUnionPage
2626
from lib.core.common import removeReflectiveValues
27+
from lib.core.convert import safecharencode
2728
from lib.core.data import conf
2829
from lib.core.data import kb
2930
from lib.core.data import logger
@@ -253,7 +254,7 @@ def unionUse(expression, unpack=True, dump=False):
253254

254255
if conf.verbose == 1:
255256
items = output.replace(kb.misc.start, "").replace(kb.misc.stop, "").split(kb.misc.delimiter)
256-
status = "[%s] [INFO] retrieved: %s\r\n" % (time.strftime("%X"), ",".join(map(lambda x: "\"%s\"" % x, items)))
257+
status = "[%s] [INFO] retrieved: %s\r\n" % (time.strftime("%X"), safecharencode(",".join(map(lambda x: "\"%s\"" % x, items))))
257258
if len(status) > width:
258259
status = "%s..." % status[:width - 3]
259260
dataToStdout(status, True)

0 commit comments

Comments
 (0)