diff --git a/core/main/client/beef.js b/core/main/client/beef.js index 7c5ad15b0..b580c936c 100644 --- a/core/main/client/beef.js +++ b/core/main/client/beef.js @@ -49,10 +49,8 @@ if(typeof beef === 'undefined' && typeof window.beef === 'undefined') { */ execute: function(fn) { if ( typeof beef.websocket == "undefined"){ - console.log("--- NO WEBSOCKETS ---"); - this.commands.push(fn); + this.commands.push(fn); }else{ - console.log("--- WEBSOCKETS ENABLED ---"); fn(); } }, diff --git a/core/main/client/net.js b/core/main/client/net.js index d72f3f8d8..03d2bace3 100644 --- a/core/main/client/net.js +++ b/core/main/client/net.js @@ -87,13 +87,9 @@ beef.net = { //Queues the current command and flushes the queue straight away send: function(handler, cid, results, callback) { - // if ( typeof beef.websocket == "undefined"){ this.queue(handler, cid, results, callback); this.flush(); - //} - // else - // beef.websocket.send(results); - }, + }, //Flush all currently queued commands to the framework flush: function() { diff --git a/core/main/client/websocket.js b/core/main/client/websocket.js index 8b3858c63..7c8039d70 100644 --- a/core/main/client/websocket.js +++ b/core/main/client/websocket.js @@ -24,8 +24,8 @@ beef.websocket = { init:function () { var webSocketServer = beef.net.host; var webSocketPort = 11989; - //@todo ceck if we have to use wss or ws we need a globalvalue - if (beef.browser.isFF() && ! beef.browser.isFF11) { + + if (beef.browser.isFF() && !!window.MozWebSocket) { beef.websocket.socket = new MozWebSocket("ws://" + webSocketServer + ":" + webSocketPort + "/"); } else{ @@ -48,8 +48,6 @@ beef.websocket = { this.socket.onmessage = function (message){ console.log("Received message via WS."); eval(message.data); - - /*END POC*/ } }, diff --git a/core/main/network_stack/websocket/websocket.rb b/core/main/network_stack/websocket/websocket.rb index b52b48be7..60eeb67f8 100644 --- a/core/main/network_stack/websocket/websocket.rb +++ b/core/main/network_stack/websocket/websocket.rb @@ -25,7 +25,6 @@ module BeEF include Singleton @@activeSocket= Hash.new #empty at begin - def initialize config = BeEF::Core::Configuration.instance port = config.get("beef.http.websocket.port") @@ -37,8 +36,7 @@ module BeEF 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}") + print_debug("Path requested #{ws.path} Origins #{ws.origin}") if ws.path == "/" ws.handshake() #accept and connect