Skip to content

Commit 6b3da7f

Browse files
committed
Update host_header_injection.rb
made some changes as suggested by @espreto
1 parent a1e0e0c commit 6b3da7f

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

modules/auxiliary/scanner/http/host_header_injection.rb

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@
77

88
class Metasploit3 < Msf::Auxiliary
99

10-
# Exploit mixins should be called first
1110
include Msf::Exploit::Remote::HttpClient
1211
include Msf::Auxiliary::WmapScanServer
13-
# Scanner mixin should be near last
1412
include Msf::Auxiliary::Scanner
1513

1614
def initialize(info={})
@@ -49,21 +47,21 @@ def run_host(target_host)
4947
})
5048

5149
unless res
52-
vprint_error("#{rhost}:#{rport} did not reply to our request")
50+
vprint_error("#{peer} did not reply to our request")
5351
return
5452
end
5553

5654
if res.headers =~ /#{p}/ || res.body =~ /#{p}/
57-
print_good("#{rhost}:#{rport} is vulnerable to HTTP Host-Header Injection")
55+
print_good("#{peer} is vulnerable to HTTP Host-Header Injection")
5856
report_vuln(
59-
:host => rhost,
60-
:port => rport,
61-
:proto => 'tcp',
62-
:sname => (ssl ? 'https' : 'http'),
63-
:info => "Vulnerable to HTTP Host-Header Injection",
57+
:host: rhost,
58+
:port: rport,
59+
:proto: 'tcp',
60+
:sname: (ssl ? 'https' : 'http'),
61+
:info: "Vulnerable to HTTP Host-Header Injection",
6462
)
6563
else
66-
vprint_error("#{rhost}:#{rport} returned #{res.code} #{res.message}")
64+
vprint_error("#{peer} returned #{res.code} #{res.message}")
6765
end
6866
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout
6967
rescue ::Timeout::Error, ::Errno::EPIPE

0 commit comments

Comments
 (0)