Threat Finding

Web application compromise on EC2 instanc...tial theft and S3 data access via NordVPN
Web application compromise on EC2 instance leading to credential theft and S3 data access via NordVPN
Priority
P0
Severity
Critical
ID
8302ce02-158...6fba48844d02
8302ce02-1589-4a4f-a498-6fba48844d02
Assignee
Select items...
Status
Open
Resolution
Unresolved
Recommendation
Needs Investigation
Confidence
High
Data Source
Exaforce
Exaforce
Finding Source
Exaforce
Exaforce
Exaforce Tags
Select items...

Exaforce Summary

A sophisticated attack compromised a PHP web application on EC2 instance i-056e476a24de044d2, allowing the attacker to execute commands, create a SUID binary for privilege escalation, and steal credentials. The attacker then used stolen AWS credentials from a NordVPN IP in Manila to access sensitive financial documents in S3.
Attack Chain
4
4
Attack Chain Findings
4
4
  • Nothing was found
Favorite
Favorite
Priority
Priority
Finding Severity
Finding Severity
Finding
Finding
Data Source
Data Source
Finding Source
Finding Source
Created At
Created At
Principal
Principal
Status
Status
Assignee
Assignee
Account
Account
MITRE Technique
MITRE Technique
MITRE Tactic
MITRE Tactic
Recommendation
Recommendation
Workflows
Workflows

Workflows

Automation

SLA Breached
SLA Breached

Send Email

Send email to PagerDuty
Send email to PagerDuty

Manual Trigger

Just for Testing
Just for Testing
Exabot Detect
Latest
Conclusion
Needs Investigation
High Confidence
Critical security incident detected with EC2 instance i-056e476a24de044d2 compromised via web application vulnerability. Attacker executed commands through php-fpm, accessed /etc/shadow, created SUID binary for privilege escalation, and connected to malicious domain whatsqpp.ru. The stolen AWS credentials were then used from NordVPN in Manila to access sensitive financial documents in S3. Multiple detection technologies corroborate this attack chain with clear progression from initial access through credential theft to data access.

A critical attack chain was detected targeting EC2 instance i-056e476a24de044d2, beginning with a PHP web application compromise allowing command execution through the apache user. The attacker accessed /etc/shadow for credential theft, created a SUID binary for privilege escalation, and connected to C2 domain whatsqpp.ru. Subsequently, the attacker exfiltrated AWS credentials for the instance's IAM role and used them from a NordVPN IP in Manila to access sensitive financial documents in the S3 bucket us-app3-west-data.

Analysis

FactorDetail
Principal Analysis

This attack involved two principal types working in tandem. First, the 'apache' user on the EC2 instance was used to execute malicious commands through the php-fpm process, indicating web application compromise. This service account should never be executing bash commands, accessing /etc/shadow, or creating SUID binaries. Second, the 'us-app3-west-ro' IAM role associated with the EC2 instance was exploited to access S3 data. The role was designed for legitimate application use but was abused after credential theft. The EC2 instance (i-056e476a24de044d2) was relatively new, created just 3 days before the attack on 2025-05-22, suggesting this may have been a purpose-built vulnerable system or one that was targeted quickly after deployment before proper security hardening could be implemented.

Location Analysis

The attack exhibited a clear location shift pattern indicative of credential theft and external use. Initially, all activity originated from the EC2 instance's own IP (54.176.66.94) in AWS infrastructure (AS16509, San Jose, US). This represented the web application compromise phase. The critical anomaly appeared when the same IAM role credentials were subsequently used from Manila, Philippines through a NordVPN connection (AS136787, IP 212.97.71.25). This represents impossible travel that cannot be explained by legitimate use patterns. Behavioral analysis showed this location had only been associated with this principal in 3 out of 181 historical observations (1.66%), making it highly suspicious. The use of a commercial VPN service (NordVPN/TEFINCOM S.A.) for accessing cloud resources strongly indicates deliberate attempts to mask the attacker's true location and evade detection mechanisms based on geographic anomalies.

Action Analysis

