Skip to content

Commit 3ad7ef9

Browse files
committed
Modify the printed URL to add https:// when SSL is used.
1 parent 8923252 commit 3ad7ef9

File tree

6 files changed

+30
-6
lines changed

6 files changed

+30
-6
lines changed

modules/auxiliary/scanner/http/apache_userdir_enum.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ def initialize
5353

5454
def target_url
5555
uri = normalize_uri(datastore['URI'])
56-
"http://#{vhost}:#{rport}#{uri}"
56+
proto = 'http'
57+
if rport == 443 || ssl
58+
proto = 'https'
59+
end
60+
"#{proto}://#{vhost}:#{rport}#{uri}"
5761
end
5862

5963
def run_host(ip)

modules/auxiliary/scanner/http/axis_local_file_include.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ def initialize
4040

4141
def target_url
4242
uri = normalize_uri(datastore['URI'])
43-
"http://#{vhost}:#{rport}#{uri}"
43+
proto = 'http'
44+
if rport == 443 || ssl
45+
proto = 'https'
46+
end
47+
"#{proto}://#{vhost}:#{rport}#{uri}"
4448
end
4549

4650
def run_host(ip)

modules/auxiliary/scanner/http/barracuda_directory_traversal.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ def initialize
4444

4545
def target_url
4646
uri = normalize_uri(datastore['URI'])
47-
"http://#{vhost}:#{rport}#{uri}"
47+
proto = 'http'
48+
if rport == 443 || ssl
49+
proto = 'https'
50+
end
51+
"#{proto}://#{vhost}:#{rport}#{uri}"
4852
end
4953

5054
def run_host(ip)

modules/auxiliary/scanner/http/nginx_source_disclosure.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ def initialize
4242

4343
def target_url
4444
uri = normalize_uri(datastore['URI'])
45-
"http://#{vhost}:#{rport}#{uri}"
45+
proto = 'http'
46+
if rport == 443 || ssl
47+
proto = 'https'
48+
end
49+
"#{proto}://#{vhost}:#{rport}#{uri}"
4650
end
4751

4852
def run_host(ip)

modules/auxiliary/scanner/http/squiz_matrix_user_enum.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ def initialize(info={})
4848

4949
def target_url
5050
uri = normalize_uri(datastore['URI'])
51-
"http://#{vhost}:#{rport}#{uri}"
51+
proto = 'http'
52+
if rport == 443 || ssl
53+
proto = 'https'
54+
end
55+
"#{proto}://#{vhost}:#{rport}#{uri}"
5256
end
5357

5458
def run_host(ip)

modules/auxiliary/scanner/http/tomcat_enum.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,11 @@ def initialize
5151

5252
def target_url
5353
uri = normalize_uri(datastore['URI'])
54-
"http://#{vhost}:#{rport}#{uri}"
54+
proto = 'http'
55+
if rport == 443 || ssl
56+
proto = 'https'
57+
end
58+
"#{proto}://#{vhost}:#{rport}#{uri}"
5559
end
5660

5761
def has_j_security_check?

0 commit comments

Comments
 (0)