A significant extortion campaign has been uncovered, targeting various organizations by exploiting publicly accessible environment variable files, commonly known as .env files, which contain sensitive credentials related to cloud and social media applications. According to a report from Palo Alto Networks’ Unit 42, several security oversights contributed to the campaign’s success, including the exposure of environment variables, reliance on long-lived credentials, and the lack of a least privilege architecture. Attackers leveraged these vulnerabilities to infiltrate organizations’ Amazon Web Services (AWS) environments and scan over 230 million unique targets for sensitive information.
The campaign specifically targeted 110,000 domains and successfully exfiltrated over 90,000 unique variables from the compromised .env files, with 7,000 of those related to cloud services and 1,500 connected to social media accounts. Rather than encrypting data before demanding ransom, the attackers extracted sensitive information from cloud storage containers and placed ransom notes directly within them, highlighting their audacity and strategic planning. Notably, the campaign did not rely on security flaws in cloud provider services but rather took advantage of the inadvertent exposure of .env files on unsecured web applications to gain initial access.
Further investigation revealed that the attackers used stolen credentials to gain access to the cloud environment, facilitating extensive reconnaissance to expand their foothold. By exploiting AWS Identity and Access Management (IAM) access keys, they created new roles with administrative permissions and deployed AWS Lambda functions to automate internet-wide scanning for potential targets. The process involved iterating over a list of victim domains and executing cURL requests to identify and extract any exposed environment variable files containing cleartext cloud credentials.
Unit 42 researchers noted that the attackers demonstrated a particular interest in extracting Mailgun credentials from the .env files, likely intending to send phishing emails using legitimate domains. The attack concluded with the exfiltration and deletion of sensitive data from victims’ S3 buckets, followed by the upload of ransom notes demanding payment to prevent the stolen information from being sold on the dark web. Despite the lack of clarity regarding the attackers’ identities, evidence suggests extensive automation techniques were employed, indicating a high level of expertise in cloud architecture. AWS has since clarified that the campaign exploited misconfigured web applications rather than vulnerabilities within their infrastructure, emphasizing that .env files should never be publicly exposed.
Reference: