martes, 4 de octubre de 2022

DEFCON: 1 : eligible for recruitment at the NSA. May the best person win....

 

https://www.vulnhub.com/entry/defcon-1,490/

Hay dos caminos para resolver esta máquina. Antes de eso:

1- Tenemos el puerto 443 abierto. De entrada la máquina nos redirige a https://nsa-server.net/. Mirando el certificado SSL sacamos que hay un subhost nsa-secretserver.net que contiene un wordpress. 

- Observando el wordpress nos da la clave admin de john

-/…./.\.--/---/.-./-../.--./.-././…/…\.--./.-/…/…/.--/---/.-./-..\---/..-.\.---/---/…./-.\../…\…/-/.----/.-../.-../…--/.-/…/-.--/-.-.--/-.-.--/-.-.--

- entramos en admin, vamos a wpterm y abrimos un shell reverse. Entramos como graham.


A partir de aquí se abren los dos caminos. Si resolvemos los puzzles de la página inicial obtenemos la clave de smith y la de graham. 

puzzle1: 96l cy berru gthre atyba phi shin ghtihac kermska litnema lware gafodro wssaper ans omwareht sisvi rusiht

Lo resolvemos a mano

a- rearmamos las palabras al haber detectado algunas con sentido:

96l cyber rug threat yba phishing hti hacker mskalitne malware gafodrowssape ransomware htsis virus iht

b- y observamos que el resto hay que leerlas del revés:

96l rug yba hti mskalitne gafodrowssape htsis iht

Nos da la password de smith y esta es la clave porque es el usuario que nos lleva a root explotando la vulnerabilidad LXC

puzzle2: TTSFM34YHHWGGSRSIEOR0SEMSPRA0YV4IADHDO3RSSOANUR7

Se trata de Transposition Cipher. dcode.fr no lo devuelve bien con todo, pero observamos una solución que parece muy aproximada

THISIS THAPES SWDROO FGHARA MGD00N 3SOYSU 4R3VER YSR4M7

Reagrupando en grupos de 6 letras observamos que solo hay que transponer últimamente cada 3ª y 5ª letra de los grupos

THIS IS THE PASSWORD OF GRAHAM G00DN3SSYOU4REV3RYSM4R7

El segundo camino es más largo al no tener la clave de smith a priori. 

- una vez dentro con graham miramos un mbox


From: john@nsa-server

Date: Mon, 10 Jun 2019 11:35:48 +0200


Hi Graham,

Sorry man to bother you, but I forgot my password.

I don't want to go to Smith because he will rip me a new hole.

Can you please help me?

Thanks man!!!

John

- miramos el .viminfo y sacamos que graham ha editado

~/.local/share/Trash/files/note.txt

que contiene

Hi John,

After your latest password failure I changed it. You know where it is right? Wink Wink!

Pretty easy right? Try not to forget this one also.

You know how the boss is like! You wanna get fired or something?


Also smart idea to sent this message with netcat right?

I don't trust our mailsystem.

After sending this message, I'll trow it away....no one will know.

hahahaha......now who is a cybernoob!!!!

Best,

Graham

P.S. You Do kNow whEre The paSswoRd Is hiDden rigHt?

La pass de john son las letras capitales

- su john -->  En Documents hay un secret.png, lo descargamos y no se abre correctamente. Miramos en hex y arreglamos el header (PNG..). Nos da una password. Tenemos los siguientes users en home:

george  graham  john  nicky  samantha  smith

Probamos uno a uno george, nicky, samantha y smith. Resulta ser george.

- su george --> 

User george may run the following commands on nsa-server:

    (samantha) /usr/bin/vi

sudo -u samantha vi -c '!/bin/bash'

- en el home de samantha hay un check con suid root. Miramos con strings y ejecuta directamente ss. Aplicamos exploit PATH:

creamos un ss conteniendo bash, añadimos el path local y ejecutamos el check

samantha@nsa-server:~$ cat ss 
cat ss
bash -i

nos lleva a nicky

- en Documents/.passwd tenemos la pass de nicky. Con ella entramos en mysql. Sacamos la pass de smith

BE84A0E22A8E3E1EAA0883956B3F8692DFE4CA13

hashcat -a0 -m300 BE84A0E22A8E3E1EAA0883956B3F8692DFE4CA13 rockyou2021.txt -d3,4

