Detecting and Mitigating Lateral Movement

Background

Lateral movement refers to a post-exploitation activity in which a threat actor attempts to penetrate adjacent devices. After acquiring initial access to an asset or network, the attacker attempts to authenticate or exploit vulnerabilities in electronically connected assets in order to execute commands or get access to further resources. Typically, the purpose is to escalate privileges, gain access to sensitive data, or inject other malware in order to promote the threat actor’s malicious mission.

 

Lateral movement, one of the first phases of a cyberattack, may only occur when a threat actor has established an initial foothold in a network or assets. The most prevalent tactics for the initial breach include identity attack vectors (such as credential stuffing and phishing), entitlement misconfigurations (over-permissive access controls and exposed default credentials), and software vulnerability exploitation (targeting unpatched vulnerabilities in applications and systems).

 

Unlike the initial breach, which may employ less subtle penetration strategies (such as brute force attacks and password spraying), lateral movement is frequently done cautiously. To avoid detection, the threat actor will use techniques that blend in with legitimate network traffic, as well as host authentication, authorization, and remote access. The issue for security professionals is to detect and prevent unwanted lateral movement before the threat actor moves on to the next asset, potentially opening a path to privileged access.

Common Lateral Movement Techniques:

Once an environment is breached, threat actors will employ myriad strategies to accomplish lateral movement. The most common lateral movement techniques include:

 

  • Credential Dumping: Extracting and reusing credentials from compromised systems to access other systems within the network.

 

  • Pass-the-Hash (PtH): Utilizing hashed passwords to authenticate without knowing the actual plaintext password.

 

  • Exploitation of Trust Relationships: Leveraging identity-based trust via account relationships to move across network segments, without raising alarms.

 

  • Remote Services: Utilizing legitimate services, such as Remote Desktop Protocol (RDP) and Server Message Block (SMB), to connect and move between systems.

 

  • WMI and PowerShell: Utilizing Windows Management Instrumentation (WMI) and PowerShell scripts to execute commands and transfer files across systems as remote commands.
  • Vulnerability Exploitation: The exploitation of known or zero-day vulnerabilities within software to execute code remotely or provide information for maintaining a persistent presence.


Misconfiguration: Simple misconfigurations, or the lack of system hardening, allow for lateral movement based on applications and services using default credentials, exposed resources, and poor cybersecurity hygiene.

Detecting Lateral Movement:

Understanding that there are multiple techniques for identifying this kind of activity is crucial to detecting techniques suggestive of lateral movement. Finding out when a malicious actor is moving within your environment may often necessitate a combination of methods.

Although it’s not easy to detect lateral movement in the environment, there are a number of ways to help detect suspicious behavior associated with lateral movement techniques and offer background information to aid in the inquiry.

You can quickly detect potentially malicious activity and look into it with contextual proof by utilizing both real-time surveillance and behavioral analysis. To further grasp how these two techniques interact, let’s examine what they are in detail.

Real-Time Monitoring (Alerting):

Real-time alerting that can detect suspicious activity that requires more research is made possible by efficiently gathering, organizing, and correlating data throughout an environment. This technology can assist in tracking the development of a threat in real time and identifying compounding action that further indicates an actual concern by combining alerts.

 

Rules that relate to the MITRE ATT&CK framework, particularly those pertaining to lateral movement techniques, can also be used while using real-time monitoring. You may make sure you’re addressing every possible area of exploitation by establishing guidelines for every technique inside the framework.

 

In your SIEM, ensure logging of key authentication events such as:

  • Event ID 4624 (Logon): Successful logins, useful for identifying suspicious access.
  • Event ID 4625 (Failed Logon): Useful for detecting brute force attempts.
  • Event ID 4648: Tracking of logons using explicit credentials.
  • Event ID 4769: Kerberos ticket requests, potentially indicating Pass-the-Hash or credential reuse attacks.
  • Event ID 4668: New process creations linked to elevated privileges or lateral access.



Network Traffic Monitoring: Observe unexpected SMB, RDP, or RPC requests, especially from endpoints that don’t typically communicate. Monitoring for unusual data volumes or protocol-specific requests between segments may help detect lateral movement.

 

An important source of information about the tools, behaviors, and even exploits being used for lateral movement is Process Creation on Windows, Linux, and OSX. Lateral movement typically causes the spawning of a remote process.

 

The following are some typical sources of process creation logs:

 

For process creation, check for detailed command line data with Event ID 4688, ideally with tools like Sysmon for granular visibility. Look for unusual commands or paths, as lateral movement often uses unexpected commands to blend in.

 

Adversaries frequently use legitimate administration credentials to create scheduled tasks and remote services.

 

The following are some typical sources for service and scheduled task creation logs:

 

Windows Security Logs: 7045,4698.

Behavioral Analysis:

In order to prioritize and address activity that exhibits significant deviations from typical behavior, behavioral analysis offers a distinctive perspective on user and network entity activity.

Machine learning (ML) models in UEBA solutions establish baselines for each user and entity’s typical behavior. For example, if an account suddenly accesses a high-security segment it has never accessed before, or logs in from multiple locations within short intervals, UEBA can flag this as a potential indicator of lateral movement.

Because every detection technique offers a different viewpoint and has varying resource and timing needs, it’s crucial to avoid relying exclusively on one technique, which might not be the best course of action in every situation. While more complex attacks would necessitate both alerting and behavioral analytic research to reliably identify a threat actor, other circumstances might only require real-time alerting to effectively detect lateral movement techniques.

References

One of the most important aspects of cybersecurity is to prevent lateral movement. A threat actor seeks to operate effectively and avoid detection. It will lessen their ability to move around and lessen the impact of the occurrence if they are unable to do so. For instance, an attacker may be prevented from continuing if their credentials are stolen and are hard to use in the environment, particularly if continuing would make them more likely to be discovered and there are other organizations to target.

  • Network isolation and segmentation: This prevents a threat actor from expanding their reach or making movements once they have gained access to a portion of the network by cutting off those sections from one another.

  • Vulnerability management: In order to obtain access to different applications, threat actors frequently take advantage of vulnerabilities for both initial and lateral movement. A strong vulnerability management approach and appropriate patching will seal these gaps before they are taken advantage of.

  • Implementing zero trust: Zero Trust principles enforce strict authentication and authorization controls for every access request, regardless of user credentials. By applying the principle of least privilege, users have minimal access, and each resource requires re-authentication, significantly hindering an attacker’s ability to move laterally.

  • Endpoint Detection and Response (EDR): It is essential to implement EDR solutions that track and log endpoint behavior in real-time in order to identify and stop any lateral movement. Unusual process executions, unexpected file alterations, or new network connections are examples of abnormalities that these technologies can identify and that frequently point to lateral movement.

In conclusion, preventing and detecting lateral movement requires a layered defense strategy. Using real-time monitoring, behavioral analysis, segmentation, and proactive vulnerability management can limit an attacker’s options, significantly reducing the risk and impact of lateral movement.

Ready to get started?

Contact us to arrange a half day
Managed SOC and XDR workshop in Dubai

Ready to get started?

Contact us to arrange a half day Managed SOC and XDR workshop in Dubai

© 2024 HawkEye – Managed CSOC and XDR powered by DTS Solution. All Rights Reserved.
This is a staging environment