Create Invoke-AtomicEnterpriseLayer.ps1

main
Rahmat Nurfauzi 2023-01-17 04:49:23 +07:00 committed by GitHub
parent 223c9376a5
commit c56e13184c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,37 @@
Import-Module C:\AtomicRedTeam\invoke-atomicredteam\Invoke-AtomicRedTeam.psm1
Set-ExecutionPolicy Bypass -Force
function Invoke-AtomicEnterpriseLayer {
Param(
[parameter(Mandatory=$true)]
[String]
$Group
)
$unixdate = [int][double]::Parse((Get-Date -UFormat %s))
Start-Transcript -NoClobber -IncludeInvocationHeader -Path "Atomic-EnterpriseLayer-$unixdate.txt"
$web = New-Object Net.WebClient
$mitre = $web.DownloadString("https://attack.mitre.org/groups/$Group/$Group-enterprise-layer.json")
$layer = $mitre | ConvertFrom-Json
$techniques = $layer.techniques.techniqueID
$name = $layer.name
$desc = $layer.description
Write-Output ""
Write-Output "[+] Name : $name"
Write-Output "[+] Description : $desc"
Start-Sleep 3
Write-Output "[+] Running Atomic Red Team"
foreach($id in $techniques) {
Invoke-AtomicTest $id
}
Write-Output "[+] Done"
}