> For the complete documentation index, see [llms.txt](https://itskode.gitbook.io/pentesting/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://itskode.gitbook.io/pentesting/vulnyx/muy_facil/real.md).

# Real

## Enumeración

Comenzamos con un escaneo de puertos utilizando `nmap`:

```bash
nmap -sV -T4 192.168.1.93
```

![nmap](/files/mFrCER9cIuj05ubsFq8I)

Se identifican los siguientes servicios:

* **22/tcp** → SSH
* **80/tcp** → HTTP (Apache)
* **6667/tcp** → IRC (UnrealIRCd)

***

## Enumeración IRC

En la página web encontramos un manual para conectarnos al servicio IRC:

![manual](/files/pIGodtqbmQQdDijyqaQy)

Se muestran comandos útiles para interactuar con el servidor IRC.

También podemos ver la conexión al servidor:

![irc](/files/AHq5uPb49i1dRoxbhwJ0)

***

## Explotación - UnrealIRCd Backdoor

Se utiliza un exploit para aprovechar una vulnerabilidad en UnrealIRCd: ![code](/files/ZkOxZsO3x5otQJKCWpry)

![exploit](/files/mEei9xXm9K5htZrvB8Ha)

Nos ponemos en escucha con netcat:

```bash
nc -lvnp 4444
```

<div align="left"><img src="/files/1kud8cR4XybWyMCNSX27" alt="nc"></div>

Se obtiene una reverse shell como el usuario `server`.

***

## Post-Explotación

Se enumeran binarios con SUID:

```bash
find / -perm -4000 -type f 2>/dev/null
```

![suid](/files/3Vxl6QYNldSbyxiJqJ3S)

Se busca archivos con permisos de escritura:

```bash
find / -writable -type f 2>/dev/null | grep -vE "var|proc|sys|home"
```

Se identifica `/etc/hosts` como editable.

***

## Escalada de privilegios

Se utiliza `pspy` para monitorear procesos en ejecución:

![pspy](/files/AfeLSyPCEsY8gj224Jeu)

Se detecta un script ejecutándose que hace referencia a:

```
shelly.real.nyx
```

Editamos el archivo `/etc/hosts`:

<div align="left"><img src="/files/MtVHDvHndmdPHDTYqNNS" alt="root"></div>

Redirigimos el dominio a nuestra IP y montamos un listener en otro puerto:

```bash
nc -lvnp 65000
```

<div align="left"><img src="/files/iZ2IblRuuyxx1x811aUP" alt=""></div>

Finalmente obtenemos una shell como **root**.

***

## Conclusión

* Enumeración inicial con `nmap`
* Identificación de servicio vulnerable (UnrealIRCd)
* Explotación mediante backdoor conocido
* Obtención de shell como usuario `server`
* Escalada de privilegios mediante:
  * Monitorización con `pspy`
  * Modificación de `/etc/hosts`
  * Redirección de tráfico hacia nuestra máquina


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://itskode.gitbook.io/pentesting/vulnyx/muy_facil/real.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
