Professional Documents
Culture Documents
Exploit
Exploit
include('compat.inc');
if (description)
{
script_id(136946);
script_version("1.2");
script_set_attribute(attribute:"plugin_modification_date", value:"2020/06/04");
script_cve_id("CVE-2017-8529");
script_bugtraq_id(98953);
script_xref(name:"MSKB", value:"4038781");
script_xref(name:"MSFT", value:"MS17-4038781");
script_xref(name:"MSKB", value:"4038783");
script_xref(name:"MSFT", value:"MS17-4038783");
script_xref(name:"MSKB", value:"4038782");
script_xref(name:"MSFT", value:"MS17-4038782");
script_xref(name:"MSKB", value:"4038788");
script_xref(name:"MSFT", value:"MS17-4038788");
script_set_attribute(attribute:"synopsis", value:
"The remote Windows host is affected by an information disclosure vulnerability.");
script_set_attribute(attribute:"description", value:
"The remote Windows host is missing a security update or a registry setting
required to enable protections for CVE-2017-8529. It is, therefore, affected by an
information disclosure vulnerability:
script_set_attribute(attribute:"plugin_type", value:"local");
script_set_attribute(attribute:"cpe", value:"cpe:/o:microsoft:windows");
script_end_attributes();
script_category(ACT_GATHER_INFO);
script_family(english:"Windows : Microsoft Bulletins");
script_dependencies("smb_check_rollup.nasl", "smb_hotfixes.nasl",
"ms_bulletin_checks_possible.nasl");
script_require_keys("SMB/MS_Bulletin_Checks/Possible");
script_require_ports(139, 445, "Host/patch_management_checks");
exit(0);
}
include('audit.inc');
include('smb_func.inc');
include('smb_hotfixes.inc');
include('smb_hotfixes_fcheck.inc');
include('smb_reg_query.inc');
include('misc_func.inc');
function is_print_fix_enabled(kb)
{
var keyx86 = "SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\
FEATURE_ENABLE_PRINT_INFO_DISCLOSURE_FIX\iexplore.exe";
var keyx64 = "SOFTWARE\WOW6432Node\Microsoft\Internet Explorer\Main\
FeatureControl\FEATURE_ENABLE_PRINT_INFO_DISCLOSURE_FIX\iexplore.exe";
registry_init();
var result = check_print_fix(key:keyx86);
var ret_result = FALSE;
var report = '';
if(result != 'set')
{
report += '\nThe following registry key is required to enable the fix for CVE-
2017-8529 and is ' + result + '\n ';
report += 'HKLM\\' + keyx86;
report += '\n';
ret_result = TRUE;
}
var arch = get_kb_item('SMB/ARCH');
if(!isnull(arch) && arch == 'x64')
{
var x64result = check_print_fix(key:keyx64);
if(x64result != 'set')
{
report += '\nThe following registry key is required to enable the fix for
CVE-2017-8529 and is ' + x64result + '\n ';
report += 'HKLM\\' + keyx64;
report += '\n';
ret_result = TRUE;
}
}
close_registry();
if(ret_result)
{
hotfix_add_report(bulletin:'MS17-06', kb:kb, report);
}
return ret_result;
}
function check_print_fix(key)
{
var hklm = registry_hive_connect(hive:HKEY_LOCAL_MACHINE, exit_on_fail:TRUE);
var key_h = get_registry_value(handle:hklm, item:key);
RegCloseKey(handle:hklm);
if(isnull(key_h))
return 'missing.';
else if(key_h == 0)
return 'not enabled.';
else
return 'set';
}
get_kb_item_or_exit('SMB/MS_Bulletin_Checks/Possible');
## NB: Microsoft
bulletin = 'MS17-09';
kbs = make_list(
'4038781',
'4038783',
'4038782',
'4038788'
);
get_kb_item_or_exit('SMB/Registry/Enumerated');
get_kb_item_or_exit('SMB/WindowsVersion', exit_code:1);
if (get_kb_item('Host/patch_management_checks'))
exit(0, 'Patch coverage provided by monthly rollup plugin.');
os_build = get_kb_item('SMB/WindowsVersionBuild');
switch (os_build)
{
case 10240: # Windows 10 RTM
kb = '4038781';
break;
case 10586: # Windows 10 1511
kb = '4038783';
break;
case 14393: # Windows 10 1607 / Windows Server 2016
kb = '4038782';
break;
case 15063: # Windows 10 1703
kb = '4038788';
break;
default:
audit(AUDIT_OS_SP_NOT_VULN);
}
if (rollupBool || printfixBool)
{
replace_kb_item(name:'SMB/Missing/'+bulletin, value:TRUE);
hotfix_security_warning();
hotfix_check_fversion_end();
exit(0);
}
else
{
hotfix_check_fversion_end();
audit(AUDIT_HOST_NOT, hotfix_get_audit_report());
}