The AWS exploitation framework, designed for testing the security of Amazon Web Services environments.
Update 5/6/2020: Pacu's database structure has been updated and PacuProxy has been removed. This update will break Pacu's database if you have used previous versions of Pacu. To fix this, rename/backup the old
sqLite.dbfile and let a new one be generated on the next startup.
Where to file issues: https://github.com/RhinoSecurityLabs/pacu/issues
Maintained by: Rhino Security Labs
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.
Pacu is a fairly lightweight program, as it requires only Python3.6+ and pip3 to install a handful of Python libraries. Running install.sh will check your Python version and ensure all Python packages are up to date.
> git clone https://github.com/RhinoSecurityLabs/pacu > cd pacu > bash install.sh > python3 pacu.py
For a more detailed and user-friendly set of user instructions, please check out the Wiki's installation guide.
$ docker run -it rhinosecuritylabs/pacu:latest
$ docker run -it --entrypoint /bin/sh rhinosecuritylabs/pacu:latest
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
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. At present, Pacu has 36 modules for executing AWS attacks, but we'll be working hard to add more modules in the future, and suggestions for new modules (or even contributions of whole completed 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.
We'll be working on improving Pacu's core capabilities and building out a well-documented ecosystem so that cybersecurity researchers and developers can make new modules quickly and easily.
We're always happy to get bugs reports in the Pacu framework itself, as well as testing and feedback on different modules, and generally, critical feedback to help refine the framework. We hope to see this grow into a key open-source tool for testing AWS security, and we need your help to make that happen! Any support towards this effort 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.
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.
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_keyscommand, 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,
helpwill bring up a list of available commands.
listwill list the available modules for the regions that were set in the current session.
help module_namewill return the applicable help information for the specified module.
run module_namewill run the specified module with its default parameters.
run module_name --regions eu-west-1,us-west-1will run the specified module against the eu-west-1 and us-west-1 regions (for modules that support the --regions argument)
python3 pacu.py --helpwill display the help menu
pyhon3 pacu.py --sessionsets the session to use for commands that require one
pyhon3 pacu.py --list-moduleswill list all modules available (does not require session)
pyhon3 pacu.py --pacu-helpwill list the pacu help window (does not require session)
python3 pacu.py --module-namethe name of a moudule to perform an action on, you can execute or get information on the module
python3 pacu.py --execexecute the module provided in
python3 pacu.py --module-infoget information on the module provded in
python3 pacu.py --dataquery the local SQLAlchemy database to retrieve enumerated information
python3 pacu.py --module-args=" "supply optional module arguments to the module being executed
python3 pacu.py --set-regionsset the regions to use in the session, seperate regions by a space or enter
allfor all regions
python3 pacu.py --whoamiget information about the current user
For walkthroughs and full documentation, please visit the Pacu wiki.