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"
  5min_stack_comments = "New fields added: required_fields, related_integrations, setup"
  6min_stack_version = "8.3.0"
  7updated_date = "2024/04/08"
  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 = ["winlogbeat-*", "logs-endpoint.events.process-*", "logs-endpoint.events.network-*", "logs-windows.sysmon_operational-*"]
 17language = "eql"
 18license = "Elastic License v2"
 19name = "Unusual Network Connection via RunDLL32"
 20note = """## Triage and analysis
 21
 22### Investigating Unusual Network Connection via RunDLL32
 23
 24RunDLL32 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.
 25
 26This 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.
 27
 28#### Possible investigation steps
 29
 30- 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.
 31- Investigate other alerts associated with the user/host during the past 48 hours.
 32- Investigate the target host that RunDLL32 is communicating with.
 33  - Check if the domain is newly registered or unexpected.
 34  - Check the reputation of the domain or IP address.
 35- Identify the target computer and its role in the IT environment.
 36- Assess whether this behavior is prevalent in the environment by looking for similar occurrences across hosts.
 37
 38### False positive analysis
 39
 40- This activity is unlikely to happen legitimately. Benign true positives (B-TPs) can be added as exceptions if necessary.
 41
 42### Response and remediation
 43
 44- Initiate the incident response process based on the outcome of the triage.
 45- Isolate the involved hosts to prevent further post-compromise behavior.
 46- 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.
 47- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
 48- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
 49- Review the privileges assigned to the user to ensure that the least privilege principle is being followed.
 50- 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).
 51"""
 52references = [
 53    "https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml",
 54    "https://redcanary.com/threat-detection-report/techniques/rundll32/",
 55]
 56risk_score = 47
 57rule_id = "52aaab7b-b51c-441a-89ce-4387b3aea886"
 58severity = "medium"
 59tags = ["Domain: Endpoint", "OS: Windows", "Use Case: Threat Detection", "Tactic: Defense Evasion", "Tactic: Command and Control", "Resources: Investigation Guide", "Data Source: Elastic Defend", "Data Source: Sysmon"]
 60type = "eql"
 61
 62query = '''
 63sequence by host.id, process.entity_id with maxspan=1m
 64  [process where host.os.type == "windows" and event.type == "start" and process.name : "rundll32.exe" and process.args_count == 1]
 65  [network where host.os.type == "windows" and process.name : "rundll32.exe" and
 66   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",
 67       "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",
 68       "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",
 69       "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",
 70       "FE80::/10", "FF00::/8")]
 71'''
 72
 73
 74[[rule.threat]]
 75framework = "MITRE ATT&CK"
 76[[rule.threat.technique]]
 77id = "T1218"
 78name = "System Binary Proxy Execution"
 79reference = "https://attack.mitre.org/techniques/T1218/"
 80[[rule.threat.technique.subtechnique]]
 81id = "T1218.011"
 82name = "Rundll32"
 83reference = "https://attack.mitre.org/techniques/T1218/011/"
 84
 85
 86
 87[rule.threat.tactic]
 88id = "TA0005"
 89name = "Defense Evasion"
 90reference = "https://attack.mitre.org/tactics/TA0005/"
 91[[rule.threat]]
 92framework = "MITRE ATT&CK"
 93[[rule.threat.technique]]
 94id = "T1071"
 95name = "Application Layer Protocol"
 96reference = "https://attack.mitre.org/techniques/T1071/"
 97[[rule.threat.technique.subtechnique]]
 98id = "T1071.001"
 99name = "Web Protocols"
100reference = "https://attack.mitre.org/techniques/T1071/001/"
101
102
103
104[rule.threat.tactic]
105id = "TA0011"
106name = "Command and Control"
107reference = "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