summaryrefslogtreecommitdiffstats
path: root/tools/sploit
diff options
context:
space:
mode:
authordusoleil <howcansocksbereal@gmail.com>2021-09-01 00:18:09 -0400
committerdusoleil <howcansocksbereal@gmail.com>2021-09-01 00:18:09 -0400
commitd28c9fe76bed900723f94527f3dc438e6d9bdc09 (patch)
tree2aabb8356fc843323b7546c02fbe5c9efbb6280e /tools/sploit
parenta56433c9557141fcdd7c681e818a3c8665e89e5e (diff)
downloadlib-des-gnux-d28c9fe76bed900723f94527f3dc438e6d9bdc09.tar.gz
lib-des-gnux-d28c9fe76bed900723f94527f3dc438e6d9bdc09.zip
Move "Read Rest of Output" Out of Destructor
With the "read rest of output" code in the Comm destructor, it would continue to read output even in situations where some error happened and we expect sploit to die or when the user presses Ctrl+C to end sploit. By moving it to the end of the script running code in main, it behaves more intuitively. Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
Diffstat (limited to 'tools/sploit')
-rw-r--r--tools/sploit/sploit/comm.py4
-rw-r--r--tools/sploit/sploit/main.py2
2 files changed, 2 insertions, 4 deletions
diff --git a/tools/sploit/sploit/comm.py b/tools/sploit/sploit/comm.py
index 040ddd6..59f8498 100644
--- a/tools/sploit/sploit/comm.py
+++ b/tools/sploit/sploit/comm.py
@@ -12,10 +12,6 @@ class Comm:
def __init__(self, backend):
self.back = backend
- def __del__(self):
- for line in self.back.stdin:
- log(line)
-
def read(self, size):
data = self.back.stdin.read(size)
log(data)
diff --git a/tools/sploit/sploit/main.py b/tools/sploit/sploit/main.py
index 1ef2316..b1ddf13 100644
--- a/tools/sploit/sploit/main.py
+++ b/tools/sploit/sploit/main.py
@@ -41,4 +41,6 @@ def runscript(script,comm):
print("Running Script...")
exec(open(script).read())
print("Script Finished!")
+ for line in comm.back.stdin:
+ log(line)