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

This commit is contained in:
Translator
2024-12-31 20:10:24 +00:00
parent 192d97f7b7
commit 536671c61c
245 changed files with 10169 additions and 12893 deletions

View File

@@ -2,17 +2,17 @@
{{#include ../../banners/hacktricks-training.md}}
## Basic Information
## Información Básica
**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.
**Antes de comenzar el pentesting** en un **AWS** ambiente, hay algunas **cosas básicas que necesitas saber** sobre cómo funciona AWS para ayudarte a entender qué necesitas hacer, cómo encontrar configuraciones incorrectas y cómo explotarlas.
Concepts such as organization hierarchy, IAM and other basic concepts are explained in:
Conceptos como la jerarquía de organización, IAM y otros conceptos básicos se explican en:
{{#ref}}
aws-basic-information/
{{#endref}}
## Labs to learn
## Laboratorios para aprender
- [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:
Herramientas para simular ataques:
- [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
## Metodología de Pentester/Red Team de AWS
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.
Para auditar un ambiente de AWS, es muy importante saber: qué **servicios se están utilizando**, qué está **siendo expuesto**, quién tiene **acceso** a qué, y cómo están conectados los servicios internos de AWS y los **servicios externos**.
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:
Desde el punto de vista de un Red Team, el **primer paso para comprometer un ambiente de AWS** es lograr obtener algunas **credenciales**. Aquí tienes algunas ideas sobre cómo hacerlo:
- **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
- **Filtraciones** en github (o similar) - OSINT
- **Ingeniería** Social
- Reutilización de **contraseñas** (filtraciones de contraseñas)
- Vulnerabilidades en Aplicaciones Alojadas en AWS
- [**Server Side Request Forgery**](https://book.hacktricks.xyz/pentesting-web/ssrf-server-side-request-forgery/cloud-ssrf) con acceso al endpoint de metadatos
- **Lectura de Archivos Locales**
- `/home/USERNAME/.aws/credentials`
- `C:\Users\USERNAME\.aws\credentials`
- **terceros** **comprometidos**
- Empleado **Interno**
- [**Cognito** ](aws-services/aws-cognito-enum/#cognito)credenciales
Or by **compromising an unauthenticated service** exposed:
O comprometiendo un **servicio no autenticado** expuesto:
{{#ref}}
aws-unauthenticated-enum-access/
{{#endref}}
Or if you are doing a **review** you could just **ask for credentials** with these roles:
O si estás haciendo una **revisión**, podrías simplemente **pedir credenciales** con estos 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:
> Después de haber logrado obtener credenciales, necesitas saber **a quién pertenecen esas credenciales**, y **a qué tienen acceso**, así que necesitas realizar alguna enumeración básica:
## Basic Enumeration
## Enumeración Básica
### SSRF
If you found a SSRF in a machine inside AWS check this page for tricks:
Si encontraste un SSRF en una máquina dentro de AWS, revisa esta página para trucos:
{{#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):
Una de las primeras cosas que necesitas saber es quién eres (en qué cuenta estás y otra información sobre el ambiente de AWS):
```bash
# Easiest way, but might be monitored?
aws sts get-caller-identity
@@ -89,117 +88,113 @@ 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).
> Tenga en cuenta que las empresas pueden usar **canary tokens** para identificar cuándo **se están robando y utilizando tokens**. Se recomienda verificar si un token es un canary token o no antes de usarlo.\
> Para más información [**ver esta página**](aws-services/aws-security-and-detection-services/aws-cloudtrail-enum.md#honeytokens-bypass).
### Org Enumeration
### Enumeración de Org
{{#ref}}
aws-services/aws-organizations-enum.md
{{#endref}}
### IAM Enumeration
### Enumeración de IAM
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**.
Si tiene suficientes permisos, **verificar los privilegios de cada entidad dentro de la cuenta de AWS** le ayudará a entender qué puede hacer usted y otras identidades y cómo **escalar privilegios**.
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:
Si no tiene suficientes permisos para enumerar IAM, puede **robarlos mediante fuerza bruta** para averiguarlos.\
Verifique **cómo realizar la enumeración y la fuerza bruta** en:
{{#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.**
> Ahora que **tiene algo de información sobre sus credenciales** (y si es un equipo rojo, espero que **no haya sido detectado**). Es hora de averiguar qué servicios se están utilizando en el entorno.\
> En la siguiente sección puede verificar algunas formas de **enumerar algunos servicios comunes.**
## Services Enumeration, Post-Exploitation & Persistence
## Enumeración de Servicios, Post-Explotación y Persistencia
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 tiene una asombrosa cantidad de servicios, en la siguiente página encontrará **información básica, enumeración** cheatsheets\*\*,\*\* cómo **evitar la detección**, obtener **persistencia** y otros trucos de **post-explotación** sobre algunos de ellos:
{{#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).
Tenga en cuenta que **no** necesita realizar todo el trabajo **manualmente**, a continuación en esta publicación puede encontrar una **sección sobre** [**herramientas automáticas**](./#automated-tools).
Moreover, in this stage you might discovered **more services exposed to unauthenticated users,** you might be able to exploit them:
Además, en esta etapa puede haber descubierto **más servicios expuestos a usuarios no autenticados**, podría ser capaz de explotarlos:
{{#ref}}
aws-unauthenticated-enum-access/
{{#endref}}
## Privilege Escalation
## Escalación de Privilegios
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:
Si puede **ver al menos sus propios permisos** sobre diferentes recursos, podría **verificar si puede obtener más permisos**. Debería centrarse al menos en los permisos indicados en:
{{#ref}}
aws-privilege-escalation/
{{#endref}}
## Publicly Exposed Services
## Servicios Expuestos Públicamente
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**.
Mientras enumera los servicios de AWS, puede haber encontrado algunos de ellos **exponiendo elementos a Internet** (puertos de VM/Contenedores, bases de datos o servicios de cola, instantáneas o buckets...).\
Como pentester/equipo rojo, siempre debe verificar si puede encontrar **información sensible / vulnerabilidades** en ellos, ya que podrían proporcionarle **más acceso a la cuenta de 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:
En este libro debería encontrar **información** sobre cómo encontrar **servicios de AWS expuestos y cómo verificarlos**. Sobre cómo encontrar **vulnerabilidades en servicios de red expuestos**, le recomendaría **buscar** el **servicio** específico en:
{{#ref}}
https://book.hacktricks.xyz/
{{#endref}}
## Compromising the Organization
## Comprometiendo la Organización
### From the root/management account
### Desde la cuenta raíz/administrativa
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.
Cuando la cuenta de administración crea nuevas cuentas en la organización, se crea un **nuevo rol** en la nueva cuenta, llamado por defecto **`OrganizationAccountAccessRole`** y otorgando la política de **AdministratorAccess** a la **cuenta de administración** para acceder a la nueva cuenta.
<figure><img src="../../images/image (171).png" alt=""><figcaption></figcaption></figure>
So, in order to access as administrator a child account you need:
Por lo tanto, para acceder como administrador a una cuenta secundaria, necesita:
- **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).
- **Comprometer** la **cuenta de administración** y encontrar el **ID** de las **cuentas secundarias** y los **nombres** del **rol** (OrganizationAccountAccessRole por defecto) que permite a la cuenta de administración acceder como administrador.
- Para encontrar cuentas secundarias, vaya a la sección de organizaciones en la consola de aws o ejecute `aws organizations list-accounts`
- No puede encontrar el nombre de los roles directamente, así que verifique todas las políticas IAM personalizadas y busque cualquier que permita **`sts:AssumeRole` sobre las cuentas secundarias descubiertas previamente**.
- **Comprometer** un **principal** en la cuenta de administración con **permiso `sts:AssumeRole` sobre el rol en las cuentas secundarias** (incluso si la cuenta permite que cualquiera de la cuenta de administración se impersonifique, como es una cuenta externa, son necesarios permisos específicos de `sts:AssumeRole`).
## Automated Tools
## Herramientas Automatizadas
### 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): Una herramienta de **colección de inventario** enfocada en la seguridad de AWS, multihilo, escrita en 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 es una **herramienta multi-nube para obtener Activos** (Nombres de host, Direcciones IP) de Proveedores de Nube.
- [**cloudmapper**](https://github.com/duo-labs/cloudmapper): CloudMapper te ayuda a analizar tus entornos de Amazon Web Services (AWS). Ahora contiene mucha más funcionalidad, incluyendo auditoría para problemas de seguridad.
```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 es una herramienta de Python que consolida los activos de infraestructura y las relaciones entre ellos en una vista gráfica intuitiva impulsada por una base de datos 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 recopila activos y relaciones de servicios y sistemas, incluyendo infraestructura en la nube, aplicaciones SaaS, controles de seguridad y más en una vista gráfica intuitiva respaldada por la base de datos Neo4j.
- [**aws-inventory**](https://github.com/nccgroup/aws-inventory): (Usa python2) Esta es una herramienta que intenta **descubrir todos** los [**recursos de AWS**](https://docs.aws.amazon.com/general/latest/gr/glos-chap.html#resource) creados en una cuenta.
- [**aws_public_ips**](https://github.com/arkadiyt/aws_public_ips): Es una herramienta para **obtener todas las direcciones IP públicas** (tanto IPv4/IPv6) asociadas con una cuenta de 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)**:** Descubre los usuarios más privilegiados en el entorno de AWS escaneado, incluyendo los AWS Shadow Admins. Utiliza powershell. Puedes encontrar la **definición de políticas privilegiadas** en la funcn **`Check-PrivilegedPolicy`** en [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 es un **framework de explotación de AWS** de código abierto, diseñado para pruebas de seguridad ofensivas contra entornos en la nube. Puede **enumerar**, encontrar **configuraciones incorrectas** y **explotarlas**. Puedes encontrar la **definición de permisos privilegiados** en [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) dentro del diccionario **`user_escalation_methods`**.
- Ten en cuenta que pacu **solo verifica tus propios caminos de privesc** (no a nivel de cuenta).
```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) es un script y biblioteca para identificar riesgos en la configuración de AWS Identity and Access Management (IAM) para una cuenta de AWS o una organización de AWS. Modela los diferentes Usuarios y Roles de IAM en una cuenta como un grafo dirigido, lo que permite verificar la **escalada de privilegios** y los caminos alternativos que un atacante podría tomar para obtener acceso a un recurso o acción en AWS. Puedes verificar los **permisos utilizados para encontrar caminos de privesc** en los nombres de archivo que terminan en `_edges.py` en [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 es una herramienta de evaluación de seguridad de AWS IAM que identifica violaciones del principio de menor privilegio y genera un informe HTML priorizado por riesgo.\
Mostrará los clientes **sobre privilegiados** potencialmente, las **políticas** en línea y de aws, y qué **principales tienen acceso a ellas**. (No solo verifica el privesc, sino también otros tipos de permisos interesantes, se recomienda su uso).
```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 evalúa cuentas de AWS en busca de **vulnerabilidades de secuestro de subdominios** como resultado de configuraciones desacopladas de Route53 y CloudFront.
- [**ccat**](https://github.com/RhinoSecurityLabs/ccat): Listar repositorios ECR -> Extraer repositorio ECR -> Insertar puerta trasera -> Subir imagen con puerta trasera
- [**Dufflebag**](https://github.com/bishopfox/dufflebag): Dufflebag es una herramienta que **busca** a través de instantáneas públicas de Elastic Block Storage (**EBS**) en busca de secretos que pueden haber sido dejados accidentalmente.
- [**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).
### Auditoría
- [**cloudsploit**](https://github.com/aquasecurity/cloudsploit)**:** CloudSploit de Aqua es un proyecto de código abierto diseñado para permitir la detección de **riesgos de seguridad en cuentas de infraestructura en la nube**, incluyendo: Amazon Web Services (AWS), Microsoft Azure, Google Cloud Platform (GCP), Oracle Cloud Infrastructure (OCI) y GitHub (no busca 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 es una herramienta de seguridad de código abierto para realizar evaluaciones de las mejores prácticas de seguridad de AWS, auditorías, respuesta a incidentes, monitoreo continuo, endurecimiento y preparación forense.
```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 te ayuda a obtener conciencia situacional en entornos de nube desconocidos. Es una herramienta de línea de comandos de código abierto creada para ayudar a los pentesters y otros profesionales de la seguridad ofensiva a encontrar rutas de ataque explotables en la infraestructura de la nube.
```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 es una herramienta de auditoría de seguridad multi-nube de código abierto, que permite la evaluación de la postura de seguridad de los entornos en la nube.
```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 (usa python2.7 y parece no estar mantenido)
- [**Zeus**](https://github.com/DenizParlak/Zeus): Zeus es una herramienta poderosa para las mejores prácticas de endurecimiento de AWS EC2 / S3 / CloudTrail / CloudWatch / KMS (parece no estar mantenida). Solo verifica las credenciales configuradas por defecto dentro del sistema.
- [**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.
### Auditoría Constante
### 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 es un motor de reglas para gestionar cuentas y recursos de nube pública. Permite a los usuarios **definir políticas para habilitar una infraestructura de nube bien gestionada**, que sea segura y optimizada en costos. Consolida muchos de los scripts ad-hoc que las organizaciones tienen en una herramienta ligera y flexible, con métricas y reportes unificados.
- [**pacbot**](https://github.com/tmobile/pacbot)**: Policy as Code Bot (PacBot)** es una plataforma para **monitoreo continuo de cumplimiento, reportes de cumplimiento y automatización de seguridad para la nube**. En PacBot, las políticas de seguridad y cumplimiento se implementan como código. Todos los recursos descubiertos por PacBot son evaluados contra estas políticas para medir la conformidad con las políticas. El marco de **auto-fix** de PacBot proporciona la capacidad de responder automáticamente a violaciones de políticas tomando acciones predefinidas.
- [**streamalert**](https://github.com/airbnb/streamalert)**:** StreamAlert es un marco de análisis de datos **en tiempo real** sin servidor que te permite **ingresar, analizar y alertar** sobre datos de cualquier entorno, **usando fuentes de datos y lógica de alertas que defines**. Los equipos de seguridad informática utilizan StreamAlert para escanear terabytes de datos de registro todos los días para la detección y respuesta a incidentes.
## DEBUG: Capturar solicitudes de 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
## Referencias
- [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}}