IBM Cloud Penetration Test & Configuration
DISCLAIMER: All commands in this cheatsheet were verified during a real engagement. Use only on systems you are authorized to test.
1. Prerequisites & Authentication
Install IBM Cloud CLI
bash
# Download from https://cloud.ibm.com/docs/cli# Or use package managercurl -fsSL https://clis.cloud.ibm.com/install/linux | sh# Verify installationibmcloud --version# Install required pluginsibmcloud plugin install vpc-infrastructureibmcloud plugin install container-serviceibmcloud plugin install cloud-object-storageibmcloud plugin install secrets-manager
Authentication Methods
bash
# Login with API keyibmcloud login --apikey YOUR_API_KEY -r us-east -g YOUR_RESOURCE_GROUP# If you have the key in an environment variableibmcloud login --apikey "$IBMCLOUD_API_KEY" -r us-east
bash
ibmcloud login -r us-east -g YOUR_RESOURCE_GROUP# Will prompt for email/password + MFA
bash
# Service IDs use API keys just like usersibmcloud login --apikey "$SERVICE_ID_API_KEY" -r us-east
Post-Login Verification
bash
# Confirm who you areibmcloud iam oauth-tokensibmcloud target# Get account detailsibmcloud account show# List available regionsibmcloud regions# List resource groupsibmcloud resource groups
Expected Output (Healthy):
text
Account: <ACCOUNT_ID>Region: us-eastResource Group: <RESOURCE_GROUP_NAME> (<RESOURCE_GROUP_ID>)User: <SERVICE_ID>
2. Token Extraction & Direct REST API Abuse
The IBM Cloud CLI is a wrapper around REST APIs. Extracting the bearer token allows you to bypass CLI limitations and hit APIs directly.
Extract IAM Bearer Token
bash
# Method 1: From ibmcloud CLITOKEN=$(ibmcloud iam oauth-tokens | grep "IAM token:" | sed 0