| Title | Default PowerSploit Schtasks Persistence |
|:---------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Description | Detects the creation of a schtask via PowerSploit Default Configuration |
| ATT&CK Tactic |
- [TA0002: Execution](https://attack.mitre.org/tactics/TA0002)
- [TA0003: Persistence](https://attack.mitre.org/tactics/TA0003)
|
| ATT&CK Technique | - [T1053: Scheduled Task](https://attack.mitre.org/techniques/T1053)
- [T1086: PowerShell](https://attack.mitre.org/techniques/T1086)
|
| Data Needed | - [DN_0024_21_windows_sysmon_WmiEvent](../Data_Needed/DN_0024_21_windows_sysmon_WmiEvent.md)
- [DN_0022_19_windows_sysmon_WmiEvent](../Data_Needed/DN_0022_19_windows_sysmon_WmiEvent.md)
- [DN_0010_6_windows_sysmon_driver_loaded](../Data_Needed/DN_0010_6_windows_sysmon_driver_loaded.md)
- [DN_0015_11_windows_sysmon_FileCreate](../Data_Needed/DN_0015_11_windows_sysmon_FileCreate.md)
- [DN_0008_4_windows_sysmon_sysmon_service_state_changed](../Data_Needed/DN_0008_4_windows_sysmon_sysmon_service_state_changed.md)
- [DN_0014_10_windows_sysmon_ProcessAccess](../Data_Needed/DN_0014_10_windows_sysmon_ProcessAccess.md)
- [DN_0018_14_windows_sysmon_RegistryEvent](../Data_Needed/DN_0018_14_windows_sysmon_RegistryEvent.md)
- [DN_0007_3_windows_sysmon_network_connection](../Data_Needed/DN_0007_3_windows_sysmon_network_connection.md)
- [DN_0016_12_windows_sysmon_RegistryEvent](../Data_Needed/DN_0016_12_windows_sysmon_RegistryEvent.md)
- [DN_0011_7_windows_sysmon_image_loaded](../Data_Needed/DN_0011_7_windows_sysmon_image_loaded.md)
- [DN_0021_18_windows_sysmon_PipeEvent](../Data_Needed/DN_0021_18_windows_sysmon_PipeEvent.md)
- [DN_0023_20_windows_sysmon_WmiEvent](../Data_Needed/DN_0023_20_windows_sysmon_WmiEvent.md)
- [DN_0017_13_windows_sysmon_RegistryEvent](../Data_Needed/DN_0017_13_windows_sysmon_RegistryEvent.md)
- [DN_0019_15_windows_sysmon_FileCreateStreamHash](../Data_Needed/DN_0019_15_windows_sysmon_FileCreateStreamHash.md)
- [DN_0020_17_windows_sysmon_PipeEvent](../Data_Needed/DN_0020_17_windows_sysmon_PipeEvent.md)
- [DN_0003_1_windows_sysmon_process_creation](../Data_Needed/DN_0003_1_windows_sysmon_process_creation.md)
- [DN_0012_8_windows_sysmon_CreateRemoteThread](../Data_Needed/DN_0012_8_windows_sysmon_CreateRemoteThread.md)
- [DN_0006_2_windows_sysmon_process_changed_a_file_creation_time](../Data_Needed/DN_0006_2_windows_sysmon_process_changed_a_file_creation_time.md)
- [DN_0013_9_windows_sysmon_RawAccessRead](../Data_Needed/DN_0013_9_windows_sysmon_RawAccessRead.md)
- [DN_0009_5_windows_sysmon_process_terminated](../Data_Needed/DN_0009_5_windows_sysmon_process_terminated.md)
|
| Trigger | - [T1053: Scheduled Task](../Triggers/T1053.md)
- [T1086: PowerShell](../Triggers/T1086.md)
|
| Severity Level | high |
| False Positives | - False positives are possible, depends on organisation and processes
|
| Development Status | experimental |
| References | - [https://github.com/0xdeadbeefJERKY/PowerSploit/blob/8690399ef70d2cad10213575ac67e8fa90ddf7c3/Persistence/Persistence.psm1](https://github.com/0xdeadbeefJERKY/PowerSploit/blob/8690399ef70d2cad10213575ac67e8fa90ddf7c3/Persistence/Persistence.psm1)
|
| Author | Markus Neis |
| Other Tags | - attack.privelege_escalation
- attack.s0111
- attack.s0111
- attack.g0022
- attack.g0022
- attack.g0060
- attack.g0060
|
## Detection Rules
### Sigma rule
```
title: Default PowerSploit Schtasks Persistence
status: experimental
description: Detects the creation of a schtask via PowerSploit Default Configuration
references:
- https://github.com/0xdeadbeefJERKY/PowerSploit/blob/8690399ef70d2cad10213575ac67e8fa90ddf7c3/Persistence/Persistence.psm1
author: Markus Neis
date: 2018/03/06
logsource:
product: windows
service: sysmon
detection:
selection:
ParentImage:
- '*\Powershell.exe'
CommandLine:
- '*\schtasks.exe*/Create*/RU*system*/SC*ONLOGON*'
- '*\schtasks.exe*/Create*/RU*system*/SC*DAILY*'
- '*\schtasks.exe*/Create*/RU*system*/SC*ONIDLE*'
- '*\schtasks.exe*/Create*/RU*system*/SC*HOURLY*'
condition: selection
tags:
- attack.execution
- attack.persistence
- attack.privelege_escalation
- attack.t1053
- attack.t1086
- attack.s0111
- attack.g0022
- attack.g0060
falsepositives:
- False positives are possible, depends on organisation and processes
level: high
```
### Kibana query
```
(ParentImage.keyword:(*\\\\Powershell.exe) AND CommandLine.keyword:(*\\\\schtasks.exe*\\/Create*\\/RU*system*\\/SC*ONLOGON* *\\\\schtasks.exe*\\/Create*\\/RU*system*\\/SC*DAILY* *\\\\schtasks.exe*\\/Create*\\/RU*system*\\/SC*ONIDLE* *\\\\schtasks.exe*\\/Create*\\/RU*system*\\/SC*HOURLY*))
```
### X-Pack Watcher
```
curl -s -XPUT -H \'Content-Type: application/json\' --data-binary @- localhost:9200/_xpack/watcher/watch/Default-PowerSploit-Schtasks-Persistence <