Skip to content

Commit 070e173

Browse files
committed
Another patch for #3389 (Fixes #3397)
1 parent f04584b commit 070e173

File tree

3 files changed

+2
-19
lines changed

3 files changed

+2
-19
lines changed

lib/core/common.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -997,11 +997,6 @@ def readInput(message, default=None, checkBatch=True, boolean=False):
997997
retVal = None
998998
kb.stickyLevel = None
999999

1000-
if kb.lastInputMessage == message:
1001-
checkBatch = False
1002-
else:
1003-
kb.lastInputMessage = message
1004-
10051000
message = getUnicode(message)
10061001

10071002
if "\n" in message:

lib/core/option.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1792,7 +1792,6 @@ def _setKnowledgeBaseAttributes(flushAll=True):
17921792
kb.injection = InjectionDict()
17931793
kb.injections = []
17941794
kb.laggingChecked = False
1795-
kb.lastInputMessage = None
17961795
kb.lastParserStatus = None
17971796

17981797
kb.locks = AttribDict()

lib/takeover/metasploit.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -168,19 +168,8 @@ def _skeletonSelection(self, msg, lst=None, maxValue=1, default=1):
168168

169169
choice = readInput(message, default="%d" % default)
170170

171-
if not choice:
172-
if lst:
173-
choice = getUnicode(default, UNICODE_ENCODING)
174-
else:
175-
return default
176-
177-
elif not choice.isdigit():
178-
logger.warn("invalid value, only digits are allowed")
179-
return self._skeletonSelection(msg, lst, maxValue, default)
180-
181-
elif int(choice) > maxValue or int(choice) < 1:
182-
logger.warn("invalid value, it must be a digit between 1 and %d" % maxValue)
183-
return self._skeletonSelection(msg, lst, maxValue, default)
171+
if not choice or not choice.isdigit() or int(choice) > maxValue or int(choice) < 1:
172+
choice = default
184173

185174
choice = int(choice)
186175

0 commit comments

Comments
 (0)