Skip to content

Commit ba7be5b

Browse files
Merge pull request rapid7#20148 from adfoster-r7/add-additional-sni-support
Add additional sni support
2 parents cb02d81 + e4d66e8 commit ba7be5b

File tree

5 files changed

+16
-7
lines changed

5 files changed

+16
-7
lines changed

Gemfile.lock

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ GEM
446446
rex-core
447447
rex-struct2
448448
rex-text
449-
rex-core (0.1.33)
449+
rex-core (0.1.34)
450450
rex-encoder (0.1.8)
451451
metasm
452452
rex-arch
@@ -476,15 +476,16 @@ GEM
476476
metasm
477477
rex-core
478478
rex-text
479-
rex-socket (0.1.60)
479+
rex-socket (0.1.61)
480480
dnsruby
481481
rex-core
482-
rex-sslscan (0.1.11)
482+
rex-sslscan (0.1.12)
483483
rex-core
484484
rex-socket
485485
rex-text
486486
rex-struct2 (0.1.5)
487-
rex-text (0.2.60)
487+
rex-text (0.2.61)
488+
bigdecimal
488489
rex-zip (0.1.6)
489490
rex-text
490491
rexml (3.4.1)

lib/anemone/rex_http.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ def connection(url)
198198
conn.set_config(
199199
'vhost' => virtual_host(url),
200200
'agent' => user_agent,
201+
'ssl_server_name_indication' => @opts[:ssl_server_name_indication],
201202
'domain' => @opts[:domain]
202203
)
203204

lib/msf/core/auxiliary/http_crawler.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,12 @@ def initialize(info = {})
3737
OptInt.new('RequestTimeout', [false, 'The maximum number of seconds to wait for a reply', 15]),
3838
OptInt.new('RedirectLimit', [false, 'The maximum number of redirects for a single request', 5]),
3939
OptInt.new('RetryLimit', [false, 'The maximum number of attempts for a single request', 5]),
40-
OptString.new('UserAgent', [true, 'The User-Agent header to use for all requests',
41-
"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
42-
]),
40+
OptString.new('UserAgent', [true, 'The User-Agent header to use for all requests', Rex::UserAgent.random]),
4341
OptString.new('BasicAuthUser', [false, 'The HTTP username to specify for basic authentication']),
4442
OptString.new('BasicAuthPass', [false, 'The HTTP password to specify for basic authentication']),
4543
OptString.new('HTTPAdditionalHeaders', [false, "A list of additional headers to send (separated by \\x01)"]),
4644
OptString.new('HTTPCookie', [false, "A HTTP cookie header to send with each request"]),
45+
OptString.new('SSLServerNameIndication', [ false, 'SSL/TLS Server Name Indication (SNI)', nil]),
4746
Opt::SSLVersion
4847
], self.class
4948
)
@@ -115,6 +114,7 @@ def run
115114

116115
t.merge!({
117116
:vhost => vhost,
117+
:ssl_server_name_indication => datastore['SSLServerNameIndication'] || vhost,
118118
:host => rhost,
119119
:port => rport,
120120
:ssl => ssl,
@@ -269,6 +269,7 @@ def crawler_process_page(t, page, cnt)
269269
def crawler_options(t)
270270
opts = {}
271271
opts[:user_agent] = datastore['UserAgent']
272+
opts[:ssl_server_name_indication] = datastore['SSLServerNameIndication']
272273
opts[:verbose] = false
273274
opts[:threads] = max_crawl_threads
274275
opts[:obey_robots_txt] = false

lib/msf/core/auxiliary/web/http.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ def connect
118118

119119
c.set_config({
120120
'vhost' => opts[:target].vhost,
121+
'ssl_server_name_indication' => opts[:target].ssl_server_name_indication || opts[:target].vhost,
121122
'agent' => opts[:user_agent] || Rex::UserAgent.session_agent,
122123
'domain' => domain
123124
})

lib/msf/core/auxiliary/web/target.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ class Auxiliary::Web::Target
3333
# Virtual host as a String.
3434
attr_accessor :vhost
3535

36+
# @return String SSL/TLS Server Name Indication (SNI)
37+
attr_accessor :ssl_server_name_indication
38+
3639
# String URI path.
3740
attr_accessor :path
3841

@@ -64,6 +67,7 @@ class Auxiliary::Web::Target
6467
# :port
6568
# :forms
6669
# :auditable
70+
# :ssl_server_name_indication
6771
#
6872
def initialize( options = {} )
6973
update( options )
@@ -79,6 +83,7 @@ def initialize( options = {} )
7983
# :port
8084
# :forms
8185
# :auditable
86+
# :ssl_server_name_indication
8287
#
8388
def update( options = {} )
8489
options.each { |k, v| send( "#{k}=", v ) }

0 commit comments

Comments
 (0)