summaryrefslogtreecommitdiffstats
path: root/tools/sploit
diff options
context:
space:
mode:
Diffstat (limited to 'tools/sploit')
-rw-r--r--tools/sploit/sploit/comm.py20
-rw-r--r--tools/sploit/sploit/main.py12
2 files changed, 16 insertions, 16 deletions
diff --git a/tools/sploit/sploit/comm.py b/tools/sploit/sploit/comm.py
index 59f8498..1f55fb6 100644
--- a/tools/sploit/sploit/comm.py
+++ b/tools/sploit/sploit/comm.py
@@ -22,14 +22,14 @@ class Comm:
log(data)
return data
- def readuntil(self,pred):
+ def readuntil(self, pred):
data = b''
while(not pred(data)):
data += self.back.stdin.read(1)
log(data)
return data
- def readlineuntil(self,pred):
+ def readlineuntil(self, pred):
data = b''
while(not pred(data)):
data = self.back.stdin.readline()
@@ -63,11 +63,11 @@ class Comm:
readall()
else:
syncstop.set()
- os.set_blocking(self.back.stdin.fileno(),False)
- readthread = threading.Thread(target=readloop,daemon=True)
+ os.set_blocking(self.back.stdin.fileno(), False)
+ readthread = threading.Thread(target=readloop, daemon=True)
readthread.start()
stdin = sys.stdin.buffer
- signal.signal(signal.SIGALRM,lambda: 0)
+ signal.signal(signal.SIGALRM, lambda: 0)
while not syncstop.isSet():
try:
signal.alarm(1)
@@ -83,7 +83,7 @@ class Comm:
signal.alarm(0)
syncstop.set()
readthread.join()
- os.set_blocking(self.back.stdin.fileno(),True)
+ os.set_blocking(self.back.stdin.fileno(), True)
print("<--Interact Mode Done-->")
class Process:
@@ -109,7 +109,7 @@ class Process:
self.proc.kill()
class Pipes:
- def __init__(self,tmp=None):
+ def __init__(self, tmp=None):
if(tmp == None):
self.dir = tempfile.TemporaryDirectory()
dirname = self.dir.name
@@ -117,13 +117,13 @@ class Pipes:
if(not os.path.exists(tmp)):
os.mkdir(tmp)
dirname = tmp
- self.pathin = os.path.join(dirname,"in")
- self.pathout = os.path.join(dirname,"out")
+ self.pathin = os.path.join(dirname, "in")
+ self.pathout = os.path.join(dirname, "out")
os.mkfifo(self.pathin)
os.mkfifo(self.pathout)
print("Waiting on Target to Connect...")
print("<"+self.pathin+" >"+self.pathout)
- self.stdout = open(self.pathin,"wb")
+ self.stdout = open(self.pathin, "wb")
self.stdin = open(self.pathout, "rb")
print("Connected!")
diff --git a/tools/sploit/sploit/main.py b/tools/sploit/sploit/main.py
index bd01993..ee0495f 100644
--- a/tools/sploit/sploit/main.py
+++ b/tools/sploit/sploit/main.py
@@ -18,7 +18,7 @@ def main():
if(len(args.target)>0):
if(args.daemon):
print("Target Given. Ignoring Daemon Flag...")
- target(args.script,args.target)
+ target(args.script, args.target)
else:
if(args.daemon):
daemon(args.script)
@@ -36,7 +36,7 @@ def daemon(script):
except KeyboardInterrupt:
break
try:
- runscript(script,Comm(p));
+ runscript(script, Comm(p));
except KeyboardInterrupt:
pass
except:
@@ -45,13 +45,13 @@ def daemon(script):
def pipe(script):
print("Running in Pipe Mode...");
- runscript(script,Comm(Pipes()));
+ runscript(script, Comm(Pipes()));
-def target(script,target):
+def target(script, target):
print("Running in Target Mode...")
- runscript(script,Comm(Process(target)));
+ runscript(script, Comm(Process(target)));
-def runscript(script,comm):
+def runscript(script, comm):
print("Running Script...")
exec(open(script).read())
print("Script Finished!")