-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (27 loc) · 1.11 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Execute and Validate Atomic Test
on: [push]
jobs:
run-atomic-test:
runs-on: windows-latest
name: Run Atomic Test and Display Output
steps:
- uses: actions/checkout@v2
- name: Install and Run Atomic Test
shell: pwsh
run: |
# Install Atomic Red Team
IEX (Invoke-WebRequest 'https://raw.githubusercontent.com/redcanaryco/invoke-atomicredteam/master/install-atomicredteam.ps1' -UseBasicParsing);
Install-AtomicRedTeam -getAtomics -Force
# Define the path and message for the test
$file_contents_path = "$Env:TEMP\test.bin"
$message = "Hello from the Windows Command Prompt!"
# Run Atomic Test T1059.003 - Test #2
Invoke-AtomicTest T1059.003 -TestNumbers 2 -InputArgs @{ "file_contents_path" = $file_contents_path; "message" = $message }
# Output the results
Write-Host "Contents of the file created by the test:"
Get-Content -Path $file_contents_path
- name: Cleanup
shell: pwsh
run: |
$file_contents_path = "$Env:TEMP\test.bin"
Remove-Item -Path $file_contents_path -Force