diff --git a/modules/browser/hooked_domain/deface_web_page/module.rb b/modules/browser/hooked_domain/deface_web_page/module.rb index 1146bfd36..ce4d6b8c9 100644 --- a/modules/browser/hooked_domain/deface_web_page/module.rb +++ b/modules/browser/hooked_domain/deface_web_page/module.rb @@ -6,9 +6,13 @@ class Deface_web_page < BeEF::Core::Command def self.options - configuration = BeEF::Core::Configuration.instance - proto = configuration.get("beef.http.https.enable") == true ? "https" : "http" - favicon_uri = "#{proto}://#{configuration.get("beef.http.host")}:#{configuration.get("beef.http.port")}/ui/media/images/favicon.ico" + @configuration = BeEF::Core::Configuration.instance + proto = @configuration.get("beef.http.https.enable") == true ? "https" : "http" + beef_host = @configuration.get("beef.http.public") || @configuration.get("beef.http.host") + beef_port = @configuration.get("beef.http.public_port") || @configuration.get("beef.http.port") + base_host = "#{proto}://#{beef_host}:#{beef_port}" + + favicon_uri = "#{base_host}/ui/media/images/favicon.ico" return [ { 'name' => 'deface_title', 'description' => 'Page Title', 'ui_label' => 'New Title', 'value' => 'BeEF - The Browser Exploitation Framework Project', 'width'=>'200px' }, { 'name' => 'deface_favicon', 'description' => 'Shortcut Icon', 'ui_label' => 'New Favicon', 'value' => favicon_uri, 'width'=>'200px' }, diff --git a/modules/browser/hooked_domain/get_stored_credentials/module.rb b/modules/browser/hooked_domain/get_stored_credentials/module.rb index 321858761..1dfcfeac8 100644 --- a/modules/browser/hooked_domain/get_stored_credentials/module.rb +++ b/modules/browser/hooked_domain/get_stored_credentials/module.rb @@ -6,9 +6,13 @@ class Get_stored_credentials < BeEF::Core::Command def self.options - configuration = BeEF::Core::Configuration.instance - proto = configuration.get("beef.http.https.enable") == true ? "https" : "http" - uri = "#{proto}://#{configuration.get("beef.http.host")}:#{configuration.get("beef.http.port")}/demos/butcher/index.html" + @configuration = BeEF::Core::Configuration.instance + proto = @configuration.get("beef.http.https.enable") == true ? "https" : "http" + beef_host = @configuration.get("beef.http.public") || @configuration.get("beef.http.host") + beef_port = @configuration.get("beef.http.public_port") || @configuration.get("beef.http.port") + base_host = "#{proto}://#{beef_host}:#{beef_port}" + + uri = "#{base_host}/demos/butcher/index.html" return [ { 'name' => 'login_url', 'description' => 'Login URL', 'ui_label' => 'Login URL', 'value' => uri, 'width'=>'400px' } ] diff --git a/modules/browser/hooked_domain/site_redirect_iframe/module.rb b/modules/browser/hooked_domain/site_redirect_iframe/module.rb index 305ba0936..c755e8a8e 100644 --- a/modules/browser/hooked_domain/site_redirect_iframe/module.rb +++ b/modules/browser/hooked_domain/site_redirect_iframe/module.rb @@ -6,9 +6,13 @@ class Site_redirect_iframe < BeEF::Core::Command def self.options - configuration = BeEF::Core::Configuration.instance - proto = configuration.get("beef.http.https.enable") == true ? "https" : "http" - favicon_uri = "#{proto}://#{configuration.get("beef.http.host")}:#{configuration.get("beef.http.port")}/ui/media/images/favicon.ico" + @configuration = BeEF::Core::Configuration.instance + proto = @configuration.get("beef.http.https.enable") == true ? "https" : "http" + beef_host = @configuration.get("beef.http.public") || @configuration.get("beef.http.host") + beef_port = @configuration.get("beef.http.public_port") || @configuration.get("beef.http.port") + base_host = "#{proto}://#{beef_host}:#{beef_port}" + + favicon_uri = "#{base_host}/ui/media/images/favicon.ico" return [ { 'name' => 'iframe_title', 'description' => 'Title of the iFrame', 'ui_label' => 'New Title', 'value' => 'BeEF - The Browser Exploitation Framework Project', 'width'=>'200px' }, { 'name' => 'iframe_favicon', 'description' => 'Shortcut Icon', 'ui_label' => 'New Favicon', 'value' => favicon_uri, 'width'=>'200px' }, diff --git a/modules/browser/play_sound/module.rb b/modules/browser/play_sound/module.rb index 2b8220b00..7914f5e98 100644 --- a/modules/browser/play_sound/module.rb +++ b/modules/browser/play_sound/module.rb @@ -8,10 +8,13 @@ class Play_sound < BeEF::Core::Command # set and return all options for this module def self.options - configuration = BeEF::Core::Configuration.instance - proto = configuration.get("beef.http.https.enable") == true ? "https" : "http" + @configuration = BeEF::Core::Configuration.instance + proto = @configuration.get("beef.http.https.enable") == true ? "https" : "http" + beef_host = @configuration.get("beef.http.public") || @configuration.get("beef.http.host") + beef_port = @configuration.get("beef.http.public_port") || @configuration.get("beef.http.port") + base_host = "#{proto}://#{beef_host}:#{beef_port}" - sound_file_url = "#{proto}://#{configuration.get("beef.http.host")}:#{configuration.get("beef.http.port")}/demos/sound.wav" + sound_file_url = "#{base_host}/demos/sound.wav" return [{ 'name' => 'sound_file_uri', diff --git a/modules/exploits/m0n0wall/module.rb b/modules/exploits/m0n0wall/module.rb index 89a6ab813..0b4f2ed30 100644 --- a/modules/exploits/m0n0wall/module.rb +++ b/modules/exploits/m0n0wall/module.rb @@ -9,8 +9,8 @@ class Monowall_reverse_root_shell_csrf < BeEF::Core::Command end def self.options - configuration = BeEF::Core::Configuration.instance - lhost = "#{configuration.get("beef.http.host")}" + @configuration = BeEF::Core::Configuration.instance + lhost = @configuration.get("beef.http.public") || @configuration.get("beef.http.host") lhost = "" if lhost == "0.0.0.0" return [ { 'name' => 'rhost', 'ui_label' => 'Target Host', 'value' => '192.168.1.1'}, diff --git a/modules/exploits/nas/freenas_reverse_root_shell_csrf/module.rb b/modules/exploits/nas/freenas_reverse_root_shell_csrf/module.rb index b35ada963..ad2fd0804 100644 --- a/modules/exploits/nas/freenas_reverse_root_shell_csrf/module.rb +++ b/modules/exploits/nas/freenas_reverse_root_shell_csrf/module.rb @@ -9,8 +9,8 @@ class Freenas_reverse_root_shell_csrf < BeEF::Core::Command def self.options - configuration = BeEF::Core::Configuration.instance - lhost = "#{configuration.get("beef.http.host")}" + @configuration = BeEF::Core::Configuration.instance + lhost = @configuration.get("beef.http.public") || @configuration.get("beef.http.host") lhost = "" if lhost == "0.0.0.0" return [ { 'name' => 'rhost', 'ui_label' => 'Target Host', 'value' => '192.168.1.1'}, diff --git a/modules/exploits/pfsense/module.rb b/modules/exploits/pfsense/module.rb index e073d1b23..f50f1bc25 100644 --- a/modules/exploits/pfsense/module.rb +++ b/modules/exploits/pfsense/module.rb @@ -6,8 +6,8 @@ class Pfsense_reverse_root_shell_csrf < BeEF::Core::Command def self.options - configuration = BeEF::Core::Configuration.instance - lhost = "#{configuration.get("beef.http.host")}" + @configuration = BeEF::Core::Configuration.instance + lhost = @configuration.get("beef.http.public") || @configuration.get("beef.http.host") lhost = "" if lhost == "0.0.0.0" return [ { 'name' => 'rhost', 'ui_label' => 'Target Host', 'value' => '192.168.1.1'}, diff --git a/modules/exploits/wanem_command_execution/module.rb b/modules/exploits/wanem_command_execution/module.rb index aadd0aaf7..4f9e51c9b 100644 --- a/modules/exploits/wanem_command_execution/module.rb +++ b/modules/exploits/wanem_command_execution/module.rb @@ -9,8 +9,8 @@ class Wanem_command_execution < BeEF::Core::Command def self.options - configuration = BeEF::Core::Configuration.instance - lhost = "#{configuration.get("beef.http.host")}" + @configuration = BeEF::Core::Configuration.instance + lhost = @configuration.get("beef.http.public") || @configuration.get("beef.http.host") lhost = "" if lhost == "0.0.0.0" return [ { 'name' => 'rhost', 'ui_label' => 'Target Host', 'value' => '192.168.1.1'}, diff --git a/modules/exploits/zenoss_3x_command_execution/module.rb b/modules/exploits/zenoss_3x_command_execution/module.rb index 8852faf06..3d7f4a234 100644 --- a/modules/exploits/zenoss_3x_command_execution/module.rb +++ b/modules/exploits/zenoss_3x_command_execution/module.rb @@ -9,8 +9,8 @@ class Zenoss_command_execution < BeEF::Core::Command def self.options - configuration = BeEF::Core::Configuration.instance - lhost = "#{configuration.get("beef.http.host")}" + @configuration = BeEF::Core::Configuration.instance + lhost = @configuration.get("beef.http.public") || @configuration.get("beef.http.host") lhost = "" if lhost == "0.0.0.0" return [ { 'name' => 'rhost', 'ui_label' => 'Target Host', 'value' => '127.0.0.1'}, diff --git a/modules/exploits/zeroshell/zeroshell_2_0rc2_reverse_shell_csrf_sop/module.rb b/modules/exploits/zeroshell/zeroshell_2_0rc2_reverse_shell_csrf_sop/module.rb index 629fb0817..791f61aa3 100644 --- a/modules/exploits/zeroshell/zeroshell_2_0rc2_reverse_shell_csrf_sop/module.rb +++ b/modules/exploits/zeroshell/zeroshell_2_0rc2_reverse_shell_csrf_sop/module.rb @@ -5,8 +5,8 @@ # class Zeroshell_2_0rc2_reverse_shell_csrf_sop < BeEF::Core::Command def self.options - configuration = BeEF::Core::Configuration.instance - lhost = "#{configuration.get("beef.http.host")}" + @configuration = BeEF::Core::Configuration.instance + lhost = @configuration.get("beef.http.public") || @configuration.get("beef.http.host") lhost = "" if lhost == "0.0.0.0" return [ { 'name' => 'rhost', 'ui_label' => 'Target Host', 'value' => '192.168.0.1'}, diff --git a/modules/exploits/zeroshell/zeroshell_2_0rc2_reverse_shell_csrf_sop_bypass/module.rb b/modules/exploits/zeroshell/zeroshell_2_0rc2_reverse_shell_csrf_sop_bypass/module.rb index 4e969f3f3..05f0caeb5 100644 --- a/modules/exploits/zeroshell/zeroshell_2_0rc2_reverse_shell_csrf_sop_bypass/module.rb +++ b/modules/exploits/zeroshell/zeroshell_2_0rc2_reverse_shell_csrf_sop_bypass/module.rb @@ -9,8 +9,8 @@ class Zeroshell_2_0rc2_reverse_shell_csrf_sop_bypass < BeEF::Core::Command end def self.options - configuration = BeEF::Core::Configuration.instance - lhost = "#{configuration.get("beef.http.host")}" + @configuration = BeEF::Core::Configuration.instance + lhost = @configuration.get("beef.http.public") || @configuration.get("beef.http.host") lhost = "" if lhost == "0.0.0.0" return [ { 'name' => 'rhost', 'ui_label' => 'Target Host', 'value' => '192.168.0.1'}, diff --git a/modules/social_engineering/clickjacking/module.rb b/modules/social_engineering/clickjacking/module.rb index ec316f682..89c5077a9 100644 --- a/modules/social_engineering/clickjacking/module.rb +++ b/modules/social_engineering/clickjacking/module.rb @@ -7,10 +7,13 @@ class Clickjacking < BeEF::Core::Command def self.options + @configuration = BeEF::Core::Configuration.instance + proto = @configuration.get("beef.http.https.enable") == true ? "https" : "http" + beef_host = @configuration.get("beef.http.public") || @configuration.get("beef.http.host") + beef_port = @configuration.get("beef.http.public_port") || @configuration.get("beef.http.port") + base_host = "#{proto}://#{beef_host}:#{beef_port}" - configuration = BeEF::Core::Configuration.instance - proto = configuration.get("beef.http.https.enable") == true ? "https" : "http" - uri = "#{proto}://#{configuration.get("beef.http.host")}:#{configuration.get("beef.http.port")}/demos/clickjacking/clickjack_victim.html" + uri = "#{base_host}/demos/clickjacking/clickjack_victim.html" return [ {'name' => 'iFrameSrc', 'ui_label'=>'iFrame Src', 'type' => 'textarea', 'value' => uri, 'width' => '400px', 'height' => '50px'}, diff --git a/modules/social_engineering/fake_flash_update/module.rb b/modules/social_engineering/fake_flash_update/module.rb index e192997c1..006083e80 100755 --- a/modules/social_engineering/fake_flash_update/module.rb +++ b/modules/social_engineering/fake_flash_update/module.rb @@ -12,12 +12,13 @@ class Fake_flash_update < BeEF::Core::Command end def self.options + @configuration = BeEF::Core::Configuration.instance + proto = @configuration.get("beef.http.https.enable") == true ? "https" : "http" + beef_host = @configuration.get("beef.http.public") || @configuration.get("beef.http.host") + beef_port = @configuration.get("beef.http.public_port") || @configuration.get("beef.http.port") + base_host = "#{proto}://#{beef_host}:#{beef_port}" - configuration = BeEF::Core::Configuration.instance - - proto = configuration.get("beef.http.https.enable") == true ? "https" : "http" - - image = "#{proto}://#{configuration.get("beef.http.host")}:#{configuration.get("beef.http.port")}/adobe/flash_update.png" + image = "#{base_host}/adobe/flash_update.png" return [ {'name' =>'image', 'description' =>'Location of image for the update prompt', 'ui_label'=>'Image', 'value' => image}, diff --git a/modules/social_engineering/gmail_phishing/module.rb b/modules/social_engineering/gmail_phishing/module.rb index 2e8330f9e..5370234b9 100644 --- a/modules/social_engineering/gmail_phishing/module.rb +++ b/modules/social_engineering/gmail_phishing/module.rb @@ -6,9 +6,13 @@ class Gmail_phishing < BeEF::Core::Command def self.options - configuration = BeEF::Core::Configuration.instance - proto = configuration.get("beef.http.https.enable") == true ? "https" : "http" - xss_hook_url = "#{proto}://#{configuration.get("beef.http.host")}:#{configuration.get("beef.http.port")}/demos/basic.html" + @configuration = BeEF::Core::Configuration.instance + proto = @configuration.get("beef.http.https.enable") == true ? "https" : "http" + beef_host = @configuration.get("beef.http.public") || @configuration.get("beef.http.host") + beef_port = @configuration.get("beef.http.public_port") || @configuration.get("beef.http.port") + base_host = "#{proto}://#{beef_host}:#{beef_port}" + + xss_hook_url = "#{base_host}/demos/basic.html" logout_gmail_interval = 10000 wait_seconds_before_redirect = 1000 return [ diff --git a/modules/social_engineering/pretty_theft/module.rb b/modules/social_engineering/pretty_theft/module.rb index 0b64ab611..c67496392 100644 --- a/modules/social_engineering/pretty_theft/module.rb +++ b/modules/social_engineering/pretty_theft/module.rb @@ -6,9 +6,12 @@ class Pretty_theft < BeEF::Core::Command def self.options - configuration = BeEF::Core::Configuration.instance - proto = configuration.get("beef.http.https.enable") == true ? "https" : "http" - logo_uri = "#{proto}://#{configuration.get("beef.http.host")}:#{configuration.get("beef.http.port")}/ui/media/images/beef.png" + @configuration = BeEF::Core::Configuration.instance + proto = @configuration.get("beef.http.https.enable") == true ? "https" : "http" + beef_host = @configuration.get("beef.http.public") || @configuration.get("beef.http.host") + beef_port = @configuration.get("beef.http.public_port") || @configuration.get("beef.http.port") + base_host = "#{proto}://#{beef_host}:#{beef_port}" + logo_uri = "#{base_host}/ui/media/images/beef.png" return [ {'name' => 'choice', 'type' => 'combobox', 'ui_label' => 'Dialog Type', 'store_type' => 'arraystore', 'store_fields' => ['choice'], 'store_data' => [['Facebook'],['LinkedIn'],['Windows'],['YouTube'],['Yammer'],['IOS'],['Generic']], 'valueField' => 'choice', 'value' => 'Facebook', editable: false, 'displayField' => 'choice', 'mode' => 'local', 'autoWidth' => true },