# OffSec Potato

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

Primeramente empezamos por lo basico escaneo de puertos abiertos que en este caso tenemos unos cuentos puertos abiertos.

***

```javascript
# Nmap 7.94SVN scan initiated Fri Feb  2 16:11:07 2024 as: nmap -sCV -p22,80 -oN tareg.txt 192.168.173.101
Nmap scan report for 192.168.173.101
Host is up (0.040s latency).

PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 8.2p1 Ubuntu 4ubuntu0.1 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   3072 ef:24:0e:ab:d2:b3:16:b4:4b:2e:27:c0:5f:48:79:8b (RSA)
|   256 f2:d8:35:3f:49:59:85:85:07:e6:a2:0e:65:7a:8c:4b (ECDSA)
|_  256 0b:23:89:c3:c0:26:d5:64:5e:93:b7:ba:f5:14:7f:3e (ED25519)
80/tcp open  http    Apache httpd 2.4.41 ((Ubuntu))
|_http-server-header: Apache/2.4.41 (Ubuntu)
|_http-title: Potato company
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 Fri Feb  2 16:11:19 2024 -- 1 IP address (1 host up) scanned in 11.95 seconds
```

Hacemos un escaneo de los puertos que ya sabemos que estan abiertos para ver que servicios y verciones estan corriendo.

***

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

WFUZZ, usandolo enumerando directorios en la web observamos un admin, vamos a verlo.

***

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

Bueno tenemos un panel admin sencillo, vamos a pasarlo a Burp Suite.

***

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

Interceptamos la peticion y en el campo password realizamos una comparativa la cual nos permite burlar la contraseña.&#x20;

***

<figure><img src="/files/81o7Gxu4uB9zjs2JsjUs" alt=""><figcaption></figcaption></figure>

Estamos dentro del panel administrativo.

***

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

Le damos al Logs de la pagina, y interceptamos esta peticion y la enviamos al repeater.

***

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

En el parametro logramos encontrar un LFI, el cual nos permite leer el /etc/passwd. Y como la maquina es super realista 😂 nos proporcionan la contraseña del webadmin en formato hash.

***

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

Si copiamos ese hash y lo crackeamos con john, encontramos la contraseña dragon.

***

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

Nos conectamos, ahora buscando escalar privilegios.

Si hacemos un sudo -l observamos que el usuario puede correr el siguiente recurso que se observa, el asterisco hace alucion que podria correr lo que sea bajo ese directorio /notes.

***

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

Facil somos root.


---

# 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-potato.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.
