From ad0e943147ac6fb724f8f57fd83d65f90e20ba05 Mon Sep 17 00:00:00 2001 From: dusoleil Date: Thu, 2 Sep 2021 00:40:13 -0400 Subject: Add readall() which reads until EOF Signed-off-by: dusoleil --- sploit/comm.py | 7 +++++++ sploit/main.py | 3 +-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/sploit/comm.py b/sploit/comm.py index 1b8ba7f..223b639 100644 --- a/sploit/comm.py +++ b/sploit/comm.py @@ -28,6 +28,13 @@ class Comm: if self.logonread : log(data) return data + def readall(self): + data = b'' + for line in self.back.stdin: + log(line) + data += line + return data + def readuntil(self, pred, /, *args, **kwargs): data = b'' pred = bind(pred, *args, **kwargs) diff --git a/sploit/main.py b/sploit/main.py index ee0495f..0bc799e 100644 --- a/sploit/main.py +++ b/sploit/main.py @@ -55,6 +55,5 @@ def runscript(script, comm): print("Running Script...") exec(open(script).read()) print("Script Finished!") - for line in comm.back.stdin: - log(line) + comm.readall() -- cgit v1.2.3