Skip to content

Commit 19d48ab

Browse files
authored
Add rules linked-against-funchook.yml and linked-against-plthook.yml (#1073)
1 parent 13e8622 commit 19d48ab

File tree

2 files changed

+92
-0
lines changed

2 files changed

+92
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
rule:
2+
meta:
3+
name: linked against Funchook
4+
namespace: linking/static/funchook
5+
authors:
6+
7+
description: Match on files linked with the Funchook hooking library.
8+
scopes:
9+
static: file
10+
dynamic: file
11+
att&ck:
12+
- Defense Evasion::Hijack Execution Flow [T1574]
13+
references:
14+
- https://github.com/kubo/funchook
15+
examples:
16+
- 749cf36adc5513c92c7acc836d20935e3c433f3c2d5641293e7a9c57c5ce22c2
17+
features:
18+
- or:
19+
- export: "funchook_hook_caller_asm"
20+
- 3 or more:
21+
- string: "Enter funchook_create()"
22+
- string: "Leave funchook_create() => %p"
23+
- string: "Enter funchook_prepare(%p, %p, %p)"
24+
- string: "Leave funchook_prepare(..., [%p->%p],...) => %d"
25+
- string: "Enter funchook_install(%p, 0x%x)"
26+
- string: "Leave funchook_install() => %d"
27+
- string: "Enter funchook_uninstall(%p, 0x%x)"
28+
- string: "Leave funchook_uninstall() => %d"
29+
- string: "Enter funchook_destroy(%p)"
30+
- string: "Leave funchook_destroy() => %d"
31+
- string: "Could not modify already-installed funchook handle."
32+
- string: "Failed to protect memory %p (size=%"
33+
- string: "Failed to unprotect memory %p (size=%"
34+
- string: "Failed to unprotect page %p (size=%"
35+
- string: "Failed to protect page %p (size=%"
36+
- string: "Failed to deallocate page %p (size=%"
37+
- string: "Could not find a free region near %p"
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
rule:
2+
meta:
3+
name: linked against PLTHook
4+
namespace: linking/static/plthook
5+
authors:
6+
7+
description: Match on files linked with the PLTHook hooking library.
8+
scopes:
9+
static: file
10+
dynamic: file
11+
att&ck:
12+
- Defense Evasion::Hijack Execution Flow [T1574]
13+
references:
14+
- https://github.com/kubo/plthook
15+
examples:
16+
- c2c3b3eea177b9411bc92a8800b40529fcd2d5c3696e71cbb2f4025429b314ee
17+
features:
18+
- or:
19+
- string: "plthook_open"
20+
- string: "plthook_open_by_handle"
21+
- string: "plthook_open_by_address"
22+
- string: "plthook_enum"
23+
- string: "plthook_replace"
24+
- string: "plthook_close"
25+
- string: "plthook_error"
26+
- export: "plthook_open"
27+
- export: "plthook_open_by_handle"
28+
- export: "plthook_open_by_address"
29+
- export: "plthook_enum"
30+
- export: "plthook_replace"
31+
- export: "plthook_close"
32+
- export: "plthook_error"
33+
- 3 or more:
34+
- string: "Cannot get module %s: "
35+
- string: "Cannot get module at address %p: "
36+
- string: "ImageDirectoryEntryToData error: "
37+
- string: "invalid argument: The first argument is null."
38+
- string: "no such function: %s"
39+
- string: "Could not find an address in the specified handle."
40+
- string: "Could not find memory region containing address %p"
41+
- string: "Could not open %s: %s"
42+
- string: "Could not find r_debug"
43+
- string: "Opening the main program is not supported on this platform."
44+
- string: "failed to open /proc/self/maps"
45+
- string: "Could not find memory region containing %p"
46+
- string: "Unexcepted memory permission %s at %p"
47+
- string: "failed to call kinfo_getvmmap()"
48+
- string: "Unknown kve_protection 0x%x at %p"
49+
- string: "Unknown pr_mflags 0x%x at %p"
50+
- string: "failed to find DT_SYMTAB"
51+
- string: "failed to find DT_STRTAB"
52+
- string: "failed to find DT_STRSZ"
53+
- string: "failed to find DT_PLTRELSZ"
54+
- string: "failed to find PLT_DT_RELENT"
55+
- string: "failed to allocate memory: %"

0 commit comments

Comments
 (0)