diff --git a/core/main/client/websocket.js b/core/main/client/websocket.js index 8114364f2..d79648526 100644 --- a/core/main/client/websocket.js +++ b/core/main/client/websocket.js @@ -22,8 +22,10 @@ beef.websocket = { /*websocket send Helo to beef server and start async communication*/ start:function(){ console.log("started ws \n") + /*server is always on ws.beefServer:6666*/ var webSocketServer=beef.net.host; /*beefHost*/ + console.log(webSocketServer); var webSocketPort=6666; if(beef.browser.getBrowserName=="FF") this.socket = new MozWebSocket("ws://"+webSocketServer+":"+webSocketPort+"/"); diff --git a/core/main/handlers/modules/beefjs.rb b/core/main/handlers/modules/beefjs.rb index a43fc5674..ea8c8ac0a 100644 --- a/core/main/handlers/modules/beefjs.rb +++ b/core/main/handlers/modules/beefjs.rb @@ -29,7 +29,8 @@ module Modules beefjs = '' # @note location of sub files beefjs_path = "#{$root_dir}/core/main/client/" - js_sub_files = %w(lib/jquery-1.5.2.min.js lib/evercookie.js lib/json2.js beef.js browser.js browser/cookie.js browser/popup.js session.js os.js dom.js logger.js net.js updater.js encode/base64.js encode/json.js net/local.js init.js mitb.js net/dns.js) + #@todo radoen insert ceck for websocket require in config.yalm + js_sub_files = %w(lib/jquery-1.5.2.min.js lib/evercookie.js lib/json2.js beef.js browser.js browser/cookie.js browser/popup.js session.js os.js dom.js logger.js net.js updater.js encode/base64.js encode/json.js net/local.js init.js mitb.js net/dns.js websocket.js) # @note construct the beefjs string from file(s) js_sub_files.each {|js_sub_file_name| diff --git a/core/main/network_stack/websocket/websocket.rb b/core/main/network_stack/websocket/websocket.rb index a57c22780..4d74f5ad3 100644 --- a/core/main/network_stack/websocket/websocket.rb +++ b/core/main/network_stack/websocket/websocket.rb @@ -26,29 +26,29 @@ module BeEF #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") - websThread = Thread.new { - 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}") - if ws.path == "/" - ws.handshake() #accept and connect + websThread = Thread.new { + 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}") + if ws.path == "/" + ws.handshake() #accept and connect - while true - #command interpretation - message=ws.receve() + while true + #command interpretation + message=ws.receve() + + if (message!="helo") + #module return value case + else + print_info("Browser #{ws.origin} says helo! ws is running") + end - if (message!="helo") - #module return value case - else - print_info("Browser #{ws.origin} says helo! ws is running") end - end end - end - } + } + end end end end - end - end +end