Class/Enterprise/EnterpriseMalware.psm1
using module ./PSAttck/Class/Enterprise/Enterprise.psm1 class EnterpriseMalware : Enterprise { [String] $CreatedByReference [String] $Revoked [System.Collections.ArrayList] $Label [System.Collections.ArrayList] $Platform EnterpriseMalware($JsonObject) : base($JsonObject) { $this.Label = $this.SetListAttribute($JsonObject, 'labels') $this.Platform = $this.SetListAttribute($JsonObject, 'x_mitre_platforms') $this.CreatedByReference = $this.SetAttribute($JsonObject, 'created_by_ref') $this.Revoked = $this.SetAttribute($JsonObject, 'revoked') } [System.Collections.ArrayList] Actors(){ $returnObject = [System.Collections.ArrayList]::new() $actorObj = @{} $global:PSAttckJson.objects.Where{$_.type -eq 'intrusion-set'}.ForEach{ $actorObj[$_.id] = $_ } [Enterprise]::relationships[$this.Stix].ForEach{ if ($actorObj[$_]){ $returnObject.Add((New-AttckObject -Object $actorObj[$_] -Type 'EnterpriseActor')) } } return $returnObject } [System.Collections.ArrayList] Techniques(){ $returnObject = [System.Collections.ArrayList]::new() $techniqueObj = @{} $global:PSAttckJson.objects.Where{$_.type -eq 'attack-pattern'}.ForEach{ $techniqueObj[$_.id] = $_ } [Enterprise]::relationships[$this.Stix].ForEach{ if ($techniqueObj[$_]){ $returnObject.Add((New-AttckObject -Object $techniqueObj[$_] -Type 'EnterpriseTechnique')) } } return $returnObject } } |