summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sploit/__main__.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/sploit/__main__.py b/sploit/__main__.py
index 5b694a2..5d53ca6 100644
--- a/sploit/__main__.py
+++ b/sploit/__main__.py
@@ -46,11 +46,19 @@ def target(script, target):
print_banner(STATUS, line3='Subprocess Mode')
runscript(script, Comm(Process(target)))
+def user_scope(comm):
+ import sploit as lib
+ scope = { name: getattr(lib, name) for name in dir(lib) }
+ scope['__version__'] = __version__
+ scope['print'] = elog
+ scope['io'] = comm
+ return scope
+
def runscript(script, comm):
try:
ilog("Running Script...")
code = compile(open(script).read(), script, 'exec')
- exec(code, {'io': comm, 'print': elog})
+ exec(code, user_scope(comm))
ilog("Script Finished!")
return
except KeyboardInterrupt: