Skip to content

Commit 0ae2e64

Browse files
committed
Only mark rsync as req'ing auth true/false if we are sure, otherwise vprint and unknown
1 parent f1a79bd commit 0ae2e64

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

modules/auxiliary/scanner/rsync/modules_list.rb

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,20 @@ def read_timeout
6060
def rsync_requires_auth?(rmodule)
6161
sock.puts("#{rmodule}\n")
6262
res = sock.get_once(-1, read_timeout)
63-
if res && (res =~ /^#{RSYNC_HEADER} AUTHREQD/)
64-
true
63+
if res
64+
if res =~ /^#{RSYNC_HEADER} AUTHREQD/
65+
true
66+
elsif res =~ /^#{RSYNC_HEADER} OK/
67+
false
68+
else
69+
vprint_error("#{peer} - unexpected response when connecting to #{rmodule}: #{res}")
70+
'unknown'
71+
end
6572
else
66-
false
73+
vprint_error("#{peer} - no response when connecting to #{rmodule}")
74+
'unknown'
6775
end
76+
6877
end
6978

7079
def rsync_list

0 commit comments

Comments
 (0)