-
Notifications
You must be signed in to change notification settings - Fork 505
/
cve_2019_14287.py
44 lines (35 loc) · 1.21 KB
/
cve_2019_14287.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
38
39
40
41
42
43
44
# 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 sys
from . import RtaMetadata, common
metadata = RtaMetadata(
uuid="df91f5f2-a0a0-47e8-848b-d01526a43d60",
platforms=["linux"],
endpoint=[
{
"rule_name": "Potential Sudo Privilege Escalation via CVE-2019-14287",
"rule_id": "b382c343-892d-46e1-8fad-22576a086598",
},
],
siem=[
{
"rule_name": "Potential Sudo Privilege Escalation via CVE-2019-14287",
"rule_id": "8af5b42f-8d74-48c8-a8d0-6d14b4197288",
},
],
techniques=["T1068"],
)
@common.requires_os(*metadata.platforms)
def main() -> None:
masquerade = "/tmp/sudo"
source = common.get_path("bin", "linux.ditto_and_spawn")
common.copy_file(source, masquerade)
# Execute command
common.log("Launching fake sudo command to simulate CVE-2019-14287")
common.execute([masquerade, "-u#-1"], timeout=5, kill=True)
# cleanup
common.remove_file(masquerade)
if __name__ == "__main__":
sys.exit(main())