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