diff options
author | dusoleil <howcansocksbereal@gmail.com> | 2021-08-02 00:36:28 -0400 |
---|---|---|
committer | dusoleil <howcansocksbereal@gmail.com> | 2021-08-03 19:45:57 -0400 |
commit | b33db8c57b0875904610ae5dec64a653332ac835 (patch) | |
tree | 433206bcd4d10173110a04641c08576380c2a12f /sploitutil.py | |
download | sploit-b33db8c57b0875904610ae5dec64a653332ac835.tar.gz sploit-b33db8c57b0875904610ae5dec64a653332ac835.zip |
Adding Initial Commit of the Sploit Tool
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
Diffstat (limited to 'sploitutil.py')
-rwxr-xr-x | sploitutil.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/sploitutil.py b/sploitutil.py new file mode 100755 index 0000000..00d2151 --- /dev/null +++ b/sploitutil.py @@ -0,0 +1,34 @@ +#!/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 |