summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordusoleil <howcansocksbereal@gmail.com>2021-09-01 00:10:11 -0400
committerdusoleil <howcansocksbereal@gmail.com>2021-09-01 00:10:11 -0400
commitffad0c5afbdc7968bb8d9de7d5ec017284dee45f (patch)
treea353ed27a2d36a93ba6ceddbc7c8439858aeae97
parent7febf6dc60205369e813bfe1f3a59922081f44b6 (diff)
downloadlib-des-gnux-ffad0c5afbdc7968bb8d9de7d5ec017284dee45f.tar.gz
lib-des-gnux-ffad0c5afbdc7968bb8d9de7d5ec017284dee45f.zip
Better Shutdown Process for Target Program
If we need to wait on the target program to die, we don't want to just wait forever with no indication to the user. Instead, only call wait if the program is still alive, inform the user that we are doing this, and give them the ability to forcefully kill the target program with Ctrl+C. Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
Diffstat (limited to '')
-rw-r--r--tools/sploit/sploit/comm.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/sploit/sploit/comm.py b/tools/sploit/sploit/comm.py
index f9c3a38..d3b1395 100644
--- a/tools/sploit/sploit/comm.py
+++ b/tools/sploit/sploit/comm.py
@@ -103,7 +103,14 @@ class Process:
self.stdout = self.proc.stdin
def __del__(self):
- self.proc.wait()
+ if(self.proc.poll() != None):
+ return
+ try:
+ print("Waiting on Target Program to End...")
+ print("Press Ctrl+C to Forcefully Kill It...")
+ self.proc.wait()
+ except KeyboardInterrupt:
+ self.proc.kill()
class Pipes:
def __init__(self,tmp=None):