From 070e17306721baae2c0034f610061e147740ae28 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Mon, 10 Dec 2018 12:59:13 +0100 Subject: [PATCH] Another patch for #3389 (Fixes #3397) --- lib/core/common.py | 5 ----- lib/core/option.py | 1 - lib/takeover/metasploit.py | 15 ++------------- 3 files changed, 2 insertions(+), 19 deletions(-) diff --git a/lib/core/common.py b/lib/core/common.py index 75e3db096..8da52c896 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -997,11 +997,6 @@ def readInput(message, default=None, checkBatch=True, boolean=False): retVal = None kb.stickyLevel = None - if kb.lastInputMessage == message: - checkBatch = False - else: - kb.lastInputMessage = message - message = getUnicode(message) if "\n" in message: diff --git a/lib/core/option.py b/lib/core/option.py index 8081e3462..499cefb0b 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -1792,7 +1792,6 @@ def _setKnowledgeBaseAttributes(flushAll=True): kb.injection = InjectionDict() kb.injections = [] kb.laggingChecked = False - kb.lastInputMessage = None kb.lastParserStatus = None kb.locks = AttribDict() diff --git a/lib/takeover/metasploit.py b/lib/takeover/metasploit.py index 8a8c0b74d..356eba16a 100644 --- a/lib/takeover/metasploit.py +++ b/lib/takeover/metasploit.py @@ -168,19 +168,8 @@ class Metasploit: choice = readInput(message, default="%d" % default) - if not choice: - if lst: - choice = getUnicode(default, UNICODE_ENCODING) - else: - return default - - elif not choice.isdigit(): - logger.warn("invalid value, only digits are allowed") - return self._skeletonSelection(msg, lst, maxValue, default) - - elif int(choice) > maxValue or int(choice) < 1: - logger.warn("invalid value, it must be a digit between 1 and %d" % maxValue) - return self._skeletonSelection(msg, lst, maxValue, default) + if not choice or not choice.isdigit() or int(choice) > maxValue or int(choice) < 1: + choice = default choice = int(choice)