{"id":167180,"date":"2024-08-18T07:17:05","date_gmt":"2024-08-18T07:17:05","guid":{"rendered":"https:\/\/securityaffairs.com\/?p=167180"},"modified":"2024-08-24T23:33:31","modified_gmt":"2024-08-24T23:33:31","slug":"extortion-campaign-environment-variable-files","status":"publish","type":"post","link":"https:\/\/securityaffairs.com\/167180\/cyber-crime\/extortion-campaign-environment-variable-files.html","title":{"rendered":"Large-scale extortion campaign targets publicly accessible environment variable files (.env)"},"content":{"rendered":"
<\/div>\n

A large-scale extortion campaign compromised multiple organizations by exploiting publicly accessible environment variable files (.env).<\/h2>\n\n\n\n

Palo Alto Unit 42 researchers uncovered a large-scale extortion campaign that successfully compromised and extorted multiple victim organizations by leveraging exposed environment variable files (.env files).<\/p>\n\n\n\n

The exposed files contained sensitive variables such as credentials belonging to various applications.<\/p>\n\n\n\n

This extortion campaign involved several security failures, including exposing environment variables, using long-lived credentials, and the lack of a least privilege architecture. Threat actors scanned over 230 million targets for sensitive information, seeking misconfigured servers with exposed .env files that contained AWS credentials.. The campaign targeted 110,000 domains, uncovering over 90,000 unique variables in .env files, with 7,000 linked to cloud services and 1,500 traced back to social media accounts. The operation utilized multiple source networks to facilitate these attacks.<\/p>\n\n\n\n

\"environment<\/a><\/figure>\n\n\n\n

<\/gwmw><\/gwmw>The attackers used several tools, including the Tor network for reconnaissance and initial access, virtual private networks (VPNs) for lateral movement and data exfiltration, and virtual private server (VPS) endpoints for other aspects of the operation.<\/p>\n\n\n\n

Unit 42 researchers states that attackers did not encrypt the data before ransom, but rather they exfiltrated the data and threatened to leak it in a ransom note dropped in the compromised cloud storage container.<\/gwmw><\/p>\n\n\n\n

“Moreover, the attackers behind this campaign likely leveraged extensive automation techniques to operate successfully and rapidly. This indicates that these threat actor groups are both skilled and knowledgeable in advanced cloud architectural processes and techniques.” reads the analysis<\/strong><\/a> published by Palo Alto Unit 42. “Note that the attackers\u2019 success relied on misconfigurations in victim organizations that inadvertently exposed their .env files. It did not result from vulnerabilities or misconfigurations in cloud providers\u2019 services.”<\/em><\/gwmw><\/p>\n\n\n\n

The attackers obtained exposed AWS Identity and Access Management (IAM) access keys that were discovered in publicly accessible .env files. They identified the keys by scanning unsecured web applications. Once obtained, the attackers used the keys to access the hosting cloud environment. The most common entry point for these threats is the inadvertent misconfiguration of servers, leading to the exposure of sensitive files like .env files to the public internet.<\/p>\n\n\n\n

Once gained initial access to the cloud environment, the attackers found that the original IAM credential lacked administrator access to all cloud resources. However, they discovered that this IAM role had permissions to create new IAM roles and attach policies to existing roles. The attackers abused these capabilities to escalate their privileges by creating a new IAM role named “lambda-ex” using the CreateRole API request and then attaching the AWS-managed AdministratorAccess policy to it via the AttachRolePolicy API call. This allowed them to gain full administrative control within the victim’s cloud environment.<\/p>\n\n\n\n

“The threat actor created a malicious lambda function by leveraging the stolen IAM user credentials.The Unit 42 reverse engineering team analyzed the malicious lambda function, which consisted of a bash script configured to perform internet-wide scanning using a preconfigured set of sources containing millions of domains and IP addresses. Figure 3 displays the complete code of the lambda function.” continues the report. “The script retrieved a list of potential targets from a publicly accessible third-party S3 bucket exploited by the threat actor. We believe the threat actor hosted these third-party S3 buckets within other compromised and legitimate cloud environments, and the threat actor leveraged these resources in this attack. The list of potential targets the malicious lambda function iterated over contained a record of victim domains. For each domain in the list, the code performed a cURL<\/a> request, targeting any environment variable files exposed at that domain, (i.e., http:\/\/<target>\/.env).”<\/em><\/gwmw><\/gwmw><\/p>\n\n\n\n

The experts noticed that threat actors focused on instances where the exposed .env files contained Mailgun credentials, a circumanstace that suggests adversary aimed at leveraging them for sending phishing emails from legitimate domains and bypass security protections.<\/a><\/p>\n\n\n\n

The identity of the attackers is still unclear, but researchers were able to identify two IP addresses e tmployed by the attackers: one in Ukraine associated with lambda function activities and another in Morocco used for data exfiltration to S3.<\/p>\n\n\n\n

\u201cAWS services and infrastructure are not affected by the findings of these researchers. The issues described in this blog were a result of a bad actor abusing misconfigured web applications\u2014hosted both in the cloud and elsewhere\u2014that allowed public access to environment variable (.env) files. Some of these files contained various kinds of credentials, including AWS credentials which were then used by the bad actor to call AWS APIs. Environment variable files should never be publicly exposed, and even if kept private, should never contain AWS credentials. AWS provides a variety of easy-to-use mechanisms for web applications to access temporary AWS credentials in a secure fashion. We recommend customers follow\u00a0best practices for AWS Identity and Access Management (IAM)<\/a>\u00a0to help secure their AWS resources.\u201d AWS spokesperson told Security Affairs.<\/em><\/p>\n\n\n\n

The report includes Indicators of Compromise for this campaign along with technical details about the operation.<\/gwmw><\/p>\n\n\n\n

Follow me on Twitter: @securityaffairs<\/strong><\/a> and Facebook<\/strong><\/a> and Mastodon<\/a><\/p>\n\n\n\n

Pierluigi Paganini<\/strong><\/a><\/p>\n\n\n\n

(<\/strong>SecurityAffairs<\/strong><\/a> \u2013<\/strong> hacking, environment variable files)<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"

A large-scale extortion campaign compromised multiple organizations by exploiting publicly accessible environment variable files (.env). Palo Alto Unit 42 researchers uncovered a large-scale extortion campaign that successfully compromised and extorted multiple victim organizations by leveraging exposed environment variable files (.env files). The exposed files contained sensitive variables such as credentials belonging to various applications. This extortion […]<\/p>\n","protected":false},"author":1,"featured_media":167189,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3323,3,5],"tags":[88,15282,2004,15283,4112,9506,10918,687,1533],"class_list":["post-167180","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-breaking-news","category-cyber-crime","category-hacking","tag-cybercrime","tag-environment-variable-files","tag-extortion","tag-extortionu","tag-hacking","tag-information-security-news","tag-it-information-security","tag-pierluigi-paganini","tag-security-news"],"yoast_head":"\n杭州江阴科强工业胶带有限公司