From ac77724970419799163b2a450615bfc17e489d87 Mon Sep 17 00:00:00 2001 From: Bernardo Damele Date: Thu, 20 Dec 2012 09:30:48 +0000 Subject: [PATCH] attempt to handle standard input from --live-test --- lib/core/testing.py | 4 ++-- lib/takeover/metasploit.py | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/core/testing.py b/lib/core/testing.py index 3bb869568..63fea1cd4 100644 --- a/lib/core/testing.py +++ b/lib/core/testing.py @@ -18,6 +18,7 @@ from extra.beep.beep import beep from lib.controller.controller import start from lib.core.common import clearConsoleLine from lib.core.common import dataToStdout +from lib.core.common import getUnicode from lib.core.common import randomStr from lib.core.common import readXmlFile from lib.core.data import conf @@ -26,6 +27,7 @@ from lib.core.data import paths from lib.core.log import LOGGER_HANDLER from lib.core.option import init from lib.core.optiondict import optDict +from lib.core.settings import UNICODE_ENCODING from lib.parse.cmdline import cmdLineParser failedItem = None @@ -239,8 +241,6 @@ def runCase(switches=None, parse=None): ifile.close() for item, console_output in parse: - from lib.core.common import getUnicode - from lib.core.settings import UNICODE_ENCODING if console_output is True: parse_on = getUnicode(console, UNICODE_ENCODING) else: diff --git a/lib/takeover/metasploit.py b/lib/takeover/metasploit.py index 4f874ccfc..9302a3635 100644 --- a/lib/takeover/metasploit.py +++ b/lib/takeover/metasploit.py @@ -486,6 +486,9 @@ class Metasploit: else: proc.stdin.write("uname -a ; id\n") + if conf.liveTest: + proc.stdin.write("exit\n") + metSess = re.search("Meterpreter session ([\d]+) opened", out) if metSess: