mirror of
https://github.com/Yamato-Security/WELA.git
synced 2026-10-23 22:53:00 +02:00
Count the root in bounded WMI descriptor evidence
This commit is contained in:
1 parent
e34ede7c38
commit
488d179f09
2 files changed
+5
No files matched your search
@@ -52,6 +52,9 @@ function Get-WelaWmiDescendants {
|
||||
try {
|
||||
if($Namespace -cnotmatch '^root(\\[A-Za-z_][A-Za-z0-9_]{0,63}){1,8}$'){throw 'An exact local WMI namespace is required.'}
|
||||
$root=Get-WelaWmiNamespaceSnapshot $Namespace
|
||||
if($root.Namespace -cne $Namespace -or -not $root.DescriptorJson -or -not $root.DescriptorMof){throw 'Incomplete selected namespace descriptor.'}
|
||||
$bytes=[Text.Encoding]::UTF8.GetByteCount($root.DescriptorJson+$root.DescriptorMof)
|
||||
if($bytes -gt 2097152){throw 'WMI tree descriptor evidence exceeds two MiB.'}
|
||||
$queue.Enqueue([pscustomobject]@{Namespace=$Namespace;Depth=0;ProtectedBarrier=$false})
|
||||
$null=$seen.Add($Namespace)
|
||||
while($queue.Count){
|
||||
|
||||
Reference in new issue
Block a user