Skip to content

Commit ea37196

Browse files
committed
use cooler names c/o @timwr, make options easier to grep
1 parent 85acbad commit ea37196

File tree

7 files changed

+29
-51
lines changed

7 files changed

+29
-51
lines changed

lib/msf/core/opt.rb

Lines changed: 11 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -59,23 +59,20 @@ def self.ssl_supported_options
5959

6060
# @return [OptEnum]
6161
def self.SSLVersion
62-
Msf::OptEnum.new(
63-
'SSLVersion',
62+
Msf::OptEnum.new('SSLVersion',
6463
'Specify the version of SSL/TLS to be used (Auto, TLS and SSL23 are auto-negotiate)',
6564
enums: self.ssl_supported_options
6665
)
6766
end
6867

6968
def self.stager_retry_options
7069
[
71-
OptInt.new(
72-
'StagerRetryCount',
70+
OptInt.new('StagerRetryCount',
7371
'The number of times the stager should retry if the first connect fails',
7472
default: 10,
7573
aliases: ['ReverseConnectRetries']
7674
),
77-
OptInt.new(
78-
'StagerRetryWait',
75+
OptInt.new('StagerRetryWait',
7976
'Number of seconds to wait for the stager between reconnect attempts',
8077
default: 5
8178
)
@@ -84,29 +81,19 @@ def self.stager_retry_options
8481

8582
def self.http_proxy_options
8683
[
87-
OptString.new(
88-
'HttpProxyHost',
89-
'An optional proxy server IP address or hostname',
84+
OptString.new('HttpProxyHost', 'An optional proxy server IP address or hostname',
9085
aliases: ['PayloadProxyHost']
9186
),
92-
OptPort.new(
93-
'HttpProxyPort',
94-
'An optional proxy server port',
87+
OptPort.new('HttpProxyPort', 'An optional proxy server port',
9588
aliases: ['PayloadProxyPort']
9689
),
97-
OptString.new(
98-
'HttpProxyUser',
99-
'An optional proxy server username',
90+
OptString.new('HttpProxyUser', 'An optional proxy server username',
10091
aliases: ['PayloadProxyUser']
10192
),
102-
OptString.new(
103-
'HttpProxyPass',
104-
'An optional proxy server password',
93+
OptString.new('HttpProxyPass', 'An optional proxy server password',
10594
aliases: ['PayloadProxyPass']
10695
),
107-
OptEnum.new(
108-
'HttpProxyType',
109-
'The type of HTTP proxy',
96+
OptEnum.new('HttpProxyType', 'The type of HTTP proxy',
11097
enums: ['HTTP', 'SOCKS'],
11198
aliases: ['PayloadProxyType']
11299
)
@@ -115,18 +102,9 @@ def self.http_proxy_options
115102

116103
def self.http_header_options
117104
[
118-
OptString.new(
119-
'HttpHeaderHost',
120-
'An optional value to use for the Host HTTP header'
121-
),
122-
OptString.new(
123-
'HttpHeaderCookie',
124-
'An optional value to use for the Cookie HTTP header'
125-
),
126-
OptString.new(
127-
'HttpHeaderReferer',
128-
'An optional value to use for the Referer HTTP header'
129-
)
105+
OptString.new('HttpHostHeader', 'An optional value to use for the Host HTTP header'),
106+
OptString.new('HttpCookie', 'An optional value to use for the Cookie HTTP header'),
107+
OptString.new('HttpReferer', 'An optional value to use for the Referer HTTP header')
130108
]
131109
end
132110

lib/msf/core/payload/java/reverse_http.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ def stager_config(opts={})
6868
c = ''
6969
c << "Spawn=#{ds["Spawn"] || 2}\n"
7070
c << "HeaderUser-Agent=#{ds["HttpUserAgent"]}\n" if ds["HttpUserAgent"]
71-
c << "HeaderHost=#{ds["HttpHeaderHost"]}\n" if ds["HttpHeaderHost"]
72-
c << "HeaderReferer=#{ds["HttpHeaderReferer"]}\n" if ds["HttpHeaderReferer"]
73-
c << "HeaderCookie=#{ds["HttpHeaderCookie"]}\n" if ds["HttpHeaderCookie"]
71+
c << "HeaderHost=#{ds["HttpHostHeader"]}\n" if ds["HttpHostHeader"]
72+
c << "HeaderReferer=#{ds["HttpReferer"]}\n" if ds["HttpReferer"]
73+
c << "HeaderCookie=#{ds["HttpCookie"]}\n" if ds["HttpCookie"]
7474
c << "URL=#{scheme}://#{ds['LHOST']}"
7575
c << ":#{ds['LPORT']}" if ds['LPORT']
7676
c << luri

lib/msf/core/payload/python/meterpreter_loader.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ def stage_meterpreter(opts={})
9898
http_user_agent = opts[:http_user_agent] || ds['HttpUserAgent']
9999
http_proxy_host = opts[:http_proxy_host] || ds['HttpProxyHost'] || ds['PROXYHOST']
100100
http_proxy_port = opts[:http_proxy_port] || ds['HttpProxyPort'] || ds['PROXYPORT']
101-
http_header_host = opts[:header_host] || ds['HttpHeaderHost']
102-
http_header_cookie = opts[:header_cookie] || ds['HttpHeaderCookie']
103-
http_header_referer = opts[:header_referer] || ds['HttpHeaderReferer']
101+
http_header_host = opts[:header_host] || ds['HttpHostHeader']
102+
http_header_cookie = opts[:header_cookie] || ds['HttpCookie']
103+
http_header_referer = opts[:header_referer] || ds['HttpReferer']
104104

105105
# The callback URL can be different to the one that we're receiving from the interface
106106
# so we need to generate it

lib/msf/core/payload/python/reverse_http.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ def generate(opts={})
2828
proxy_host: ds['HttpProxyHost'],
2929
proxy_port: ds['HttpProxyPort'],
3030
user_agent: ds['HttpUserAgent'],
31-
header_host: ds['HttpHeaderHost'],
32-
header_cookie: ds['HttpHeaderCookie'],
33-
header_referer: ds['HttpHeaderReferer']
31+
header_host: ds['HttpHostHeader'],
32+
header_cookie: ds['HttpCookie'],
33+
header_referer: ds['HttpReferer']
3434
})
3535
opts[:scheme] = 'http' if opts[:scheme].nil?
3636

lib/msf/core/payload/transport_config.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ def transport_config_reverse_named_pipe(opts={})
8383

8484
def get_custom_headers(ds)
8585
headers = ""
86-
headers << "Host: #{ds['HttpHeaderHost']}\r\n" if ds['HttpHeaderHost']
87-
headers << "Cookie: #{ds['HttpHeaderCookie']}\r\n" if ds['HttpHeaderCookie']
88-
headers << "Referer: #{ds['HttpHeaderReferer']}\r\n" if ds['HttpHeaderReferer']
86+
headers << "Host: #{ds['HttpHostHeader']}\r\n" if ds['HttpHostHeader']
87+
headers << "Cookie: #{ds['HttpCookie']}\r\n" if ds['HttpCookie']
88+
headers << "Referer: #{ds['HttpReferer']}\r\n" if ds['HttpReferer']
8989

9090
if headers.length > 0
9191
headers

lib/msf/core/payload/windows/reverse_http.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ def generate(opts={})
7272
#
7373
def get_custom_headers(ds)
7474
headers = ""
75-
headers << "Host: #{ds['HttpHeaderHost']}\r\n" if ds['HttpHeaderHost']
76-
headers << "Cookie: #{ds['HttpHeaderCookie']}\r\n" if ds['HttpHeaderCookie']
77-
headers << "Referer: #{ds['HttpHeaderReferer']}\r\n" if ds['HttpHeaderReferer']
75+
headers << "Host: #{ds['HttpHostHeader']}\r\n" if ds['HttpHostHeader']
76+
headers << "Cookie: #{ds['HttpCookie']}\r\n" if ds['HttpCookie']
77+
headers << "Referer: #{ds['HttpReferer']}\r\n" if ds['HttpReferer']
7878

7979
if headers.length > 0
8080
headers

lib/msf/core/payload/windows/x64/reverse_http.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ def generate(opts={})
7777
#
7878
def get_custom_headers(ds)
7979
headers = ""
80-
headers << "Host: #{ds['HttpHeaderHost']}\r\n" if ds['HttpHeaderHost']
81-
headers << "Cookie: #{ds['HttpHeaderCookie']}\r\n" if ds['HttpHeaderCookie']
82-
headers << "Referer: #{ds['HttpHeaderReferer']}\r\n" if ds['HttpHeaderReferer']
80+
headers << "Host: #{ds['HttpHostHeader']}\r\n" if ds['HttpHostHeader']
81+
headers << "Cookie: #{ds['HttpCookie']}\r\n" if ds['HttpCookie']
82+
headers << "Referer: #{ds['HttpReferer']}\r\n" if ds['HttpReferer']
8383

8484
if headers.length > 0
8585
headers

0 commit comments

Comments
 (0)