AWS Pentesting Tools & Configuration
Set up your attacker machine before starting any AWS engagement. These tools cover credential management, automated auditing, manual exploitation, and scripting.
Tools covered on this page:
- AWS CLI for direct API interaction and credential management
- Pacu for automated exploitation and privilege escalation
- ScoutSuite and Prowler for configuration auditing
- enumerate-iam for brute-forcing allowed IAM actions
- aws_consoler for converting credentials to console access
AWS CLI
Primary interface for interacting with AWS APIs. Most attack tools rely on it for credential resolution.
Configure a named profile for each credential set:
Explain command
| --profile $PROFILE | Name for this credential profile. Use a separate profile per engagement. |
Stores credentials in ~/.aws/credentials and config in ~/.aws/config. Use --profile $PROFILE on every command or export AWS_PROFILE=$PROFILE in your shell.
Verify access and identify the current principal:
{
"UserId": "AIDA...",
"Account": "123456789012",
"Arn": "arn:aws:iam::123456789012:user/jdoe"
}
Confirm which identity you are operating as before continuing.
Pacu
AWS exploitation framework. Covers IAM enumeration, privilege escalation, persistence, and lateral movement modules.
Launch and create a session:
Import credentials from an existing AWS CLI profile:
List available modules:
Pacu stores session data locally. Use a separate named session per engagement.
ScoutSuite
Multi-cloud security auditing tool. Produces an HTML report of misconfigurations across IAM, EC2, S3, RDS, Lambda, and more.
Run against an AWS account:
Report lands in scoutsuite-report/. Use it as a map for manual follow-up: not as a final deliverable. Findings are categorized by severity and service.
Prowler
Security assessment tool with CLI-focused output. Maps findings to CIS, NIST, and other frameworks.
Full assessment:
Scope to specific services:
Explain command
| -s iam s3 ec2 | Limit scan to specific AWS services. |
Use -M csv or -M json for machine-readable output. Useful for rapid gap analysis on large accounts before manual work.
enumerate-iam
Brute-forces allowed IAM actions for a credential set: identifies what actions are permitted without needing direct policy access.
Explain command
| --access-key $AWS_ACCESS_KEY_ID | AWS access key ID to test. |
| --secret-key $AWS_SECRET_ACCESS_KEY | AWS secret access key. |
| --session-token $AWS_SESSION_TOKEN | Session token for temporary credentials. Omit for long-term keys. |
Warning
This tool generates significant API noise: every allowed action fires a real request. Expect CloudTrail entries for every tested call.
aws_consoler
Converts temporary AWS credentials into a signed console URL. Useful for confirming access level or demonstrating impact.
Generate a console URL from a named profile:
Explain command
| -p $PROFILE | AWS CLI profile name to generate a console URL for. |
Output is a browser-ready URL valid for a short session. Does not work with long-term IAM user keys: requires session credentials.
boto3
Python SDK for custom enumeration scripts and automation beyond what CLI tooling covers.
Always use an explicit session with a named profile to avoid ambient credential bleed between engagements:
import boto3
session = boto3.Session(profile_name="$PROFILE")
iam = session.client("iam")
response = iam.list_users()