Cloud Privilege Escalation & Post-Exploitation Framework
Features β’ Quick Start β’ Usage β’ Attack Flow β’ Providers β’ Contributing
S7aba is designed for authorized security testing only. Usage of this tool for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state, and federal laws. The author assumes no liability and is not responsible for any misuse or damage caused by this program.
S7aba (Ψ³ΨΨ§Ψ¨Ψ© β Arabic word for "Cloud") is a pure Bash cloud privilege escalation and post-exploitation framework designed for red teamers, penetration testers, and cloud security professionals.
It auto-detects your cloud environment, enumerates permissions and misconfigurations, identifies privilege escalation paths, and provides post-exploitation capabilities β all from a single command-line tool with zero dependencies beyond standard cloud CLIs.
- Pure Bash β No Python, Go, or Ruby required. Runs anywhere Bash runs
- Multi-Cloud β Single framework for AWS, Azure, GCP, and Kubernetes
- Modular β Plug-and-play modules for each provider and attack phase
- Safe by Default β Dry-run mode, confirmation prompts, full audit logging
- Extensible β Add new providers or techniques by creating simple shell scripts
| Phase | Capability | Description |
|---|---|---|
| π Recon | Identity & Permissions | Enumerate IAM users, roles, policies, and effective permissions |
| π Recon | Service Discovery | Map S3, EC2, Lambda, RDS, and other cloud resources |
| π Recon | Network Analysis | VPCs, security groups, public endpoints, IMDS configuration |
| π Recon | Secret Scanning | SSM parameters, Secrets Manager, Lambda env vars |
| β‘ Privesc | IAM Escalation | 14+ AWS privilege escalation methods (Rhino Security style) |
| β‘ Privesc | Policy Abuse | CreatePolicyVersion, SetDefaultPolicyVersion, inline policies |
| β‘ Privesc | Role Chaining | PassRole+Lambda, PassRole+EC2, PassRole+CloudFormation |
| π Lateral | Trust Mapping | Cross-account roles, service-linked roles, federation |
| π Lateral | Service Pivots | Move between cloud services using discovered credentials |
| π‘οΈ Persist | IAM Backdoors | Create persistent access through IAM manipulation |
| π€ Exfil | Data Discovery | Find and classify sensitive data across cloud storage |
| π§Ή Cleanup | Artifact Removal | Remove traces, logs, and created resources |
| π Report | Multi-Format | Generate reports in Text, JSON, or HTML |
# Clone
git clone https://github.com/SiteQ8/S7aba.git
cd S7aba
# Make executable
chmod +x s7aba.sh
# Run reconnaissance (auto-detects cloud provider)
./s7aba.sh recon
# Or specify provider
./s7aba.sh -p aws reconRequired:
- Bash 4.0+
curl,jq,grep,awk,sed,base64
At least one cloud CLI:
- AWS CLI (
aws) β for AWS assessments - Azure CLI (
az) β for Azure assessments - Google Cloud SDK (
gcloud) β for GCP assessments - kubectl β for Kubernetes assessments
./s7aba.sh [OPTIONS] <COMMAND> [ARGS]
COMMANDS:
recon Enumerate cloud environment & permissions
privesc Identify & exploit privilege escalation paths
persist Establish persistence mechanisms
exfil Data discovery & exfiltration techniques
lateral Lateral movement across cloud services
cleanup Remove artifacts & cover tracks
report Generate assessment report
interactive Launch interactive TUI mode
OPTIONS:
-p, --provider Target cloud (aws|azure|gcp|k8s|multi)
-r, --region Target region
-o, --output Output format (text|json|html)
-v, --verbose Verbose output
-d, --dry-run Simulate without executing
-h, --help Show help
--version Show version
# Full recon with verbose logging
./s7aba.sh -v -p aws recon
# Privilege escalation scan (dry-run)
./s7aba.sh -p aws -d privesc
# Kubernetes lateral movement
./s7aba.sh -p k8s lateral
# Generate HTML report
./s7aba.sh -o html report
# Interactive TUI mode
./s7aba.sh interactiveββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β RECON ββββββΆβ PRIVESC ββββββΆβ LATERAL β
β β β β β MOVEMENT β
β β’ Identity β β β’ IAM Paths β β β’ Trust Map β
β β’ Permissionsβ β β’ Policy Abuseβ β β’ Svc Pivots β
β β’ Services β β β’ Role Chain β β β’ Targets β
β β’ Network β β β’ Exploit β β β
ββββββββββββββββ ββββββββββββββββ ββββββββ¬ββββββββ
β
ββββββββββββββββ ββββββββββββββββ ββββββββΌββββββββ
β REPORT βββββββ CLEANUP βββββββ PERSIST & β
β β β β β EXFIL β
β β’ Text/JSON β β β’ Remove β β β’ Backdoors β
β β’ HTML β β artifacts β β β’ Data Disc. β
β β’ Findings β β β’ Cover logs β β β’ Exfil Chan.β
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
S7aba checks for 14+ known AWS IAM privilege escalation techniques:
| # | Method | Risk | Description |
|---|---|---|---|
| 1 | CreatePolicyVersion |
HIGH | Create admin policy version, set as default |
| 2 | SetDefaultPolicyVersion |
HIGH | Switch to older, more permissive policy version |
| 3 | PassRole+Lambda |
HIGH | Pass admin role to Lambda function |
| 4 | PassRole+EC2 |
HIGH | Launch EC2 with admin instance profile |
| 5 | AttachUserPolicy |
CRITICAL | Attach AdministratorAccess to self |
| 6 | AttachGroupPolicy |
HIGH | Attach admin policy to user's group |
| 7 | PutUserPolicy |
CRITICAL | Add inline admin policy to user |
| 8 | AddUserToGroup |
HIGH | Join admin group |
| 9 | UpdateAssumeRolePolicy |
HIGH | Modify admin role trust policy |
| 10 | PassRole+CloudFormation |
HIGH | CFN stack with admin role |
| 11 | LambdaCodeInjection |
MEDIUM | Modify Lambda to exfil credentials |
| 12 | SSMCommand |
HIGH | Execute on EC2 via SSM |
| 13 | CreateAccessKey |
MEDIUM | Generate keys for other users |
| 14 | PassRole+Glue |
HIGH | Glue dev endpoint with admin role |
| # | Method | Risk | Description |
|---|---|---|---|
| 1 | UserAccessAdminβOwner |
CRITICAL | Self-assign Owner role via User Access Admin |
| 2 | ContributorβRunCommand |
HIGH | Execute commands on VMs via Run Command |
| 3 | ContributorβCustomScript |
HIGH | Deploy Custom Script Extension on VMs |
| 4 | ContributorβFunctionApp |
HIGH | Create Function App with managed identity |
| 5 | VMRunCommand |
HIGH | Run arbitrary commands on virtual machines |
| 6 | AutomationRunbook |
HIGH | Create runbook with RunAs account |
| 7 | LogicAppManagedId |
HIGH | Logic App with managed identity for ARM access |
| 8 | KeyVaultPolicyMod |
HIGH | Modify Key Vault access policies |
| 9 | AppSecretAdd |
HIGH | Add credentials to owned application |
| 10 | ManagedIdentityToken |
HIGH | Extract MI token from IMDS |
| 11 | TenantConsent |
CRITICAL | Abuse tenant-wide consented permissions |
| # | Method | Risk | Description |
|---|---|---|---|
| 1 | SetIamPolicy |
CRITICAL | Modify project IAM to grant Owner |
| 2 | CreateSAKey |
HIGH | Generate key for privileged SA |
| 3 | GetSAToken |
HIGH | Generate access token for SA |
| 4 | SignBlobJwt |
HIGH | Sign blobs/JWTs as service account |
| 5 | ActAs+Compute |
HIGH | Create VM with privileged SA |
| 6 | ActAs+CloudFunction |
HIGH | Deploy Cloud Function with privileged SA |
| 7 | ActAs+CloudRun |
HIGH | Deploy Cloud Run with privileged SA |
| 8 | SetMetadata |
HIGH | Inject startup script via instance metadata |
| 9 | CloudBuild |
HIGH | Submit build using Cloud Build SA |
| 10 | UpdateRole |
HIGH | Add permissions to custom role |
| 11 | DeploymentManager |
HIGH | Create deployment with DM SA |
| 12 | OrgPolicyOverride |
CRITICAL | Override org security policies |
| # | Method | Risk | Description |
|---|---|---|---|
| 1 | BindClusterAdmin |
CRITICAL | ClusterRoleBinding to cluster-admin |
| 2 | EscalateClusterRole |
CRITICAL | Modify ClusterRole with wildcard perms |
| 3 | PrivilegedPod |
HIGH | Privileged pod to escape to host |
| 4 | HostPathPod |
HIGH | Mount host filesystem into pod |
| 5 | HostPIDPod |
HIGH | Pod with hostPID for node process access |
| 6 | ReadSecrets |
HIGH | Read SA tokens and secrets |
| 7 | Impersonate |
HIGH | Impersonate privileged users/SAs |
| 8 | PodExec |
HIGH | Exec into existing privileged pods |
| 9 | PatchWorkload |
HIGH | Modify pods/deployments for escalation |
| 10 | DaemonSetAllNodes |
HIGH | Deploy DaemonSet on every node |
| 11 | MintSAToken |
HIGH | Create tokens for privileged SAs |
| 12 | CronJobBackdoor |
MEDIUM | CronJob for persistent execution |
| Provider | Status | Recon | Privesc | Lateral | Persist | Exfil | Cleanup |
|---|---|---|---|---|---|---|---|
| AWS | β Ready | β | β | β | β | β | β |
| Azure | β Ready | β | β | β | β | β | β |
| GCP | β Ready | β | β | β | β | β | β |
| Kubernetes | β Ready | β | β | β | β | β | β |
All 4 providers fully implemented across all 6 attack phases + reporting.
S7aba/
βββ s7aba.sh # Main entry point
βββ src/
β βββ lib/
β β βββ utils.sh # Utility functions
β β βββ logger.sh # Logging & output formatting
β β βββ cloud_detect.sh # Cloud provider auto-detection
β βββ modules/
β βββ recon_aws.sh # AWS reconnaissance
β βββ privesc_aws.sh # AWS privilege escalation
β βββ lateral_*.sh # Lateral movement modules
β βββ persist_*.sh # Persistence modules
β βββ exfil_*.sh # Data exfiltration modules
β βββ cleanup_*.sh # Cleanup modules
β βββ report.sh # Report generation
βββ ui/
β βββ index.html # Web UI landing page
βββ docs/
β βββ screenshots/ # Documentation screenshots
βββ logs/ # Runtime logs (gitignored)
βββ reports/ # Generated reports (gitignored)
βββ SECURITY.md # Security policy
βββ CONTRIBUTING.md # Contribution guidelines
βββ CODE_OF_CONDUCT.md # Code of conduct
βββ LICENSE # MIT License
βββ README.md # This file
Contributions are welcome! Whether it's new cloud provider modules, additional escalation techniques, bug fixes, or documentation improvements.
See CONTRIBUTING.md for guidelines.
- π§ Azure/GCP/K8s modules β Implement recon, privesc, lateral, persist, exfil
- π§ͺ New escalation techniques β Add emerging IAM abuse methods
- π Report templates β PDF reports, SARIF output, integration with platforms
- π§Ή Testing β Unit tests, integration tests, CI/CD
- π Documentation β Tutorials, walkthroughs, video demos
Found a vulnerability? Please report it responsibly.
See SECURITY.md for our security policy and disclosure process.
Do NOT open public issues for security vulnerabilities.
This project is licensed under the MIT License β see LICENSE for details.
- Rhino Security Labs β AWS IAM privilege escalation research
- PayloadsAllTheThings β Cloud security references
- HackTricks Cloud β Cloud pentesting methodology
- Prowler β Inspiration for cloud security tooling
Built by @SiteQ8 β Ali AlEnezi π°πΌ