Network Logon Provider Registry Modification

Identifies the modification of the network logon provider registry. Adversaries may register a rogue network logon provider module for persistence and/or credential access via intercepting the authentication credentials in clear text during user logon.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2021/03/18"
  3integration = ["endpoint"]
  4maturity = "production"
  5min_stack_comments = "New fields added: required_fields, related_integrations, setup"
  6min_stack_version = "8.3.0"
  7updated_date = "2024/03/28"
  8
  9[transform]
 10[[transform.osquery]]
 11label = "Osquery - Retrieve DNS Cache"
 12query = "SELECT * FROM dns_cache"
 13
 14[[transform.osquery]]
 15label = "Osquery - Retrieve All Services"
 16query = "SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services"
 17
 18[[transform.osquery]]
 19label = "Osquery - Retrieve Services Running on User Accounts"
 20query = """
 21SELECT description, display_name, name, path, pid, service_type, start_type, status, user_account FROM services WHERE
 22NOT (user_account LIKE '%LocalSystem' OR user_account LIKE '%LocalService' OR user_account LIKE '%NetworkService' OR
 23user_account == null)
 24"""
 25
 26[[transform.osquery]]
 27label = "Osquery - Retrieve Service Unsigned Executables with Virustotal Link"
 28query = """
 29SELECT concat('https://www.virustotal.com/gui/file/', sha1) AS VtLink, name, description, start_type, status, pid,
 30services.path FROM services JOIN authenticode ON services.path = authenticode.path OR services.module_path =
 31authenticode.path JOIN hash ON services.path = hash.path WHERE authenticode.result != 'trusted'
 32"""
 33
 34[rule]
 35author = ["Elastic"]
 36description = """
 37Identifies the modification of the network logon provider registry. Adversaries may register a rogue network logon
 38provider module for persistence and/or credential access via intercepting the authentication credentials in clear text
 39during user logon.
 40"""
 41false_positives = ["Authorized third party network logon providers."]
 42from = "now-9m"
 43index = ["logs-endpoint.events.registry-*", "endgame-*", "logs-windows.sysmon_operational-*"]
 44language = "eql"
 45license = "Elastic License v2"
 46name = "Network Logon Provider Registry Modification"
 47note = """## Triage and analysis
 48
 49### Investigating Network Logon Provider Registry Modification
 50
 51Network logon providers are components in Windows responsible for handling the authentication process during a network logon.
 52
 53This rule identifies the modification of the network logon provider registry. Adversaries may register a rogue network logon provider module for persistence and/or credential access via intercepting the authentication credentials in plain text during user logon.
 54
 55> **Note**:
 56> This investigation guide uses the [Osquery Markdown Plugin](https://www.elastic.co/guide/en/security/master/invest-guide-run-osquery.html) introduced in Elastic Stack version 8.5.0. Older Elastic Stack versions will display unrendered Markdown in this guide.
 57
 58### Possible investigation steps
 59
 60- Examine the `registry.data.strings` field to identify the DLL registered.
 61- Identify the process responsible for the registry operation and the file creation and investigate their process execution chains (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.
 62  - Validate the activity is not related to planned patches, updates, network administrator activity, or legitimate software installations.
 63  - Investigate any abnormal behavior by the subject process, such as network connections, DLLs loaded, registry or file modifications, and any spawned child processes.
 64- Retrieve the file and examine if it is signed with valid digital signatures from vendors that are supposed to implement this kind of software and approved to use in the environment. Check for prevalence in the environment and whether they are located in expected locations.
 65- Investigate other alerts associated with the user/host during the past 48 hours.
 66- Examine the host for derived artifacts that indicate suspicious activities:
 67  - Analyze the executables of the processes using a private sandboxed analysis system.
 68  - Observe and collect information about the following activities in both the sandbox and the alert subject host:
 69    - Attempts to contact external domains and addresses.
 70      - Use the Elastic Defend network events to determine domains and addresses contacted by the subject process by filtering by the process's `process.entity_id`.
 71      - Examine the DNS cache for suspicious or anomalous entries.
 72        - $osquery_0
 73    - Use the Elastic Defend registry events to examine registry keys accessed, modified, or created by the related processes in the process tree.
 74    - Examine the host services for suspicious or anomalous entries.
 75      - $osquery_1
 76      - $osquery_2
 77      - $osquery_3
 78  - Retrieve the files' SHA-256 hash values using the PowerShell `Get-FileHash` cmdlet and search for the existence and reputation of the hashes in resources like VirusTotal, Hybrid-Analysis, CISCO Talos, Any.run, etc.
 79
 80
 81### False positive analysis
 82
 83- False Positives can include legitimate software installations or updates that modify the network logon provider registry. These modifications may be necessary for the proper functioning of the software and are not indicative of malicious activity.
 84
 85### Response and Remediation
 86
 87- Initiate the incident response process based on the outcome of the triage.
 88  - If malicious activity is confirmed, perform a broader investigation to identify the scope of the compromise and determine the appropriate remediation steps.
 89- Isolate the involved host to prevent further post-compromise behavior.
 90- If the triage identified malware, search the environment for additional compromised hosts.
 91  - Implement temporary network rules, procedures, and segmentation to contain the malware.
 92  - Stop suspicious processes.
 93  - Immediately block the identified indicators of compromise (IoCs).
 94  - Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
 95- Remove and block malicious artifacts identified during triage.
 96- 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.
 97- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
 98- Reimage the host operating system or restore the compromised files to clean versions.
 99- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
100- 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).
101"""
102references = [
103    "https://github.com/gtworek/PSBits/tree/master/PasswordStealing/NPPSpy",
104    "https://docs.microsoft.com/en-us/windows/win32/api/npapi/nf-npapi-nplogonnotify",
105]
106risk_score = 47
107rule_id = "54c3d186-0461-4dc3-9b33-2dc5c7473936"
108severity = "medium"
109tags = ["Domain: Endpoint", "OS: Windows", "Use Case: Threat Detection", "Tactic: Persistence", "Tactic: Credential Access", "Data Source: Elastic Endgame", "Data Source: Elastic Defend", "Data Source: Sysmon"]
110timestamp_override = "event.ingested"
111type = "eql"
112
113query = '''
114registry where host.os.type == "windows" and registry.data.strings : "?*" and
115  registry.path : (
116    "HKLM\\SYSTEM\\*ControlSet*\\Services\\*\\NetworkProvider\\ProviderPath",
117    "\\REGISTRY\\MACHINE\\SYSTEM\\*ControlSet*\\Services\\*\\NetworkProvider\\ProviderPath"
118  ) and
119  /* Excluding default NetworkProviders RDPNP, LanmanWorkstation and webclient. */
120  not (
121    user.id : "S-1-5-18" and
122    registry.data.strings : (
123        "%SystemRoot%\\System32\\ntlanman.dll",
124        "%SystemRoot%\\System32\\drprov.dll",
125        "%SystemRoot%\\System32\\davclnt.dll",
126        "%SystemRoot%\\System32\\vmhgfs.dll",
127        "?:\\Program Files (x86)\\Citrix\\ICA Client\\x64\\pnsson.dll",
128        "?:\\Program Files\\Dell\\SARemediation\\agent\\DellMgmtNP.dll",
129        "?:\\Program Files (x86)\\CheckPoint\\Endpoint Connect\\\\epcgina.dll"
130    )
131  )
132'''
133
134
135[[rule.threat]]
136framework = "MITRE ATT&CK"
137[[rule.threat.technique]]
138id = "T1556"
139name = "Modify Authentication Process"
140reference = "https://attack.mitre.org/techniques/T1556/"
141
142
143[rule.threat.tactic]
144id = "TA0006"
145name = "Credential Access"
146reference = "https://attack.mitre.org/tactics/TA0006/"
147[[rule.threat]]
148framework = "MITRE ATT&CK"
149[[rule.threat.technique]]
150id = "T1543"
151name = "Create or Modify System Process"
152reference = "https://attack.mitre.org/techniques/T1543/"
153
154
155[rule.threat.tactic]
156id = "TA0003"
157name = "Persistence"
158reference = "https://attack.mitre.org/tactics/TA0003/"

