{"id":406653,"date":"2024-06-29T19:04:15","date_gmt":"2024-06-29T19:04:15","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=406653"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=406653","title":{"rendered":"<span>BloodHound \u0438 GPO Client Side Extension<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/bfb\/fa9\/06d\/bfbfa906dedbf9a1bd25a4bbcea606b5.jpg\" width=\"763\" height=\"422\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/bfb\/fa9\/06d\/bfbfa906dedbf9a1bd25a4bbcea606b5.jpg\" data-blurred=\"true\"\/><\/figure>\n<p>\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0446\u0438\u043a\u043b \u0441\u0442\u0430\u0442\u0435\u0439 \u00ab\u0423\u0447\u0438\u043c \u0441\u0442\u0430\u0440\u043e\u0433\u043e \u043f\u0441\u0430\u043e\u0432\u044b\u043c \u0442\u0440\u044e\u043a\u0430\u043c\u00bb, \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u043d\u044b\u0445 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 BloodHound. \u042d\u0442\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043f\u0435\u043d\u0442\u0435\u0441\u0442\u0430 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043d\u0430 \u0431\u0430\u0437\u0435 Active Directory. BloodHound \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 Active Directory \u0438 \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0446\u0435\u043f\u043e\u0447\u043a\u0438 \u0430\u0442\u0430\u043a. \u0415\u0433\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u2013 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0435\u043e\u0440\u0438\u0438 \u0433\u0440\u0430\u0444\u043e\u0432 \u043f\u0440\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u0412 \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u0435\u043c \u043f\u043e\u0441\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f GPO Client Side Extension \u0432 \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u043c \u0432\u0438\u0434\u0435 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0432 \u0431\u0430\u0437\u0443 BloodHound. <\/p>\n<p>GPO \u2013 \u043e\u0431\u044a\u0435\u043a\u0442 \u0434\u043e\u043c\u0435\u043d\u0430, \u0438 \u043e\u043d \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0439 GPO \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c. \u0417\u0430 \u044d\u0442\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b <em>gpcuserextensionnames<\/em> (\u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 GPO \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f) \u0438 <em>gpcmachineextensionnames<\/em> (\u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 GPO \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430). \u042d\u0442\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 GUID Client Side Extension (CSE). \u0421\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 GUID CSE \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 <a href=\"https:\/\/docs.microsoft.com\/ru-ru\/archive\/blogs\/mempson\/group-policy-client-side-extension-list\">\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 Microsoft<\/a>. \u0423 GPO \u0442\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c \u0447\u0435\u0442\u043a\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u0432 \u0438 \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432. \u041a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0434\u043b\u044f GPO \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c <em>gpcfilesyspath<\/em>. \u041f\u0440\u043e\u0449\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b <em>gpcuserextensionnames<\/em> \u0438 <em>gpcmachineextensionnames<\/em> \u2013 \u044d\u0442\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/a40\/19a\/7be\/a4019a7be43e266ff8408d8886204b8d.jpg\" alt=\"\u0413\u0440\u0443\u043f\u043f\u043e\u0432\u0430\u044f \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 Default Domain Policy\" title=\"\u0413\u0440\u0443\u043f\u043f\u043e\u0432\u0430\u044f \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 Default Domain Policy\" width=\"1165\" height=\"343\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a40\/19a\/7be\/a4019a7be43e266ff8408d8886204b8d.jpg\" data-blurred=\"true\"\/><\/p>\n<div><figcaption>\u0413\u0440\u0443\u043f\u043f\u043e\u0432\u0430\u044f \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 Default Domain Policy<\/figcaption><\/div>\n<\/figure>\n<p>CSE \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043d\u0430\u0431\u043e\u0440 GUID, \u0430 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0434\u0430\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0433\u0440\u0443\u043f\u043f\u043e\u0432\u0430\u044f \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u0438\u0434\u0435\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c CSE \u0432 \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u0439 \u0432\u0438\u0434 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0432 \u0431\u0430\u0437\u0443 Neo4j. <\/p>\n<p>\u0417\u0430\u0439\u043c\u0435\u043c\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0432 PowerShell. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c hashtable, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f CSE. \u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043f\u0435\u0440\u0435\u0447\u0435\u043d\u044c \u0432\u044b\u0448\u0435.<\/p>\n<pre><code>$GpoGuidRef = @{ '00000000-0000-0000-0000-000000000000' = 'Core GPO Engine' '0E28E245-9368-4853-AD84-6DA3BA35BB75' = 'Preference CSE GUID Environment Variables' '0F6B957D-509E-11D1-A7CC-0000F87571E3' = 'Tool Extension GUID (Computer Policy Settings)' '0F6B957E-509E-11D1-A7CC-0000F87571E3' = 'Tool Extension GUID (User Policy Settings) \/ Restrict Run' '1612b55c-243c-48dd-a449-ffc097b19776' = 'Preference Tool CSE GUID Data Sources' ... '0F3F3735-573D-9804-99E4-AB2A69BA5FD4' = 'Advanced Audit Policy Snapin' } <\/code><\/pre>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0431\u0443\u0434\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432 \u0444\u0430\u0439\u043b:<\/p>\n<pre><code>[string]$OutFile = \"Result_\" + $(Get-Date -f ddMMyyyyhhmmss) + \".log\"<\/code><\/pre>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b <em>gpcuserextensionnames<\/em> \u0438 <em>gpcmachineextensionnames<\/em> \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u0432\u0438\u0434\u0435 [{CSE}{CSE}][{CSE}{CSE}], \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u044b\u0445 \u0438 \u0444\u0438\u0433\u0443\u0440\u043d\u044b\u0445 \u0441\u043a\u043e\u0431\u043e\u043a:   <\/p>\n<pre><code>$extPattern = \"(?&lt;=\\[)[^]]+(?=\\])\" $guidPattern = \"(?&lt;=\\{).+?(?=\\})\"<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438\u0437 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u044b\u0445 \u0441\u043a\u043e\u0431\u043e\u043a, \u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u2013 \u0438\u0437 \u0444\u0438\u0433\u0443\u0440\u043d\u044b\u0445. <\/p>\n<p>\u041d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0448\u0430\u0433\u0435 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0432\u0441\u0435 \u0433\u0440\u0443\u043f\u043f\u043e\u0432\u044b\u0435 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438. \u0417\u0434\u0435\u0441\u044c \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f ADSI-\u0437\u0430\u043f\u0440\u043e\u0441, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0437\u0430\u0442\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f.<\/p>\n<pre><code>$DomainObject = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain() $CurrentDomain = \"LDAP:\/\/\" + ([ADSI]\"\").distinguishedName $Domain = $DomainObject.name  $ObjectSearcher = New-Object System.DirectoryServices.DirectorySearcher([ADSI]$CurrentDomain) $DirEntry = New-Object System.DirectoryServices.DirectoryEntry $ObjectSearcher.SearchRoot = $DirEntry  $ObjectSearcher.Filter = \"(&amp;(objectClass=groupPolicyContainer))\"  $ObjectSearcher.PageSize = 1000 $Objects = $ObjectSearcher.FindAll() <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432 \u0446\u0438\u043a\u043b\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u0432\u043b\u0435\u0447\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b <em>gpcuserextensionnames<\/em>, <em>gpcmachineextensionnames <\/em>\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 objectguid, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 GPO \u0432 \u0431\u0430\u0437\u0435 neo4j. \u041f\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u0445. \u041f\u043e\u0442\u043e\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u044e\u0442 CSE \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0442 \u0432 \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u0439 \u0432\u0438\u0434. \u041d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u044d\u0442\u0430\u043f\u0430\u0445 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043d\u0430\u0431\u043e\u0440 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0441\u0442\u0440\u043e\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 Cypher. <\/p>\n<p>\u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u0431\u0443\u0434\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 <em>MATCH<\/em>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f <em>CALL {}<\/em>.<\/p>\n<pre><code> foreach($object in $Objects) { $objectGuid = [guid]$Object.Properties.objectguid.Item(0)  if ($Object.Properties.gpcmachineextensionnames -ne $null) { $exts = [Regex]::Matches($Object.Properties.gpcmachineextensionnames, $extPattern).Value $collects =  @()  foreach ($ext in $exts) { $guids = [Regex]::Matches($ext, $guidPattern).Value $collects += $GpoGuidRef[$guids] -join ': ' } $collectionGuid =  '\"{0}\"' -f ($collects -join '\",\"') Add-Content $OutFile \"CALL {MATCH (g:GPO) WHERE g.objectid =~ '(?i)$objectGuid' SET g.machineextname = [$collectionGuid]}\" }  if ($Object.Properties.gpcuserextensionnames -ne $null) {  $exts = [Regex]::Matches($Object.Properties. gpcuserextensionnames, $extPattern).Value $collects =  @()  foreach ($ext in $exts) { $guids = [Regex]::Matches($ext, $guidPattern).Value $collects += $GpoGuidRef[$guids] -join ': ' } $collectionGuid =  '\"{0}\"' -f ($collects -join '\",\"') Add-Content $OutFile \"CALL {MATCH (g:GPO) WHERE g.objectid =~ '(?i)$objectGuid' SET g.userextname = [$collectionGuid]}\" }<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432 \u0432\u0438\u0434\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 Cypher.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/4c6\/7e9\/fbb\/4c67e9fbb75533e3983d6b8e693386f8.jpg\" width=\"1134\" height=\"414\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4c6\/7e9\/fbb\/4c67e9fbb75533e3983d6b8e693386f8.jpg\" data-blurred=\"true\"\/><\/figure>\n<p>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430\u0434\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432 \u043f\u043e\u043b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432 Browser Neo4j \u0438 \u043d\u0430\u0436\u0430\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443 \u00ab\u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c\u00bb. \u0422\u0435\u043f\u0435\u0440\u044c, \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 BloodHound \u0438 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0433\u0440\u0443\u043f\u043f\u043e\u0432\u0443\u044e \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443, \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 EXTRA PROPERTIES \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u043d\u043e\u0432\u044b\u0435 \u043f\u043e\u043b\u044f.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/c80\/434\/58b\/c8043458baa38071533da50a219cce98.jpg\" width=\"468\" height=\"639\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c80\/434\/58b\/c8043458baa38071533da50a219cce98.jpg\" data-blurred=\"true\"\/><\/figure>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0432\u0441\u0435. \u0410 \u043d\u0430\u0448\u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u043f\u043e\u0441\u0442\u044b \u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 BloodHound \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/habr.com\/ru\/company\/solarsecurity\/blog\/681108\/\">\u0437\u0434\u0435\u0441\u044c<\/a>, <a href=\"https:\/\/habr.com\/ru\/company\/solarsecurity\/blog\/707190\/\">\u0437\u0434\u0435\u0441\u044c<\/a> \u0438 <a href=\"https:\/\/habr.com\/ru\/companies\/solarsecurity\/articles\/719714\/\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u0414\u043e \u043d\u043e\u0432\u044b\u0445 \u0432\u0441\u0442\u0440\u0435\u0447!<\/p>\n<p><em>\u0410\u0432\u0442\u043e\u0440: \u0414\u043c\u0438\u0442\u0440\u0438\u0439 \u041d\u0435\u0432\u0435\u0440\u043e\u0432, \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c \u0433\u0440\u0443\u043f\u043f\u044b \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u043e\u0441\u0442\u0438\u00a0\u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, &#171;\u0420\u0422\u041a-\u0421\u043e\u043b\u0430\u0440&#187;<\/em>  <\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/746418\/\"> https:\/\/habr.com\/ru\/articles\/746418\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><\/figure>\n<p>\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0446\u0438\u043a\u043b \u0441\u0442\u0430\u0442\u0435\u0439 \u00ab\u0423\u0447\u0438\u043c \u0441\u0442\u0430\u0440\u043e\u0433\u043e \u043f\u0441\u0430\u043e\u0432\u044b\u043c \u0442\u0440\u044e\u043a\u0430\u043c\u00bb, \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u043d\u044b\u0445 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 BloodHound. \u042d\u0442\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043f\u0435\u043d\u0442\u0435\u0441\u0442\u0430 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043d\u0430 \u0431\u0430\u0437\u0435 Active Directory. BloodHound \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 Active Directory \u0438 \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0446\u0435\u043f\u043e\u0447\u043a\u0438 \u0430\u0442\u0430\u043a. \u0415\u0433\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u2013 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0435\u043e\u0440\u0438\u0438 \u0433\u0440\u0430\u0444\u043e\u0432 \u043f\u0440\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u0412 \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u0435\u043c \u043f\u043e\u0441\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f GPO Client Side Extension \u0432 \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u043c \u0432\u0438\u0434\u0435 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0432 \u0431\u0430\u0437\u0443 BloodHound. <\/p>\n<p>GPO \u2013 \u043e\u0431\u044a\u0435\u043a\u0442 \u0434\u043e\u043c\u0435\u043d\u0430, \u0438 \u043e\u043d \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0439 GPO \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c. \u0417\u0430 \u044d\u0442\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b <em>gpcuserextensionnames<\/em> (\u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 GPO \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f) \u0438 <em>gpcmachineextensionnames<\/em> (\u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 GPO \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430). \u042d\u0442\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 GUID Client Side Extension (CSE). \u0421\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 GUID CSE \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 <a href=\"https:\/\/docs.microsoft.com\/ru-ru\/archive\/blogs\/mempson\/group-policy-client-side-extension-list\">\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 Microsoft<\/a>. \u0423 GPO \u0442\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c \u0447\u0435\u0442\u043a\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u0432 \u0438 \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432. \u041a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0434\u043b\u044f GPO \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c <em>gpcfilesyspath<\/em>. \u041f\u0440\u043e\u0449\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b <em>gpcuserextensionnames<\/em> \u0438 <em>gpcmachineextensionnames<\/em> \u2013 \u044d\u0442\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0413\u0440\u0443\u043f\u043f\u043e\u0432\u0430\u044f \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 Default Domain Policy<\/figcaption><\/div>\n<\/figure>\n<p>CSE \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043d\u0430\u0431\u043e\u0440 GUID, \u0430 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0434\u0430\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0433\u0440\u0443\u043f\u043f\u043e\u0432\u0430\u044f \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u0438\u0434\u0435\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c CSE \u0432 \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u0439 \u0432\u0438\u0434 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0432 \u0431\u0430\u0437\u0443 Neo4j. <\/p>\n<p>\u0417\u0430\u0439\u043c\u0435\u043c\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0432 PowerShell. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c hashtable, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f CSE. \u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043f\u0435\u0440\u0435\u0447\u0435\u043d\u044c \u0432\u044b\u0448\u0435.<\/p>\n<pre><code>$GpoGuidRef = @{ '00000000-0000-0000-0000-000000000000' = 'Core GPO Engine' '0E28E245-9368-4853-AD84-6DA3BA35BB75' = 'Preference CSE GUID Environment Variables' '0F6B957D-509E-11D1-A7CC-0000F87571E3' = 'Tool Extension GUID (Computer Policy Settings)' '0F6B957E-509E-11D1-A7CC-0000F87571E3' = 'Tool Extension GUID (User Policy Settings) \/ Restrict Run' '1612b55c-243c-48dd-a449-ffc097b19776' = 'Preference Tool CSE GUID Data Sources' ... '0F3F3735-573D-9804-99E4-AB2A69BA5FD4' = 'Advanced Audit Policy Snapin' } <\/code><\/pre>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0431\u0443\u0434\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432 \u0444\u0430\u0439\u043b:<\/p>\n<pre><code>[string]$OutFile = \"Result_\" + $(Get-Date -f ddMMyyyyhhmmss) + \".log\"<\/code><\/pre>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b <em>gpcuserextensionnames<\/em> \u0438 <em>gpcmachineextensionnames<\/em> \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u0432\u0438\u0434\u0435 [{CSE}{CSE}][{CSE}{CSE}], \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u044b\u0445 \u0438 \u0444\u0438\u0433\u0443\u0440\u043d\u044b\u0445 \u0441\u043a\u043e\u0431\u043e\u043a:   <\/p>\n<pre><code>$extPattern = \"(?&lt;=\\[)[^]]+(?=\\])\" $guidPattern = \"(?&lt;=\\{).+?(?=\\})\"<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438\u0437 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u044b\u0445 \u0441\u043a\u043e\u0431\u043e\u043a, \u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u2013 \u0438\u0437 \u0444\u0438\u0433\u0443\u0440\u043d\u044b\u0445. <\/p>\n<p>\u041d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0448\u0430\u0433\u0435 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0432\u0441\u0435 \u0433\u0440\u0443\u043f\u043f\u043e\u0432\u044b\u0435 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438. \u0417\u0434\u0435\u0441\u044c \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f ADSI-\u0437\u0430\u043f\u0440\u043e\u0441, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0437\u0430\u0442\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f.<\/p>\n<pre><code>$DomainObject = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain() $CurrentDomain = \"LDAP:\/\/\" + ([ADSI]\"\").distinguishedName $Domain = $DomainObject.name  $ObjectSearcher = New-Object System.DirectoryServices.DirectorySearcher([ADSI]$CurrentDomain) $DirEntry = New-Object System.DirectoryServices.DirectoryEntry $ObjectSearcher.SearchRoot = $DirEntry  $ObjectSearcher.Filter = \"(&amp;(objectClass=groupPolicyContainer))\"  $ObjectSearcher.PageSize = 1000 $Objects = $ObjectSearcher.FindAll() <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432 \u0446\u0438\u043a\u043b\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u0432\u043b\u0435\u0447\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b <em>gpcuserextensionnames<\/em>, <em>gpcmachineextensionnames <\/em>\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 objectguid, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 GPO \u0432 \u0431\u0430\u0437\u0435 neo4j. \u041f\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u0445. \u041f\u043e\u0442\u043e\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u044e\u0442 CSE \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0442 \u0432 \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u0439 \u0432\u0438\u0434. \u041d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u044d\u0442\u0430\u043f\u0430\u0445 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043d\u0430\u0431\u043e\u0440 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0441\u0442\u0440\u043e\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 Cypher. <\/p>\n<p>\u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u0431\u0443\u0434\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 <em>MATCH<\/em>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f <em>CALL {}<\/em>.<\/p>\n<pre><code> foreach($object in $Objects) { $objectGuid = [guid]$Object.Properties.objectguid.Item(0)  if ($Object.Properties.gpcmachineextensionnames -ne $null) { $exts = [Regex]::Matches($Object.Properties.gpcmachineextensionnames, $extPattern).Value $collects =  @()  foreach ($ext in $exts) { $guids = [Regex]::Matches($ext, $guidPattern).Value $collects += $GpoGuidRef[$guids] -join ': ' } $collectionGuid =  '\"{0}\"' -f ($collects -join '\",\"') Add-Content $OutFile \"CALL {MATCH (g:GPO) WHERE g.objectid =~ '(?i)$objectGuid' SET g.machineextname = [$collectionGuid]}\" }  if ($Object.Properties.gpcuserextensionnames -ne $null) {  $exts = [Regex]::Matches($Object.Properties. gpcuserextensionnames, $extPattern).Value $collects =  @()  foreach ($ext in $exts) { $guids = [Regex]::Matches($ext, $guidPattern).Value $collects += $GpoGuidRef[$guids] -join ': ' } $collectionGuid =  '\"{0}\"' -f ($collects -join '\",\"') Add-Content $OutFile \"CALL {MATCH (g:GPO) WHERE g.objectid =~ '(?i)$objectGuid' SET g.userextname = [$collectionGuid]}\" }<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432 \u0432\u0438\u0434\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 Cypher.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430\u0434\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432 \u043f\u043e\u043b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432 Browser Neo4j \u0438 \u043d\u0430\u0436\u0430\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443 \u00ab\u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c\u00bb. \u0422\u0435\u043f\u0435\u0440\u044c, \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 BloodHound \u0438 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0433\u0440\u0443\u043f\u043f\u043e\u0432\u0443\u044e \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443, \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 EXTRA PROPERTIES \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u043d\u043e\u0432\u044b\u0435 \u043f\u043e\u043b\u044f.<\/p>\n<figure class=\"\"><\/figure>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0432\u0441\u0435. \u0410 \u043d\u0430\u0448\u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u043f\u043e\u0441\u0442\u044b \u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 BloodHound \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/habr.com\/ru\/company\/solarsecurity\/blog\/681108\/\">\u0437\u0434\u0435\u0441\u044c<\/a>, <a href=\"https:\/\/habr.com\/ru\/company\/solarsecurity\/blog\/707190\/\">\u0437\u0434\u0435\u0441\u044c<\/a> \u0438 <a href=\"https:\/\/habr.com\/ru\/companies\/solarsecurity\/articles\/719714\/\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u0414\u043e \u043d\u043e\u0432\u044b\u0445 \u0432\u0441\u0442\u0440\u0435\u0447!<\/p>\n<p><em>\u0410\u0432\u0442\u043e\u0440: \u0414\u043c\u0438\u0442\u0440\u0438\u0439 \u041d\u0435\u0432\u0435\u0440\u043e\u0432, \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c \u0433\u0440\u0443\u043f\u043f\u044b \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u043e\u0441\u0442\u0438\u00a0\u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, &#171;\u0420\u0422\u041a-\u0421\u043e\u043b\u0430\u0440&#187;<\/em>  <\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/746418\/\"> https:\/\/habr.com\/ru\/articles\/746418\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-406653","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/406653","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=406653"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/406653\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=406653"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=406653"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=406653"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}