Files
sigma-rules/rta/process_name_masquerade.py
T

38 lines
1.2 KiB
Python
Raw Normal View History

2020-06-29 23:07:16 -06:00
# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
2021-03-03 22:12:11 -09:00
# 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.
2020-06-29 23:07:16 -06:00
from pathlib import Path
2022-09-08 12:50:39 -04:00
from . import RtaMetadata, common
2022-09-08 12:50:39 -04:00
metadata = RtaMetadata(
uuid="98adf0ff-2d8e-4eea-8d68-42084204bb74",
platforms=["windows"],
endpoint=[
{"rule_name": "Binary Masquerading via Untrusted Path", "rule_id": "35dedf0c-8db6-4d70-b2dc-a133b808211f"},
{"rule_name": "Potential Masquerading as SVCHOST", "rule_id": "5b00c9ba-9546-47cc-8f9f-1c1a3e95f65c"},
{"rule_name": "Execution via Renamed Signed Binary Proxy", "rule_id": "b0207677-5041-470b-981d-13ab956cf5b4"},
],
siem=[],
techniques=["T1218", "T1036"],
)
2020-06-29 23:07:16 -06:00
2022-09-08 12:50:39 -04:00
CMD_PATH = "c:\\windows\\system32\\cmd.exe"
2020-06-29 23:07:16 -06:00
2023-10-03 10:47:58 -04:00
@common.requires_os(*metadata.platforms)
2020-06-29 23:07:16 -06:00
def main():
2022-09-08 12:50:39 -04:00
masquerades = ["svchost.exe", "lsass.exe"]
2020-06-29 23:07:16 -06:00
for name in masquerades:
path = Path(name).resolve()
2022-09-08 12:50:39 -04:00
common.copy_file(CMD_PATH, path)
2020-06-29 23:07:16 -06:00
common.execute(path, timeout=3, kill=True)
common.remove_file(path)
if __name__ == "__main__":
exit(main())