summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordusoleil <howcansocksbereal@gmail.com>2021-09-01 01:08:06 -0400
committerdusoleil <howcansocksbereal@gmail.com>2021-09-01 01:08:06 -0400
commitc394b31ecbcc78682629ef20b552de32e2ac3e9e (patch)
tree00517200c526e7baa1f7c2825fcdf0a3f37fc7e2
parenta5d0003aa8f3f14076945a9a01ea23915be874dc (diff)
downloadlib-des-gnux-c394b31ecbcc78682629ef20b552de32e2ac3e9e.tar.gz
lib-des-gnux-c394b31ecbcc78682629ef20b552de32e2ac3e9e.zip
Correct read() Semantics
The BufferedReader's .read() doesn't behave as expected. It reads EXACTLY size bytes and will block until there are enough available to read. os.read() does what we expect. It will read UP TO size bytes and only block if there is nothing available to read. Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
-rw-r--r--tools/sploit/sploit/comm.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/sploit/sploit/comm.py b/tools/sploit/sploit/comm.py
index fc220ef..9a20318 100644
--- a/tools/sploit/sploit/comm.py
+++ b/tools/sploit/sploit/comm.py
@@ -13,7 +13,7 @@ class Comm:
self.back = backend
def read(self, size):
- data = self.back.stdin.read(size)
+ data = os.read(self.back.stdin.fileno(), size)
if(data == b''):
raise BrokenPipeError('Tried to read on broken pipe')
log(data)