From 5d9b295bb658c96837667040708fef7b72cc61d7 Mon Sep 17 00:00:00 2001 From: protections machine <72879786+protectionsmachine@users.noreply.github.com> Date: Fri, 25 Oct 2024 03:17:17 +1100 Subject: [PATCH] Sync RTA Potential Mining Pool Command Detection (#4204) Co-authored-by: shashank-elastic <91139415+shashank-elastic@users.noreply.github.com> --- ..._impact_potential_mining_pool_detection.py | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 rta/linux_impact_potential_mining_pool_detection.py diff --git a/rta/linux_impact_potential_mining_pool_detection.py b/rta/linux_impact_potential_mining_pool_detection.py new file mode 100644 index 000000000..6a1ac69a9 --- /dev/null +++ b/rta/linux_impact_potential_mining_pool_detection.py @@ -0,0 +1,40 @@ +# 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="5abebdea-b42e-4401-8838-15f19d11401f", + platforms=["linux"], + endpoint=[ + { + "rule_name": "Potential Mining Pool Command Detection", + "rule_id": "fcc42a61-4507-4918-867b-d673e5b065dc", + }, + ], + techniques=["T1496", "T1059"], +) + + +@common.requires_os(*metadata.platforms) +def main() -> None: + common.log("Creating a fake executable..") + masquerade = "/dev/shm/evil" + + source = common.get_path("bin", "netcon_exec_chain.elf") + common.copy_file(source, masquerade) + common.execute(["chmod", "+x", masquerade]) + + commands = [masquerade, "exec", "-c", "crypto-pool.info"] + common.execute([*commands], timeout=5, kill=True) + common.log("Cleaning...") + common.remove_file(masquerade) + common.log("Simulation successfull!") + + +if __name__ == "__main__": + sys.exit(main())