mirror of
https://github.com/paradoxxxzero/butterfly.git
synced 2026-05-26 07:08:08 +00:00
Merge remote-tracking branch 'creckx/master'
Conflicts: butterfly/routes.py
This commit is contained in:
@@ -37,6 +37,8 @@ tornado.options.define("port", default=57575, type=int, help="Server port")
|
||||
tornado.options.define("shell", help="Shell to execute at login")
|
||||
tornado.options.define("unsecure", default=False,
|
||||
help="Don't use ssl not recommended")
|
||||
tornado.options.define("login", default=True,
|
||||
help="Use login screen at start")
|
||||
|
||||
tornado.options.define("generate_certs", default=False,
|
||||
help="Generate butterfly certificates")
|
||||
|
||||
@@ -128,12 +128,19 @@ class TermWebSocket(Route, tornado.websocket.WebSocketHandler):
|
||||
self.communicate()
|
||||
|
||||
def shell(self):
|
||||
if self.callee is None and tornado.options.options.unsecure:
|
||||
if self.callee is None and (
|
||||
tornado.options.options.unsecure and
|
||||
tornado.options.options.login):
|
||||
# If callee is now known and we have unsecure connection
|
||||
user = input('login: ')
|
||||
try:
|
||||
self.callee = utils.User(name=user)
|
||||
except:
|
||||
self.callee = utils.User(name='nobody')
|
||||
else:
|
||||
# if login is not required, we will use the same user as
|
||||
# butterfly is executed
|
||||
self.callee = utils.User()
|
||||
|
||||
assert self.callee is not None
|
||||
|
||||
@@ -160,8 +167,10 @@ class TermWebSocket(Route, tornado.websocket.WebSocketHandler):
|
||||
if not tornado.options.options.unsecure or (
|
||||
self.socket.local and
|
||||
self.caller == self.callee and
|
||||
server == self.callee):
|
||||
server == self.callee
|
||||
) or not tornado.options.options.login:
|
||||
# User has been auth with ssl or is the same user as server
|
||||
# or login is explicitly turned off
|
||||
if not tornado.options.options.unsecure:
|
||||
# User is authed by ssl, setting groups
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user