Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mandiant/capa-rules
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v7.4.0
Choose a base ref
...
head repository: mandiant/capa-rules
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v8.0.0
Choose a head ref

Commits on Oct 15, 2024

  1. Copy the full SHA
    60fcf98 View commit details

Commits on Oct 16, 2024

  1. get-process-filename.yml: added x86 support (#945)

    * Added x86 support for get-process-filename.yml
    mwilliams31 authored Oct 16, 2024
    Copy the full SHA
    01e45df View commit details

Commits on Oct 18, 2024

  1. Copy the full SHA
    9917a93 View commit details

Commits on Oct 22, 2024

  1. Copy the full SHA
    9133ab1 View commit details
  2. Merge pull request #947 from mandiant/rules-remove-py38-support

    update analogous to capa repo, removing Python 3.8
    mr-tz authored Oct 22, 2024
    Copy the full SHA
    125419b View commit details

Commits on Oct 25, 2024

  1. tighten scopes

    mr-tz committed Oct 25, 2024
    Copy the full SHA
    7acd831 View commit details

Commits on Oct 28, 2024

  1. Merge pull request #950 from mandiant/fix/enc-scope

    tighten scopes
    mr-tz authored Oct 28, 2024
    Copy the full SHA
    b325cf8 View commit details

Commits on Oct 30, 2024

  1. added detections for reading/writing shadow file, password database (#…

    …949)
    
    * added detections for reading/writing shadow file, password database
    jlmndt authored Oct 30, 2024
    Copy the full SHA
    f880b13 View commit details

Commits on Oct 31, 2024

  1. Copy the full SHA
    29dc617 View commit details

Commits on Nov 5, 2024

  1. Copy the full SHA
    48621e0 View commit details

Commits on Nov 13, 2024

  1. change to COM tag

    jorik-utwente committed Nov 13, 2024
    Copy the full SHA
    1d7ef45 View commit details
  2. change namespaces

    jorik-utwente committed Nov 13, 2024
    Copy the full SHA
    f23aaa7 View commit details
  3. Copy the full SHA
    d95d7b6 View commit details

Commits on Nov 15, 2024

  1. Add rules for various stealer techniques (#960)

    * Add rules for various stealer techniques
    
    Signed-off-by: Still Hsu <dev@stillu.cc>
    
    * Add bytes and replace string with substring
    
    Signed-off-by: Still Hsu <dev@stillu.cc>
    
    * Fix scope for get-steam-token
    
    Signed-off-by: Still Hsu <dev@stillu.cc>
    
    * Add Microsoft Edge in IID/CLSID detection & rename rule to broaden scope of the target
    
    Signed-off-by: Still Hsu <dev@stillu.cc>
    
    * Remove bytes representation of the string as substring supercedes it
    
    Signed-off-by: Still Hsu <dev@stillu.cc>
    
    * Replace string with substring for Steam token rule
    
    Signed-off-by: Still Hsu <dev@stillu.cc>
    
    ---------
    
    Signed-off-by: Still Hsu <dev@stillu.cc>
    Still34 authored Nov 15, 2024
    Copy the full SHA
    993785d View commit details
  2. Copy the full SHA
    2627820 View commit details

Commits on Nov 18, 2024

  1. enable namespace

    mr-tz authored Nov 18, 2024
    Copy the full SHA
    cd12dbf View commit details

Commits on Nov 19, 2024

  1. Merge pull request #963 from mandiant/mr-tz-patch-1

    enable namespace
    mr-tz authored Nov 19, 2024
    Copy the full SHA
    5d02084 View commit details
  2. Merge pull request #952 from jorik-utwente/narrow-dyn-scope-atomic-op…

    …erations
    
    Change dynamic scope to call for atomic operations
    mr-tz authored Nov 19, 2024
    Copy the full SHA
    e50d824 View commit details

Commits on Nov 22, 2024

  1. Copy the full SHA
    82a9d40 View commit details
  2. Copy the full SHA
    5873d7f View commit details

Commits on Nov 25, 2024

  1. Merge pull request #956 from jorik-utwente/add-miscellaneous-persiste…

    …nce-techniques
    
    Add 4 miscellaneous persistence techniques
    mr-tz authored Nov 25, 2024
    Copy the full SHA
    f3bb093 View commit details

Commits on Nov 28, 2024

  1. Add .NET AoT & TouchSocket linking detection (#948)

    * Add initial two rules
    
    Signed-off-by: Still Hsu <dev@stillu.cc>
    
    * Swap sample for a smaller custom compiled one
    
    Signed-off-by: Still Hsu <dev@stillu.cc>
    
    ---------
    
    Signed-off-by: Still Hsu <dev@stillu.cc>
    Still34 authored Nov 28, 2024
    Copy the full SHA
    1649218 View commit details

Commits on Dec 3, 2024

  1. extend rule features and rename (#969)

    * extend rule features
    mr-tz authored Dec 3, 2024
    Copy the full SHA
    1adcf13 View commit details
  2. Add 10 file system-based persistence techniques (#955)

    * Add file system based persistence techniques
    
    ---------
    
    Co-authored-by: Moritz <mr-tz@users.noreply.github.com>
    jorik-utwente and mr-tz authored Dec 3, 2024
    Copy the full SHA
    ed816a8 View commit details

Commits on Dec 9, 2024

  1. Improve existing persistence rules (#953)

    * 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 <mr-tz@users.noreply.github.com>
    
    * change scope to call for shell command via WRM
    
    * Update persistence/startup-folder/write-file-to-startup-folder.yml
    
    Co-authored-by: Moritz <mr-tz@users.noreply.github.com>
    
    * 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 <mr-tz@users.noreply.github.com>
    jorik-utwente and mr-tz authored Dec 9, 2024
    Copy the full SHA
    ce5e041 View commit details
  2. Add 38 new registry-based persistence techniques (#954)

    * Add 38 new registry-based persistence techniques
    
    * fix hhctrl com hijack match statement
    
    * fix core_profiler_path rule
    
    * remove optional from disk cleanup handler rule
    
    * update dotnet_startup_hooks
    
    * improve filter handler rule
    
    * update persist via PATH
    
    * merge task schedule persistence with existing rule
    
    * update UserInitMprLogonScript rule
    
    * merge universal app uri with default file association; add better reference
    jorik-utwente authored Dec 9, 2024
    Copy the full SHA
    e033410 View commit details
Showing with 1,259 additions and 84 deletions.
  1. +2 −3 .github/scripts/create_releases.py
  2. +1 −1 .github/workflows/release.yml
  3. +4 −4 .github/workflows/sync.yml
  4. +4 −4 .github/workflows/tests.yml
  5. +13 −7 anti-analysis/anti-av/block-operations-on-executable-memory-pages-using-arbitrary-code-guard.yml
  6. +25 −0 collection/browser/get-chrome-cookiemonster.yml
  7. +50 −0 collection/browser/get-elevation-service-for-chromium-based-browsers.yml
  8. +16 −0 collection/get-steam-token.yml
  9. +2 −2 data-manipulation/encryption/create-new-key-via-cryptacquirecontext.yml
  10. +1 −1 host-interaction/file-system/copy/copy-file.yml
  11. +1 −1 host-interaction/file-system/move/move-file.yml
  12. +1 −1 host-interaction/file-system/write/write-file-on-windows.yml
  13. +20 −11 host-interaction/process/get-process-filename.yml
  14. +1 −1 host-interaction/registry/create/set-registry-value.yml
  15. +31 −17 host-interaction/wmi/connect-to-wmi-namespace-via-wbemlocator.yml
  16. +1 −1 linking/runtime-linking/access-peb-ldr_data.yml
  17. +27 −0 linking/static/touchsocket/linked-against-touchsocket.yml
  18. +1 −1 nursery/execute-shell-command-via-windows-remote-management.yml
  19. +6 −1 nursery/get-password-database-entry-on-linux.yml
  20. +21 −0 nursery/get-shadow-password-file-entry-on-linux.yml
  21. +1 −1 nursery/hook-routines-via-microsoft-detours.yml
  22. +18 −0 nursery/persist-via-aedebug-registry-key.yml
  23. +17 −0 nursery/persist-via-amsi-registry-key.yml
  24. +17 −0 nursery/persist-via-app-paths-registry-key.yml
  25. +17 −0 nursery/persist-via-appcertdlls-registry-key.yml
  26. +29 −0 nursery/persist-via-application-shimming.yml
  27. +22 −0 nursery/persist-via-appx-registry-key.yml
  28. +19 −0 nursery/persist-via-autodialdll-registry-key.yml
  29. +22 −0 nursery/persist-via-autoplayhandlers-registry-key.yml
  30. +25 −0 nursery/persist-via-bits-job.yml
  31. +18 −0 nursery/persist-via-bootverificationprogram-registry-key.yml
  32. +19 −0 nursery/persist-via-code-signing-registry-key.yml
  33. +23 −0 nursery/persist-via-com-hijack.yml
  34. +19 −0 nursery/persist-via-command-processor-registry-key.yml
  35. +18 −0 nursery/persist-via-contextmenuhandlers-registry-key.yml
  36. +18 −0 nursery/persist-via-cor_profiler_path-registry-value.yml
  37. +21 −0 nursery/persist-via-default-file-association-registry-key.yml
  38. +18 −0 nursery/persist-via-disk-cleanup-handler-registry-key.yml
  39. +18 −0 nursery/persist-via-dotnet-dbgmanageddebugger-registry-key.yml
  40. +18 −0 nursery/persist-via-dotnet_startup_hooks-registry-key.yml
  41. +20 −0 nursery/persist-via-errorhandler-script.yml
  42. +17 −0 nursery/persist-via-explorer-tools-registry-key.yml
  43. +19 −0 nursery/persist-via-filter-handlers-registry-key.yml
  44. +20 −0 nursery/persist-via-get-variable-hijack.yml
  45. +21 −0 nursery/persist-via-group-policy-registry-key.yml
  46. +17 −0 nursery/persist-via-hhctrl-com-hijack.yml
  47. +19 −0 nursery/persist-via-htmlhelp-author-registry-key.yml
  48. +19 −0 nursery/persist-via-image-file-execution-options-registry-key.yml
  49. +20 −0 nursery/persist-via-iphlpapi-dll-hijack.yml
  50. +20 −0 nursery/persist-via-lnk-shortcut.yml
  51. +28 −0 nursery/persist-via-lsa-registry-key.yml
  52. +20 −0 nursery/persist-via-natural-language-registry-key.yml
  53. +17 −0 nursery/persist-via-netsh-registry-key.yml
  54. +18 −0 nursery/persist-via-network-provider-registry-key.yml
  55. +18 −0 nursery/persist-via-path-registry-key.yml
  56. +22 −0 nursery/persist-via-powershell-profile.yml
  57. +19 −0 nursery/persist-via-print-monitors-registry-key.yml
  58. +25 −0 nursery/persist-via-print-processors-registry-key.yml
  59. +19 −0 nursery/persist-via-rdp-startup-programs-registry-key.yml
  60. +5 −5 nursery/{reference-screen-saver-executable.yml → persist-via-screensaver-registry-key.yml}
  61. +18 −0 nursery/persist-via-silentprocessexit-registry-key.yml
  62. +18 −0 nursery/persist-via-telemetrycontroller-registry-key.yml
  63. +19 −0 nursery/persist-via-timeproviders-registry-key.yml
  64. +20 −0 nursery/persist-via-ts-initialprogram-registry-key.yml
  65. +18 −0 nursery/persist-via-userinitmprlogonscript-registry-value.yml
  66. +27 −0 nursery/persist-via-windows-accessibility-tools.yml
  67. +18 −0 nursery/persist-via-windows-error-reporting-registry-key.yml
  68. +21 −0 nursery/persist-via-windows-terminal-profile.yml
  69. +16 −0 nursery/set-shadow-password-file-entry-on-linux.yml
  70. +22 −0 nursery/write-to-browser-extension-directory.yml
  71. +1 −1 persistence/registry/appinitdlls/persist-via-appinit_dlls-registry-key.yml
  72. +1 −1 persistence/registry/ginadll/persist-via-ginadll-registry-key.yml
  73. +1 −1 persistence/registry/persist-via-active-setup-registry-key.yml
  74. +4 −2 persistence/registry/run/persist-via-run-registry-key.yml
  75. +8 −1 persistence/registry/winlogon-helper/persist-via-winlogon-helper-dll-registry-key.yml
  76. +1 −1 persistence/scheduled-tasks/schedule-task-via-at.yml
  77. +19 −8 persistence/scheduled-tasks/schedule-task-via-schtasks.yml
  78. +1 −1 persistence/service/persist-via-windows-service.yml
  79. +15 −6 persistence/startup-folder/write-file-to-startup-folder.yml
  80. +23 −0 runtime/dotnet/compiled-with-dotnet-aot.yml
5 changes: 2 additions & 3 deletions .github/scripts/create_releases.py
Original file line number Diff line number Diff line change
@@ -8,7 +8,6 @@
import logging
import subprocess
import collections
from typing import Dict, Tuple
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter

GIT_EXE = "git"
@@ -23,7 +22,7 @@
logger = logging.getLogger(__name__)


def run_cmd(cmd: str) -> Tuple[str, str]:
def run_cmd(cmd: str) -> tuple[str, str]:
logger.debug("cmd: %s", cmd)
p = subprocess.Popen(cmd.split(" "), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out_, err_ = p.communicate()
@@ -34,7 +33,7 @@ def run_cmd(cmd: str) -> Tuple[str, str]:
return out, err


def get_diffs(cpath1: str, cpath2: str, percentage: str) -> Dict[str, list]:
def get_diffs(cpath1: str, cpath2: str, percentage: str) -> dict[str, list]:
cmd = f"{GIT_EXE} --no-pager diff --find-renames={percentage} --name-status {cpath1} {cpath2}"
gdiff, err = run_cmd(cmd)
# example output:
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ on:
jobs:

create_release:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
permissions:
contents: write
steps:
8 changes: 4 additions & 4 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ on:
branches: [ master ]
jobs:
update_num_rules:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Checkout capa-rules
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
@@ -23,7 +23,7 @@ jobs:
color: blue

sync_submodule_capa:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
needs: update_num_rules
steps:
# Do not checkout submodules as we don't need capa-testfiles and we need to
@@ -50,10 +50,10 @@ jobs:
- name: Get modified files
id: files
uses: Ana06/get-changed-files@25f79e676e7ea1868813e21465014798211fad8c # v2.3.0
- name: Set up Python 3.9
- name: Set up Python 3.12
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: 3.9
python-version: 3.12
- name: Install Python dependencies
run:
pip install pyyaml
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ env:

jobs:
rule_linter:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
env:
# expect this text in the PR body to trigger thorough lint of all rules
LINT_THOROUGH: '[x] lint thorough all'
@@ -43,10 +43,10 @@ jobs:
repository: mandiant/capa-testfiles
path: tests/data
# use latest available python for best performance
- name: Set up Python 3.11
- name: Set up Python 3.12
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: 3.11
python-version: 3.12
- name: Install capa
run: pip install -e .
# Regular lint is fast, so do this first
@@ -100,7 +100,7 @@ jobs:
rules_latest_release:
# e.g. v4
if: startsWith(github.base_ref, 'v')
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Get latest release executable name and version
run: |
Original file line number Diff line number Diff line change
@@ -17,10 +17,16 @@ rule:
examples:
- 2ebadd04f0ada89c36c1409b6e96423a68dd77b513db8db3da203c36d3753e5f:0x140002120
features:
- and:
- api: SetProcessMitigationPolicy
- number: 4 = sizeof(PROCESS_MITIGATION_DYNAMIC_CODE_POLICY)
- number: 1 = ProhibitDynamicCode
- or:
- number: 8 = ProcessDynamicCodePolicy
- offset: 4
- or:
- and:
- api: SetProcessMitigationPolicy
- number: 4 = sizeof(PROCESS_MITIGATION_DYNAMIC_CODE_POLICY)
- number: 1 = set policy.ProhibitDynamicCode to 1
- number: 2 = ProcessDynamicCodePolicy
- and:
- api: SetProcessMitigationPolicy
- number: 4 = sizeof(PROCESS_MITIGATION_BINARY_SIGNATURE_POLICY)
- number: 1 = set policy.MicrosoftSignedOnly to 1
- or:
- number: 8 = ProcessSignaturePolicy
- offset: 4 = lea ecx, [r8+4] ; with r8 equal to 4
25 changes: 25 additions & 0 deletions collection/browser/get-chrome-cookiemonster.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
rule:
meta:
name: get Chrome CookieMonster
namespace: collection/browser
authors:
- still@teamt5.org
description: finds sections related to Chrome's CookieMonster component, typically used in conjunction with code that dumps cookies from Chromium-based browsers
scopes:
static: file
dynamic: process
att&ck:
- Credential Access::Credentials from Password Stores::Credentials from Web Browsers [T1555.003]
references:
- https://github.com/Meckazin/ChromeKatz/blob/main/CookieKatz-BOF/CookieKatzBOF.cpp
examples:
- 79f5cabff898d60cd614e7254d409d9c2e05184416e5c54201e2dc216998d28b:0x117D
features:
- and:
- substring: "network.mojom.NetworkService" # process with CookieMonster
- or:
- substring: "chrome.dll"
- substring: "chrome.exe"
- substring: "msedge.exe"
- substring: "msedgewebview2.exe"
- substring: "msedge.dll"
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
rule:
meta:
name: get elevation service for Chromium-based browsers
namespace: collection/browser
authors:
- still@teamt5.org
description: finds strings/identifiers related to Chrome Elevation Service, typically used in conjunction with retrieving App-bound Encryption related key
scopes:
static: function
dynamic: unsupported # requires bytes features
att&ck:
- Credential Access::Exploitation for Credential Access [T1212]
- Credential Access::Credentials from Password Stores::Credentials from Web Browsers [T1555.003]
references:
- https://gist.github.com/snovvcrash/caded55a318bbefcb6cc9ee30e82f824
- https://chromium.googlesource.com/chromium/src/+/HEAD/chrome/install_static/install_util_unittest.cc
examples:
- fb690a23b66d4f90dac83f1b4d6dec0074aff68d6ef62c2613120bd4d17cfbdd:0x14006E8C0
features:
- and:
- optional:
- string: "APPB"
description: prefix for App-bound Encryption encrypted credentials
- or:
- 2 or more:
- bytes: CF BE 3A 46 0D 41 7F 40 8A F5 0D F3 5A 00 5C C8 = IID for Google Chrome
- bytes: E0 60 88 70 41 F6 11 46 88 95 7D 86 7D D3 67 5B = CLSID for Google Chrome
- substring: "{708860E0-F641-4611-8895-7D867DD3675B}"
description: CLSID for Google Chrome
- 2 or more:
- bytes: 66 1D 72 A2 6E 37 2F 4D 9F 0F 90 70 E9 A4 2B 5F = IID for Google Chrome Beta
- bytes: BA 46 26 DD 07 37 F8 4B B9 A7 03 86 91 A6 8F C2 = CLSID for Google Chrome Beta
- substring: "{DD2646BA-3707-4BF8-B9A7-038691A68FC2}"
description: CLSID for Google Chrome Beta
- 2 or more:
- bytes: 6B A2 2A BB 3A 34 72 40 8B 6F 80 55 7B 8C E5 71 = IID for Google Chrome Dev
- bytes: A5 DC 7F DA AA 2C 37 46 AA 17 07 40 58 4D E7 DA = CLSID for Google Chrome Dev
- substring: "{DA7FDCA5-2CAA-4637-AA17-0740584DE7DA}"
description: CLSID for Google Chrome Dev
- 2 or more:
- bytes: 41 E0 7C 4F E9 28 4F 48 9D D0 61 A8 CA CE FE E4 = IID for Google Chrome Canary
- bytes: 72 28 4C 70 49 20 5E 43 A4 69 0A 53 43 13 C4 2B = CLSID for Google Chrome Canary
- substring: "{704C2872-2049-435E-A469-0A534313C42B}"
description: CLSID for Google Chrome Canary
- 2 or more:
# untested
- bytes: 07 B8 C2 C9 31 77 34 4F 81 B7 44 FF 77 79 52 2B = IID for Microsoft Edge
- bytes: 6C E9 CB 1F 97 16 AF 43 91 40 28 97 C7 C6 97 67 = CLSID for Microsoft Edge
- substring: "{1FCBE96C-1697-43AF-9140-2897C7C69767}"
description: CLSID for Microsoft Edge
16 changes: 16 additions & 0 deletions collection/get-steam-token.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
rule:
meta:
name: get Steam token
namespace: collection
authors:
- still@teamt5.org
description: locates references to Steam authentication token via the beginning of a Steam bearer token
scopes:
static: function
dynamic: unsupported # requires bytes feature
examples:
- 2c83f152e09d0abaa3a3784669e75276784e50e1e202d16ab27e5741eef9ab4f:0x0041718C
features:
- or:
- substring: "65 79 41 69 64 48 6C 77 49 6A 6F 67 49 6B 70 58 56 43 49 73 49 43 4A"
- substring: "eyAidHlwIjogIkpXVCIsICJ"
Original file line number Diff line number Diff line change
@@ -5,8 +5,8 @@ rule:
authors:
- chuong.dong@mandiant.com
scopes:
static: function
dynamic: thread
static: basic block
dynamic: call
att&ck:
- Defense Evasion::Obfuscated Files or Information [T1027]
mbc:
2 changes: 1 addition & 1 deletion host-interaction/file-system/copy/copy-file.yml
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ rule:
- michael.hunhoff@mandiant.com
scopes:
static: function
dynamic: thread
dynamic: call
mbc:
- File System::Copy File [C0045]
examples:
2 changes: 1 addition & 1 deletion host-interaction/file-system/move/move-file.yml
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ rule:
- michael.hunhoff@mandiant.com
scopes:
static: function
dynamic: thread
dynamic: call
mbc:
- File System::Move File [C0063]
examples:
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ rule:
- anushka.virgaonkar@mandiant.com
scopes:
static: function
dynamic: thread
dynamic: call
mbc:
- File System::Writes File [C0052]
examples:
31 changes: 20 additions & 11 deletions host-interaction/process/get-process-filename.yml
Original file line number Diff line number Diff line change
@@ -12,17 +12,26 @@ rule:
- Discovery::Process Discovery [T1057]
references:
- https://learn.microsoft.com/en-us/windows/win32/api/winternl/ns-winternl-peb_ldr_data
- https://research.openanalysis.net/rhadamanthys/config/ida/shifted%20pointers/peb/_list_entry/_ldr_data_table_entry/2023/01/19/rhadamanthys.html#PEB-Walk-_LDR_DATA_TABLE_ENTRY-and-Shifted-Pointers-in-IDA
examples:
- cb948b13a5046a692ec3ed8cc16a9566:0x140013ee2
features:
- and:
# example:
# mov rax, gs:60h ; TEB.ProcessEnvironmentBlock
# mov rcx, [rax+18h] ; PEB64.Ldr
# mov rax, [rcx+20h] ; PEB_LDR_DATA.InMemoryOrderModuleList.Flink
# mov rcx, [rax+50h] ; LDR_DATA_TABLE_ENTRY.FullDllName.Buffer
- arch: amd64
- characteristic: peb access
- offset: 0x18 = PEB->Ldr
- offset: 0x20 = PEB->Ldr->InMemoryOrderModuleList->Flink
- offset: 0x50 = PEB->Ldr->InMemoryOrderModuleList->Flink->FullDllName
- or:
- and:
- arch: i386
- characteristic: peb access
- offset: 0x0C = PEB->Ldr
- offset: 0x14 = PEB->Ldr->InMemoryOrderModuleList->Flink
- offset: 0x28 = PEB->Ldr->InMemoryOrderModuleList->Flink->BaseDllName.Buffer

- and:
# example:
# mov rax, gs:60h ; TEB.ProcessEnvironmentBlock
# mov rcx, [rax+18h] ; PEB64.Ldr
# mov rax, [rcx+20h] ; PEB_LDR_DATA.InMemoryOrderModuleList.Flink
# mov rcx, [rax+50h] ; LDR_DATA_TABLE_ENTRY.BaseDllName.Buffer
- arch: amd64
- characteristic: peb access
- offset: 0x18 = PEB->Ldr
- offset: 0x20 = PEB->Ldr->InMemoryOrderModuleList->Flink
- offset: 0x50 = PEB->Ldr->InMemoryOrderModuleList->Flink->BaseDllName.Buffer
2 changes: 1 addition & 1 deletion host-interaction/registry/create/set-registry-value.yml
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ rule:
- michael.hunhoff@mandiant.com
scopes:
static: function
dynamic: thread
dynamic: call
mbc:
- Operating System::Registry::Set Registry Key [C0036.001]
examples:
48 changes: 31 additions & 17 deletions host-interaction/wmi/connect-to-wmi-namespace-via-wbemlocator.yml
Original file line number Diff line number Diff line change
@@ -7,26 +7,40 @@ rule:
- michael.hunhoff@mandiant.com
scopes:
static: function
dynamic: unsupported # requires offset, bytes features
dynamic: call
att&ck:
- Execution::Windows Management Instrumentation [T1047]
examples:
- al-khaser_x64.exe_:0x14001956e
- al-khaser_x86.exe_:0x00445270
features:
- and:
- basic block:
- and:
- api: ole32.CoCreateInstance
- com/class: WbemLocator # 11 F8 90 45 3A 1D D0 11 89 1F 00 AA 00 4B 2E 24 = CLSID_WbemLocator
- com/interface: IWbemLocator # 87 A6 12 DC 7F 73 CF 11 88 4D 00 AA 00 4B 2E 24 = IID_IWbemLocator
- or:
- and:
- arch: i386
- offset: 0xC = ppv->ConnectServer
- and:
- arch: amd64
- offset: 0x18 = ppv->ConnectServer
- optional:
- string: /ROOT\\CIMV2/i
- string: /ROOT\\DEFAULT/i
- or:
- call:
- description: dynamic detection rule
- or:
- and:
- api: ole32.CoCreateInstance
- com/class: WbemLocator # 11 F8 90 45 3A 1D D0 11 89 1F 00 AA 00 4B 2E 24 = CLSID_WbemLocator
- and:
- match: host-interaction/process/create
- or:
- string: /wmic(|\.exe) /i
- string: /Register-WMIEvent /i
- and:
- description: static detection rule
- basic block:
- and:
- api: ole32.CoCreateInstance
- com/class: WbemLocator # 11 F8 90 45 3A 1D D0 11 89 1F 00 AA 00 4B 2E 24 = CLSID_WbemLocator
- com/interface: IWbemLocator # 87 A6 12 DC 7F 73 CF 11 88 4D 00 AA 00 4B 2E 24 = IID_IWbemLocator
- basic block:
- or:
- and:
- arch: i386
- offset: 0xC = ppv->ConnectServer
- and:
- arch: amd64
- offset: 0x18 = ppv->ConnectServer
- optional:
- string: /ROOT\\CIMV2/i
- string: /ROOT\\DEFAULT/i
2 changes: 1 addition & 1 deletion linking/runtime-linking/access-peb-ldr_data.yml
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ rule:
att&ck:
- Execution::Shared Modules [T1129]
references:
- https://www.geoffchappell.com/studies/windows/win32/ntdll/structs/peb_ldr_data.htm
- https://www.geoffchappell.com/studies/windows/km/ntoskrnl/inc/api/ntpsapi_x/peb_ldr_data.htm
- https://github.com/d35ha/CallObfuscator/blob/5834aff9ff4511f1408ae4ce80b79737af4ae77b/ShellCode/shell_x64.asm#L8
examples:
- 3FDFB2D522E7DEECAAAF2F87420F7E75:0x4117B7
27 changes: 27 additions & 0 deletions linking/static/touchsocket/linked-against-touchsocket.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
rule:
meta:
name: linked against TouchSocket
namespace: linking/static/touchsocket
authors:
- still@teamt5.org
description: TouchSocket is a .NET networking library, supporting a wide variety of protocol types such as WebSocket, RPC, DMTP, Modbus, and more.
scopes:
static: file
dynamic: file
references:
- https://github.com/RRQM/TouchSocket/
- https://www.trendmicro.com/en_us/research/24/i/earth-preta-new-malware-and-strategies.html
examples:
- 684cc28e6a7fbd12f23dbc563f06306555ebb870bd727ad60839d4ff26e7f3b2
features:
- and:
- or:
- match: compiled to the .NET platform
- match: compiled with .NET AoT
- 3 or more:
- substring: "TouchSocket"
- substring: "TouchSocket.Core"
- substring: "TouchSocket.Dmtp"
- substring: "TouchSocket.Modbus"
- substring: "BinarySerialize"
- substring: "BinaryDeserialize"
Loading