diff options
author | Malfurious <m@lfurio.us> | 2022-03-10 04:56:04 -0500 |
---|---|---|
committer | Malfurious <m@lfurio.us> | 2022-03-14 00:15:02 -0400 |
commit | 554e159ab80dfe4f8e504209de3c95f4929aa5aa (patch) | |
tree | 8df7ca2220bcf6fcb8c9581e50cf1c6aa952f4e8 /tools | |
parent | f013d802088ede38389705c8b8591e8b26de221e (diff) | |
download | lib-des-gnux-554e159ab80dfe4f8e504209de3c95f4929aa5aa.tar.gz lib-des-gnux-554e159ab80dfe4f8e504209de3c95f4929aa5aa.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>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/sploit/sploit/comm.py | 2 |
1 files changed, 2 insertions, 0 deletions
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') |