Skip to content

Commit af137f3

Browse files
committed
Land rapid7#7127, Fix rapid7#6989, scanner modules printing RHOST in progress messages
2 parents c3635e0 + cce1ae6 commit af137f3

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

lib/msf/core/auxiliary/scanner.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,18 @@ def initialize(info = {})
3131

3232
end
3333

34+
# If a module is using the scanner mixin, technically the RHOST datastore option should be
35+
# disabled. Only the mixin should be setting this. See #6989
36+
37+
def setup
38+
@original_rhost = datastore['RHOST']
39+
datastore['RHOST'] = nil
40+
end
41+
42+
def cleanup
43+
datastore['RHOST'] = @original_rhost
44+
end
45+
3446

3547
def check
3648
nmod = replicant

modules/auxiliary/scanner/ftp/ftp_version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def run_host(target_host)
3333

3434
if(banner)
3535
banner_sanitized = Rex::Text.to_hex_ascii(self.banner.to_s)
36-
print_status("#{rhost}:#{rport} FTP Banner: '#{banner_sanitized}'")
36+
print_status("FTP Banner: '#{banner_sanitized}'")
3737
report_service(:host => rhost, :port => rport, :name => "ftp", :info => banner_sanitized)
3838
end
3939

0 commit comments

Comments
 (0)