Translated ['src/README.md', 'src/banners/hacktricks-training.md', 'src/

This commit is contained in:
Translator
2024-12-31 20:36:01 +00:00
parent 388bdfdf0a
commit 0077c42f9c
245 changed files with 9025 additions and 11888 deletions

View File

@@ -4,62 +4,57 @@
## STS
**AWS Security Token Service (STS)** is primarily designed to issue **temporary, limited-privilege credentials**. These credentials can be requested for **AWS Identity and Access Management (IAM)** users or for authenticated users (federated users).
**AWS सुरक्षा टोकन सेवा (STS)** मुख्य रूप से **अस्थायी, सीमित-विशेषाधिकार क्रेडेंशियल्स** जारी करने के लिए डिज़ाइन की गई है। ये क्रेडेंशियल्स **AWS पहचान और पहुंच प्रबंधन (IAM)** उपयोगकर्ताओं या प्रमाणित उपयोगकर्ताओं (संघीय उपयोगकर्ताओं) के लिए अनुरोध किए जा सकते हैं।
Given that STS's purpose is to **issue credentials for identity impersonation**, the service is immensely valuable for **escalating privileges and maintaining persistence**, even though it might not have a wide array of options.
चूंकि STS का उद्देश्य **पहचान अनुकरण के लिए क्रेडेंशियल्स जारी करना** है, यह सेवा **विशेषाधिकार बढ़ाने और निरंतरता बनाए रखने** के लिए अत्यधिक मूल्यवान है, भले ही इसके पास विकल्पों की एक विस्तृत श्रृंखला न हो।
### Assume Role Impersonation
The action [AssumeRole](https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html) provided by AWS STS is crucial as it permits a principal to acquire credentials for another principal, essentially impersonating them. Upon invocation, it responds with an access key ID, a secret key, and a session token corresponding to the specified ARN.
AWS STS द्वारा प्रदान किया गया क्रिया [AssumeRole](https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html) महत्वपूर्ण है क्योंकि यह एक प्रमुख को दूसरे प्रमुख के लिए क्रेडेंशियल्स प्राप्त करने की अनुमति देती है, मूल रूप से उन्हें अनुकरण करती है। जब इसे लागू किया जाता है, तो यह एक एक्सेस कुंजी आईडी, एक गुप्त कुंजी, और निर्दिष्ट ARN के अनुसार एक सत्र टोकन के साथ प्रतिक्रिया करता है।
For Penetration Testers or Red Team members, this technique is instrumental for privilege escalation (as elaborated [**here**](../aws-privilege-escalation/aws-sts-privesc.md#sts-assumerole)). However, it's worth noting that this technique is quite conspicuous and may not catch an attacker off guard.
पेनिट्रेशन टेस्टर्स या रेड टीम के सदस्यों के लिए, यह तकनीक विशेषाधिकार वृद्धि के लिए महत्वपूर्ण है (जैसा कि [**यहां**](../aws-privilege-escalation/aws-sts-privesc.md#sts-assumerole) विस्तृत किया गया है)। हालाँकि, यह ध्यान देने योग्य है कि यह तकनीक काफी स्पष्ट है और यह हमलावर को चौंका नहीं सकती।
#### Assume Role Logic
In order to assume a role in the same account if the **role to assume is allowing specifically a role ARN** like in:
यदि **ध्यान देने योग्य भूमिका ARN** की अनुमति देने वाली भूमिका है तो उसी खाते में एक भूमिका को मानने के लिए:
```json
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::<acc_id>:role/priv-role"
},
"Action": "sts:AssumeRole",
"Condition": {}
}
]
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::<acc_id>:role/priv-role"
},
"Action": "sts:AssumeRole",
"Condition": {}
}
]
}
```
इस मामले में **`priv-role`** भूमिका को उस भूमिका को ग्रहण करने के लिए **विशेष रूप से अनुमति देने** की आवश्यकता नहीं है (उस अनुमति के लिए पर्याप्त है)।
The role **`priv-role`** in this case, **doesn't need to be specifically allowed** to assume that role (with that allowance is enough).
However, if a role is allowing an account to assume it, like in:
हालांकि, यदि एक भूमिका किसी खाते को उसे ग्रहण करने की अनुमति दे रही है, जैसे कि:
```json
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::<acc_id>:root"
},
"Action": "sts:AssumeRole",
"Condition": {}
}
]
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::<acc_id>:root"
},
"Action": "sts:AssumeRole",
"Condition": {}
}
]
}
```
उस भूमिका को ग्रहण करने की कोशिश करने के लिए उसे उस भूमिका पर **विशिष्ट `sts:AssumeRole` अनुमति** की आवश्यकता होगी **ताकि वह उसे ग्रहण कर सके**
The role trying to assume it will need a **specific `sts:AssumeRole` permission** over that role **to assume it**.
If you try to assume a **role** **from a different account**, the **assumed role must allow it** (indicating the role **ARN** or the **external account**), and the **role trying to assume** the other one **MUST** to h**ave permissions to assume it** (in this case this isn't optional even if the assumed role is specifying an ARN).
यदि आप **किसी अन्य खाते** से **भूमिका** ग्रहण करने की कोशिश करते हैं, तो **ग्रहण की गई भूमिका को इसकी अनुमति देनी चाहिए** (भूमिका **ARN** या **बाहरी खाते** को इंगित करते हुए), और **जो भूमिका दूसरी को ग्रहण करने की कोशिश कर रही है** उसे **इसे ग्रहण करने की अनुमति होनी चाहिए** (इस मामले में यह वैकल्पिक नहीं है, भले ही ग्रहण की गई भूमिका एक ARN निर्दिष्ट कर रही हो)।
### Enumeration
```bash
# Get basic info of the creds
aws sts get-caller-identity
@@ -72,10 +67,9 @@ aws sts get-session-token
## MFA
aws sts get-session-token --serial-number <arn_device> --token-code <otp_code>
```
### Privesc
In the following page you can check how to **abuse STS permissions to escalate privileges**:
इस पृष्ठ पर आप देख सकते हैं कि **STS अनुमतियों का दुरुपयोग करके विशेषाधिकार कैसे बढ़ाएं**:
{{#ref}}
../aws-privilege-escalation/aws-sts-privesc.md
@@ -98,7 +92,3 @@ In the following page you can check how to **abuse STS permissions to escalate p
- [https://blog.christophetd.fr/retrieving-aws-security-credentials-from-the-aws-console/?utm_source=pocket_mylist](https://blog.christophetd.fr/retrieving-aws-security-credentials-from-the-aws-console/?utm_source=pocket_mylist)
{{#include ../../../banners/hacktricks-training.md}}