• The Salted Hash
  • Posts
  • Abusing AWS Native Services: How Ransomware is Encrypting S3 Buckets with SSE-C

Abusing AWS Native Services: How Ransomware is Encrypting S3 Buckets with SSE-C

How Cybercriminals Are Exploiting AWS's Own Encryption Mechanisms to Render Critical Data Inaccessible

Ransomware operators continue to find innovative ways to exploit even the most robust cloud infrastructures. A recent campaign, detailed by the Halcyon RISE Team, reveals a novel method where attackers leverage Amazon Web Services’ (AWS) own security features against its customers. This blog post delves into how threat actors are using AWS’s Server-Side Encryption with Customer Provided Keys (SSE-C) to encrypt data stored in S3 buckets—and what you can do to safeguard your organization.

The New Ransomware Threat: A Deep Dive

Unlike traditional ransomware that typically exploits vulnerabilities or weak security practices on local systems, this emerging campaign exploits trusted cloud services. Here’s how it works:

1. Credential Compromise

Attackers, operating under the moniker Codefinger, begin by obtaining compromised AWS credentials. These credentials, often publicized or leaked online, grant the threat actor access to permissions such as s3:GetObject and s3:PutObject. With these keys in hand, they can identify and target vulnerable S3 buckets.

2. Exploitation of SSE-C

Once inside the AWS environment, the attackers exploit AWS’s Server-Side Encryption with Customer Provided Keys (SSE-C). They initiate the encryption process by sending requests that include the x-amz-server-side-encryption-customer-algorithm header, using a locally generated AES-256 key. While AWS processes this key for the encryption operation, it never actually stores it—only an HMAC (hash-based message authentication code) is logged via AWS CloudTrail. This design choice means that without the attacker’s key, decryption—and consequently, data recovery—is virtually impossible.

3. Lifecycle Policy Manipulation

To heighten the pressure on the victim, the attackers set a lifecycle policy on the affected S3 objects. This policy marks the files for deletion within seven days, creating a ticking clock for organizations to comply with ransom demands. A ransom note is also dropped in every affected directory, complete with payment instructions (typically in Bitcoin) and a unique client ID that ties the encrypted data to the ransom request.

Why This Attack Matters

The sophistication of this method underscores a number of concerning implications:

  • Permanent Data Loss:
    Since the encryption key is generated and stored solely by the attacker, there is no AWS-based recovery path. Without the attacker’s cooperation, encrypted data remains permanently inaccessible.

  • Limited Forensic Evidence:
    AWS CloudTrail only records the HMAC of the encryption key rather than the key itself. This limitation severely hampers forensic analysis and makes it challenging to trace the source or method of the attack after the fact.

  • Potential Systemic Impact:
    Although the campaign has so far affected only a few targets, the technique has the potential for broader adoption. As more threat actors recognize this method, organizations using AWS S3 for critical data storage could face systemic threats.

Mitigation Strategies for Cybersecurity Professionals

Given the high stakes involved, it’s crucial to implement proactive measures to defend against such attacks. Here are some recommendations:

  1. Restrict SSE-C Usage:
    Utilize IAM policies with Condition elements to tightly control the application of SSE-C. Ensure that only authorized users or systems can invoke this encryption feature on S3 buckets.

  2. Strengthen Credential Management:
    Regularly audit AWS keys to ensure adherence to the principle of least privilege. Disable any unused keys and adopt a robust key rotation policy to minimize the risk of credential compromise.

  3. Enhance Logging and Monitoring:
    Enable detailed logging for S3 operations to quickly detect unusual activities such as bulk encryption events or unauthorized changes to lifecycle policies. Advanced monitoring can help identify potential breaches before they escalate.

  4. Engage AWS Support:
    Proactively work with AWS support to review your account’s security posture. Leverage AWS’s shared responsibility model by following best practices and implementing tailored security measures as advised by AWS.

Last Thoughts

The evolving ransomware landscape demands that cybersecurity professionals remain vigilant and adaptive. The recent exploitation of AWS native services using SSE-C is a stark reminder that even secure cloud platforms can be turned against us if proper safeguards are not in place. By restricting the use of sensitive features, rigorously managing credentials, and enhancing logging and monitoring practices, organizations can significantly reduce their vulnerability to such innovative attacks.

Stay informed, stay secure, and ensure that your AWS environment is as resilient as possible against emerging threats.

Have thoughts or questions on this emerging threat? Leave a comment below or reach out to our team for more insights on how to protect your cloud infrastructure from advanced ransomware tactics.