daemon-sec-cheatsheet

The cheatsheet vault for operators: AD, enumeration, exploitation, priv-esc, web, DFIR
git clone https://git.daemon-sec.xyz/daemon-sec-cheatsheet.git
Log | Files | Refs | README | LICENSE

aws-lambda.md (1555B)


      1 ---
      2 title: "AWS - Service - Lambda & API Gateway"
      3 section: "Cloud"
      4 sectionSlug: "cloud"
      5 sourcePath: "docs/cloud/aws/aws-lambda.md"
      6 sourceUrl: "https://github.com/swisskyrepo/InternalAllTheThings/blob/203bb0c0b290/docs/cloud/aws/aws-lambda.md"
      7 sha: "203bb0c0b290"
      8 isIndex: false
      9 ---
     10 
     11 # AWS - Service - Lambda & API Gateway
     12 
     13 ## List Lambda Functions
     14 
     15 ```ps1
     16 aws lambda list-functions
     17 ```
     18 
     19 ### Invoke a Lambda Function
     20 
     21 ```ps1
     22 aws lambda invoke --function-name name response.json --region region 
     23 ```
     24 
     25 ## Extract Function's Code
     26 
     27 ```powershell
     28 aws lambda list-functions --profile uploadcreds
     29 aws lambda get-function --function-name "LAMBDA-NAME-HERE-FROM-PREVIOUS-QUERY" --query 'Code.Location' --profile uploadcreds
     30 wget -O lambda-function.zip url-from-previous-query --profile uploadcreds
     31 ```
     32 
     33 ## List API Gateway
     34 
     35 ```ps1
     36 aws apigateway get-rest-apis
     37 aws apigateway get-rest-api --rest-api-id ID
     38 ```
     39 
     40 ## Listing Information About Endpoints
     41 
     42 ```ps1
     43 aws apigateway get-resources --rest-api-id ID
     44 aws apigateway get-resource --rest-api-id ID --resource-id ID
     45 aws apigateway get-method --rest-api-id ApiID --resource-id ID --http-method method
     46 ```
     47 
     48 ## Listing API Keys
     49 
     50 ```ps1
     51 aws apigateway get-api-keys --include-values
     52 ```
     53 
     54 ## Getting Information About A Specific Api Key
     55 
     56 ```ps1
     57 aws apigateway get-api-key --api-key KEY
     58 ```
     59 
     60 ## References
     61 
     62 * [Getting shell and data access in AWS by chaining vulnerabilities - Appsecco - Riyaz Walikar - Aug 29, 2019](https://blog.appsecco.com/getting-shell-and-data-access-in-aws-by-chaining-vulnerabilities-7630fa57c7ed)