diff --git a/lib/request/basic.py b/lib/request/basic.py index fc3685cd1..4882b0def 100644 --- a/lib/request/basic.py +++ b/lib/request/basic.py @@ -5,6 +5,7 @@ Copyright (c) 2006-2017 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ +import cgi import codecs import gzip import logging @@ -338,8 +339,33 @@ def decodePage(page, contentEncoding, contentType): # e.g. ζ page = re.sub(r"&([^;]+);", lambda _: unichr(htmlEntities[_.group(1)]) if htmlEntities.get(_.group(1), 0) > 255 else _.group(0), page) + if contentType and contentType.lower() == 'application/vnd.ms-excel': + page = _xlsx2html(StringIO.StringIO(page)) + return page +def _xlsx2html(fio): + sio = StringIO.StringIO() + try: + import openpyxl + wb = openpyxl.load_workbook(fio) + for ws in wb: + sio.write(u'
{0} | '.format(value)) + sio.write(u'