# OffSec  Gaara

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

Ahora hacemos un reconocimiento con nmap para detectar que puertos estan abiertos en el host.

```javascript
# Nmap 7.94SVN scan initiated Sun Dec 24 23:32:55 2023 as: nmap -sCV -p22,80 -oN target.txt 192.168.1.149
Nmap scan report for 192.168.1.149
Host is up (0.0011s latency).

PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0)
| ssh-hostkey: 
|   2048 3e:a3:6f:64:03:33:1e:76:f8:e4:98:fe:be:e9:8e:58 (RSA)
|   256 6c:0e:b5:00:e7:42:44:48:65:ef:fe:d7:7c:e6:64:d5 (ECDSA)
|_  256 b7:51:f2:f9:85:57:66:a8:65:54:2e:05:f9:40:d2:f4 (ED25519)
80/tcp open  http    Apache httpd 2.4.38 ((Debian))
|_http-server-header: Apache/2.4.38 (Debian)
|_http-title: Gaara
MAC Address: 08:00:27:5D:C7:85 (Oracle VirtualBox virtual NIC)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
# Nmap done at Sun Dec 24 23:33:02 2023 -- 1 IP address (1 host up) scanned in 7.15 seconds

```

Ahora lanzamos una nmap para ver que versiones y servicios corren para estos puertos que encontramos abiertos.

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

Si fuzeamos la web encontramos dos directorios, Vamos a observarlos.

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

Si lanzamos un CURL ah /Cryoserver observamos tres tipos de directorios mas, se intuye por la / que llevan.

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

Practicamente todos tienen el mismo contenido, pero este en especial en el parrafo dos, hay una cadena en base58.

Entonces lo que hacemos es decodificar la cadena y tenemos un usuario y una contraseña

Bueno con estas credenciales intente iniciar session por SSH y nada no funcionan, esta parte esta ahi pa hacerte perder el tiempo, asi que bueno teniendo un usuario vamos a hacer fuerza bruta con hydra.

<figure><img src="/files/62GPyBmnADKXCE1vLdeL" alt=""><figcaption></figcaption></figure>

Bueno con hydra encontramos credenciales validas para el usuario gaara, vamos a conectarnos via SSH.

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

Ya dentro tenemos dos archivos de texto, que uno nos da una pista una ruta, vamos por ahi y es una perdida de tiempo no hay nada que nos ayude a escalar nuestros privilegios.

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

Entonces nos vamos a la raiz para buscar archivos con permisos de alto calibre y encontramos gdb.

Y que es gdb, Es un depurador portable que se puede utilizar en varias plataformas Unix. Bueno si te vas a GTObins y colocas gbd te da la forma de usar este archivo para escalar tus privilegios a root.

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

Sigues las instrucciones que te dan el GTFObins para escalar los privilegios y listo somos root, maquina resuelta ahora vamos por nuestra flag de root.

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

Y maquina resuelta.


---

# 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://rodgar.gitbook.io/rodgar/plataformas/vulnhub/offsec-gaara.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.
