Execution of File Written or Modified by PDF Reader

Identifies a suspicious file that was written by a PDF reader application and subsequently executed. These processes are often launched via exploitation of PDF applications.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2020/09/02"
  3integration = ["endpoint", "windows"]
  4maturity = "production"
  5updated_date = "2024/10/15"
  6min_stack_version = "8.14.0"
  7min_stack_comments = "Breaking change at 8.14.0 for the Windows Integration."
  8
  9[rule]
 10author = ["Elastic"]
 11description = """
 12Identifies a suspicious file that was written by a PDF reader application and subsequently executed. These processes are
 13often launched via exploitation of PDF applications.
 14"""
 15from = "now-120m"
 16index = [
 17    "logs-endpoint.events.process-*",
 18    "logs-endpoint.events.file-*",
 19    "winlogbeat-*",
 20    "logs-windows.sysmon_operational-*",
 21    "endgame-*",
 22]
 23interval = "60m"
 24language = "eql"
 25license = "Elastic License v2"
 26name = "Execution of File Written or Modified by PDF Reader"
 27note = """## Triage and analysis
 28
 29### Investigating Execution of File Written or Modified by PDF Reader
 30
 31PDF is a common file type used in corporate environments and most machines have software to handle these files. This creates a vector where attackers can exploit the engines and technology behind this class of software for initial access or privilege escalation.
 32
 33This rule searches for executable files written by PDF reader software and executed in sequence. This is most likely the result of exploitation for privilege escalation or initial access. This rule can also detect suspicious processes masquerading as PDF readers.
 34
 35#### Possible investigation steps
 36
 37- Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
 38- Investigate other alerts associated with the user/host during the past 48 hours.
 39- Retrieve the PDF documents received and opened by the user that could cause this behavior. Common locations include, but are not limited to, the Downloads and Document folders and the folder configured at the email client.
 40- Determine if the collected files are malicious:
 41  - Use a private sandboxed malware analysis system to perform analysis.
 42    - Observe and collect information about the following activities:
 43      - Attempts to contact external domains and addresses.
 44      - File and registry access, modification, and creation activities.
 45      - Service creation and launch activities.
 46      - Scheduled task creation.
 47  - Use the PowerShell `Get-FileHash` cmdlet to get the files' SHA-256 hash values.
 48    - Search for the existence and reputation of the hashes in resources like VirusTotal, Hybrid-Analysis, CISCO Talos, Any.run, etc.
 49
 50### False positive analysis
 51
 52- This activity is unlikely to happen legitimately. Benign true positives (B-TPs) can be added as exceptions if necessary.
 53
 54### Response and remediation
 55
 56- Initiate the incident response process based on the outcome of the triage.
 57- Isolate the involved host to prevent further post-compromise behavior.
 58- 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.
 59- If the triage identified malware, search the environment for additional compromised hosts.
 60  - Implement temporary network rules, procedures, and segmentation to contain the malware.
 61  - Stop suspicious processes.
 62  - Immediately block the identified indicators of compromise (IoCs).
 63  - Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
 64- Remove and block malicious artifacts identified during triage.
 65- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
 66- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
 67  - If the malicious file was delivered via phishing:
 68    - Block the email sender from sending future emails.
 69    - Block the malicious web pages.
 70    - Remove emails from the sender from mailboxes.
 71    - Consider improvements to the security awareness program.
 72- 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).
 73"""
 74risk_score = 73
 75rule_id = "1defdd62-cd8d-426e-a246-81a37751bb2b"
 76severity = "high"
 77tags = [
 78    "Domain: Endpoint",
 79    "OS: Windows",
 80    "Use Case: Threat Detection",
 81    "Tactic: Execution",
 82    "Resources: Investigation Guide",
 83    "Data Source: Elastic Endgame",
 84    "Data Source: Elastic Defend",
 85    "Data Source: Sysmon",
 86]
 87type = "eql"
 88
 89query = '''
 90sequence with maxspan=2h
 91  [file where host.os.type == "windows" and event.type != "deletion" and file.extension : "exe" and
 92     (process.name : "AcroRd32.exe" or
 93      process.name : "rdrcef.exe" or
 94      process.name : "FoxitPhantomPDF.exe" or
 95      process.name : "FoxitReader.exe") and
 96     not (file.name : "FoxitPhantomPDF.exe" or
 97          file.name : "FoxitPhantomPDFUpdater.exe" or
 98          file.name : "FoxitReader.exe" or
 99          file.name : "FoxitReaderUpdater.exe" or
100          file.name : "AcroRd32.exe" or
101          file.name : "rdrcef.exe")
102  ] by host.id, file.path
103  [process where host.os.type == "windows" and event.type == "start"] by host.id, process.executable
104'''
105
106
107[[rule.threat]]
108framework = "MITRE ATT&CK"
109
110[rule.threat.tactic]
111id = "TA0002"
112name = "Execution"
113reference = "https://attack.mitre.org/tactics/TA0002/"
114[[rule.threat]]
115framework = "MITRE ATT&CK"
116[[rule.threat.technique]]
117id = "T1566"
118name = "Phishing"
119reference = "https://attack.mitre.org/techniques/T1566/"
120[[rule.threat.technique.subtechnique]]
121id = "T1566.001"
122name = "Spearphishing Attachment"
123reference = "https://attack.mitre.org/techniques/T1566/001/"
124
125[[rule.threat.technique.subtechnique]]
126id = "T1566.002"
127name = "Spearphishing Link"
128reference = "https://attack.mitre.org/techniques/T1566/002/"
129
130
131
132[rule.threat.tactic]
133id = "TA0001"
134name = "Initial Access"
135reference = "https://attack.mitre.org/tactics/TA0001/"

Triage and analysis

Investigating Execution of File Written or Modified by PDF Reader

PDF is a common file type used in corporate environments and most machines have software to handle these files. This creates a vector where attackers can exploit the engines and technology behind this class of software for initial access or privilege escalation.

This rule searches for executable files written by PDF reader software and executed in sequence. This is most likely the result of exploitation for privilege escalation or initial access. This rule can also detect suspicious processes masquerading as PDF readers.

Possible investigation steps

  • Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
  • Investigate other alerts associated with the user/host during the past 48 hours.
  • Retrieve the PDF documents received and opened by the user that could cause this behavior. Common locations include, but are not limited to, the Downloads and Document folders and the folder configured at the email client.
  • Determine if the collected files are malicious:
    • Use a private sandboxed malware analysis system to perform analysis.
      • Observe and collect information about the following activities:
        • Attempts to contact external domains and addresses.
        • File and registry access, modification, and creation activities.
        • Service creation and launch activities.
        • Scheduled task creation.
    • Use the PowerShell Get-FileHash cmdlet to get the files' SHA-256 hash values.
      • Search for the existence and reputation of the hashes in resources like VirusTotal, Hybrid-Analysis, CISCO Talos, Any.run, etc.

False positive analysis

  • This activity is unlikely to happen legitimately. Benign true positives (B-TPs) can be added as exceptions if necessary.

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.
  • 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.
  • 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.
  • 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.
    • If the malicious file was delivered via phishing:
      • Block the email sender from sending future emails.
      • Block the malicious web pages.
      • Remove emails from the sender from mailboxes.
      • Consider improvements to the security awareness program.
  • 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).

Related rules

to-top