Hoy vamos a hackear la maquina de Vulnhub llamada
Death Star. Podeis descargarla desde el siguiente enlace:
DeathStar
Video
Enumeration
En esta maquina nmap nos sirve de poco :)
El primer paso es abrir Wireshark y filtramos
por la ip de la maquina victima con el siguiente
filtro:
ip.addr == 192.168.1.95
Con paciencia, veremos que recibimos 2 paquetes
UDP que contienen la siguiente informacion:
Thanks to the successful Operation Skyhook, the Rebel Alliance
got some plans for the new weapon of the Galactic Empire. We
know that there is a small opening that we can explore through a
thermal exhaust that is directly connected to the Main Reactor of the
Death Star. The superlaser takes 1440 minutes to reload.
It is very important to observe 'this window' in order to recover the blueprint.
This is because, it is only possible to make an attempt every 60 seconds.
Y el otro paquete:
Code to access the Death Star Blueprint
within the time it takes to reload is: DS-1@OBS
Leyendo, nos indica el codigo de acceso (DS-1@OBS) y
por otro lado vemos el numero 1440... Asi que si probamos a enviar algo
de informacion por UDP al puerto 1440, nos dira algo como "Wrong Code".
Como tenemos el codigo, lo enviamos, y guardamos todos los datos recibidos en
el fichero death.txt.
Vemos que es base64, asi que hacemos decode y lo guardamos en death2, y por
ultimo, usamos file para ver que se trata de una imagen...
Al abrir la imagen vemos que hay un "unlock code", pero no
sabemos que hacer con el.
Usamos steghide y usamos el codigo anterior "DS-1@OBS" para
ver si podemos extraer algo de informacion.
sml@Cassandra:~$ steghide extract -sf death2.jpeg
Anotar salvoconducto:
anot los datos extraidos e/"openTheExhaust.txt".
Exploramos el fichero que hemos extraido.
sml@Cassandra:~$ cat openTheExhaust.txt
Each segment of the "unlock code" can only contain 3 characters sent in
sequence to unlock port 10110.
Debemos separar el unlock code en cifras de 3 numeros, y luego hacer port
knocking para que se abra el puerto 10110.
Nos descargamos un "knocker".
Y probamos a conectar por ssh al puerto que nos indicaba.
sml@Cassandra:~$ ssh 192.168.1.95 -p 10110
Devoloped by Galen Walton Erso
System's user: erso
Pass Hint: My wife's first name plus the year (BBY) she died.
Glory to the Empire - Project DS-1: Orbital Battle Station
sml@192.168.1.95's password:
En el banner vemos que el usuario del sistema es erso, y el
password es el nombre de la mujer y el ano en que murio.
Si buscamos en Intrenet veremos que la mujer se llamaba Lyra
y murio 13(BBY) con lo cual la password es: lyra13
Nos logueamos con el usuario erso...
Low Shell
sml@Cassandra:~$ ssh erso@192.168.1.95 -p 10110
Devoloped by Galen Walton Erso
System's user: erso
Pass Hint: My wife's first name plus the year (BBY) she died.
Glory to the Empire - Project DS-1: Orbital Battle Station
erso@192.168.1.95's password
erso@deathStar1:~$
Ya estamos dentro :)
Exploramos el sistema.
erso@deathStar1:~$ ls
warning.txt
erso@deathStar1:~$ cat warning.txt
Message from GALEN ERSO:
This is your chance. Destroy the plans of the Galactic Empire. I know that Lord
Vader
will not like this at all. But, this will be my chance for redemption.
I hope you have enough knowledge to help destroy this new weapon.
Explore the system and get 'root access' to read the secret message located at
'/root/message.txt'.
Hack or fail!!
Echamos un vistazo a ficheros con permisos "especiales".
erso@deathStar1:~$ /bin/dartVader
dartVader: Voce tem um futuro aqui. Nao seja um Lammer, busque e aprenda
realmente...
Despues de hacer pruebas, el fichero es vulnerable a ret2lib...
Nos lo descargamos en nuestra maquina.
Exploit
sml@Cassandra:~$ scp -P 10110 erso@192.168.1.95:/bin/dartVader .
Devoloped by Galen Walton Erso
System's user: erso
Pass Hint: My wife's first name plus the year (BBY) she died.
Glory to the Empire - Project DS-1: Orbital Battle Station
erso@192.168.1.95's password:
dartVader
100% 7338 7.0MB/s 00:00
Como ASLR esta activado, si ejecutamos el exploit una sola vez probablemente
no funcione, asi que hacemos un bucle "while" para que se ejecute hasta
que funcione.
# cd /root
# ls
message.txt
# cat mess
cat: mess: No such file or directory
# cat message.txt
Art by Shanaka Dias
.==.
()''()-.
.---. ;--; /
.'_:___". _..'. __'.
|__ --==|'-''' \'...;
[ ] :[| |---\
|__| I=[| .' '.
/ / ____| : '._
|-/.____.' | : :
snd /___\ /___\ '-'._----'
-------------------------------------
Congratulations!!
You helped me destroy the empire's weapon.
-------------------------------------
If you had fun, love to get your feedback.
Send me a tweet @mrhenrike ;)
Until the next VM and "May the force be with you".