forked from elastic/detection-rules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
edmond_child_process.py
34 lines (24 loc) · 1010 Bytes
/
edmond_child_process.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
# 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.
from . import common
from . import RtaMetadata
metadata = RtaMetadata(
uuid="58041706-c636-4043-b221-3d59f977b7e2",
platforms=["macos"],
endpoint=[{"rule_name": "Potential Persistence via Emond", "rule_id": "1cd247d8-00e8-4c62-b9ee-90cd1811460b"}],
siem=[{"rule_name": "Suspicious Emond Child Process", "rule_id": "3e3d15c6-1509-479a-b125-21718372157e"}],
techniques=["T1546"],
)
@common.requires_os(*metadata.platforms)
def main():
masquerade = "/tmp/emond"
common.create_macos_masquerade(masquerade)
# Execute command
common.log("Launching bash from fake emond command")
common.execute([masquerade], timeout=10, kill=True)
# cleanup
common.remove_file(masquerade)
if __name__ == "__main__":
exit(main())