Added WebSocket config options for enable, secure and port
This commit is contained in:
4
beef
4
beef
@@ -113,7 +113,9 @@ BeEF::Core::Console::Banners.print_network_interfaces_routes
|
||||
print_info "RESTful API key: #{BeEF::Core::Crypto::api_token}"
|
||||
|
||||
#@note Starts the WebSocket server
|
||||
BeEF::Core::Websocket::Websocket.new
|
||||
if config.get("beef.http.websocket.enable")
|
||||
BeEF::Core::Websocket::Websocket.new
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -37,6 +37,10 @@ beef:
|
||||
hook_file: "/hook.js"
|
||||
hook_session_name: "BEEFHOOK"
|
||||
session_cookie_name: "BEEFSESSION"
|
||||
websocket:
|
||||
enable: true
|
||||
secure: false # use WebSocketSecure
|
||||
port: 6666
|
||||
|
||||
database:
|
||||
# For information on using other databases please read the
|
||||
|
||||
@@ -21,10 +21,12 @@ module BeEF
|
||||
|
||||
def initialize
|
||||
print_info("Starting WebSockets")
|
||||
config = BeEF::Core::Configuration.instance
|
||||
|
||||
#todo antisnatchor: add config file options for IP/port/enable websocket
|
||||
#todo antisnatchor: start websocket secure if beef.http.websocket.secure == true
|
||||
server = WebSocketServer.new :accepted_domains => "0.0.0.0",
|
||||
:port => config.get("beef.http.websocket.port")
|
||||
|
||||
server = WebSocketServer.new(:accepted_domains => "0.0.0.0",:port => 6666) #we get host and port
|
||||
server.run() do |ws|
|
||||
#@TODO debug print the path and who request for hooked browser mapping
|
||||
print_info("Path requested #{ws.path} Origins #{ws.origin}")
|
||||
|
||||
Reference in New Issue
Block a user