mirror of
https://github.com/paradoxxxzero/butterfly.git
synced 2026-05-26 15:13:36 +00:00
Ability to run any command instead of shell using --cmd command line parameter
This commit is contained in:
@@ -36,6 +36,7 @@ tornado.options.define("more", default=False,
|
||||
tornado.options.define("host", default='localhost', help="Server host")
|
||||
tornado.options.define("port", default=57575, type=int, help="Server port")
|
||||
tornado.options.define("shell", help="Shell to execute at login")
|
||||
tornado.options.define("cmd", help="Command to run instead of shell")
|
||||
tornado.options.define("unsecure", default=False,
|
||||
help="Don't use ssl not recommended")
|
||||
tornado.options.define("login", default=True,
|
||||
|
||||
@@ -191,8 +191,12 @@ class TermWebSocket(Route, tornado.websocket.WebSocketHandler):
|
||||
'if you want to log as different user\n')
|
||||
sys.exit(1)
|
||||
|
||||
args = [tornado.options.options.shell or self.callee.shell]
|
||||
args.append('-i')
|
||||
args = [
|
||||
tornado.options.options.cmd
|
||||
or tornado.options.options.shell or self.callee.shell
|
||||
]
|
||||
if not tornado.options.options.cmd:
|
||||
args.append('-i')
|
||||
os.execvpe(args[0], args, env)
|
||||
# This process has been replaced
|
||||
|
||||
|
||||
Reference in New Issue
Block a user