Enhance T1496(Resource Hijacking): Add Windows CPU Load Simulation (#3275)
This commit is contained in:
@@ -14,3 +14,24 @@ atomic_tests:
|
||||
yes > /dev/null
|
||||
name: sh
|
||||
|
||||
- name: Windows - Simulate CPU Load with PowerShell
|
||||
description: |
|
||||
This test simulates high CPU load using PowerShell, commonly seen in resource hijacking.
|
||||
Spawns background jobs to stress CPU cores for a specified duration.
|
||||
supported_platforms:
|
||||
- windows
|
||||
input_arguments:
|
||||
duration_seconds:
|
||||
description: Duration in seconds to run the CPU stress test
|
||||
type: integer
|
||||
default: 30
|
||||
cpu_threads:
|
||||
description: Number of threads to stress (default 4)
|
||||
type: integer
|
||||
default: 4
|
||||
executor:
|
||||
command: |
|
||||
$end = (Get-Date).AddSeconds(#{duration_seconds})
|
||||
1..#{cpu_threads} | ForEach-Object { Start-Job { param($t) while((Get-Date) -lt $t) { $i=0; while($i -lt 200000){$i++} } } -ArgumentList $end }
|
||||
Get-Job | Wait-Job | Remove-Job
|
||||
name: powershell
|
||||
|
||||
Reference in New Issue
Block a user