# MAQUINA GRILLO (BruteForce SSH - PrivEsc /usr/bin/puttygen)

Se enumero los puertos abiertos de la maquina, antes de eso se debió identificar que ip es la maquina.

```
arp-scan --interface=eth0 --localnet
```

Luego

```
nmap -p- --open --min-rate 2000 -n -Pn -sSCV -oN fullscan.txt 192.168.0.111

PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 9.2p1 Debian 2+deb12u2 (protocol 2.0)
| ssh-hostkey:
|   256 9c:e0:78:67:d7:63:23:da:f5:e3:8a:77:00:60:6e:76 (ECDSA)
|_  256 4b:30:12:97:4b:5c:47:11:3c:aa:0b:68:0e:b2:01:1b (ED25519)
80/tcp open  http    Apache httpd 2.4.57 ((Debian))
|_http-title: Apache2 Debian Default Page: It works
|_http-server-header: Apache/2.4.57 (Debian)
MAC Address: 08:00:27:E6:62:68 (PCS Systemtechnik/Oracle VirtualBox virtual NIC)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
```

El escaneo anterior ejecuta unas serie de scripts que nos va a devolver los servicios y las versiones que corren en los puertos abiertos.

Dentro de la web, se detecto una pagina por default donde se aloja un comentario interesante.

Se realizo una búsqueda de passwords mediante fuerza bruta apuntando al usuario encontrado.

Una vez finalizado el escaneo, se dio con éxito con su password. Seguidamente se ingreso a la maquina victima mediante ssh.

Como metodología se inspecciono la maquina haciendo un reconocimiento, luego el comando sudo -l devolvió un binario que esta siendo ejecutado por root y no requiere password para utilizarlo.

Para aprovechar este binario se siguieron lo siguientes pasos.

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

Y finalmente se logro acceder al objetivo final.

<figure><img src="/files/XepAPbB5zxperdMzhHhw" 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://1gnotus.gitbook.io/ignotus_pwn/thehacklabs/writeups/maquina-grillo-bruteforce-ssh-privesc-usr-bin-puttygen.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.
