Browse Source

Fix #6989, scanner modules printing RHOST in progress messages

Fix #6989
wchen-r7 3 years ago
parent
commit
cce1ae6026
2 changed files with 13 additions and 1 deletions
  1. 12
    0
      lib/msf/core/auxiliary/scanner.rb
  2. 1
    1
      modules/auxiliary/scanner/ftp/ftp_version.rb

+ 12
- 0
lib/msf/core/auxiliary/scanner.rb View File

@@ -31,6 +31,18 @@ def initialize(info = {})
31 31
 
32 32
 end
33 33
 
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
+
34 46
 
35 47
 def check
36 48
   nmod = replicant

+ 1
- 1
modules/auxiliary/scanner/ftp/ftp_version.rb View File

@@ -33,7 +33,7 @@ class MetasploitModule < Msf::Auxiliary
33 33
 
34 34
     if(banner)
35 35
       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}'")
37 37
       report_service(:host => rhost, :port => rport, :name => "ftp", :info => banner_sanitized)
38 38
     end
39 39
 

Loading…
Cancel
Save