Changeset 52907 in vbox for trunk/src/VBox/HostDrivers/Support/win
- Timestamp:
- Sep 30, 2014 7:15:29 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/win/SUPHardenedVerifyImage-win.cpp
r52795 r52907 145 145 g_TrustedInstallerSid, 146 146 /** Local system ID (S-1-5-21). */ 147 g_LocalSystemSid; 147 g_LocalSystemSid, 148 /** Builtin Administrators group alias (S-1-5-32-544). */ 149 g_AdminsGroupSid; 148 150 149 151 … … 452 454 * the plugin loaded once it's installed (WinVerityTrust fails). 453 455 * 454 * Note! We cannot really allow Builtin\Administrators here it's the default 455 * owner of anything an admin user creates. (We must, unforutnately, 456 * allow that in system32 though.) 456 * We'd like to avoid allowing Builtin\Administrators here since it's the 457 * default owner of anything an admin user creates (at least when elevated). 458 * Seems windows update or someone ends up installing or modifying system 459 * DLL ownership to this group, so for system32 and winsxs it's unavoidable. 460 * And, not surprise, a bunch of products, including AV, firewalls and similar 461 * ends up with their files installed with this group as owner. For instance 462 * if we wish to have NAT continue working, we need to allow this. 463 * 464 * Hopefully, we can limit the allowed files to these owners though, so 465 * we won't be subject to ordinary (non-admin, or not elevated) users 466 * downloading or be tricked into putting evil DLLs around the place... 457 467 */ 458 468 PSID pOwner = uBuf.Rel.Control & SE_SELF_RELATIVE ? &uBuf.abView[uBuf.Rel.Owner] : uBuf.Abs.Owner; … … 462 472 if (RtlEqualSid(pOwner, &g_LocalSystemSid)) 463 473 return true; 474 if (RtlEqualSid(pOwner, &g_AdminsGroupSid)) 475 { 476 SUP_DPRINTF(("%ls: Owner is administrators group.\n", pwszName)); 477 return true; 478 } 464 479 465 480 SUP_DPRINTF(("%ls: Owner is not trusted installer (%.*Rhxs)\n", … … 1082 1097 * SECURITY_BUILTIN_DOMAIN_RID + DOMAIN_ALIAS_RID_ADMINS (with 4.3.16). 1083 1098 */ 1099 /** @todo Since we're now allowing Builtin\Administrators after all, perhaps we 1100 * could drop these system32 + winsxs hacks?? */ 1084 1101 if ( (pNtViRdr->fFlags & SUPHNTVI_F_TRUSTED_INSTALLER_OWNER) 1085 1102 && !supHardNtViCheckIsOwnedByTrustedInstallerOrSimilar(pNtViRdr->hFile, pwszName)) … … 1691 1708 *RtlSubAuthoritySid(&g_TrustedInstallerSid, 5) = 2271478464; 1692 1709 1693 if (NT_SUCCESS(rcNt)) 1694 rcNt = RtlInitializeSid(&g_LocalSystemSid, &s_NtAuth, 1); 1710 rcNt = RtlInitializeSid(&g_LocalSystemSid, &s_NtAuth, 1); 1695 1711 if (NT_SUCCESS(rcNt)) 1696 1712 { 1697 1713 *RtlSubAuthoritySid(&g_LocalSystemSid, 0) = SECURITY_LOCAL_SYSTEM_RID; 1698 return VINF_SUCCESS; 1714 1715 rcNt = RtlInitializeSid(&g_AdminsGroupSid, &s_NtAuth, 2); 1716 if (NT_SUCCESS(rcNt)) 1717 { 1718 *RtlSubAuthoritySid(&g_AdminsGroupSid, 0) = SECURITY_BUILTIN_DOMAIN_RID; 1719 *RtlSubAuthoritySid(&g_AdminsGroupSid, 1) = DOMAIN_ALIAS_RID_ADMINS; 1720 return VINF_SUCCESS; 1721 } 1699 1722 } 1700 1723 }
Note:
See TracChangeset
for help on using the changeset viewer.