mirror of https://github.com/n1nj4sec/pupy.git
Fix non-interactive memexec launch for linux
This commit is contained in:
parent
4940035bd2
commit
1b6ffdf7b4
|
@ -13,6 +13,7 @@ def mexec(module, path, argv, argv0=None, interactive=False, raw=False, codepage
|
|||
data, argv0, args = argv,
|
||||
no_stdin = not interactive,
|
||||
no_stdor = not interactive,
|
||||
redirect_stdio = interactive,
|
||||
compressed = True,
|
||||
terminate = interactive
|
||||
)
|
||||
|
@ -44,3 +45,9 @@ def mexec(module, path, argv, argv0=None, interactive=False, raw=False, codepage
|
|||
else:
|
||||
complete.set()
|
||||
module.error('Launch failed. Press ENTER')
|
||||
|
||||
else:
|
||||
if module.mp.run():
|
||||
module.success('Process started: {}'.format(module.mp.pid))
|
||||
else:
|
||||
module.error('Launch failed')
|
||||
|
|
|
@ -194,6 +194,9 @@ class MExec(object):
|
|||
self.pid = pid
|
||||
self.stdin, self.stdout, self.stderr = stdior
|
||||
|
||||
if not self.redirect_stdio:
|
||||
return True
|
||||
|
||||
if self.no_stdin:
|
||||
self.stdin.close()
|
||||
self.stdin = None
|
||||
|
|
Loading…
Reference in New Issue