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 | 72cf7bc384249a4140dbcfc3898589c1d83b6e25 (patch) | |
tree | 36d153449bd53bb5c19c3719a3607115a08bc647 /tools/sploit/sploitutil.py | |
parent | ad0ff4ede0e35d7c70fa0469f94f526196fa8ad4 (diff) | |
download | lib-des-gnux-72cf7bc384249a4140dbcfc3898589c1d83b6e25.tar.gz lib-des-gnux-72cf7bc384249a4140dbcfc3898589c1d83b6e25.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 'tools/sploit/sploitutil.py')
-rwxr-xr-x | tools/sploit/sploitutil.py | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/tools/sploit/sploitutil.py b/tools/sploit/sploitutil.py deleted file mode 100755 index 00d2151..0000000 --- a/tools/sploit/sploitutil.py +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env python3 - -import sploitconfig as config -from sploitlog import sploitlog - -def btoi(b): - return int.from_bytes(b,'little') - -def itob(i): - return i.to_bytes(8,'little',signed=True) - -class Libc: - def __init__(self,libc_addr,libc_offset): - self.libc_base = btoi(libc_addr)-btoi(libc_offset) - def base(self): - return itob(self.libc_base) - def addr(self,offset): - return itob(self.libc_base + btoi(offset)) - -def log(s): - if config.use_popen: - sploitlog(s) - -class Communication: - def __init__(self,stdin,stdout): - self.stdin = stdin - self.stdout = stdout - def send(self,s): - self.stdout.write(s) - self.stdout.flush() - def recv(self): - out = self.stdin.readline() - log(out) - return out |