The attack progressed through a series of coordinated actions that align perfectly with the cyber kill chain: 1) Web application exploitation allowed command execution through php-fpm, leading to connection with C2 infrastructure (whatsqpp.ru) and system reconnaissance; 2) Credential harvesting via accessing /etc/shadow and storing password hashes in hidden location (/var/tmp/.ssh/conf/keys); 3) Privilege escalation attempts through creation of a SUID binary (/var/tmp/.sshd) designed to provide root access; 4) AWS credential theft (inferred from subsequent activity); and 5) Data access/exfiltration targeting specific financial documents in S3 ('exaforce_earnings.text.rtf' and 'exaforce_business_financial.txt.rtf'). The systematically increasing impact of these actions - from system reconnaissance to targeted data access - demonstrates a sophisticated threat actor with specific objectives rather than opportunistic exploitation.

Behavioral Analysis

Multiple behavioral anomalies confirm the malicious nature of this attack chain: 1) Process ancestry violations where php-fpm spawned bash processes - a classic indicator of web application compromise; 2) Creation of hidden files and directories with suspicious names (.sshd, .ssh/conf/keys) to evade detection; 3) Use of SUID binary creation - a rarely legitimate operation typically associated with privilege escalation attempts; 4) Access to sensitive credential files like /etc/shadow which should never be accessed by web server processes; 5) Network location shifts from AWS infrastructure to VPN services; 6) Targeted access to financial documents suggesting data theft rather than random exploration. The sequence of activities perfectly aligns with established MITRE ATT&CK patterns for web application compromise followed by privilege escalation, credential theft, and data exfiltration. The attacker's operational security measures (hidden files, error output redirection, VPN usage) demonstrate sophistication and deliberate attempts to evade detection.

Prioritization Analysis

This attack chain warrants Critical severity (5) with P0 priority due to: 1) Confirmed malicious activity with multiple high-confidence detections across different security tools; 2) Successful compromise of cloud credentials leading to data access; 3) Targeting of sensitive financial documents; 4) Sophistication demonstrating a determined threat actor rather than automated scanning; and 5) The recommendation is clearly 'NeedsInvestigation' given the overwhelming evidence of coordinated malicious activity. The EC2 instance (i-056e476a24de044d2) and associated IAM role (us-app3-west-ro) should be immediately isolated and revoked respectively to prevent further unauthorized access.

Next Steps
  1. Immediately isolate the affected EC2 instance (i-056e476a24de044d2) by updating its security group to block all inbound and outbound traffic. This action is critical to prevent further malicious activity, command and control communication, or data exfiltration. Create a snapshot of the instance before any modifications to preserve forensic evidence. The isolation will stop any ongoing malicious processes and prevent lateral movement while allowing for investigation. Document all changes made to the security group as part of the incident response process.

  2. Revoke and rotate all AWS credentials associated with the compromised EC2 instance and the 'us-app3-west-ro' IAM role immediately. This includes terminating any active sessions using temporary credentials by updating the IAM role's trust policy. Review CloudTrail logs to identify all API calls made using these credentials during and after the attack timeframe, particularly focusing on S3 object access and any attempts to access other AWS services. Implement more restrictive IAM policies based on the principle of least privilege to limit the blast radius of future compromises.

  3. Perform comprehensive forensic analysis on the EC2 instance to determine the initial infection vector and full extent of compromise. Focus on web application logs to identify how the initial access was achieved, examine all files in hidden directories like /var/tmp/.ssh/ and /var/tmp/.sshd, analyze bash history files, and scan for additional backdoors or persistence mechanisms. Investigate which specific financial documents in the S3 bucket may have been accessed or exfiltrated and assess the sensitivity of any exposed data for potential notification requirements.

  4. Enhance preventive security controls based on the attack patterns observed. Implement AWS IMDSv2 for all EC2 instances to prevent simple HTTP request credential theft. Configure Web Application Firewall rules to block common injection patterns that could lead to command execution. Implement S3 bucket policies that restrict access based on IP ranges and require MFA. Enable CloudTrail data events for sensitive S3 buckets to improve detection of unauthorized access. Consider implementing runtime application security monitoring for web applications to detect and block command injection attacks in real-time.

Exabot Search

Hello, Taylor

Exabot can make mistakes. Verify before making decisions.
Use shift+enter for new line
Exabot Search