Sync RTA Linux Production Tuning (#4014)
This commit is contained in:
committed by
GitHub
parent
ba76c20b3d
commit
cb739fb161
@@ -3,8 +3,9 @@
|
||||
# 2.0; you may not use this file except in compliance with the Elastic License
|
||||
# 2.0.
|
||||
|
||||
from . import common
|
||||
from . import RtaMetadata
|
||||
import sys
|
||||
|
||||
from . import RtaMetadata, common
|
||||
|
||||
metadata = RtaMetadata(
|
||||
uuid="fd5fb7a8-398a-4322-ae28-8f88cce6aa88",
|
||||
@@ -12,24 +13,23 @@ metadata = RtaMetadata(
|
||||
endpoint=[
|
||||
{
|
||||
"rule_name": "Interactive Shell Spawned via Hidden Process",
|
||||
"rule_id": "52deef30-e633-49e1-9dd2-da1ad6cb5e43"
|
||||
}
|
||||
"rule_id": "52deef30-e633-49e1-9dd2-da1ad6cb5e43",
|
||||
},
|
||||
],
|
||||
techniques=["T1059", "T1564"],
|
||||
)
|
||||
|
||||
|
||||
@common.requires_os(*metadata.platforms)
|
||||
def main():
|
||||
|
||||
def main() -> None:
|
||||
common.log("Creating a fake hidden executable..")
|
||||
masquerade = "/tmp/.evil"
|
||||
source = common.get_path("bin", "netcon_exec_chain.elf")
|
||||
common.copy_file(source, masquerade)
|
||||
common.log("Granting execute permissions...")
|
||||
common.execute(['chmod', '+x', masquerade])
|
||||
common.execute(["chmod", "+x", masquerade])
|
||||
|
||||
commands = [masquerade, 'exec', '-c', '-i']
|
||||
commands = [masquerade, "exec", "-c", "-i"]
|
||||
common.execute([*commands], timeout=5, kill=True)
|
||||
common.log("Cleaning...")
|
||||
common.remove_file(masquerade)
|
||||
@@ -37,4 +37,4 @@ def main():
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
exit(main())
|
||||
sys.exit(main())
|
||||
|
||||
Reference in New Issue
Block a user