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