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

Skip to content

Commit 1e6191e

Browse files
committed
Fixes #2026
1 parent c10b282 commit 1e6191e

2 files changed

Lines changed: 24 additions & 20 deletions

File tree

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from lib.core.revision import getRevisionNumber
2020

2121
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
22-
VERSION = "1.0.7.25"
22+
VERSION = "1.0.7.26"
2323
REVISION = getRevisionNumber()
2424
STABLE = VERSION.count('.') <= 2
2525
VERSION_STRING = "sqlmap/%s#%s" % (VERSION, "stable" if STABLE else "dev")

lib/techniques/union/use.py

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -102,28 +102,32 @@ def _(regex):
102102

103103
retVal = _("(?P<result>%s.*%s)" % (kb.chars.start, kb.chars.stop))
104104
else:
105-
output = extractRegexResult(r"(?P<result>(<row[^>]+>)+)", page)
105+
output = extractRegexResult(r"(?P<result>(<row.+?/>)+)", page)
106106
if output:
107-
retVal = ""
108-
root = xml.etree.ElementTree.fromstring("<root>%s</root>" % output)
109-
for column in kb.dumpColumns:
110-
base64 = True
111-
for child in root:
112-
try:
113-
child.attrib.get(column, "").decode("base64")
114-
except binascii.Error:
115-
base64 = False
116-
break
117-
118-
if base64:
107+
try:
108+
root = xml.etree.ElementTree.fromstring("<root>%s</root>" % output)
109+
retVal = ""
110+
for column in kb.dumpColumns:
111+
base64 = True
119112
for child in root:
120-
child.attrib[column] = child.attrib.get(column, "").decode("base64") or NULL
113+
try:
114+
child.attrib.get(column, "").decode("base64")
115+
except binascii.Error:
116+
base64 = False
117+
break
121118

122-
for child in root:
123-
row = []
124-
for column in kb.dumpColumns:
125-
row.append(child.attrib.get(column, NULL))
126-
retVal += "%s%s%s" % (kb.chars.start, kb.chars.delimiter.join(row), kb.chars.stop)
119+
if base64:
120+
for child in root:
121+
child.attrib[column] = child.attrib.get(column, "").decode("base64") or NULL
122+
123+
for child in root:
124+
row = []
125+
for column in kb.dumpColumns:
126+
row.append(child.attrib.get(column, NULL))
127+
retVal += "%s%s%s" % (kb.chars.start, kb.chars.delimiter.join(row), kb.chars.stop)
128+
129+
except xml.etree.ElementTree.ParseError:
130+
pass
127131

128132
if retVal is not None:
129133
retVal = getUnicode(retVal, kb.pageEncoding)

0 commit comments

Comments
 (0)