a0d3b4bd23
Co-Authored-By: Brent Murphy <56412096+bm11100@users.noreply.github.com> Co-Authored-By: Daniel Stepanic <57736958+dstepanic17@users.noreply.github.com> Co-Authored-By: David French <56409778+threat-punter@users.noreply.github.com> Co-Authored-By: Joe Desimone <56411054+joe-desimone@users.noreply.github.com> Co-Authored-By: Justin Ibarra <brokensound77@users.noreply.github.com>
48 lines
1.4 KiB
Python
48 lines
1.4 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;
|
|
# you may not use this file except in compliance with the Elastic License.
|
|
|
|
# Name: Emulate Suspect MS Office Child Processes
|
|
# RTA: suspect_office_children.py
|
|
# ATT&CK: T1064
|
|
# Description: Generates various children processes from emulated Office processes.
|
|
|
|
import os
|
|
import time
|
|
|
|
from . import common
|
|
|
|
|
|
@common.requires_os(common.WINDOWS)
|
|
def main():
|
|
common.log("MS Office unusual child process emulation")
|
|
suspicious_apps = [
|
|
"msiexec.exe /i blah /quiet",
|
|
"powershell.exe exit",
|
|
"wscript.exe //b",
|
|
]
|
|
cmd_path = "c:\\windows\\system32\\cmd.exe"
|
|
browser_path = os.path.abspath("firefox.exe")
|
|
common.copy_file(cmd_path, browser_path)
|
|
|
|
for office_app in ["winword.exe", "excel.exe"]:
|
|
|
|
common.log("Emulating %s" % office_app)
|
|
office_path = os.path.abspath(office_app)
|
|
common.copy_file(cmd_path, office_path)
|
|
|
|
for command in suspicious_apps:
|
|
common.execute('%s /c %s /c %s' % (office_path, browser_path, command), timeout=5, kill=True)
|
|
|
|
common.log('Cleanup %s' % office_path)
|
|
common.remove_file(office_path)
|
|
|
|
common.log("Sleep 5 to allow processes to finish")
|
|
time.sleep(5)
|
|
common.log('Cleanup %s' % browser_path)
|
|
common.remove_file(browser_path)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
exit(main())
|