From 554e159ab80dfe4f8e504209de3c95f4929aa5aa Mon Sep 17 00:00:00 2001 From: Malfurious Date: Thu, 10 Mar 2022 04:56:04 -0500 Subject: sploit: Add Comm property 'readonwrite' If readonwrite is set to True (default False), Sploit will catch up and read all available stdin data from the target in a non-blocking fashion. If logonread is also set to True, this data will immediately be presented to the user whenever data is sent, but is otherwise lost (not returned). This mode is primarily intended for use in the interactive Python interpreter, where it can be cumbersome to keep alternating read and write calls when one does not care to actually record the read values. Signed-off-by: Malfurious Signed-off-by: dusoleil --- tools/sploit/sploit/comm.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/sploit/sploit/comm.py b/tools/sploit/sploit/comm.py index 4b1d487..c109ec4 100644 --- a/tools/sploit/sploit/comm.py +++ b/tools/sploit/sploit/comm.py @@ -11,6 +11,7 @@ class Comm: logonread = True logonwrite = False flushonwrite = True + readonwrite = False timeout = 0.25 # seconds def __init__(self, backend): @@ -81,6 +82,7 @@ class Comm: self.back.stdout.write(data) if self.flushonwrite : self.back.stdout.flush() if self.logonwrite : ilog(data, file=sys.stdout, color=ALT) + if self.readonwrite : self.readall_nonblock() def writeline(self, data): self.write(data + b'\n') -- cgit v1.2.3