Skip to content

Commit 52eb22d

Browse files
Sync RTA Suspicious Execution from Foomatic-rip or Cupsd Parent (#4201)
Co-authored-by: shashank-elastic <[email protected]> (cherry picked from commit 933020a)
1 parent 37a5c3d commit 52eb22d

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
2+
# or more contributor license agreements. Licensed under the Elastic License
3+
# 2.0; you may not use this file except in compliance with the Elastic License
4+
# 2.0.
5+
6+
import sys
7+
from . import RtaMetadata, common
8+
9+
metadata = RtaMetadata(
10+
uuid="00a75607-9f1d-45c1-a9d8-41229cdb561f",
11+
platforms=["linux"],
12+
endpoint=[
13+
{
14+
"rule_name": "Suspicious Execution from Foomatic-rip or Cupsd Parent",
15+
"rule_id": "7c4d6361-3e7f-481a-9313-d1d1c0e5a3a9",
16+
},
17+
],
18+
techniques=["T1203"],
19+
)
20+
21+
22+
@common.requires_os(*metadata.platforms)
23+
def main() -> None:
24+
common.log("Creating a fake executable..")
25+
masquerade = "/tmp/foomatic-rip"
26+
27+
source = common.get_path("bin", "netcon_exec_chain.elf")
28+
common.copy_file(source, masquerade)
29+
common.log("Granting execute permissions...")
30+
common.execute(["chmod", "+x", masquerade])
31+
32+
commands = [masquerade, "exec", "-c", "/dev/tcp"]
33+
common.execute([*commands], timeout=5, kill=True)
34+
common.log("Cleaning...")
35+
common.remove_file(masquerade)
36+
common.log("Simulation successfull!")
37+
38+
39+
if __name__ == "__main__":
40+
sys.exit(main())

0 commit comments

Comments
 (0)