(11 minutos, tenemos que usar necesariamente ese diccionario a no ser que hayamos descifrado el puzzle 1...)

/mnt/root/root # cat root.txt
cat root.txt


░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░░▓████████████████████████▒░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░▓█████▓▒░░░░░░░░░░░░░░░▒██████▒░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░████▒░░░░░░░░░░░░░░░░░░░░░░░░░▓███▒░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░███░░░░░░░░░░░░░░░
░░░░░░░░░░░░░▒██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒██░░░░░░░░░░░░░░
░░░░░░░░░░░░▒██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██░░░░░░░░░░░░░
░░░░░░░░░░░░██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██░░░░░░░░░░░░
░░░░░░░░░░░██▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒░░██░░░░░░░░░░░░
░░░░░░░░░░░██░░██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██░░██░░░░░░░░░░░
░░░░░░░░░░░██░░██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██░░██░░░░░░░░░░░
░░░░░░░░░░░██░░██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██░░██░░░░░░░░░░░
░░░░░░░░░░░██▒░██▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██▓░▒██░░░░░░░░░░░
░░░░░░░░░░░░██░░██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██░░██░░░░░░░░░░░░
░░░░░░░░░░░░██▒░██░░░░░▒▒▓███▒░░░░░░░▒███▓▒▒░░░░░██░▓██░░░░░░░░░░░░
░░░░░░░░░░░░░██░██░░██████████▒░░░░░▓██████████░░██▒██░░░░░░░░░░░░░
░░░░░░░░░░░░░░████░████████████░░░░░████████████░████░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░███░▒██████████░░░░░░░██████████▒░██▒░░░░░░░░░▒░░░░░
░░░▒████░░░░░░░▓█▒░░█████████░░░░░░░░░█████████░░▒█▓░░░░░░▓████░░░░
░░░██░▒██▒░░░░░██░░░░██████▓░░░░█░█░░░░███████░░░░██░░░░░███░░██░░░
░░░██░░░██▓░░░░██░░░░░░▒▓▓░░░░▒██░██░░░░░▓▓▒░░░░░▒██░░░░███░░░██░░░
░▓██▒░░░░████▓░░██░░░░░░░░░░░░███░███░░░░░░░░░░░░██░░█████░░░░▓██▒░
██▓░░░░░░░░▒████████▓░░░░░░░░████░███▓░░░░░░░▒▓████████░░░░░░░░░███
██▓▒▓███▓░░░░░░▓████████▓░░░░████░███▓░░░░▓████████▓░░░░░░████▓▓███
░███████████▒░░░░░░███████░░░░██░░░██░░░░██████▓░░░░░░▓███████████░
░░░░░░░░░░▓█████░░░░██▓▓░██░░░░░░░░░░░░░██░█▒██░░░▒█████▓░░░░░░░░░░
░░░░░░░░░░░░░▒█████▒▒█▓█░███▓▓▒▒▒▓▒▒▓▓▓███▒███░▓█████░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░▒████▒▓█▒▒█░█▒█░█░█▓█▒█▓░█░█████▒░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░██░░██▓█▓█▓█▒█▒█▓█▓████░▓█▓░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░▓████▓░▓█▓█░█▒█░█░█▒█▒███▒░██████░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░▓█████░░██░░░▒█████▓█▓█████▒░░░██░▒█████▓░░░░░░░░░░░░░
░░░░▒██████████▓░░░░░███░░░░░░░░░░░░░░░░░░░██▒░░░░░▓██████████▒░░░░
░░░░██░░░▓▓▓░░░░░░▒██████▓░░░░░░░░░░░░░░░███████▒░░░░░░▓▓▒░░▒██░░░░
░░░░▓██░░░░░░░░▓████▓░░░█████▒░░░░░░▒▓█████░░░▓████▓░░░░░░░▒██▓░░░░
░░░░░░███░░░░████▒░░░░░░░░▓█████████████▒░░░░░░░░▒████░░░░███░░░░░░
░░░░░░░██░░░██▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓██░░░██░░░░░░░
░░░░░░░██▒▓██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒██▒▓██░░░░░░░
░░░░░░░░████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░████░░░░░░░░
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

CONGRATULATIONS!!!!

YOU JUST PWND THIS MACHINE





No hay comentarios:

Publicar un comentario