pacu
The AWS exploitation framework, designed for testing the security of Amazon Web Services environments.
Top Related Projects
Records actions made in the AWS Management Console and outputs the equivalent CLI/SDK commands and CloudFormation/Terraform templates.
Multi-Cloud Security Auditing Tool
Cloudsplaining is an AWS IAM Security Assessment tool that identifies violations of least privilege and generates a risk-prioritized report.
Prowler is an Open Source Security tool for AWS, Azure, GCP and Kubernetes to do security assessments, audits, incident response, compliance, continuous monitoring, hardening and forensics readiness. Includes CIS, NIST 800, NIST CSF, CISA, FedRAMP, PCI-DSS, GDPR, HIPAA, FFIEC, SOC2, GXP, Well-Architected Security, ENS and more
CloudMapper helps you analyze your Amazon Web Services (AWS) environments.
Quick Overview
Pacu is an open-source AWS exploitation framework, designed to simulate attack scenarios and test AWS environments. It provides a set of modules for reconnaissance, privilege escalation, and data exfiltration, helping security professionals and penetration testers identify and address vulnerabilities in AWS infrastructures.
Pros
- Comprehensive suite of AWS-specific attack modules
- Modular architecture allowing easy extension and customization
- Active development and community support
- Helps identify and remediate security misconfigurations in AWS environments
Cons
- Requires careful handling to avoid unintended consequences in production environments
- Learning curve for users unfamiliar with AWS services and security concepts
- Some modules may become outdated as AWS frequently updates its services and security measures
- Potential for misuse if not used responsibly and ethically
Getting Started
-
Clone the repository:
git clone https://github.com/RhinoSecurityLabs/pacu.git cd pacu
-
Install dependencies:
pip install -r requirements.txt
-
Run Pacu:
python3 pacu.py
-
Set up AWS credentials:
set_keys
-
List available modules:
list
-
Run a module:
run module_name
Remember to use Pacu responsibly and only on systems and environments you have explicit permission to test.
Competitor Comparisons
Records actions made in the AWS Management Console and outputs the equivalent CLI/SDK commands and CloudFormation/Terraform templates.
Pros of AWSConsoleRecorder
- Focuses on recording and replaying AWS Console actions, useful for auditing and documentation
- Generates CloudFormation templates from recorded actions, aiding in infrastructure-as-code practices
- Lightweight and easy to use as a browser extension
Cons of AWSConsoleRecorder
- Limited to AWS Console actions, doesn't cover CLI or SDK operations
- Lacks the extensive security assessment features found in Pacu
- May require manual intervention to clean up generated CloudFormation templates
Code Comparison
AWSConsoleRecorder (JavaScript):
chrome.webRequest.onBeforeRequest.addListener(
function(details) {
if (details.method == "POST") {
// Process and record AWS Console actions
}
},
{urls: ["https://*.console.aws.amazon.com/*"]},
["requestBody"]
);
Pacu (Python):
def run(self, args, pacu_main):
session = pacu_main.get_active_session()
# Perform security assessment on AWS resources
# ...
return
Both tools serve different purposes in the AWS ecosystem. AWSConsoleRecorder is focused on capturing and reproducing AWS Console actions, while Pacu is a comprehensive AWS exploitation framework for security testing. The choice between them depends on the specific use case and security assessment requirements.
Multi-Cloud Security Auditing Tool
Pros of ScoutSuite
- Multi-cloud support: Covers AWS, Azure, GCP, and more
- Comprehensive reporting: Generates detailed HTML reports
- Customizable rulesets: Allows for tailored security assessments
Cons of ScoutSuite
- Less focus on exploitation: Primarily a scanning and reporting tool
- Steeper learning curve: More complex setup and configuration
- Limited active testing capabilities
Code Comparison
ScoutSuite (Python):
from ScoutSuite.core.cli_parser import ScoutSuiteArgumentParser
from ScoutSuite.core.console import set_logger_configuration, print_info
from ScoutSuite.core.exceptions import RuleExceptions
from ScoutSuite.core.processingengine import ProcessingEngine
from ScoutSuite.core.ruleset import Ruleset
Pacu (Python):
import argparse
import importlib
import os
import sys
from pathlib import Path
import boto3
import requests
import urllib3
from botocore.exceptions import ClientError
ScoutSuite focuses on multi-cloud scanning and reporting, with a modular architecture for different cloud providers. Pacu is more specialized for AWS and includes active testing modules. ScoutSuite's code reflects its emphasis on rule processing and report generation, while Pacu's code shows a focus on AWS interactions and module management.
Cloudsplaining is an AWS IAM Security Assessment tool that identifies violations of least privilege and generates a risk-prioritized report.
Pros of Cloudsplaining
- Focused specifically on AWS IAM policy analysis, providing in-depth insights
- Generates comprehensive HTML reports for easy sharing and visualization
- Lightweight and easy to install via pip
Cons of Cloudsplaining
- Limited to IAM policy analysis, while Pacu offers a broader range of AWS security testing features
- Less active development and community support compared to Pacu
- Lacks the extensibility and modularity of Pacu's plugin system
Code Comparison
Cloudsplaining:
from cloudsplaining.scan.policy_document import PolicyDocument
policy = PolicyDocument(policy_dict)
results = policy.analyze_policy_document()
Pacu:
import pacu.main
session = pacu.main.PacuSession()
module = session.load_module('enum_iam')
data = module.run(session)
Both tools are Python-based, but Cloudsplaining focuses on policy analysis, while Pacu provides a more comprehensive framework for AWS security testing. Cloudsplaining's code is more straightforward for IAM policy analysis, while Pacu offers a modular approach for various AWS security tasks.
Prowler is an Open Source Security tool for AWS, Azure, GCP and Kubernetes to do security assessments, audits, incident response, compliance, continuous monitoring, hardening and forensics readiness. Includes CIS, NIST 800, NIST CSF, CISA, FedRAMP, PCI-DSS, GDPR, HIPAA, FFIEC, SOC2, GXP, Well-Architected Security, ENS and more
Pros of Prowler
- More comprehensive AWS security assessment tool, covering a wider range of security checks and best practices
- Regularly updated with new checks and features, aligning with the latest AWS security recommendations
- Supports multiple output formats, making it easier to integrate with other tools and workflows
Cons of Prowler
- Primarily focused on AWS, while Pacu offers multi-cloud support
- Steeper learning curve due to its extensive feature set and configuration options
- May require more resources to run comprehensive scans compared to Pacu
Code Comparison
Prowler (Python):
def check_cloudtrail_enabled(self):
cloudtrail_client = self.session.client('cloudtrail')
trails = cloudtrail_client.describe_trails()
# ... (additional code to check CloudTrail status)
Pacu (Python):
def run(self, args, pacu_main):
session = pacu_main.get_active_session()
print('Starting CloudTrail enumeration...')
client = pacu_main.get_boto3_client('cloudtrail')
trails = client.describe_trails()['trailList']
# ... (additional code to process CloudTrail information)
Both tools use similar approaches to interact with AWS services, but Prowler tends to have more extensive checks and validations for each security aspect it examines.
CloudMapper helps you analyze your Amazon Web Services (AWS) environments.
Pros of CloudMapper
- Provides visual representation of AWS environments, making it easier to understand complex infrastructures
- Focuses on network security and offers detailed network path analysis
- Supports multiple AWS accounts, allowing for comprehensive multi-account assessments
Cons of CloudMapper
- More specialized tool, primarily focused on network visualization and analysis
- Less extensive feature set for general AWS security auditing and exploitation
- May require more manual interpretation of results compared to Pacu's automated modules
Code Comparison
CloudMapper (Python):
def parse_arguments():
parser = argparse.ArgumentParser(description="CloudMapper - AWS visualization tool")
parser.add_argument("--accounts", help="Account to collect from", required=True)
parser.add_argument("--regions", help="Regions to restrict to", default=None)
return parser.parse_args()
Pacu (Python):
def parse_args(args):
parser = argparse.ArgumentParser(description='Pacu - AWS exploitation framework')
parser.add_argument('--session', help='Set the session to interact with')
parser.add_argument('--module', help='Run a specific module')
return parser.parse_args(args)
Both tools use argparse for command-line argument parsing, but CloudMapper focuses on account and region selection, while Pacu emphasizes session management and module execution, reflecting their different primary use cases.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Quick reference
-
Where to get help: the Rhino Security Labs Discord, or Stack Overflow
-
Where to file issues: https://github.com/RhinoSecurityLabs/pacu/issues
-
Maintained by: Rhino Security Labs
What is Pacu?
Pacu is an open-source AWS exploitation framework, designed for offensive security testing against cloud environments. Created and maintained by Rhino Security Labs, Pacu allows penetration testers to exploit configuration flaws within an AWS account, using modules to easily expand its functionality. Current modules enable a range of attacks, including user privilege escalation, backdooring of IAM users, attacking vulnerable Lambda functions, and much more.
Installation
Pacu is a fairly lightweight program, as it requires only Python3.7+ and pip3 to install a handful of Python libraries.
Quick Installation
> pip3 install -U pip
> pip3 install -U pacu
> pacu
For a more detailed and user-friendly set of user instructions, please check out the Wiki's installation guide.
How to use Pacu's Docker image
Option 1: Run with default entrypoint which directly runs Pacu
$ docker run -it rhinosecuritylabs/pacu:latest
Option 2: Run without default entrypoint
$ docker run -it --entrypoint /bin/sh rhinosecuritylabs/pacu:latest
Option 3: Run with AWS config and credentials
Warning: Running this command will mount your local AWS configuration files into the Docker container when it is launched. This means that any user with access to the container will have access to your host computer's AWS credentials.
$ docker run -it -v ~/.aws:/root/.aws rhinosecuritylabs/pacu:latest
Getting Started
The first time Pacu is launched, you will be prompted to start and name a new session. This session will be used to store AWS key pairs, as well as any data obtained from running various modules. You can have any number of different sessions in Pacu, each with their own sets of AWS keys and data, and resume a session at any time (though a restart is currently required to switch between sessions).
Modules require an AWS key, which grants you minimal access to an AWS environment and is comprised of an access key ID and a secret access key. To set your session's keys, use the set_keys
command, and then follow the prompts to supply a key alias (nickname for reference), an AWS access key ID, an AWS secret access key, and an AWS session token (if you are using one).
If you are ever stuck, help
will bring up a list of available commands.
Basic Commands in Pacu
list
will list the available modules for the regions that were set in the current session.help module_name
will return the applicable help information for the specified module.run module_name
will run the specified module with its default parameters.run module_name --regions eu-west-1,us-west-1
will run the specified module against the eu-west-1 and us-west-1 regions (for modules that support the --regions argument)
Running Pacu From the CLI
pacu --help
will display the help menupacu --session <session name>
sets the session to use for commands that require onepacu --list-modules
will list all modules available (does not require session)pacu --pacu-help
will list the pacu help window (does not require session)pacu --module-name <module name>
the name of a module to perform an action on, you can execute or get information on the modulepacu --exec
execute the module provided in--module-name
pacu --module-info
get information on the module provided in--module-name
pacu --data <service name || all>
query the local SQLAlchemy database to retrieve enumerated informationpacu --module-args="<arg1> <value> <arg2> <value>"
supply optional module arguments to the module being executedpacu --set-regions <region1 region2 || all>
set the regions to use in the session, separate regions by a space or enterall
for all regionspacu --whoami
get information about the current user
Pacu's Modular Power
Pacu uses a range of plug-in modules to assist an attacker in enumeration, privilege escalation, data exfiltration, service exploitation, and log manipulation within AWS environments. Contributions or ideas for new modules are welcome.
To keep pace with ongoing AWS product developments, we've designed Pacu from the ground up with extensibility in mind. A common syntax and data structure keep modules easy to build and expand on - no need to specify AWS regions or make redundant permission checks between modules. A local SQLite database is used to manage and manipulate retrieved data, minimizing API calls (and associated logs). Reporting and attack auditing is also built into the framework; Pacu assists the documentation process through command logging and exporting, helping build a timeline for the testing process.
Community
We're always happy to get bug reports in the Pacu framework itself, as well as testing and feedback on different modules, and generally, critical feedback to help refine the framework. Any support for Pacu through use, testing, improvement, or just by spreading the word, would be very much appreciated.
If you're interested in contributing directly to the Pacu Framework itself, please read our contribution guidelines for code conventions and git-flow notes.
Developing Pacu Modules
If you're interested in writing your own modules for Pacu, check out our Module Development wiki page. As you develop new capabilities please reach out to us -- we'd love to add your new modules into the core collection that comes with Pacu.
Pacu Framework Development Goals
- Improve interface formatting
- Database forward-migrations and version tracking
- "Attack Playbooks" to allow for easier use of complex module execution chains
- Colored console output
- Module Dry-Run functionality
- Allow use of standalone config files
- Plugin architecture improvements
Notes
- Pacu is officially supported in OSX and Linux.
- Pacu is Open-Source Software and is distributed with a BSD-3-Clause License.
Submitting Requests / Bug Reports
- Report vulnerabilities in Pacu directly to us via email: pacu@rhinosecuritylabs.com .
- Pacu creates error logs within each session's folder, as well as a global error log for out-of-session errors which is created in the main directory. If you can, please include these logs with your bug reports, as it will dramatically simplify the debugging process.
- If you have a feature request, an idea, or a bug to report, please submit them here.
- Please include a description sufficient to reproduce the bug you found, including tracebacks and reproduction steps, and check for other reports of your bug before filing a new bug report. Don't submit duplicates.
Wiki
For walkthroughs and full documentation, please visit the Pacu wiki.
Contact Us
- We'd love to hear from you, whatever the reason. Reach out on the Rhino Security Labs Discord.
Disclaimers, and the AWS Acceptable Use Policy
- To the best of our knowledge Pacu's capabilities are compliant with the AWS Acceptable Use Policy, but as a flexible and modular tool, we cannot guarantee this will be true in every situation. It is entirely your responsibility to ensure that how you use Pacu is compliant with the AWS Acceptable Use Policy.
- Depending on what AWS services you use and what your planned testing entails, you may need to review AWS Customer Support Policy for Penetration Testing before actually running Pacu against your infrastructure.
- As with any penetration testing tool, it is your responsibility to get proper authorization before using Pacu outside of your environment.
- Pacu is software that comes with absolutely no warranties whatsoever. By using Pacu, you take full responsibility for any and all outcomes that result.
Top Related Projects
Records actions made in the AWS Management Console and outputs the equivalent CLI/SDK commands and CloudFormation/Terraform templates.
Multi-Cloud Security Auditing Tool
Cloudsplaining is an AWS IAM Security Assessment tool that identifies violations of least privilege and generates a risk-prioritized report.
Prowler is an Open Source Security tool for AWS, Azure, GCP and Kubernetes to do security assessments, audits, incident response, compliance, continuous monitoring, hardening and forensics readiness. Includes CIS, NIST 800, NIST CSF, CISA, FedRAMP, PCI-DSS, GDPR, HIPAA, FFIEC, SOC2, GXP, Well-Architected Security, ENS and more
CloudMapper helps you analyze your Amazon Web Services (AWS) environments.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot