Unusual Execution via Microsoft Common Console File

Identifies the execution of a child process from a Microsoft Common Console file. Adversaries may embed a malicious command in an MSC file in order to trick victims into executing malicious commands.

Elastic rule (View on GitHub)

 1[metadata]
 2creation_date = "2024/05/12"
 3integration = ["endpoint", "windows"]
 4maturity = "production"
 5min_stack_comments = "New fields added: required_fields, related_integrations, setup"
 6min_stack_version = "8.3.0"
 7updated_date = "2024/05/12"
 8
 9[rule]
10author = ["Elastic"]
11description = """
12Identifies the execution of a child process from a Microsoft Common Console file. Adversaries may embed a malicious command
13in an MSC file in order to trick victims into executing malicious commands.
14"""
15from = "now-9m"
16index = ["winlogbeat-*", "logs-endpoint.events.process-*", "logs-windows.sysmon_operational-*", "endgame-*"]
17language = "eql"
18license = "Elastic License v2"
19name = "Unusual Execution via Microsoft Common Console File"
20note = """## Triage and analysis
21
22### Investigating Execution via Microsoft Common Console File
23
24- Investigate the source of the MSC file.
25- Investigate the process execution chain (all spawned child processes and their descendants).
26- Investigate the process and it's descendants network and file events.
27- Identify the user account that performed the action and whether it should perform this kind of action.
28- Contact the account owner and confirm whether they are aware of this activity.
29
30### Response and remediation
31- Initiate the incident response process based on the outcome of the triage.
32- Isolate the involved host to prevent further post-compromise behavior.
33- If the triage identified malware, search the environment for additional compromised hosts.
34  - Implement temporary network rules, procedures, and segmentation to contain the malware.
35  - Stop suspicious processes.
36  - Immediately block the identified indicators of compromise (IoCs).
37  - Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
38- Remove and block malicious artifacts identified during triage.
39- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
40- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
41- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
42- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
43"""
44references = ["https://www.genians.co.kr/blog/threat_intelligence/facebook"]
45risk_score = 73
46rule_id = "e760c72b-bb1f-44f0-9f0d-37d51744ee75"
47severity = "high"
48tags = ["Domain: Endpoint", "OS: Windows", "Use Case: Threat Detection", "Tactic: Execution", "Tactic: Initial Access", "Resources: Investigation Guide", "Data Source: Elastic Endgame", "Data Source: Elastic Defend", "Data Source: Sysmon"]
49timestamp_override = "event.ingested"
50type = "eql"
51
52query = '''
53process where host.os.type == "windows" and event.type == "start" and
54 process.parent.executable : "?:\\Windows\\System32\\mmc.exe" and endswith~(process.parent.args, ".msc") and
55 not process.parent.args : ("?:\\Windows\\System32\\*.msc", "?:\\Windows\\SysWOW64\\*.msc", "?:\\Program files\\*.msc", "?:\\Program Files (x86)\\*.msc")
56'''
57
58
59[[rule.threat]]
60framework = "MITRE ATT&CK"
61[[rule.threat.technique]]
62id = "T1204"
63name = "User Execution"
64reference = "https://attack.mitre.org/techniques/T1204/"
65[[rule.threat.technique.subtechnique]]
66id = "T1204.002"
67name = "Malicious File"
68reference = "https://attack.mitre.org/techniques/T1204/002/"
69
70
71
72[rule.threat.tactic]
73id = "TA0002"
74name = "Execution"
75reference = "https://attack.mitre.org/tactics/TA0002/"
76[[rule.threat]]
77framework = "MITRE ATT&CK"
78[[rule.threat.technique]]
79id = "T1566"
80name = "Phishing"
81reference = "https://attack.mitre.org/techniques/T1566/"
82[[rule.threat.technique.subtechnique]]
83id = "T1566.001"
84name = "Spearphishing Attachment"
85reference = "https://attack.mitre.org/techniques/T1566/001/"
86
87[[rule.threat.technique.subtechnique]]
88id = "T1566.002"
89name = "Spearphishing Link"
90reference = "https://attack.mitre.org/techniques/T1566/002/"
91
92
93
94[rule.threat.tactic]
95id = "TA0001"
96name = "Initial Access"
97reference = "https://attack.mitre.org/tactics/TA0001/"

Triage and analysis

Investigating Execution via Microsoft Common Console File

  • Investigate the source of the MSC file.
  • Investigate the process execution chain (all spawned child processes and their descendants).
  • Investigate the process and it's descendants network and file events.
  • Identify the user account that performed the action and whether it should perform this kind of action.
  • Contact the account owner and confirm whether they are aware of this activity.

Response and remediation

  • Initiate the incident response process based on the outcome of the triage.
  • Isolate the involved host to prevent further post-compromise behavior.
  • If the triage identified malware, search the environment for additional compromised hosts.
    • Implement temporary network rules, procedures, and segmentation to contain the malware.
    • Stop suspicious processes.
    • Immediately block the identified indicators of compromise (IoCs).
    • Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
  • Remove and block malicious artifacts identified during triage.
  • Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
  • Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
  • Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
  • Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).

References

Related rules

to-top