forked from elastic/detection-rules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbinary_masquerade.py
37 lines (29 loc) · 946 Bytes
/
binary_masquerade.py
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
# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
# or more contributor license agreements. Licensed under the Elastic License
# 2.0; you may not use this file except in compliance with the Elastic License
# 2.0.
import platform
from . import common
from . import RtaMetadata
metadata = RtaMetadata(
uuid="62eb4521-cfb8-4fb8-bc6d-792fe57273b7",
platforms=["macos"],
endpoint=[
{
"rule_name": "Potential Binary Masquerading via Invalid Code Signature",
"rule_id": "4154c8ce-c718-4641-80db-a6a52276f1a4",
}
],
siem=[],
techniques=["T1036"],
)
@common.requires_os(*metadata.platforms)
def main():
if platform.processor() == "arm":
name = "com.apple.sleep_arm"
else:
name = "com.apple.sleep_intel"
path = common.get_path("bin", name)
common.execute([path, "5"], kill=True)
if __name__ == "__main__":
exit(main())