Lambda Functions

Lambda Function exploits

AWS Lambda is a compute service used to run code in response to events, and manage compute resources automatically. Lambda is serverless

Enumeration

List of all lambda functions

aws lambda list-functions

Retrieve the information about the specified lambda function

aws lambda get-function --function-name [function-name]

Retrieve the policy information about the specified lambda function

aws lambda get-policy --function-name [function-name]

Retrieve the event source mapping information about the specified lambda function

aws lambda list-event-source-mappings --function-name [function-name]

List of all the layers (dependencies) in aws account

aws lambda list-layers

Retrieve the full information about the specified layer name

aws lambda get-layer-version --layer-name [layername] --version-number [version-number]

REST API Gateway

List of all the REST APIs

aws apigateway get-rest-apis

Get the information about specified API

Get stages

List information about a collection of resources

Get information about the specified resource

Get the method information for the specified resource

List of all stages for a REST API

Get the information about specified API's stage

Get the information about a specified API key

Call a REST API

Credential Access

RCE

Lambda function vulnerable to command injection

Command Injection

SSRF

Using CLI

Environment variable:

One misconfiguration organizations often make with Lambda is including sensitive information in the environmental variables of the function

Execute a lambda function

Exploitation - update-function-code

Persistence

lambda:UpdateFunctionCode

IAM

PrivEsc

iam:PassRole + lambda:CreateFunction + lambda:InvokeFunction

IAM

Interesting Book

Interesting Books

Disclaimer: As an Amazon Associate, I earn from qualifying purchases. This helps support this GitBook project at no extra cost to you.

Last updated