mirror of
https://github.com/HackTricks-wiki/hacktricks-cloud.git
synced 2026-01-10 12:13:17 -08:00
Translated ['src/README.md', 'src/banners/hacktricks-training.md', 'src/
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
## Lambda
|
||||
|
||||
For more information check:
|
||||
詳細については、次を確認してください:
|
||||
|
||||
{{#ref}}
|
||||
../../aws-services/aws-lambda-enum.md
|
||||
@@ -12,7 +12,7 @@ For more information check:
|
||||
|
||||
### Lambda Layer Persistence
|
||||
|
||||
It's possible to **introduce/backdoor a layer to execute arbitrary code** when the lambda is executed in a stealthy way:
|
||||
**任意のコードを実行するためにレイヤーを導入/バックドアする**ことが可能で、ラムダがステルスな方法で実行されるときに行えます:
|
||||
|
||||
{{#ref}}
|
||||
aws-lambda-layers-persistence.md
|
||||
@@ -20,7 +20,7 @@ aws-lambda-layers-persistence.md
|
||||
|
||||
### Lambda Extension Persistence
|
||||
|
||||
Abusing Lambda Layers it's also possible to abuse extensions and persist in the lambda but also steal and modify requests.
|
||||
Lambda Layersを悪用することで、拡張機能を悪用し、ラムダに持続させるだけでなく、リクエストを盗んだり変更したりすることも可能です。
|
||||
|
||||
{{#ref}}
|
||||
aws-abusing-lambda-extensions.md
|
||||
@@ -28,41 +28,37 @@ aws-abusing-lambda-extensions.md
|
||||
|
||||
### Via resource policies
|
||||
|
||||
It's possible to grant access to different lambda actions (such as invoke or update code) to external accounts:
|
||||
外部アカウントに対して、さまざまなラムダアクション(呼び出しやコードの更新など)へのアクセスを付与することが可能です:
|
||||
|
||||
<figure><img src="../../../../images/image (255).png" alt=""><figcaption></figcaption></figure>
|
||||
|
||||
### Versions, Aliases & Weights
|
||||
|
||||
A Lambda can have **different versions** (with different code each version).\
|
||||
Then, you can create **different aliases with different versions** of the lambda and set different weights to each.\
|
||||
This way an attacker could create a **backdoored version 1** and a **version 2 with only the legit code** and **only execute the version 1 in 1%** of the requests to remain stealth.
|
||||
ラムダは**異なるバージョン**(各バージョンに異なるコード)を持つことができます。\
|
||||
その後、**異なるバージョンの異なるエイリアスを作成**し、それぞれに異なる重みを設定できます。\
|
||||
この方法で、攻撃者は**バックドア付きのバージョン1**と**正当なコードのみのバージョン2**を作成し、**リクエストの1%でのみバージョン1を実行**してステルスを維持できます。
|
||||
|
||||
<figure><img src="../../../../images/image (120).png" alt=""><figcaption></figcaption></figure>
|
||||
|
||||
### Version Backdoor + API Gateway
|
||||
|
||||
1. Copy the original code of the Lambda
|
||||
2. **Create a new version backdooring** the original code (or just with malicious code). Publish and **deploy that version** to $LATEST
|
||||
1. Call the API gateway related to the lambda to execute the code
|
||||
3. **Create a new version with the original code**, Publish and deploy that **version** to $LATEST.
|
||||
1. This will hide the backdoored code in a previous version
|
||||
4. Go to the API Gateway and **create a new POST method** (or choose any other method) that will execute the backdoored version of the lambda: `arn:aws:lambda:us-east-1:<acc_id>:function:<func_name>:1`
|
||||
1. Note the final :1 of the arn **indicating the version of the function** (version 1 will be the backdoored one in this scenario).
|
||||
5. Select the POST method created and in Actions select **`Deploy API`**
|
||||
6. Now, when you **call the function via POST your Backdoor** will be invoked
|
||||
1. ラムダの元のコードをコピーします
|
||||
2. **元のコードをバックドアする新しいバージョンを作成**します(または悪意のあるコードのみ)。そのバージョンを公開し、**$LATESTにデプロイ**します
|
||||
1. ラムダに関連するAPIゲートウェイを呼び出してコードを実行します
|
||||
3. **元のコードを持つ新しいバージョンを作成**し、その**バージョンを$LATESTに公開してデプロイ**します。
|
||||
1. これにより、バックドア付きのコードは以前のバージョンに隠されます
|
||||
4. APIゲートウェイに移動し、**バックドア付きのラムダを実行する新しいPOSTメソッドを作成**します:`arn:aws:lambda:us-east-1:<acc_id>:function:<func_name>:1`
|
||||
1. 最後の:1は**関数のバージョンを示す**ことに注意してください(このシナリオではバージョン1がバックドア付きのものになります)。
|
||||
5. 作成したPOSTメソッドを選択し、アクションで**`APIをデプロイ`**を選択します
|
||||
6. これで、**POST経由で関数を呼び出すと、あなたのバックドア**が呼び出されます
|
||||
|
||||
### Cron/Event actuator
|
||||
|
||||
The fact that you can make **lambda functions run when something happen or when some time pass** makes lambda a nice and common way to obtain persistence and avoid detection.\
|
||||
Here you have some ideas to make your **presence in AWS more stealth by creating lambdas**.
|
||||
**何かが起こったときや時間が経過したときにラムダ関数を実行できる**という事実は、ラムダを持続性を得て検出を避けるための素晴らしく一般的な方法にします。\
|
||||
ここでは、**ラムダを作成してAWSでの存在をよりステルスにするためのアイデア**をいくつか紹介します。
|
||||
|
||||
- Every time a new user is created lambda generates a new user key and send it to the attacker.
|
||||
- Every time a new role is created lambda gives assume role permissions to compromised users.
|
||||
- Every time new cloudtrail logs are generated, delete/alter them
|
||||
- 新しいユーザーが作成されるたびに、ラムダは新しいユーザーキーを生成し、攻撃者に送信します。
|
||||
- 新しいロールが作成されるたびに、ラムダは侵害されたユーザーにロールの引き受け権限を付与します。
|
||||
- 新しいCloudTrailログが生成されるたびに、それらを削除/変更します。
|
||||
|
||||
{{#include ../../../../banners/hacktricks-training.md}}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user