Files
sigma-rules/rta/exec_conhost_indirect.py
T
Jonhnathan 95b8b1688b [RTA] Add RTAs for Endpoint Rules - 2 (#2633)
* [RTA] Add RTAs for Endpoint Rules - 2

* Update exec_conhost_indirect.py

* Update msoffice_file_dll_sideload.py

---------

Co-authored-by: Terrance DeJesus <99630311+terrancedejesus@users.noreply.github.com>
2023-03-24 09:55:32 -03:00

38 lines
1.0 KiB
Python

# 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.
from . import common
from . import RtaMetadata
metadata = RtaMetadata(
uuid="32e926c2-2f33-4dd0-ac77-12545331d3e4",
platforms=["windows"],
endpoint=[
{
'rule_id': '4b61b37d-c569-444a-bafa-e29d221ee55c',
'rule_name': 'Indirect Command Execution via Console Window Host'
}
],
siem=[],
techniques=['T1202'],
)
EXE_FILE = common.get_path("bin", "renamed_posh.exe")
@common.requires_os(metadata.platforms)
def main():
conhost = "C:\\Users\\Public\\conhost.exe"
posh = "C:\\Users\\Public\\posh.exe"
common.copy_file(EXE_FILE, conhost)
common.copy_file(EXE_FILE, posh)
common.execute([conhost, posh], timeout=10, kill=True)
common.remove_files(conhost, posh)
if __name__ == "__main__":
exit(main())