Skip to content

Commit e049b77

Browse files
committed
Add additional SNI support to the http crawler
1 parent 1be3fb3 commit e049b77

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def connect
118118

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

0 commit comments

Comments
 (0)