summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMalfurious <m@lfurio.us>2022-03-10 04:56:04 -0500
committerMalfurious <m@lfurio.us>2022-03-14 00:15:02 -0400
commit5d388a4f47272c612413961938692d1d28030fc8 (patch)
tree1172df087a9b81406e2d7ffffed59865653f0e77
parent71b03b656540fbc135f2fc78b3c1104b7b05ee5a (diff)
downloadsploit-5d388a4f47272c612413961938692d1d28030fc8.tar.gz
sploit-5d388a4f47272c612413961938692d1d28030fc8.zip
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 <m@lfurio.us> Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
-rw-r--r--sploit/comm.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/sploit/comm.py b/sploit/comm.py
index 4b1d487..c109ec4 100644
--- a/sploit/comm.py
+++ b/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')