1
mirror of https://github.com/rapid7/metasploit-framework synced 2024-10-29 18:07:27 +01:00

Change to OptBool and default to explicit

This commit is contained in:
sinn3r 2015-03-05 13:07:03 -06:00
parent d40e7485dd
commit 16c86227e2

View File

@ -57,13 +57,7 @@ class Metasploit3 < Msf::Auxiliary
# This is a good example of passive vs explicit check
register_options([
OptEnum.new('CHECK_STYLE',
[
true,
'Explicit style will actually try to trigger the bug, otheriwse purely a banner check',
'PASSIVE',
['EXPLICIT', 'PASSIVE']
])
OptBool.new('PASSIVE', [false, 'Try banner checking instead of triggering the bug', false])
])
# It's either 139 or 445. The user should not touch this.
@ -224,17 +218,17 @@ class Metasploit3 < Msf::Auxiliary
return Exploit::CheckCode::Safe
end
case datastore['CHECK_STYLE']
when /explicit/i
if is_vulnerable?(ip)
flag_vuln_host(ip, samba_info)
return Exploit::CheckCode::Vulnerable
end
when /passive/i
if datastore['PASSIVE']
if maybe_vulnerable?(samba_info)
flag_vuln_host(ip, samba_info)
return Exploit::CheckCode::Appears
end
else
# Explicit: Actually triggers the bug
if is_vulnerable?(ip)
flag_vuln_host(ip, samba_info)
return Exploit::CheckCode::Vulnerable
end
end
end