Potential Lateral Tool Transfer via SMB Share

Identifies the creation or change of a Windows executable file over network shares. Adversaries may transfer tools or other files between systems in a compromised environment.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2020/11/10"
  3integration = ["endpoint"]
  4maturity = "production"
  5updated_date = "2024/09/23"
  6
  7[rule]
  8author = ["Elastic"]
  9description = """
 10Identifies the creation or change of a Windows executable file over network shares. Adversaries may transfer tools or
 11other files between systems in a compromised environment.
 12"""
 13from = "now-9m"
 14index = ["logs-endpoint.events.file-*", "logs-endpoint.events.network-*"]
 15language = "eql"
 16license = "Elastic License v2"
 17name = "Potential Lateral Tool Transfer via SMB Share"
 18note = """## Triage and analysis
 19
 20### Investigating Potential Lateral Tool Transfer via SMB Share
 21
 22Adversaries can use network shares to host tooling to support the compromise of other hosts in the environment. These tools can include discovery utilities, credential dumpers, malware, etc. Attackers can also leverage file shares that employees frequently access to host malicious files to gain a foothold in other machines.
 23
 24#### Possible investigation steps
 25
 26- 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.
 27- Identify the user account that performed the action and whether it should perform this kind of action.
 28- Contact the account owner and confirm whether they are aware of this activity.
 29- Investigate other alerts associated with the user/host during the past 48 hours.
 30- Retrieve the created file and determine if it is malicious:
 31  - Use a private sandboxed malware analysis system to perform analysis.
 32    - Observe and collect information about the following activities:
 33      - Attempts to contact external domains and addresses.
 34      - File and registry access, modification, and creation activities.
 35      - Service creation and launch activities.
 36      - Scheduled task creation.
 37  - Use the PowerShell `Get-FileHash` cmdlet to get the files' SHA-256 hash values.
 38    - Search for the existence and reputation of the hashes in resources like VirusTotal, Hybrid-Analysis, CISCO Talos, Any.run, etc.
 39
 40### False positive analysis
 41
 42- This activity can happen legitimately. Consider adding exceptions if it is expected and noisy in your environment.
 43
 44### Response and remediation
 45
 46- Initiate the incident response process based on the outcome of the triage.
 47- Isolate the involved host to prevent further post-compromise behavior.
 48- If the triage identified malware, search the environment for additional compromised hosts.
 49  - Implement temporary network rules, procedures, and segmentation to contain the malware.
 50  - Stop suspicious processes.
 51  - Immediately block the identified indicators of compromise (IoCs).
 52  - Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
 53- Remove and block malicious artifacts identified during triage.
 54- Review the privileges needed to write to the network share and restrict write access as needed.
 55- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
 56- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
 57- 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).
 58"""
 59references = [
 60    "https://www.elastic.co/security-labs/elastic-protects-against-data-wiper-malware-targeting-ukraine-hermeticwiper",
 61    "https://www.elastic.co/security-labs/hunting-for-lateral-movement-using-event-query-language",
 62]
 63risk_score = 47
 64rule_id = "58bc134c-e8d2-4291-a552-b4b3e537c60b"
 65severity = "medium"
 66tags = [
 67    "Domain: Endpoint",
 68    "OS: Windows",
 69    "Use Case: Threat Detection",
 70    "Tactic: Lateral Movement",
 71    "Resources: Investigation Guide",
 72    "Data Source: Elastic Defend",
 73]
 74type = "eql"
 75
 76query = '''
 77sequence by host.id with maxspan=30s
 78  [network where host.os.type == "windows" and event.type == "start" and process.pid == 4 and destination.port == 445 and
 79   network.direction : ("incoming", "ingress") and
 80   network.transport == "tcp" and source.ip != "127.0.0.1" and source.ip != "::1"
 81  ] by process.entity_id
 82  /* add more executable extensions here if they are not noisy in your environment */
 83  [file where host.os.type == "windows" and event.type in ("creation", "change") and process.pid == 4 and 
 84   (file.Ext.header_bytes : "4d5a*" or file.extension : ("exe", "scr", "pif", "com", "dll"))] by process.entity_id
 85'''
 86
 87
 88[[rule.threat]]
 89framework = "MITRE ATT&CK"
 90[[rule.threat.technique]]
 91id = "T1021"
 92name = "Remote Services"
 93reference = "https://attack.mitre.org/techniques/T1021/"
 94[[rule.threat.technique.subtechnique]]
 95id = "T1021.002"
 96name = "SMB/Windows Admin Shares"
 97reference = "https://attack.mitre.org/techniques/T1021/002/"
 98
 99
100[[rule.threat.technique]]
101id = "T1570"
102name = "Lateral Tool Transfer"
103reference = "https://attack.mitre.org/techniques/T1570/"
104
105
106[rule.threat.tactic]
107id = "TA0008"
108name = "Lateral Movement"
109reference = "https://attack.mitre.org/tactics/TA0008/"

Triage and analysis

Investigating Potential Lateral Tool Transfer via SMB Share

Adversaries can use network shares to host tooling to support the compromise of other hosts in the environment. These tools can include discovery utilities, credential dumpers, malware, etc. Attackers can also leverage file shares that employees frequently access to host malicious files to gain a foothold in other machines.

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.
  • Identify the user account that performed the action and whether it should perform this kind of action.
  • Contact the account owner and confirm whether they are aware of this activity.
  • Investigate other alerts associated with the user/host during the past 48 hours.
  • Retrieve the created file and determine if it is 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 can happen legitimately. Consider adding exceptions if it is expected and noisy in your environment.

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.
  • 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.
  • Review the privileges needed to write to the network share and restrict write access as needed.
  • 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.
  • 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