Skip to content

Commit

Permalink
StagerProxy -> PayloadProxy
Browse files Browse the repository at this point in the history
  • Loading branch information
HD Moore committed Mar 16, 2015
1 parent f361e4e commit 69a808b
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 27 deletions.
14 changes: 7 additions & 7 deletions lib/msf/core/handler/reverse_http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ def on_request(cli, req, obj)
blob.sub!('HTTP_COMMUNICATION_TIMEOUT = 300', "HTTP_COMMUNICATION_TIMEOUT = #{datastore['SessionCommunicationTimeout']}")
blob.sub!('HTTP_USER_AGENT = None', "HTTP_USER_AGENT = '#{var_escape.call(datastore['MeterpreterUserAgent'])}'")

unless datastore['PROXYHOST'].blank? && datastore['StagerProxyHost'].blank?
proxy_url = "http://#{datastore['StagerProxyHost']||datastore['PROXYHOST']}:#{datastore['StagerProxyPort']||datastore['PROXYPORT']}"
unless datastore['PROXYHOST'].blank? && datastore['PayloadProxyHost'].blank?
proxy_url = "http://#{datastore['PayloadProxyHost']||datastore['PROXYHOST']}:#{datastore['PayloadProxyPort']||datastore['PROXYPORT']}"
blob.sub!('HTTP_PROXY = None', "HTTP_PROXY = '#{var_escape.call(proxy_url)}'")
end

Expand Down Expand Up @@ -268,11 +268,11 @@ def on_request(cli, req, obj)
:expiration => datastore['SessionExpirationTimeout'],
:comm_timeout => datastore['SessionCommunicationTimeout'],
:ua => datastore['MeterpreterUserAgent'],
:proxyhost => datastore['StagerProxyHost'] || datastore['PROXYHOST'],
:proxyport => datastore['StagerProxyPort'] || datastore['PROXYPORT'],
:proxy_type => datastore['StagerProxyType'] || datastore['PROXY_TYPE'],
:proxy_username => datastore['StagerProxyUser'] || datastore['PROXY_USERNAME'],
:proxy_password => datastore['StagerProxyPass'] || datastore['PROXY_PASSWORD']
:proxyhost => datastore['PayloadProxyHost'] || datastore['PROXYHOST'],
:proxyport => datastore['PayloadProxyPort'] || datastore['PROXYPORT'],
:proxy_type => datastore['PayloadProxyType'] || datastore['PROXY_TYPE'],
:proxy_username => datastore['PayloadProxyUser'] || datastore['PROXY_USERNAME'],
:proxy_password => datastore['PayloadProxyPass'] || datastore['PROXY_PASSWORD']

resp.body = encode_stage(blob)

Expand Down
20 changes: 10 additions & 10 deletions lib/msf/core/payload/windows/reverse_http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ def initialize(*args)
register_advanced_options(
[
OptInt.new('StagerURILength', [false, 'The URI length for the stager (at least 5 bytes)']),
OptString.new('StagerProxyHost', [false, 'An optional proxy server IP address or hostname']),
OptPort.new('StagerProxyPort', [false, 'An optional proxy server port']),
OptString.new('StagerProxyUser', [false, 'An optional proxy server username']),
OptString.new('StagerProxyPass', [false, 'An optional proxy server password']),
OptEnum.new('StagerProxyType', [false, 'The type of HTTP proxy (HTTP or SOCKS)', 'HTTP', ['HTTP', 'SOCKS']]),
OptString.new('PayloadProxyHost', [false, 'An optional proxy server IP address or hostname']),
OptPort.new('PayloadProxyPort', [false, 'An optional proxy server port']),
OptString.new('PayloadProxyUser', [false, 'An optional proxy server username']),
OptString.new('PayloadProxyPass', [false, 'An optional proxy server password']),
OptEnum.new('PayloadProxyType', [false, 'The type of HTTP proxy (HTTP or SOCKS)', 'HTTP', ['HTTP', 'SOCKS']]),
], self.class)
end

Expand All @@ -55,11 +55,11 @@ def generate
port: datastore['LPORT'],
url: generate_uri,
exitfunk: datastore['EXITFUNC'],
proxy_host: datastore['StagerProxyHost'],
proxy_port: datastore['StagerProxyPort'],
proxy_user: datastore['StagerProxyUser'],
proxy_pass: datastore['StagerProxyPass'],
proxy_type: datastore['StagerProxyType']
proxy_host: datastore['PayloadProxyHost'],
proxy_port: datastore['PayloadProxyPort'],
proxy_user: datastore['PayloadProxyUser'],
proxy_pass: datastore['PayloadProxyPass'],
proxy_type: datastore['PayloadProxyType']
}

generate_reverse_http(conf)
Expand Down
10 changes: 5 additions & 5 deletions lib/msf/core/payload/windows/reverse_https.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ def generate
port: datastore['LPORT'],
url: generate_uri,
exitfunk: datastore['EXITFUNC'],
proxy_host: datastore['StagerProxyHost'],
proxy_port: datastore['StagerProxyPort'],
proxy_user: datastore['StagerProxyUser'],
proxy_pass: datastore['StagerProxyPass'],
proxy_type: datastore['StagerProxyType']
proxy_host: datastore['PayloadProxyHost'],
proxy_port: datastore['PayloadProxyPort'],
proxy_user: datastore['PayloadProxyUser'],
proxy_pass: datastore['PayloadProxyPass'],
proxy_type: datastore['PayloadProxyType']
}

generate_reverse_https(conf)
Expand Down
10 changes: 5 additions & 5 deletions lib/rex/post/meterpreter/client_core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -411,11 +411,11 @@ def generate_windows_stub(process)
:expiration => self.client.expiration,
:comm_timeout => self.client.comm_timeout,
:ua => client.exploit_datastore['MeterpreterUserAgent'],
:proxyhost => client.exploit_datastore['StagerProxyHost'] || client.exploit_datastore['PROXYHOST'],
:proxyport => client.exploit_datastore['StagerProxyPort'] || client.exploit_datastore['PROXYPORT'],
:proxy_type => client.exploit_datastore['StagerProxyType'] || client.exploit_datastore['PROXY_TYPE'],
:proxy_username => client.exploit_datastore['StagerProxyUser'] || client.exploit_datastore['PROXY_USERNAME'],
:proxy_password => client.exploit_datastore['StagerProxyPass'] || client.exploit_datastore['PROXY_PASSWORD']
:proxyhost => client.exploit_datastore['PayloadProxyHost'] || client.exploit_datastore['PROXYHOST'],
:proxyport => client.exploit_datastore['PayloadProxyPort'] || client.exploit_datastore['PROXYPORT'],
:proxy_type => client.exploit_datastore['PayloadProxyType'] || client.exploit_datastore['PROXY_TYPE'],
:proxy_username => client.exploit_datastore['PayloadProxyUser'] || client.exploit_datastore['PROXY_USERNAME'],
:proxy_password => client.exploit_datastore['PayloadProxyPass'] || client.exploit_datastore['PROXY_PASSWORD']

end

Expand Down

0 comments on commit 69a808b

Please sign in to comment.