Translated ['src/README.md', 'src/banners/hacktricks-training.md', 'src/

This commit is contained in:
Translator
2024-12-31 20:42:16 +00:00
parent 4ecda9fe96
commit 92eaf7ce11
245 changed files with 9813 additions and 12533 deletions

View File

@@ -2,17 +2,17 @@
{{#include ../../banners/hacktricks-training.md}}
## Basic Information
## Основна інформація
**Before start pentesting** an **AWS** environment there are a few **basics things you need to know** about how AWS works to help you understand what you need to do, how to find misconfigurations and how to exploit them.
**Перед початком пентестингу** середовища **AWS** є кілька **основних речей, які вам потрібно знати** про те, як працює AWS, щоб допомогти вам зрозуміти, що потрібно робити, як знаходити неправильні налаштування та як їх експлуатувати.
Concepts such as organization hierarchy, IAM and other basic concepts are explained in:
Концепції, такі як ієрархія організації, IAM та інші базові концепції, пояснюються в:
{{#ref}}
aws-basic-information/
{{#endref}}
## Labs to learn
## Лабораторії для навчання
- [https://github.com/RhinoSecurityLabs/cloudgoat](https://github.com/RhinoSecurityLabs/cloudgoat)
- [https://github.com/BishopFox/iam-vulnerable](https://github.com/BishopFox/iam-vulnerable)
@@ -22,49 +22,49 @@ aws-basic-information/
- [http://flaws.cloud/](http://flaws.cloud/)
- [http://flaws2.cloud/](http://flaws2.cloud/)
Tools to simulate attacks:
Інструменти для симуляції атак:
- [https://github.com/Datadog/stratus-red-team/](https://github.com/Datadog/stratus-red-team/)
- [https://github.com/sbasu7241/AWS-Threat-Simulation-and-Detection/tree/main](https://github.com/sbasu7241/AWS-Threat-Simulation-and-Detection/tree/main)
## AWS Pentester/Red Team Methodology
## Методологія AWS Pentester/Red Team
In order to audit an AWS environment it's very important to know: which **services are being used**, what is **being exposed**, who has **access** to what, and how are internal AWS services an **external services** connected.
Для аудиту середовища AWS дуже важливо знати: які **послуги використовуються**, що **експонується**, хто має **доступ** до чого, і як внутрішні AWS послуги та **зовнішні послуги** з'єднані.
From a Red Team point of view, the **first step to compromise an AWS environment** is to manage to obtain some **credentials**. Here you have some ideas on how to do that:
З точки зору Red Team, **перший крок для компрометації середовища AWS** - це отримати деякі **облікові дані**. Ось кілька ідей, як це зробити:
- **Leaks** in github (or similar) - OSINT
- **Social** Engineering
- **Password** reuse (password leaks)
- Vulnerabilities in AWS-Hosted Applications
- [**Server Side Request Forgery**](https://book.hacktricks.xyz/pentesting-web/ssrf-server-side-request-forgery/cloud-ssrf) with access to metadata endpoint
- **Local File Read**
- `/home/USERNAME/.aws/credentials`
- `C:\Users\USERNAME\.aws\credentials`
- 3rd parties **breached**
- **Internal** Employee
- [**Cognito** ](aws-services/aws-cognito-enum/#cognito)credentials
- **Витоки** в github (або подібних) - OSINT
- **Соціальна** інженерія
- Повторне використання **паролів** (витоки паролів)
- Вразливості в AWS-розміщених додатках
- [**Server Side Request Forgery**](https://book.hacktricks.xyz/pentesting-web/ssrf-server-side-request-forgery/cloud-ssrf) з доступом до метаданих
- **Читання локальних файлів**
- `/home/USERNAME/.aws/credentials`
- `C:\Users\USERNAME\.aws\credentials`
- 3-ті сторони **зламані**
- **Внутрішній** співробітник
- [**Cognito** ](aws-services/aws-cognito-enum/#cognito)облікові дані
Or by **compromising an unauthenticated service** exposed:
Або шляхом **компрометації неавтентифікованої служби**, що експонується:
{{#ref}}
aws-unauthenticated-enum-access/
{{#endref}}
Or if you are doing a **review** you could just **ask for credentials** with these roles:
Або, якщо ви проводите **огляд**, ви можете просто **попросити облікові дані** з цими ролями:
{{#ref}}
aws-permissions-for-a-pentest.md
{{#endref}}
> [!NOTE]
> After you have managed to obtain credentials, you need to know **to who do those creds belong**, and **what they have access to**, so you need to perform some basic enumeration:
> Після того, як ви змогли отримати облікові дані, вам потрібно знати, **кому належать ці облікові дані**, і **до чого вони мають доступ**, тому вам потрібно виконати деяку базову енумерацію:
## Basic Enumeration
## Базова енумерація
### SSRF
If you found a SSRF in a machine inside AWS check this page for tricks:
Якщо ви знайшли SSRF на машині всередині AWS, перевірте цю сторінку для трюків:
{{#ref}}
https://book.hacktricks.xyz/pentesting-web/ssrf-server-side-request-forgery/cloud-ssrf
@@ -72,8 +72,7 @@ https://book.hacktricks.xyz/pentesting-web/ssrf-server-side-request-forgery/clou
### Whoami
One of the first things you need to know is who you are (in where account you are in other info about the AWS env):
Однією з перших речей, які вам потрібно знати, є те, хто ви (в якому обліковому записі ви знаходитесь та інша інформація про середовище AWS):
```bash
# Easiest way, but might be monitored?
aws sts get-caller-identity
@@ -89,10 +88,9 @@ aws sns publish --topic-arn arn:aws:sns:us-east-1:*account id*:aaa --message aaa
TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"`
curl -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/dynamic/instance-identity/document
```
> [!CAUTION]
> Note that companies might use **canary tokens** to identify when **tokens are being stolen and used**. It's recommended to check if a token is a canary token or not before using it.\
> For more info [**check this page**](aws-services/aws-security-and-detection-services/aws-cloudtrail-enum.md#honeytokens-bypass).
> Зверніть увагу, що компанії можуть використовувати **canary tokens** для виявлення, коли **токени крадуться та використовуються**. Рекомендується перевірити, чи є токен canary token, перш ніж його використовувати.\
> Для отримання додаткової інформації [**перевірте цю сторінку**](aws-services/aws-security-and-detection-services/aws-cloudtrail-enum.md#honeytokens-bypass).
### Org Enumeration
@@ -102,30 +100,30 @@ aws-services/aws-organizations-enum.md
### IAM Enumeration
If you have enough permissions **checking the privileges of each entity inside the AWS account** will help you understand what you and other identities can do and how to **escalate privileges**.
Якщо у вас достатньо прав, **перевірка привілеїв кожної сутності всередині облікового запису AWS** допоможе вам зрозуміти, що ви та інші ідентичності можете робити і як **підвищити привілеї**.
If you don't have enough permissions to enumerate IAM, you can **steal bruteforce them** to figure them out.\
Check **how to do the numeration and brute-forcing** in:
Якщо у вас недостатньо прав для перерахунку IAM, ви можете **викрасти їх за допомогою брутфорсу**, щоб їх з'ясувати.\
Перевірте **як виконати нумерацію та брутфорс** в:
{{#ref}}
aws-services/aws-iam-enum.md
{{#endref}}
> [!NOTE]
> Now that you **have some information about your credentials** (and if you are a red team hopefully you **haven't been detected**). It's time to figure out which services are being used in the environment.\
> In the following section you can check some ways to **enumerate some common services.**
> Тепер, коли ви **маєте деяку інформацію про свої облікові дані** (і якщо ви червона команда, сподіваюся, ви **не були виявлені**). Час з'ясувати, які сервіси використовуються в середовищі.\
> У наступному розділі ви можете перевірити деякі способи **перерахунку деяких загальних сервісів.**
## Services Enumeration, Post-Exploitation & Persistence
AWS has an astonishing amount of services, in the following page you will find **basic information, enumeration** cheatsheets\*\*,\*\* how to **avoid detection**, obtain **persistence**, and other **post-exploitation** tricks about some of them:
AWS має вражаючу кількість сервісів, на наступній сторінці ви знайдете **основну інформацію, нумерацію** cheatsheets\*\*,\*\* як **уникнути виявлення**, отримати **постійність** та інші **післяексплуатаційні** трюки про деякі з них:
{{#ref}}
aws-services/
{{#endref}}
Note that you **don't** need to perform all the work **manually**, below in this post you can find a **section about** [**automatic tools**](./#automated-tools).
Зверніть увагу, що вам **не потрібно** виконувати всю роботу **вручну**, нижче в цьому пості ви можете знайти **розділ про** [**автоматичні інструменти**](./#automated-tools).
Moreover, in this stage you might discovered **more services exposed to unauthenticated users,** you might be able to exploit them:
Більше того, на цьому етапі ви могли виявити **більше сервісів, доступних для неавтентифікованих користувачів,** ви можете мати можливість їх експлуатувати:
{{#ref}}
aws-unauthenticated-enum-access/
@@ -133,7 +131,7 @@ aws-unauthenticated-enum-access/
## Privilege Escalation
If you can **check at least your own permissions** over different resources you could **check if you are able to obtain further permissions**. You should focus at least in the permissions indicated in:
Якщо ви можете **перевірити принаймні свої власні права** на різні ресурси, ви могли б **перевірити, чи можете ви отримати додаткові права**. Вам слід зосередитися принаймні на правах, вказаних у:
{{#ref}}
aws-privilege-escalation/
@@ -141,10 +139,10 @@ aws-privilege-escalation/
## Publicly Exposed Services
While enumerating AWS services you might have found some of them **exposing elements to the Internet** (VM/Containers ports, databases or queue services, snapshots or buckets...).\
As pentester/red teamer you should always check if you can find **sensitive information / vulnerabilities** on them as they might provide you **further access into the AWS account**.
Під час перерахунку сервісів AWS ви могли знайти деякі з них, **які відкривають елементи в Інтернеті** (порти VM/контейнерів, бази даних або сервіси черг, знімки або кошики...).\
Як pentester/red teamer ви завжди повинні перевіряти, чи можете ви знайти **чутливу інформацію / вразливості** на них, оскільки вони можуть надати вам **додатковий доступ до облікового запису AWS**.
In this book you should find **information** about how to find **exposed AWS services and how to check them**. About how to find **vulnerabilities in exposed network services** I would recommend you to **search** for the specific **service** in:
У цій книзі ви повинні знайти **інформацію** про те, як знайти **відкриті сервіси AWS та як їх перевірити**. Щодо того, як знайти **вразливості у відкритих мережевих сервісах**, я б рекомендував вам **шукати** конкретний **сервіс** в:
{{#ref}}
https://book.hacktricks.xyz/
@@ -154,52 +152,49 @@ https://book.hacktricks.xyz/
### From the root/management account
When the management account creates new accounts in the organization, a **new role** is created in the new account, by default named **`OrganizationAccountAccessRole`** and giving **AdministratorAccess** policy to the **management account** to access the new account.
Коли обліковий запис управління створює нові облікові записи в організації, у новому обліковому записі створюється **нова роль**, за замовчуванням називана **`OrganizationAccountAccessRole`** і надає політику **AdministratorAccess** для **облікового запису управління** для доступу до нового облікового запису.
<figure><img src="../../images/image (171).png" alt=""><figcaption></figcaption></figure>
So, in order to access as administrator a child account you need:
Отже, для доступу як адміністратора до дочірнього облікового запису вам потрібно:
- **Compromise** the **management** account and find the **ID** of the **children accounts** and the **names** of the **role** (OrganizationAccountAccessRole by default) allowing the management account to access as admin.
- To find children accounts go to the organizations section in the aws console or run `aws organizations list-accounts`
- You cannot find the name of the roles directly, so check all the custom IAM policies and search any allowing **`sts:AssumeRole` over the previously discovered children accounts**.
- **Compromise** a **principal** in the management account with **`sts:AssumeRole` permission over the role in the children accounts** (even if the account is allowing anyone from the management account to impersonate, as its an external account, specific `sts:AssumeRole` permissions are necessary).
- **Скомпрометувати** **управлінський** обліковий запис і знайти **ID** **дочірніх облікових записів** та **імена** **ролі** (за замовчуванням OrganizationAccountAccessRole), що дозволяє обліковому запису управління отримати доступ як адміністратор.
- Щоб знайти дочірні облікові записи, перейдіть до розділу організацій у консолі aws або виконайте `aws organizations list-accounts`
- Ви не можете знайти назву ролей безпосередньо, тому перевірте всі користувацькі політики IAM і шукайте будь-які, що дозволяють **`sts:AssumeRole` над раніше виявленими дочірніми обліковими записами**.
- **Скомпрометувати** **принципала** в управлінському обліковому записі з **дозволом `sts:AssumeRole` над роллю в дочірніх облікових записах** (навіть якщо обліковий запис дозволяє будь-кому з управлінського облікового запису видавати себе, оскільки це зовнішній обліковий запис, специфічні дозволи `sts:AssumeRole` є необхідними).
## Automated Tools
### Recon
- [**aws-recon**](https://github.com/darkbitio/aws-recon): A multi-threaded AWS security-focused **inventory collection tool** written in Ruby.
- [**aws-recon**](https://github.com/darkbitio/aws-recon): Багатопотоковий інструмент для збору **інвентаризації**, орієнтований на безпеку AWS, написаний на Ruby.
```bash
# Install
gem install aws_recon
# Recon and get json
AWS_PROFILE=<profile> aws_recon \
--services S3,EC2 \
--regions global,us-east-1,us-east-2 \
--verbose
--services S3,EC2 \
--regions global,us-east-1,us-east-2 \
--verbose
```
- [**cloudlist**](https://github.com/projectdiscovery/cloudlist): Cloudlist is a **multi-cloud tool for getting Assets** (Hostnames, IP Addresses) from Cloud Providers.
- [**cloudmapper**](https://github.com/duo-labs/cloudmapper): CloudMapper helps you analyze your Amazon Web Services (AWS) environments. It now contains much more functionality, including auditing for security issues.
- [**cloudlist**](https://github.com/projectdiscovery/cloudlist): Cloudlist - це **інструмент для багатохмарного отримання активів** (імена хостів, IP-адреси) від постачальників хмар.
- [**cloudmapper**](https://github.com/duo-labs/cloudmapper): CloudMapper допомагає вам аналізувати ваші середовища Amazon Web Services (AWS). Тепер він містить набагато більше функціональності, включаючи аудит на предмет проблем безпеки.
```bash
# Installation steps in github
# Create a config.json file with the aws info, like:
{
"accounts": [
{
"default": true,
"id": "<account id>",
"name": "dev"
}
],
"cidrs":
{
"2.2.2.2/28": {"name": "NY Office"}
}
"accounts": [
{
"default": true,
"id": "<account id>",
"name": "dev"
}
],
"cidrs":
{
"2.2.2.2/28": {"name": "NY Office"}
}
}
# Enumerate
@@ -229,9 +224,7 @@ python3 cloudmapper.py public --accounts dev
python cloudmapper.py prepare #Prepare webserver
python cloudmapper.py webserver #Show webserver
```
- [**cartography**](https://github.com/lyft/cartography): Cartography is a Python tool that consolidates infrastructure assets and the relationships between them in an intuitive graph view powered by a Neo4j database.
- [**cartography**](https://github.com/lyft/cartography): Cartography - це інструмент на Python, який консолідує інфраструктурні активи та відносини між ними в інтуїтивно зрозумілому графічному вигляді, що працює на базі Neo4j.
```bash
# Install
pip install cartography
@@ -240,17 +233,15 @@ pip install cartography
# Get AWS info
AWS_PROFILE=dev cartography --neo4j-uri bolt://127.0.0.1:7687 --neo4j-password-prompt --neo4j-user neo4j
```
- [**starbase**](https://github.com/JupiterOne/starbase): Starbase collects assets and relationships from services and systems including cloud infrastructure, SaaS applications, security controls, and more into an intuitive graph view backed by the Neo4j database.
- [**aws-inventory**](https://github.com/nccgroup/aws-inventory): (Uses python2) This is a tool that tries to **discover all** [**AWS resources**](https://docs.aws.amazon.com/general/latest/gr/glos-chap.html#resource) created in an account.
- [**aws_public_ips**](https://github.com/arkadiyt/aws_public_ips): It's a tool to **fetch all public IP addresses** (both IPv4/IPv6) associated with an AWS account.
- [**starbase**](https://github.com/JupiterOne/starbase): Starbase збирає активи та відносини з сервісів і систем, включаючи хмарну інфраструктуру, SaaS-додатки, засоби безпеки та інше в інтуїтивно зрозумілому графічному вигляді, підтримуваному базою даних Neo4j.
- [**aws-inventory**](https://github.com/nccgroup/aws-inventory): (Використовує python2) Це інструмент, який намагається **виявити всі** [**ресурси AWS**](https://docs.aws.amazon.com/general/latest/gr/glos-chap.html#resource), створені в обліковому записі.
- [**aws_public_ips**](https://github.com/arkadiyt/aws_public_ips): Це інструмент для **отримання всіх публічних IP-адрес** (як IPv4, так і IPv6), пов'язаних з обліковим записом AWS.
### Privesc & Exploiting
- [**SkyArk**](https://github.com/cyberark/SkyArk)**:** Discover the most privileged users in the scanned AWS environment, including the AWS Shadow Admins. It uses powershell. You can find the **definition of privileged policies** in the function **`Check-PrivilegedPolicy`** in [https://github.com/cyberark/SkyArk/blob/master/AWStealth/AWStealth.ps1](https://github.com/cyberark/SkyArk/blob/master/AWStealth/AWStealth.ps1).
- [**pacu**](https://github.com/RhinoSecurityLabs/pacu): Pacu is an open-source **AWS exploitation framework**, designed for offensive security testing against cloud environments. It can **enumerate**, find **miss-configurations** and **exploit** them. You can find the **definition of privileged permissions** in [https://github.com/RhinoSecurityLabs/pacu/blob/866376cd711666c775bbfcde0524c817f2c5b181/pacu/modules/iam\_\_privesc_scan/main.py#L134](https://github.com/RhinoSecurityLabs/pacu/blob/866376cd711666c775bbfcde0524c817f2c5b181/pacu/modules/iam__privesc_scan/main.py#L134) inside the **`user_escalation_methods`** dict.
- Note that pacu **only checks your own privescs paths** (not account wide).
- [**SkyArk**](https://github.com/cyberark/SkyArk)**:** Виявляє найбільш привілейованих користувачів у сканованому середовищі AWS, включаючи AWS Shadow Admins. Він використовує PowerShell. Ви можете знайти **визначення привілейованих політик** у функції **`Check-PrivilegedPolicy`** в [https://github.com/cyberark/SkyArk/blob/master/AWStealth/AWStealth.ps1](https://github.com/cyberark/SkyArk/blob/master/AWStealth/AWStealth.ps1).
- [**pacu**](https://github.com/RhinoSecurityLabs/pacu): Pacu - це відкритий **фреймворк експлуатації AWS**, призначений для тестування безпеки в наступальних цілях проти хмарних середовищ. Він може **перераховувати**, знаходити **неправильні конфігурації** та **експлуатувати** їх. Ви можете знайти **визначення привілейованих дозволів** в [https://github.com/RhinoSecurityLabs/pacu/blob/866376cd711666c775bbfcde0524c817f2c5b181/pacu/modules/iam\_\_privesc_scan/main.py#L134](https://github.com/RhinoSecurityLabs/pacu/blob/866376cd711666c775bbfcde0524c817f2c5b181/pacu/modules/iam__privesc_scan/main.py#L134) всередині словника **`user_escalation_methods`**.
- Зверніть увагу, що pacu **перевіряє лише ваші власні шляхи підвищення привілеїв** (не в межах облікового запису).
```bash
# Install
## Feel free to use venvs
@@ -264,9 +255,7 @@ pacu
> exec iam__enum_permissions # Get permissions
> exec iam__privesc_scan # List privileged permissions
```
- [**PMapper**](https://github.com/nccgroup/PMapper): Principal Mapper (PMapper) is a script and library for identifying risks in the configuration of AWS Identity and Access Management (IAM) for an AWS account or an AWS organization. It models the different IAM Users and Roles in an account as a directed graph, which enables checks for **privilege escalation** and for alternate paths an attacker could take to gain access to a resource or action in AWS. You can check the **permissions used to find privesc** paths in the filenames ended in `_edges.py` in [https://github.com/nccgroup/PMapper/tree/master/principalmapper/graphing](https://github.com/nccgroup/PMapper/tree/master/principalmapper/graphing)
- [**PMapper**](https://github.com/nccgroup/PMapper): Principal Mapper (PMapper) - це скрипт і бібліотека для виявлення ризиків у конфігурації AWS Identity and Access Management (IAM) для облікового запису AWS або організації AWS. Він моделює різних IAM користувачів і ролей в обліковому записі як орієнтований граф, що дозволяє перевіряти **підвищення привілеїв** та альтернативні шляхи, якими зловмисник може отримати доступ до ресурсу або дії в AWS. Ви можете перевірити **дозволи, використані для знаходження privesc** шляхів у файлах, що закінчуються на `_edges.py` в [https://github.com/nccgroup/PMapper/tree/master/principalmapper/graphing](https://github.com/nccgroup/PMapper/tree/master/principalmapper/graphing)
```bash
# Install
pip install principalmapper
@@ -288,10 +277,8 @@ pmapper --profile dev query 'preset privesc *' # Get privescs with admins
pmapper --profile dev orgs create
pmapper --profile dev orgs display
```
- [**cloudsplaining**](https://github.com/salesforce/cloudsplaining): Cloudsplaining is an AWS IAM Security Assessment tool that identifies violations of least privilege and generates a risk-prioritized HTML report.\
It will show you potentially **over privileged** customer, inline and aws **policies** and which **principals has access to them**. (It not only checks for privesc but also other kind of interesting permissions, recommended to use).
- [**cloudsplaining**](https://github.com/salesforce/cloudsplaining): Cloudsplaining - це інструмент оцінки безпеки AWS IAM, який виявляє порушення принципу найменших привілеїв і генерує звіт у форматі HTML з пріоритетом ризику.\
Він покаже вам потенційно **переповнені привілеї** клієнта, вбудовані та aws **політики** та які **суб'єкти мають доступ до них**. (Він не тільки перевіряє на privesc, але й інші види цікавих дозволів, рекомендовано використовувати).
```bash
# Install
pip install cloudsplaining
@@ -303,24 +290,20 @@ cloudsplaining download --profile dev
# Analyze the IAM policies
cloudsplaining scan --input-file /private/tmp/cloudsplaining/dev.json --output /tmp/files/
```
- [**cloudjack**](https://github.com/prevade/cloudjack): CloudJack оцінює облікові записи AWS на наявність **вразливостей перехоплення піддоменів** внаслідок розділених конфігурацій Route53 та CloudFront.
- [**ccat**](https://github.com/RhinoSecurityLabs/ccat): Список репозиторіїв ECR -> Витягти репозиторій ECR -> Задній доступ -> Відправити зворотне зображення
- [**Dufflebag**](https://github.com/bishopfox/dufflebag): Dufflebag - це інструмент, який **шукає** через публічні знімки Elastic Block Storage (**EBS**) на наявність секретів, які могли бути випадково залишені.
- [**cloudjack**](https://github.com/prevade/cloudjack): CloudJack assesses AWS accounts for **subdomain hijacking vulnerabilities** as a result of decoupled Route53 and CloudFront configurations.
- [**ccat**](https://github.com/RhinoSecurityLabs/ccat): List ECR repos -> Pull ECR repo -> Backdoor it -> Push backdoored image
- [**Dufflebag**](https://github.com/bishopfox/dufflebag): Dufflebag is a tool that **searches** through public Elastic Block Storage (**EBS) snapshots for secrets** that may have been accidentally left in.
### Audit
- [**cloudsploit**](https://github.com/aquasecurity/cloudsploit)**:** CloudSploit by Aqua is an open-source project designed to allow detection of **security risks in cloud infrastructure** accounts, including: Amazon Web Services (AWS), Microsoft Azure, Google Cloud Platform (GCP), Oracle Cloud Infrastructure (OCI), and GitHub (It doesn't look for ShadowAdmins).
### Аудит
- [**cloudsploit**](https://github.com/aquasecurity/cloudsploit)**:** CloudSploit від Aqua - це проект з відкритим кодом, призначений для виявлення **ризиків безпеки в облікових записах хмарної інфраструктури**, включаючи: Amazon Web Services (AWS), Microsoft Azure, Google Cloud Platform (GCP), Oracle Cloud Infrastructure (OCI) та GitHub (не шукає ShadowAdmins).
```bash
./index.js --csv=file.csv --console=table --config ./config.js
# Compiance options: --compliance {hipaa,cis,cis1,cis2,pci}
## use "cis" for cis level 1 and 2
```
- [**Prowler**](https://github.com/prowler-cloud/prowler): Prowler is an Open Source security tool to perform AWS security best practices assessments, audits, incident response, continuous monitoring, hardening and forensics readiness.
- [**Prowler**](https://github.com/prowler-cloud/prowler): Prowler - це інструмент з відкритим кодом для проведення оцінок найкращих практик безпеки AWS, аудитів, реагування на інциденти, безперервного моніторингу, зміцнення та готовності до судово-медичної експертизи.
```bash
# Install python3, jq and git
# Install
@@ -331,15 +314,11 @@ prowler -v
prowler <provider>
prowler aws --profile custom-profile [-M csv json json-asff html]
```
- [**CloudFox**](https://github.com/BishopFox/cloudfox): CloudFox helps you gain situational awareness in unfamiliar cloud environments. Its an open source command line tool created to help penetration testers and other offensive security professionals find exploitable attack paths in cloud infrastructure.
- [**CloudFox**](https://github.com/BishopFox/cloudfox): CloudFox допомагає вам отримати ситуаційну обізнаність у незнайомих хмарних середовищах. Це інструмент командного рядка з відкритим вихідним кодом, створений для допомоги тестувальникам на проникнення та іншим фахівцям з наступальної безпеки у знаходженні експлуатованих шляхів атаки в хмарній інфраструктурі.
```bash
cloudfox aws --profile [profile-name] all-checks
```
- [**ScoutSuite**](https://github.com/nccgroup/ScoutSuite): Scout Suite is an open source multi-cloud security-auditing tool, which enables security posture assessment of cloud environments.
- [**ScoutSuite**](https://github.com/nccgroup/ScoutSuite): Scout Suite - це інструмент для аудиту безпеки в мульти-хмарах з відкритим кодом, який дозволяє оцінювати безпекову позицію хмарних середовищ.
```bash
# Install
virtualenv -p python3 venv
@@ -350,18 +329,16 @@ scout --help
# Get info
scout aws -p dev
```
- [**cs-suite**](https://github.com/SecurityFTW/cs-suite): Cloud Security Suite (використовує python2.7 і виглядає непідтримуваним)
- [**Zeus**](https://github.com/DenizParlak/Zeus): Zeus - потужний інструмент для найкращих практик зміцнення AWS EC2 / S3 / CloudTrail / CloudWatch / KMS (виглядає непідтримуваним). Він перевіряє лише стандартно налаштовані облікові дані в системі.
- [**cs-suite**](https://github.com/SecurityFTW/cs-suite): Cloud Security Suite (uses python2.7 and looks unmaintained)
- [**Zeus**](https://github.com/DenizParlak/Zeus): Zeus is a powerful tool for AWS EC2 / S3 / CloudTrail / CloudWatch / KMS best hardening practices (looks unmaintained). It checks only default configured creds inside the system.
### Постійний аудит
### Constant Audit
- [**cloud-custodian**](https://github.com/cloud-custodian/cloud-custodian): Cloud Custodian is a rules engine for managing public cloud accounts and resources. It allows users to **define policies to enable a well managed cloud infrastructure**, that's both secure and cost optimized. It consolidates many of the adhoc scripts organizations have into a lightweight and flexible tool, with unified metrics and reporting.
- [**pacbot**](https://github.com/tmobile/pacbot)**: Policy as Code Bot (PacBot)** is a platform for **continuous compliance monitoring, compliance reporting and security automation for the clou**d. In PacBot, security and compliance policies are implemented as code. All resources discovered by PacBot are evaluated against these policies to gauge policy conformance. The PacBot **auto-fix** framework provides the ability to automatically respond to policy violations by taking predefined actions.
- [**streamalert**](https://github.com/airbnb/streamalert)**:** StreamAlert is a serverless, **real-time** data analysis framework which empowers you to **ingest, analyze, and alert** on data from any environment, u**sing data sources and alerting logic you define**. Computer security teams use StreamAlert to scan terabytes of log data every day for incident detection and response.
## DEBUG: Capture AWS cli requests
- [**cloud-custodian**](https://github.com/cloud-custodian/cloud-custodian): Cloud Custodian - це механізм правил для управління обліковими записами та ресурсами публічного хмари. Він дозволяє користувачам **визначати політики для забезпечення добре керованої хмарної інфраструктури**, яка є як безпечною, так і оптимізованою за витратами. Він консолідує багато з тих випадкових скриптів, які мають організації, в легкий і гнучкий інструмент з єдиними метриками та звітністю.
- [**pacbot**](https://github.com/tmobile/pacbot)**: Policy as Code Bot (PacBot)** - це платформа для **безперервного моніторингу відповідності, звітності про відповідність та автоматизації безпеки для хмари**. У PacBot політики безпеки та відповідності реалізовані як код. Всі ресурси, виявлені PacBot, оцінюються відповідно до цих політик для оцінки відповідності політикам. Рамка **автоматичного виправлення** PacBot надає можливість автоматично реагувати на порушення політик, вживаючи попередньо визначені дії.
- [**streamalert**](https://github.com/airbnb/streamalert)**:** StreamAlert - це безсерверна, **реальна** система аналізу даних, яка дозволяє вам **збирати, аналізувати та сповіщати** про дані з будь-якого середовища, **використовуючи джерела даних та логіку сповіщень, які ви визначаєте**. Команди комп'ютерної безпеки використовують StreamAlert для сканування терабайтів журналів щодня для виявлення інцидентів та реагування на них.
## DEBUG: Захоплення запитів AWS cli
```bash
# Set proxy
export HTTP_PROXY=http://localhost:8080
@@ -380,14 +357,9 @@ export AWS_CA_BUNDLE=~/Downloads/certificate.pem
# Run aws cli normally trusting burp cert
aws ...
```
## References
## Посилання
- [https://www.youtube.com/watch?v=8ZXRw4Ry3mQ](https://www.youtube.com/watch?v=8ZXRw4Ry3mQ)
- [https://cloudsecdocs.com/aws/defensive/tooling/audit/](https://cloudsecdocs.com/aws/defensive/tooling/audit/)
{{#include ../../banners/hacktricks-training.md}}