IAM (Identity and Access Management) credentials are used to control and manage access to cloud services and resources. When a penetration tester obtains IAM credentials, especially those with administrative privileges, they can perform high-level operations such as provisioning services, modifying configurations, or accessing sensitive data across the cloud environment.
📝 Overview
What it is: A security framework that manages digital identities and regulates how they access resources. It is the “gatekeeper” of modern enterprise and cloud environments. Phase: passive (Recon) / attack / postexploitation Target: Active Directory, AWS, Azure, Google Cloud
⚙️ Core Concepts
- Principle of Least Privilege (PoLP): Giving users only the minimum access they need to do their jobs.
- RBAC vs. ABAC: * Role-Based: Access based on your job title (e.g., “Manager”).
- Attribute-Based: Access based on context (e.g., “Only if on the office Wi-Fi during business hours”).
- SSO (Single Sign-On): One set of credentials for multiple systems.
💻 Essential CLItool options
| Tool | Purpose |
|---|---|
| aws-cli | The native tool for interacting with AWS IAM. |
| Pacu | The “Metasploit of AWS”—specifically for IAM exploitation. |
| Prowler | An auditing tool that finds IAM misconfigurations. |
| PMapper | Visualizes IAM permissions to find hidden PrivEsc paths. |
🏷️ Tags
IAM CloudSecurity AccessControl PrivEsc attack postexploitation CLItool PenTestPlus
IAM Credentials
📝 Overview
What it is: The programmatic “keys” used by users and services to authenticate with cloud providers or identity systems. Target Phase: attack postexploitation Operating System: Cross-platform (Cloud-native)
⚙️ Key Types
- Long-term Keys: Permanent access keys (e.g., AWS Access Key ID). Dangerous if leaked.
- Temporary Credentials: Short-lived tokens granted to roles (usually valid for 1-12 hours).
- Service Accounts: Credentials specifically for non-human users (bots, apps, scripts).
⚠️ Notes for the Vault
- Hardcoded Secrets: This is the #1 finding in cloud audits. Always search codebases for strings like
SECRET_KEYorACCESS_KEY. - Privilege Escalation: A stolen “Support” key might have
iam:PassRolepermissions, allowing you to attach an “Admin” role to a new VM you create.
🏷️ Tags
IAM CloudSecurity Credentials postexploitation attack CLItool PenTestPlus
How Pentesters Steal IAM Credentials
Since you are mapping out attack paths, here are the primary ways these are harvested:
-
Local Configuration Files: Pentesters use linux commands like
grepor Windowsfindstrto hunt for hidden credential files (e.g.,~/.aws/credentialsor~/.azure/config). -
Metadata Services (SSRF): If you compromise a web server, you can query the internal metadata service (like
169.254.169.254) to pull the IAM role credentials assigned to that server. -
Environment Variables: Developers often store keys in environment variables (
env) for easy access, which can be dumped once you have a shell. -
CI/CD Pipelines: Tools like Jenkins or GitHub Actions store “Secrets.” If you gain access to the build server, you can often exfiltrate these keys.