Unusual Network Connection via RunDLL32

Identifies unusual instances of rundll32.exe making outbound network connections. This may indicate adversarial Command and Control activity.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2020/02/18"
  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 unusual instances of rundll32.exe making outbound network connections. This may indicate adversarial Command
 13and Control activity.
 14"""
 15from = "now-9m"
 16index = [
 17    "winlogbeat-*",
 18    "logs-endpoint.events.process-*",
 19    "logs-endpoint.events.network-*",
 20    "logs-windows.sysmon_operational-*",
 21]
 22language = "eql"
 23license = "Elastic License v2"
 24name = "Unusual Network Connection via RunDLL32"
 25note = """## Triage and analysis
 26
 27### Investigating Unusual Network Connection via RunDLL32
 28
 29RunDLL32 is a built-in Windows utility and also a vital component used by the operating system itself. The functionality provided by RunDLL32 to execute Dynamic Link Libraries (DLLs) is widely abused by attackers, because it makes it hard to differentiate malicious activity from normal operations.
 30
 31This rule looks for external network connections established using RunDLL32 when the utility is being executed with no arguments, which can potentially indicate command and control activity.
 32
 33#### Possible investigation steps
 34
 35- 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.
 36- Investigate other alerts associated with the user/host during the past 48 hours.
 37- Investigate the target host that RunDLL32 is communicating with.
 38  - Check if the domain is newly registered or unexpected.
 39  - Check the reputation of the domain or IP address.
 40- Identify the target computer and its role in the IT environment.
 41- Assess whether this behavior is prevalent in the environment by looking for similar occurrences across hosts.
 42
 43### False positive analysis
 44
 45- This activity is unlikely to happen legitimately. Benign true positives (B-TPs) can be added as exceptions if necessary.
 46
 47### Response and remediation
 48
 49- Initiate the incident response process based on the outcome of the triage.
 50- Isolate the involved hosts to prevent further post-compromise behavior.
 51- 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.
 52- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
 53- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
 54- Review the privileges assigned to the user to ensure that the least privilege principle is being followed.
 55- 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).
 56"""
 57references = [
 58    "https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml",
 59    "https://redcanary.com/threat-detection-report/techniques/rundll32/",
 60]
 61risk_score = 47
 62rule_id = "52aaab7b-b51c-441a-89ce-4387b3aea886"
 63severity = "medium"
 64tags = [
 65    "Domain: Endpoint",
 66    "OS: Windows",
 67    "Use Case: Threat Detection",
 68    "Tactic: Defense Evasion",
 69    "Tactic: Command and Control",
 70    "Resources: Investigation Guide",
 71    "Data Source: Elastic Defend",
 72    "Data Source: Sysmon",
 73]
 74type = "eql"
 75
 76query = '''
 77sequence by host.id, process.entity_id with maxspan=1m
 78  [process where host.os.type == "windows" and event.type == "start" and process.name : "rundll32.exe" and process.args_count == 1]
 79  [network where host.os.type == "windows" and process.name : "rundll32.exe" and
 80   not cidrmatch(destination.ip, "10.0.0.0/8", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24",
 81       "192.0.0.0/29", "192.0.0.8/32", "192.0.0.9/32", "192.0.0.10/32", "192.0.0.170/32", "192.0.0.171/32",
 82       "192.0.2.0/24", "192.31.196.0/24", "192.52.193.0/24", "192.168.0.0/16", "192.88.99.0/24", "224.0.0.0/4",
 83       "100.64.0.0/10", "192.175.48.0/24","198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", "240.0.0.0/4", "::1",
 84       "FE80::/10", "FF00::/8")]
 85'''
 86
 87
 88[[rule.threat]]
 89framework = "MITRE ATT&CK"
 90[[rule.threat.technique]]
 91id = "T1218"
 92name = "System Binary Proxy Execution"
 93reference = "https://attack.mitre.org/techniques/T1218/"
 94[[rule.threat.technique.subtechnique]]
 95id = "T1218.011"
 96name = "Rundll32"
 97reference = "https://attack.mitre.org/techniques/T1218/011/"
 98
 99
100
101[rule.threat.tactic]
102id = "TA0005"
103name = "Defense Evasion"
104reference = "https://attack.mitre.org/tactics/TA0005/"
105[[rule.threat]]
106framework = "MITRE ATT&CK"
107[[rule.threat.technique]]
108id = "T1071"
109name = "Application Layer Protocol"
110reference = "https://attack.mitre.org/techniques/T1071/"
111[[rule.threat.technique.subtechnique]]
112id = "T1071.001"
113name = "Web Protocols"
114reference = "https://attack.mitre.org/techniques/T1071/001/"
115
116
117
118[rule.threat.tactic]
119id = "TA0011"
120name = "Command and Control"
121reference = "https://attack.mitre.org/tactics/TA0011/"

Triage and analysis

Investigating Unusual Network Connection via RunDLL32

RunDLL32 is a built-in Windows utility and also a vital component used by the operating system itself. The functionality provided by RunDLL32 to execute Dynamic Link Libraries (DLLs) is widely abused by attackers, because it makes it hard to differentiate malicious activity from normal operations.

This rule looks for external network connections established using RunDLL32 when the utility is being executed with no arguments, which can potentially indicate command and control activity.

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.
  • Investigate the target host that RunDLL32 is communicating with.
    • Check if the domain is newly registered or unexpected.
    • Check the reputation of the domain or IP address.
  • Identify the target computer and its role in the IT environment.
  • Assess whether this behavior is prevalent in the environment by looking for similar occurrences across hosts.

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 hosts 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.
  • 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.
  • Review the privileges assigned to the user to ensure that the least privilege principle is being followed.
  • 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