diff options
author | dusoleil <howcansocksbereal@gmail.com> | 2021-09-01 00:10:11 -0400 |
---|---|---|
committer | dusoleil <howcansocksbereal@gmail.com> | 2021-09-01 00:10:11 -0400 |
commit | b4216a6525f1a71b785707c7c018cf55c05a159f (patch) | |
tree | 211305b728a72242ec12fdbee772fcc801eafca8 | |
parent | 8f8eefefbc2c06d10ad29a83d79fcd6c425b54c6 (diff) | |
download | sploit-b4216a6525f1a71b785707c7c018cf55c05a159f.tar.gz sploit-b4216a6525f1a71b785707c7c018cf55c05a159f.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>
-rw-r--r-- | sploit/comm.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sploit/comm.py b/sploit/comm.py index f9c3a38..d3b1395 100644 --- a/sploit/comm.py +++ b/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): |