☼
⌃
☰

Lateral movement

Table of Contents

Lateral Movement

Description

Lateral Movement is a crucial stage in a multi-stage cyber attack, following the initial compromise and often succeeding initial Privilege Escalation on the first machine. The goal is to avoid detection by distributing the attack footprint and gaining access to systems that store critical assets, such as domain controllers, financial servers, or intellectual property repositories.

The Process

The technique typically involves three main steps, executed repeatedly until the primary target is reached:

  1. Reconnaissance: The attacker gathers information from the current compromised host about the surrounding network environment. This includes querying the Address Resolution Protocol (ARP) cache, viewing the routing table, checking local firewall rules, and listing local network shares.
  2. Credential Theft: The attacker extracts credentials (plain-text passwords, NTLM hashes, Kerberos tickets) from the compromised machine's memory (LSASS process on Windows) using tools like Mimikatz. These credentials belong to users who have recently logged into the current host, often including administrator or service accounts with access to other hosts.
  3. Connection and Execution: The attacker uses the stolen credentials to connect to a new host using legitimate administrative protocols (like SSH, RDP, WinRM, or PsExec). Once connected, the cycle repeats: the attacker performs further reconnaissance, attempts local privilege escalation if necessary, and harvests new credentials for the next jump.

Attack Focus

Lateral Movement relies on the principle of "trust within the network." Many internal security controls, such as network firewalls, are configured to be less restrictive for traffic originating from inside the network, allowing attackers to exploit standard administrative tools for malicious purposes.


Examples

Lateral Movement techniques often abuse standard, legitimate operating system tools and protocols.

1. Windows Environment (Domain Networks)

Tool/Protocol Command/Technique Description
PsExec psexec \\TargetPC -u user_name -p password cmd.exe A utility from Microsoft Sysinternals used to execute processes on remote systems, often via the Server Message Block (SMB) protocol.
Windows Remote Management (WinRM) Invoke-Command -ComputerName TargetPC -ScriptBlock {whoami} Uses PowerShell's remote capabilities to run arbitrary commands on a target machine, commonly used by administrators.
WMI (Windows Management Instrumentation) wmic /node:"TargetPC" process call create "c:\malware.exe" A powerful, built-in interface for managing Windows. Attackers use it to create remote processes stealthily.
Pass-the-Hash (PtH) Attack uses a stolen NTLM password hash directly to authenticate to a remote service, bypassing the need to crack the hash into a cleartext password.  

2. Linux Environment

Tool/Protocol Command/Technique Description
Secure Shell (SSH) ssh -i ~/.ssh/id_rsa user@TargetServer If the attacker finds a compromised user's SSH private key (id_rsa), they can use it to log in to any system the user has access to without needing a password.
Jumping (Pivoting) proxychains ssh user@InternalServer Using a compromised host as a relay (pivot) to tunnel traffic to otherwise inaccessible network segments.
Nmap/Netstat netstat -antp or nmap -sn 192.168.1.0/24 Used on the compromised host for internal network scanning and port discovery to identify the next target.