Skip to content

Commit 8c8e268

Browse files
committed
refine BITS rules and add pendingfilerenameoperations persistence rule
1 parent 384cc6b commit 8c8e268

4 files changed

Lines changed: 25 additions & 34 deletions

File tree

communication/http/client/create-bits-job.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ rule:
55
namespace: communication/http/client
66
authors:
77
- "@mr-tz"
8-
description: BITS jobs can be used to download data or achieve persistence (via SetNotifyCmdLine)
8+
description: create a Windows BITS job via COM or command-line tooling
99
scopes:
1010
static: function
1111
dynamic: unsupported # requires offset, bytes features
@@ -17,13 +17,10 @@ rule:
1717
examples:
1818
- 08ac667c65d36d6542917655571e61c8.exe_:0x401E78
1919
features:
20-
- and:
20+
- or:
2121
- and:
2222
- bytes: 0D 4C E3 5C C9 0D 1F 4C 89 7C DA A1 B7 8C EE 7C = IBackgroundCopyManager
2323
- bytes: 4B D3 91 49 A1 80 91 42 83 B6 33 28 36 6B 90 97 = BITS_ControlClass
2424
- offset: 0xC = IBackgroundCopyManagerVtbl.CreateJob
25-
- offset: 0x10 = IBackgroundCopyJobVtbl.AddFile
26-
- optional:
27-
- description: SetNotifyCmdLine may be use to persist
28-
- bytes: 39 07 B5 54 6F 68 EB 45 9D FF D6 A9 A0 FA A9 AF = IBackgroundCopyJob2
29-
- offset: 0x8C = IBackgroundCopyJob2Vtbl.SetNotifyCmdLine
25+
- string: /\bbitsadmin(?:\.exe)?\b.{0,80}\b\/create\b/i
26+
- string: /\bStart-BitsTransfer\b/i

communication/http/client/transfer-files-via-bits.yml

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,23 @@ rule:
44
namespace: communication/http/client
55
authors:
66
- akshat4703
7-
description: detect file transfer via Windows Background Intelligent Transfer Service (BITS), excluding persistence-focused NotifyCmdLine usage
7+
description: transfer files using a BITS job
88
scopes:
99
static: function
10-
dynamic: call
10+
dynamic: unsupported # requires offset, bytes features
1111
att&ck:
1212
- Defense Evasion::BITS Jobs [T1197]
1313
references:
14-
- https://www.mandiant.com/resources/attacker-use-of-windows-background-intelligent-transfer-service
15-
- https://learn.microsoft.com/en-us/windows/win32/bits/background-intelligent-transfer-service-portal
14+
- https://cloud.google.com/blog/topics/threat-intelligence/attacker-use-of-windows-background-intelligent-transfer-service/
15+
- https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/bitsadmin
16+
- https://learn.microsoft.com/en-us/powershell/module/bitstransfer/start-bitstransfer
1617
examples:
1718
- 08ac667c65d36d6542917655571e61c8.exe_:0x401E78
1819
features:
19-
- or:
20+
- and:
2021
- match: create BITS job
21-
- and:
22-
- match: host-interaction/process/create
23-
- or:
24-
- and:
25-
- string: /\bbitsadmin(\.exe)?\b/i
26-
- string: /\/(transfer|addfile)\b/i
27-
- string: /\bStart-BitsTransfer\b/i
28-
- string: /Set-BitsTransfer /i
29-
- not:
30-
- string: /\/SetNotifyCmdLine\b/i
31-
- not:
32-
- string: /\s-NotifyCmdLine\b/i
22+
- or:
23+
- offset: 0x10 = IBackgroundCopyJobVtbl.AddFile
24+
- string: /\bbitsadmin(?:\.exe)?\b.{0,80}\b\/addfile\b/i
25+
- string: /\bbitsadmin(?:\.exe)?\b.{0,80}\b\/transfer\b/i
26+
- string: /\bSet-BitsTransfer\b/i

nursery/persist-via-bits-job.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ rule:
1616
- match: host-interaction/process/create
1717
- or:
1818
- and:
19-
- string: /bitsadmin(|\.exe) /i
20-
- string: /\/SetNotifyCmdLine/i
19+
- string: /\bbitsadmin(?:\.exe)?\b/i
20+
- string: /\b\/SetNotifyCmdLine\b/i
2121
- and:
2222
- or:
23-
- string: /Set-BitsTransfer /i
24-
- string: /Start-BitsTransfer /i
25-
- string: / -NotifyCmdLine /i
23+
- string: /\bSet-BitsTransfer\b/i
24+
- string: /\bStart-BitsTransfer\b/i
25+
- string: /\b-NotifyCmdLine\b/i

nursery/persist-via-pendingfilerenameoperations-registry-value.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ rule:
44
namespace: persistence/registry
55
authors:
66
- akshat4703
7+
description: persist by queuing file rename or delete operations via Session Manager at next reboot
78
scopes:
89
static: function
910
dynamic: span of calls
11+
att&ck:
12+
- Persistence::Boot or Logon Autostart Execution::Registry Run Keys / Startup Folder [T1547.001]
1013
references:
1114
- https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-movefileexa
1215
- https://forensicatorj.wordpress.com/2014/06/25/interpreting-the-pendingfilerenameoperations-registry-key-for-forensics/
1316
examples:
1417
- ac742739cae0d411dfcb78ae99a7baee:0x140002318
1518
features:
1619
- and:
17-
- or:
18-
- match: set registry value
19-
- number: 0x80000002 = HKEY_LOCAL_MACHINE
20-
- string: /System\\(ControlSet\d{3}|CurrentControlSet)\\Control\\Session Manager/i
21-
- string: /PendingFileRenameOperations/i
20+
- match: set registry value
21+
- string: /\bSystem\\(ControlSet\d{3}|CurrentControlSet)\\Control\\Session Manager\\PendingFileRenameOperations\b/i

0 commit comments

Comments
 (0)