Triage and analysis

Investigating Network Logon Provider Registry Modification

Network logon providers are components in Windows responsible for handling the authentication process during a network logon.

This rule identifies the modification of the network logon provider registry. Adversaries may register a rogue network logon provider module for persistence and/or credential access via intercepting the authentication credentials in plain text during user logon.

Note: This investigation guide uses the Osquery Markdown Plugin introduced in Elastic Stack version 8.5.0. Older Elastic Stack versions will display unrendered Markdown in this guide.

Possible investigation steps

  • Examine the registry.data.strings field to identify the DLL registered.
  • Identify the process responsible for the registry operation and the file creation and investigate their process execution chains (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.
    • Validate the activity is not related to planned patches, updates, network administrator activity, or legitimate software installations.
    • Investigate any abnormal behavior by the subject process, such as network connections, DLLs loaded, registry or file modifications, and any spawned child processes.
  • Retrieve the file and examine if it is signed with valid digital signatures from vendors that are supposed to implement this kind of software and approved to use in the environment. Check for prevalence in the environment and whether they are located in expected locations.
  • Investigate other alerts associated with the user/host during the past 48 hours.
  • Examine the host for derived artifacts that indicate suspicious activities:
    • Analyze the executables of the processes using a private sandboxed analysis system.
    • Observe and collect information about the following activities in both the sandbox and the alert subject host:
      • Attempts to contact external domains and addresses.
        • Use the Elastic Defend network events to determine domains and addresses contacted by the subject process by filtering by the process's process.entity_id.
        • Examine the DNS cache for suspicious or anomalous entries.
          • $osquery_0
      • Use the Elastic Defend registry events to examine registry keys accessed, modified, or created by the related processes in the process tree.
      • Examine the host services for suspicious or anomalous entries.
        • $osquery_1
        • $osquery_2
        • $osquery_3
    • Retrieve the files' SHA-256 hash values using the PowerShell Get-FileHash cmdlet and search for the existence and reputation of the hashes in resources like VirusTotal, Hybrid-Analysis, CISCO Talos, Any.run, etc.

False positive analysis

  • False Positives can include legitimate software installations or updates that modify the network logon provider registry. These modifications may be necessary for the proper functioning of the software and are not indicative of malicious activity.

Response and Remediation

  • Initiate the incident response process based on the outcome of the triage.
    • If malicious activity is confirmed, perform a broader investigation to identify the scope of the compromise and determine the appropriate remediation steps.
  • 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.
  • Reimage the host operating system or restore the compromised files to clean versions.
  • 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