@@ -58,11 +58,14 @@ def initialize(info = {})
58
58
59
59
# Vulnerable since 0.6.0 and patched in 0.7.6 and 0.8.4
60
60
def check_banner ( ip , version )
61
- version =~ /libssh_ ([\d .]+ )$/ && $1 && ( v = Gem ::Version . new ( $1) )
61
+ version =~ /libssh[_-]? ([\d .]* )$/ && $1 && ( v = Gem ::Version . new ( $1) )
62
62
63
63
if v . nil?
64
64
vprint_error ( "#{ ip } :#{ rport } - #{ version } does not appear to be libssh" )
65
65
Exploit ::CheckCode ::Unknown
66
+ elsif v == Gem ::Version . new ( '' )
67
+ vprint_warning ( "#{ ip } :#{ rport } - libssh version not reported" )
68
+ Exploit ::CheckCode ::Detected
66
69
elsif v . between? ( Gem ::Version . new ( '0.6.0' ) , Gem ::Version . new ( '0.7.5' ) ) ||
67
70
v . between? ( Gem ::Version . new ( '0.8.0' ) , Gem ::Version . new ( '0.8.3' ) )
68
71
vprint_good ( "#{ ip } :#{ rport } - #{ version } appears to be unpatched" )
@@ -110,8 +113,10 @@ def run_host(ip)
110
113
version = ssh . transport . server_version . version
111
114
112
115
# XXX: The OOB authentication leads to false positives, so check banner
113
- return if datastore [ 'CHECK_BANNER' ] &&
114
- check_banner ( ip , version ) != Exploit ::CheckCode ::Appears
116
+ if datastore [ 'CHECK_BANNER' ]
117
+ return if check_banner ( ip , version ) !=
118
+ ( Exploit ::CheckCode ::Appears || Exploit ::CheckCode ::Detected )
119
+ end
115
120
116
121
report_vuln (
117
122
host : ip ,
0 commit comments