diff options
author | Malfurious <m@lfurio.us> | 2021-12-12 02:51:50 -0500 |
---|---|---|
committer | Malfurious <m@lfurio.us> | 2021-12-17 22:19:20 -0500 |
commit | eb3933d26ec97d88472f7ff1eefde06b3c9c3e8a (patch) | |
tree | 22579601014d2718c5f2103a094d4d137c78a8a8 | |
parent | 2d871847bca0fe530b286246b9c041162c175781 (diff) | |
download | lib-des-gnux-eb3933d26ec97d88472f7ff1eefde06b3c9c3e8a.tar.gz lib-des-gnux-eb3933d26ec97d88472f7ff1eefde06b3c9c3e8a.zip |
sploit: Remove -d/--daemon option
A couple of facts have influenced the decision to remove this option:
- If a sploit script uses a shebang to launch sploit, it is
tricky to specify this option. Specifically, one must add it
to their shebang line, which couples more information to the
script than was originally intended.
- Single-pass pipe mode wasn't all that useful. One can
accomplish the same thing by running pipe-daemon, and it is
easy to exit after one iteration. Electing to run normal pipe
mode requires you to know you only want to run once, which is
much more common when running via direct subprocess.
As a result of this change, running in pipe mode will now be equivalent to
the previous pipe-daemon mode, and subprocess target mode remains single
pass.
Signed-off-by: Malfurious <m@lfurio.us>
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
-rw-r--r-- | tools/sploit/sploit/main.py | 33 |
1 files changed, 10 insertions, 23 deletions
diff --git a/tools/sploit/sploit/main.py b/tools/sploit/sploit/main.py index 77ef49e..8456029 100644 --- a/tools/sploit/sploit/main.py +++ b/tools/sploit/sploit/main.py @@ -1,48 +1,35 @@ -import argparse +from argparse import ArgumentParser, REMAINDER +import gc import tempfile import traceback -import gc from sploit.comm import * def main(): - parser = argparse.ArgumentParser(description='Execute Sploit Script Against Target') - parser.add_argument('-d', '--daemon', action='store_true', - help='run in "daemon" mode with pipes instead of a designated target') - parser.add_argument('script', - help='exploit script to run') - parser.add_argument('target', nargs=argparse.REMAINDER, - help='target program to exploit') + parser = ArgumentParser(description='Execute Sploit script against target') + parser.add_argument('script', help='Exploit script to run') + parser.add_argument('target', nargs=REMAINDER, help='Target program to exploit') args = parser.parse_args() if(len(args.target)>0): - if(args.daemon): - print("Target Given. Ignoring Daemon Flag...") target(args.script, args.target) else: - if(args.daemon): - daemon(args.script) - else: - pipe(args.script) + pipe(args.script) -def daemon(script): - print("Running in Pipe Daemon Mode...") +def pipe(script): + print("Running in Pipe Mode...") with tempfile.TemporaryDirectory() as tmpdir: while(True): try: p = Pipes(tmpdir) except KeyboardInterrupt: break - runscript(script, Comm(p)); + runscript(script, Comm(p)) del p -def pipe(script): - print("Running in Pipe Mode..."); - runscript(script, Comm(Pipes())); - def target(script, target): print("Running in Target Mode...") - runscript(script, Comm(Process(target))); + runscript(script, Comm(Process(target))) def runscript(script, comm): try: |