diff --git a/lib/controller/controller.py b/lib/controller/controller.py index aecb75b00..84d0adf59 100644 --- a/lib/controller/controller.py +++ b/lib/controller/controller.py @@ -308,7 +308,7 @@ def start(): warnMsg = "Ctrl+C detected in multiple target mode" logger.warn(warnMsg) - message = "do you want to skip to the next target in list [Y/n/q]" + message = "do you want to skip to the next target in list? [Y/n/q]" test = readInput(message, default="Y") if not test or test[0] in ("y", "Y"): diff --git a/lib/request/basic.py b/lib/request/basic.py index 931839860..c79ae66e3 100644 --- a/lib/request/basic.py +++ b/lib/request/basic.py @@ -78,8 +78,8 @@ def checkCharEncoding(encoding): else: return encoding - #http://www.destructor.de/charsets/index.htm - translate = { 'windows-874':'iso-8859-11', 'en_us':'utf8' } + # http://www.destructor.de/charsets/index.htm + translate = { 'windows-874': 'iso-8859-11', 'en_us': 'utf8' } for delimiter in (';', ','): if delimiter in encoding: @@ -117,9 +117,10 @@ def decodePage(page, contentEncoding, contentType): page = data.read() - #http://stackoverflow.com/questions/1020892/python-urllib2-read-to-unicode + # http://stackoverflow.com/questions/1020892/python-urllib2-read-to-unicode if contentType and (contentType.find('charset=') != -1): charset = checkCharEncoding(contentType.split('charset=')[-1]) + if charset: page = getUnicode(page, charset) diff --git a/lib/request/comparison.py b/lib/request/comparison.py index 162a40797..5c3009c94 100644 --- a/lib/request/comparison.py +++ b/lib/request/comparison.py @@ -55,6 +55,7 @@ def comparison(page, headers=None, getSeqMatcher=False, pageLength=None): if not kb.nullConnection and not conf.longestCommon: for item in kb.dynamicMarkings: prefix, postfix = item + if prefix is None: page = re.sub('(?s)^.+%s' % postfix, postfix, page) elif postfix is None: @@ -75,6 +76,7 @@ def comparison(page, headers=None, getSeqMatcher=False, pageLength=None): elif not conf.eRegexp and not conf.eString and kb.nullConnection and pageLength: ratio = 1. * pageLength / len(conf.seqMatcher.a) + if ratio > 1.: ratio = 1. / ratio else: