-
Notifications
You must be signed in to change notification settings - Fork 26
/
INFO_Macho_ExternalLibary_Load_Count.yar
114 lines (91 loc) · 3.31 KB
/
INFO_Macho_ExternalLibary_Load_Count.yar
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
rule INFO_Macho_ExternalLibary_Load_Count_0
{
meta:
author = "Greg Lesnewich"
date = "2023-01-24"
version = "1.0"
description = "highlight the volume of external libraries loaded by a Macho sample, derived from number of LOAD_DYLIB commands in the LoadCommand header"
strings:
$load_cmd = {00 00 00 00 0C 00 00 00}
condition:
(uint32be(0x0) == 0xCAFEBABE or uint32be(0x0) == 0xCFFAEDFE or uint32be(0x0) == 0xCEFAEDFE) and
#load_cmd in (0 .. 0x1000) == 0
}
rule INFO_Macho_ExternalLibary_Load_Count_1
{
meta:
author = "Greg Lesnewich"
date = "2023-01-24"
version = "1.0"
description = "highlight the volume of external libraries loaded by a Macho sample, derived from number of LOAD_DYLIB commands in the LoadCommand header"
strings:
$load_cmd = {00 00 00 00 0C 00 00 00}
condition:
(uint32be(0x0) == 0xCAFEBABE or uint32be(0x0) == 0xCFFAEDFE or uint32be(0x0) == 0xCEFAEDFE) and
#load_cmd in (0 .. 0x1000) == 1
}
rule INFO_Macho_ExternalLibary_Load_Count_2
{
meta:
author = "Greg Lesnewich"
date = "2023-01-24"
version = "1.0"
description = "highlight the volume of external libraries loaded by a Macho sample, derived from number of LOAD_DYLIB commands in the LoadCommand header"
strings:
$load_cmd = {00 00 00 00 0C 00 00 00}
condition:
(uint32be(0x0) == 0xCAFEBABE or uint32be(0x0) == 0xCFFAEDFE or uint32be(0x0) == 0xCEFAEDFE) and
#load_cmd in (0 .. 0x1000) == 2
}
rule INFO_Macho_ExternalLibary_Load_Count_3
{
meta:
author = "Greg Lesnewich"
date = "2023-01-24"
version = "1.0"
description = "highlight the volume of external libraries loaded by a Macho sample, derived from number of LOAD_DYLIB commands in the LoadCommand header"
strings:
$load_cmd = {00 00 00 00 0C 00 00 00}
condition:
(uint32be(0x0) == 0xCAFEBABE or uint32be(0x0) == 0xCFFAEDFE or uint32be(0x0) == 0xCEFAEDFE) and
#load_cmd in (0 .. 0x1000) == 3
}
rule INFO_Macho_ExternalLibary_Load_Count_4
{
meta:
author = "Greg Lesnewich"
date = "2023-01-24"
version = "1.0"
description = "highlight the volume of external libraries loaded by a Macho sample, derived from number of LOAD_DYLIB commands in the LoadCommand header"
strings:
$load_cmd = {00 00 00 00 0C 00 00 00}
condition:
(uint32be(0x0) == 0xCAFEBABE or uint32be(0x0) == 0xCFFAEDFE or uint32be(0x0) == 0xCEFAEDFE) and
#load_cmd in (0 .. 0x1000) == 4
}
rule INFO_Macho_ExternalLibary_Load_Count_5
{
meta:
author = "Greg Lesnewich"
date = "2023-01-24"
version = "1.0"
description = "highlight the volume of external libraries loaded by a Macho sample, derived from number of LOAD_DYLIB commands in the LoadCommand header"
strings:
$load_cmd = {00 00 00 00 0C 00 00 00}
condition:
(uint32be(0x0) == 0xCAFEBABE or uint32be(0x0) == 0xCFFAEDFE or uint32be(0x0) == 0xCEFAEDFE) and
#load_cmd in (0 .. 0x1000) == 5
}
rule INFO_Macho_ExternalLibary_Load_Count_More_Than_5
{
meta:
author = "Greg Lesnewich"
date = "2023-01-24"
version = "1.0"
description = "highlight the volume of external libraries loaded by a Macho sample, derived from number of LOAD_DYLIB commands in the LoadCommand header"
strings:
$load_cmd = {00 00 00 00 0C 00 00 00}
condition:
(uint32be(0x0) == 0xCAFEBABE or uint32be(0x0) == 0xCFFAEDFE or uint32be(0x0) == 0xCEFAEDFE) and
#load_cmd in (0 .. 0x1000) > 5
}