diff options
author | Malfurious <m@lfurio.us> | 2022-04-08 23:44:49 -0400 |
---|---|---|
committer | Malfurious <m@lfurio.us> | 2022-04-08 23:44:49 -0400 |
commit | 83a7e196cfcefee11e9bed6542b2dd5954b3d055 (patch) | |
tree | d7feb42202bbf46e995edc000f99d88fb071857e | |
parent | 9b91175045c4dc6e2c3d1d83433f9569495fcb9f (diff) | |
parent | 93c6adcbc97f6cdd9b45b78b95279abb82e8a05c (diff) | |
download | lib-des-gnux-83a7e196cfcefee11e9bed6542b2dd5954b3d055.tar.gz lib-des-gnux-83a7e196cfcefee11e9bed6542b2dd5954b3d055.zip |
Merge branch 'sploit/interactive-fixes'
These patches correct some issues I've run into using the interactive
workflow in Sploit during picoCTF.
* sploit/interactive-fixes:
sploit: Allow multiple reads in Comm.readall_nonblock()
sploit: Fix units for Comm.timeout
-rw-r--r-- | tools/sploit/sploit/comm.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/sploit/sploit/comm.py b/tools/sploit/sploit/comm.py index 265ab96..67c97bc 100644 --- a/tools/sploit/sploit/comm.py +++ b/tools/sploit/sploit/comm.py @@ -12,7 +12,7 @@ class Comm: logonwrite = False flushonwrite = True readonwrite = False - timeout = 0.25 # seconds + timeout = 250 # milliseconds def __init__(self, backend): self.back = backend @@ -46,11 +46,15 @@ class Comm: def readall_nonblock(self): try: + data = b'' os.set_blocking(self.back.stdin.fileno(), False) poll = select.poll() poll.register(self.back.stdin, select.POLLIN) - poll.poll(self.timeout) - return self.readall() + while True: + poll.poll(self.timeout) + d = self.readall() + if len(d) == 0: return data + data += d finally: os.set_blocking(self.back.stdin.fileno(), True) |