Only mark rsync as req'ing auth true/false if we are sure, otherwise vprint and unknown

This commit is contained in:
Jon Hart
2015-11-05 09:20:02 -08:00
parent f1a79bd207
commit 0ae2e64bc5
@@ -60,11 +60,20 @@ class Metasploit3 < Msf::Auxiliary
def rsync_requires_auth?(rmodule)
sock.puts("#{rmodule}\n")
res = sock.get_once(-1, read_timeout)
if res && (res =~ /^#{RSYNC_HEADER} AUTHREQD/)
true
if res
if res =~ /^#{RSYNC_HEADER} AUTHREQD/
true
elsif res =~ /^#{RSYNC_HEADER} OK/
false
else
vprint_error("#{peer} - unexpected response when connecting to #{rmodule}: #{res}")
'unknown'
end
else
false
vprint_error("#{peer} - no response when connecting to #{rmodule}")
'unknown'
end
end
def rsync_list