Initial Access (TA0001) Techniques
Introduction
Investigating initial access in a network, particularly in Windows workstations and server systems, involves a structured approach to identify how an unauthorised entity first gained entry. This process is critical for understanding the scope and impact of a security incident.
Initial Preparation and Response
Initial Assessment: Confirm the breach and assess the scope.
Secure Your Environment: Ensure the investigation is conducted securely to prevent further compromise.
Containment: Isolate affected systems to prevent lateral movement or further damage.
Preserve Evidence: Immediately secure and preserve logs and data that could be critical for the investigation.
Identify Entry Points
Review Logs: Check security logs, system logs, application logs, and firewall logs for unusual activities.
Analyse Network Traffic: Look for anomalies in network traffic that could indicate unauthorised access.
Examine Entry Points: Common entry points include email (phishing), remote desktop protocol (RDP), web applications, and external devices.
System-Specific Investigations
Windows Workstation:
Check Event Viewer for login attempts, application errors, and system messages.
Analyse the Windows Security Logs for failed login attempts or unusual successful logins.
Use tools like Process Explorer to examine running processes for signs of malicious activity.
Windows Server:
Examine IIS logs if the server hosts web applications.
Review Active Directory logs for unauthorised changes.
Check database logs to see if the server hosts critical databases.
Forensic Analysis
Disk and Memory Forensics: Use tools like Volatility for memory analysis and Autopsy for disk forensics.
Timeline Analysis: Build a timeline of events to understand the sequence of actions taken by the attacker.
Artifact Analysis: Examine files, registry entries, and other system artefacts for signs of tampering or unauthorised access.
Malware Analysis (If Applicable)
Identify Malware: Use antivirus scans and malware analysis tools to identify and analyse malicious software.
Reverse Engineering: If skilled resources are available, reverse-engineering malware can provide insights into its capabilities and origin.
Utilise Threat Intelligence
Cross-reference Indicators of Compromise (IoCs): Compare findings with known IoCs from threat intelligence sources.
Contextualise the Attack: Understand if the attack is part of a more extensive campaign or linked to known threat actors.
Interviews and Internal Investigation
Conduct Interviews: Talk to users who might have witnessed unusual activities or received phishing emails.
Review Internal Policies: Check for any recent changes in network or security policies that could have opened vulnerabilities.
Documentation and Reporting
Detail Findings: Document every step taken and evidence found during the investigation.
Report to Stakeholders: Provide clear and comprehensive reports to relevant stakeholders, including technical details and business impact.
Post-Investigation Actions
Remediation: Address the identified vulnerabilities and entry points.
Monitoring: Enhance monitoring capabilities to detect similar attempts in the future.
Lessons Learned: Conduct a post-mortem to improve security posture and response capabilities.
Legal and Compliance Considerations
Legal Compliance: Ensure the investigation complies with legal requirements and industry standards.
Data Protection: Be mindful of privacy and data protection laws when handling sensitive information.
Forensic investigation of initial access is a meticulous and detailed process. Each step is critical to uncovering the full scope of the intrusion and preventing future incidents. Stay updated with the latest forensic techniques and tools as cyber threats evolve.
Using KQL to Investigate Initial Access Activities in an Environment Using Defender/Sentinel
Initial Access is the first stage in the attack lifecycle, where adversaries gain entry into a network.
Note: While there are more straightforward methods for looking at these kinds of attacks, the goal is to tackle them from a beginner's point of view without utilising intricate KQL queries that a Junior SOC analyst would find challenging to understand the intent of the query.
1. T1190 - Exploit Public-Facing Application
Objective: Detect attempts to exploit vulnerabilities in public-facing applications to gain unauthorised access.
Detect Unusual HTTP POST Requests
Purpose: Identify suspicious POST requests that might exploit attempt.
Monitor Web Server Logs for Exploit Patterns
Purpose: Detect patterns in web logs that may indicate exploitation.
Detect Suspicious Input in Web Forms
Purpose: Identify attempts at SQL injection or XSS.
Identify Access to Vulnerable Endpoints
Purpose: Detect attempts to access known vulnerable endpoints.
Monitor for Known Exploit Tools
Purpose: Identify the use of automated tools to exploit web applications.
Detect Web Shell Uploads
Purpose: Monitor for the upload of web shells.
Monitor for Suspicious GET Requests
Purpose: Identify GET requests that attempt to execute commands.
Detect Suspicious File Uploads
Purpose: Monitor for excessive file uploads.
Monitor for Exploit Attempts via HTTP Headers
Purpose: Detect exploit attempts via HTTP headers.
Identify Unexpected Application Behaviour
Purpose: Monitor for web servers executing unexpected processes.
2. T1078 - Valid Accounts
Objective: Detect unauthorised access using stolen or compromised credentials.
Detect Logins from Unusual Locations
Purpose: Identify logins from unfamiliar IP addresses.
Monitor Logins Outside Business Hours
Purpose: Detect logins occurring outside regular working hours.
Detect Failed Login Attempts
Purpose: Identify multiple failed login attempts.
Identify Privileged Account Use
Purpose: Monitor the usage of privileged accounts.
Detect Logins from Multiple Geolocations
Purpose: Identify users logging in from multiple geolocations in a short period.
Monitor for New Account Creations
Purpose: Detect the creation of new accounts.
Detect Account Deletions
Purpose: Monitor for account deletions.
Monitor for Account Privilege Escalation
Purpose: Detect unauthorised privilege escalations.
Detect Suspicious Use of Service Accounts
Purpose: Monitor the use of service accounts.
Identify Logins with Disabled Accounts
Purpose: Detect login attempts with disabled accounts.
Purpose: Detect login attempts with disabled accounts.
3. T1195 - Supply Chain Compromise
Objective: Detect indicators of a supply chain compromise where an adversary infiltrates via a third-party service or software.
Monitor for New or Unknown Software Installations
Purpose: Detect installation of software from potentially compromised supply chains.
Identify Changes to Critical System Files
Purpose: Monitor for modifications to critical system files.
Detect Communication with Known Malicious IPs
Purpose: Identify communication with IP addresses known to be associated with supply chain attacks.
Monitor for Unusual Application Behaviour
Purpose: Detect unexpected execution of system tools by third-party applications.
Identify Suspicious DLL Loads
Purpose: Monitor for DLL loads that may indicate a compromised application.
Detect New or Unknown Network Connections
Purpose: Identify new or unknown network connections that could indicate a supply chain attack.
Monitor for Changes to Startup Programs
Purpose: Detect unauthorised changes to startup programs.
Identify Unauthorised Code Signing
Purpose: Monitor for unauthorised code signing that could indicate a compromised application.
Detect Changes to System Services
Purpose: Identify changes to system services that may be linked to a supply chain compromise.
Monitor for Suspicious Scripting Activity
Purpose: Detect the execution of scripts that could be associated with a supply chain attack.
4. T1199 - Trusted Relationship
Objective: Detect unauthorised access or activity stemming from a trusted relationship, such as a partner or vendor.
Monitor for Logins from Partner Networks
Purpose: Identify logins originating from partner networks.
Detect Unusual Activity from Trusted Accounts
Purpose: Monitor for unusual activity from accounts associated with trusted relationships.
Identify Access to Critical Systems by Trusted Accounts
Purpose: Detect access to critical systems by trusted accounts.
Monitor for Changes to Permissions of Trusted Accounts
Purpose: Detect changes to permissions for trusted accounts.
Detect Unusual File Access by Trusted Accounts
Purpose: Identify unusual file access by trusted accounts.
Monitor for Network Connections from Trusted Vendors
Purpose: Detect network connections originating from vendor networks.
Identify Changes to Firewall Rules by Trusted Accounts
Purpose: Monitor changes to firewall rules by trusted accounts.
Detect Installation of Software by Trusted Accounts
Purpose: Identify software installation by trusted accounts.
Monitor for Changes to Network Configurations by Trusted Accounts
Purpose: Detect changes to network configurations by trusted accounts.
Identify Unusual Email Activity from Trusted Accounts
Purpose: Monitor for unusual email activity from trusted domains.
5. T1133 - External Remote Services
Objective: Detect unauthorised access via external remote services such as VPNs, RDP, or other remote access tools.
Detect RDP Logins from Unfamiliar IPs
Purpose: Identify RDP logins from unfamiliar IP addresses.
Monitor VPN Connections from Unusual Locations
Purpose: Detect VPN connections from unusual locations.
Identify SSH Logins from External Sources
Purpose: Monitor SSH logins from external IP addresses.
Monitor for Remote Desktop Gateway Access
Purpose: Identify access to Remote Desktop Gateways.
Detect Multiple Failed Remote Login Attempts
Purpose: Identify multiple failed remote login attempts.
Monitor for RDP Connections Outside Business Hours
Purpose: Detect RDP connections outside normal working hours.
Detect Use of Remote Access Tools
Purpose: Identify the use of remote access tools.
Identify VPN Logins from Multiple Geolocations
Purpose: Monitor VPN logins from multiple geolocations.
Monitor for External Access to Administrative Accounts
Purpose: Detect remote access to administrative accounts.
Detect VPN Access from Blacklisted Countries
Purpose: Identify VPN access attempts from blacklisted countries.
6. T1078.004 - Cloud Accounts
Objective: Detect unauthorised access using compromised cloud accounts.
Monitor Cloud Logins from Unusual Locations
Purpose: Detect cloud account access from unexpected countries.
Detect Multiple Cloud Logins from Different Locations
Purpose: Identify users logging in from multiple locations in a short period.
Monitor for Cloud Account Logins During Off-Hours
Purpose: Detect cloud account logins outside normal working hours.
Identify Failed Cloud Login Attempts
Purpose: Monitor for failed cloud login attempts.
Detect Use of Cloud Admin Accounts
Purpose: Identify logins using cloud admin accounts.
Monitor for Cloud Account Privilege Escalation
Purpose: Detect unauthorised privilege escalations in cloud accounts.
Detect Cloud Account Logins from Unrecognised Devices
Purpose: Monitor for logins from unrecognised devices.
Monitor for Cloud Account Logins via Unusual Methods
Purpose: Detect cloud account logins using unusual methods.
Identify Suspicious Cloud Account Activity
Purpose: Monitor OAuth2 logins for suspicious activity.
Detect Unauthorised Cloud API Calls
Purpose: Identify unauthorised API calls made using cloud accounts.
7. T1566 - Phishing
Objective: Detect phishing attempts aimed at gaining unauthorised access to systems or credentials.
Monitor for Emails Containing Suspicious Attachments
Purpose: Identify emails with suspicious attachments that may be phishing attempts.
Detect Emails from Unfamiliar Domains
Purpose: Monitor for emails originating from unfamiliar domains.
Identify Multiple Failed Login Attempts Following Phishing Emails
Purpose: Detect multiple failed login attempts after a phishing campaign.
4. Monitor for Credential Harvesting Attempts
Purpose: Identify potential credential harvesting attempts.
Detect Email Links Leading to Malicious Sites
Purpose: Monitor emails with links that could lead to malicious websites.
Identify Unusual Email Forwarding Rules
Purpose: Detect unauthorised email forwarding rules that may indicate a phishing attack.
Monitor for Phishing Emails Spoofing Trusted Domains
Purpose: Identify phishing emails spoofing trusted domains.
Detect Suspicious Email Activity After Clicking Phishing Links
Purpose: Monitor for suspicious email activity following phishing attempts.
Identify Emails Containing Suspicious Macros
Purpose: Detect emails with attachments containing macros that may be used for phishing.
Monitor for Executable Files Sent via Email
Purpose: Identify emails containing executable files that could be part of a phishing attack.
Last updated