From 6caccc3d930cf81e7224720c1d341398d74a41ca Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Wed, 20 Aug 2014 01:38:01 +0200 Subject: [PATCH] Bug fix for ultra-slow processing of binary data --- lib/request/connect.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/request/connect.py b/lib/request/connect.py index b3e4bbfdf..f8c3ae75d 100644 --- a/lib/request/connect.py +++ b/lib/request/connect.py @@ -568,6 +568,10 @@ class Connect(object): raise SqlmapConnectionException(warnMsg) finally: + if HTTP_HEADER.CONTENT_TYPE in (responseHeaders or {}) and responseHeaders[HTTP_HEADER.CONTENT_TYPE] in ("application/octet-stream",): + page = unicode(page, errors="replace") + else: + page = page if isinstance(page, unicode) else getUnicode(page) page = page if isinstance(page, unicode) else getUnicode(page) socket.setdefaulttimeout(conf.timeout)