# Enumeracion manual con AWSCLI

{% hint style="danger" %}
¿Crees tener lo que se necesita para ser un experto en Pentesting contra AWS? Si nuestro libro te abrió los ojos a las posibilidades de la ciberseguridad ofensiva o si ya cuentas con habilidades en este campo, es momento de subir de nivel. Te retamos a certificarte en el [CPNA - Curso Profesional de Pentesting Contra AWS](https://spartan-cybersec.com/cursos/pentesting-contra-la-nube-de-aws/). No será fácil: te enfrentarás a un examen riguroso de 12 horas donde deberás hackear una infraestructura completa alojada en AWS. ¿Listo para el desafío? Acepta el reto y demuestra tu verdadero potencial.
{% endhint %}

Durante el inicio de unas pruebas post-autenticadas, es ideal ejecutar los siguientes comandos para recopilar información sobre la infraestructura relacionada al servicio de ECS.

## <mark style="color:orange;">Enumerando ECR</mark>

Este comando devuelve todos los repositorios privados del ECR.

```
aws ecr describe-repositories
```

<figure><img src="/files/VOJ79vbLRjkTzu2dnEuW" alt=""><figcaption></figcaption></figure>

Este comando devuelve la política de un repositorio de ECR especificado:

```
aws ecr get-repository-policy --repository-name spartan-cpna
```

<figure><img src="/files/jqN4VEHZSyNE8mjn2rx5" alt=""><figcaption></figcaption></figure>

Este comando devuelve las imágenes de un repositorio de ECR especificado:

```
aws ecr list-images --repository-name spartan-cpna
```

<figure><img src="/files/m8UZb9259b7L1OMqfEsF" alt=""><figcaption></figcaption></figure>

Este comando devuelve todo los relacionado a una imagen de un repositorio de ECR especificado:

```
aws ecr describe-images --repository-name spartan-cpna --image-ids imageTag=latest
```

<figure><img src="/files/NQkLXL0YQ1icPBFu72zF" alt=""><figcaption></figcaption></figure>

## <mark style="color:orange;">Enumerando ECS</mark>

Este comando devuelve todos los clusters disponibles:

```
aws ecs list-clusters
```

<figure><img src="/files/AZ1p7Wtc4nanKMk9Za4J" alt=""><figcaption></figcaption></figure>

Este comando devuelve toda la información relacionada a un cluster existente:

```
aws ecs describe-clusters --cluster ecs-takeover-ecs_takeover_cgidoc6vcayyqm-cluster
```

<figure><img src="/files/4PA6Gl43Oa5koWlGBFKs" alt=""><figcaption></figcaption></figure>

Este comando devuelve todos los servicios de un cluster existente:

```
aws ecs list-services --cluster ecs-takeover-ecs_takeover_cgidoc6vcayyqm-cluster
```

<figure><img src="/files/XUuMLRP3zTDxTtjZi0k8" alt=""><figcaption></figcaption></figure>

Este comando devuelve toda la información relacionada a un servicio de un cluster existente:

{% code overflow="wrap" %}

```
aws ecs describe-services --cluster ecs-takeover-ecs_takeover_cgidoc6vcayyqm-cluster --services vulnsite
```

{% endcode %}

<figure><img src="/files/b4DCeXt4a0fxyWDRGCdx" alt=""><figcaption></figcaption></figure>

Este comando devuelve toda la información relacionada a listar las tareas de un cluster:

```
aws ecs list-tasks --cluster ecs-takeover-ecs_takeover_cgidoc6vcayyqm-cluster
```

<figure><img src="/files/tPFwRY8TVoYj4dsmsUdY" alt=""><figcaption></figcaption></figure>

Este comando devuelve toda la información relacionada a una tarea de un cluster especifico:

{% code overflow="wrap" %}

```
aws ecs describe-tasks --cluster ecs-takeover-ecs_takeover_cgidoc6vcayyqm-cluster --tasks 06dc7909ac424acdafc362c17fd7bb0c
```

{% endcode %}

<figure><img src="/files/3FG1VEaLpBHNa5peUmok" alt=""><figcaption></figcaption></figure>

Este comando devuelve todas las instancias relacionadas a un cluster especifico:

{% code overflow="wrap" %}

```
aws ecs list-container-instances --cluster ecs-takeover-ecs_takeover_cgidoc6vcayyqm-cluster
```

{% endcode %}

<figure><img src="/files/InRVkOA2oyAa5xRXRNwG" alt=""><figcaption></figcaption></figure>

## <mark style="color:orange;">Enumerando EKS</mark>

Este comando devuelve todos los clusters de EKS:

```
aws eks list-clusters
```

<figure><img src="/files/sNORWC51nh0xcT1gYfWU" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://books.spartan-cybersec.com/cpna/introduccion-a-ecs-eks-ecr/enumeracion-manual-con-awscli.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
