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-functionsRetrieve 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-layersRetrieve 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-apisGet 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 InjectionSSRF
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
IAMPrivEsc
iam:PassRole + lambda:CreateFunction + lambda:InvokeFunction
IAMInteresting Book
Interesting BooksAdvanced Penetration Testing: Hacking AWS 2 This book delves deeper into analyzing the security of various AWS services and shows techniques and tactics used by an attacker to breach an AWS environment
Hands-On AWS Penetration Testing with Kali Linux Set up a virtual lab and pentest major AWS services, including EC2, S3, Lambda, and Cloud
Last updated