diff options
author | dusoleil <howcansocksbereal@gmail.com> | 2021-08-30 05:00:00 -0400 |
---|---|---|
committer | dusoleil <howcansocksbereal@gmail.com> | 2021-08-30 05:00:00 -0400 |
commit | e342ae082960cad4d05d719914801f907cd9d61d (patch) | |
tree | bd37ce9a0a237b9efcf2025cea996c0d49b197da /sploitrunner.py | |
parent | b33db8c57b0875904610ae5dec64a653332ac835 (diff) | |
download | sploit-e342ae082960cad4d05d719914801f907cd9d61d.tar.gz sploit-e342ae082960cad4d05d719914801f907cd9d61d.zip |
Sploit Rework MVP Structure, Packaging, and Comms
First part of the MVP for the larger Sploit rework effort.
Add project structure, python packaging, basic comms, and "log" hook.
From in or out of the sploit directory, you can run the "sploit.py"
script, run python -m sploit, or import the sploit modules from the
python3 shell.
You can also pip install Sploit and from anywhere you can run the sploit
command, run python -m sploit, or import the sploit modules from the
python3 shell.
Running as a standalone application, Sploit can run in a "target" mode,
a "pipe" mode, and a "pipe daemon" mode. In "target" mode, Sploit will
launch a target program as a subprocess and run an exploit script
against its I/O. In "pipe" mode, Sploit will create named fifos and
wait for a program to connect to them to run an exploit script against
them. In "pipe daemon" mode, Sploit will run similar to the "pipe" mode,
but automatically recreate the fifos with the same name after each
execution.
Basic comm operations of read, readline, write, and writeline are
available to the exploit script.
A "log" hook is executed whenever data is read in from the target
program. This will just print the data out, but it can be configured to
decode it with a specific encoding or you could replace the function for
different behavior.
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
Diffstat (limited to '')
-rwxr-xr-x | sploitrunner.py | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/sploitrunner.py b/sploitrunner.py deleted file mode 100755 index f0e5ac6..0000000 --- a/sploitrunner.py +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env python3 - -import os -import sys -import subprocess -import time - -import sploitconfig as config -import sploitutil as util - -#infrastructure to run sploit -#if sploit is called with command line arguments, -#it will use them to call the target program with popen -#otherwise, sploit will use stdin/stdout -#you can use sploitpipe to run sploit with pipes spltin/spltout -#which can be used with the target program -#<spltin ./target &>spltout -#or from within gdb -#r <spltin &>spltout -def runsploit(sploit): - if config.use_popen: - print(sys.argv[1:]) - p = subprocess.Popen(sys.argv[1:],stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=subprocess.STDOUT) - - stdin = p.stdout if config.use_popen else os.fdopen(0,"rb") - stdout = p.stdin if config.use_popen else os.fdopen(1,"wb") - - if config.wait_for_gdb > 0: - time.sleep(config.wait_for_gdb) - - #exec custom sploit - sploit(stdin,stdout) - - #read anything else out and wait for termination - for line in stdin: - util.log(line) - if config.use_popen: - p.wait() |