Added WebSocket config options for enable, secure and port

This commit is contained in:
antisnatchor
2012-04-07 12:46:57 +01:00
parent 236c8a81b6
commit 64cee24c65
3 changed files with 11 additions and 3 deletions

4
beef
View File

@@ -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

View File

@@ -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

View File

@@ -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}")