Skip to content

Commit

Permalink
Improve existing persistence rules (#953)
Browse files Browse the repository at this point in the history
* Improve existing persistence rules by limiting their scope, and adding some more details.

* Update persistence/startup-folder/write-file-to-startup-folder.yml

Co-authored-by: Moritz <[email protected]>

* change scope to call for shell command via WRM

* Update persistence/startup-folder/write-file-to-startup-folder.yml

Co-authored-by: Moritz <[email protected]>

* fix startup folder persistence rule

* change name screensaver persistence technique

* change name screensaver persistence technique pt 2

* fix write to startup folder persistence rule

---------

Co-authored-by: Moritz <[email protected]>
  • Loading branch information
jorik-utwente and mr-tz authored Dec 9, 2024
1 parent ed816a8 commit ce5e041
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ rule:
- [email protected]
scopes:
static: function
dynamic: thread
dynamic: call
features:
- and:
- or:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
rule:
meta:
name: reference screen saver executable
name: persist via screensaver registry key
namespace: persistence/screensaver
authors:
- [email protected]
description: SCRNSAVE.EXE registry value specifies the name of the screen saver executable file
scopes:
static: function
dynamic: thread
dynamic: call
att&ck:
- Persistence::Event Triggered Execution::Screensaver [T1546.002]
features:
- and:
- string: "SCRNSAVE.EXE"
- match: set registry value
- string: /Control Panel\\Desktop/i
- string: /^SCRNSAVE.EXE$/i
- optional:
- string: "ScreenSaveTimeOut"
- string: "Control Panel\\Desktop"
- match: set registry value
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ rule:
- [email protected]
scopes:
static: function
dynamic: thread
dynamic: call
att&ck:
- Persistence::Event Triggered Execution::AppInit DLLs [T1546.010]
references:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ rule:
- [email protected]
scopes:
static: function
dynamic: thread
dynamic: call
att&ck:
- Persistence::Event Triggered Execution [T1546]
examples:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ rule:
- [email protected]
scopes:
static: function
dynamic: thread
dynamic: call
att&ck:
- Persistence::Boot or Logon Autostart Execution::Active Setup [T1547.014]
references:
Expand Down
6 changes: 4 additions & 2 deletions persistence/registry/run/persist-via-run-registry-key.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ rule:
- [email protected]
scopes:
static: function
dynamic: thread
dynamic: call
att&ck:
- Persistence::Boot or Logon Autostart Execution::Registry Run Keys / Startup Folder [T1547.001]
mbc:
Expand All @@ -30,5 +30,7 @@ rule:
- string: /User Shell Folders/i
- string: /RunServices/i
- string: /Policies\\Explorer\\Run/i
- string: /Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows\\load/i
- and:
- string: /Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows/i
- string: /Load/i
- string: /System\\CurrentControlSet\\Control\\Session Manager\\BootExecute/i
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ rule:
namespace: persistence/registry/winlogon-helper
authors:
- [email protected]
- [email protected]
scopes:
static: function
dynamic: thread
dynamic: call
att&ck:
- Persistence::Boot or Logon Autostart Execution::Winlogon Helper DLL [T1547.004]
references:
- https://learn.microsoft.com/en-us/previous-versions/windows/desktop/policy/creating-a-policy-callback-function
examples:
- 9ff8e68343cc29c1036650fc153e69f7:0x47f818
features:
Expand All @@ -22,3 +25,7 @@ rule:
- string: /Notify/i
- string: /Userinit/i
- string: /Shell/i
- string: /mpnotify/i
- and:
- string: /GPExtensions/i
- string: /DllName/i
2 changes: 1 addition & 1 deletion persistence/scheduled-tasks/schedule-task-via-at.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ rule:
- joren485
scopes:
static: function
dynamic: thread
dynamic: call
att&ck:
- Persistence::Scheduled Task/Job::At [T1053.002]
examples:
Expand Down
2 changes: 1 addition & 1 deletion persistence/scheduled-tasks/schedule-task-via-schtasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ rule:
- [email protected]
scopes:
static: function
dynamic: thread
dynamic: call
att&ck:
- Persistence::Scheduled Task/Job::Scheduled Task [T1053.005]
examples:
Expand Down
2 changes: 1 addition & 1 deletion persistence/service/persist-via-windows-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ rule:
- [email protected]
scopes:
static: function
dynamic: thread
dynamic: call
att&ck:
- Persistence::Create or Modify System Process::Windows Service [T1543.003]
- Execution::System Services::Service Execution [T1569.002]
Expand Down
21 changes: 15 additions & 6 deletions persistence/startup-folder/write-file-to-startup-folder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ rule:
namespace: persistence/startup-folder
authors:
- [email protected]
- [email protected]
scopes:
static: function
dynamic: thread
Expand All @@ -12,9 +13,17 @@ rule:
examples:
- 07F7846BBCDA782E5639292AD93907EB:0x401040
features:
- and:
- match: get startup folder
- or:
- match: copy file
- match: move file
- match: host-interaction/file-system/write
- or:
- and:
- match: get startup folder
- or:
- match: copy file
- match: move file
- match: write file on Windows
- call:
- and:
- string: /Start Menu\\Programs\\Startup/i
- or:
- match: copy file
- match: move file
- match: write file on Windows

0 comments on commit ce5e041

Please sign in to comment.