linuxNibbles

Enumeration:

Port Scanning:

┌──(kali㉿kali)-[~/…/Machines/OffsecPG/Practice/Nibbles]
└─$ sudo nmap -sCV -p- --min-rate 4000 -oA nmap/services -vv 192.168.215.47
Starting Nmap 7.95 ( https://nmap.org ) at 2025-11-07 20:21 EST
Nmap scan report for 192.168.215.47                                                                                                                                        
Host is up, received echo-reply ttl 61 (0.15s latency).                                                                                                                    
Scanned at 2025-11-07 20:21:08 EST for 49s                                                                                                                                 
Not shown: 65529 filtered tcp ports (no-response)                                                                                                                          
PORT     STATE  SERVICE      REASON         VERSION                                                                                                                        
21/tcp   open   ftp          syn-ack ttl 61 vsftpd 3.0.3                                                                                                                   
22/tcp   open   ssh          syn-ack ttl 61 OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0)                                                                                 
| ssh-hostkey:                                                                                                                                                             
|   2048 10:62:1f:f5:22:de:29:d4:24:96:a7:66:c3:64:b7:10 (RSA)                                                                                                             
| ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDJgyzpWrB8SyLb/XmPYQYzsnfizW7d0aNZHpwQ9ivcHQ/RYLbCc8yUIQGN2JMqCgfSj8CRMA36UnV8jnngjkw9njcgMyA5qc1mO4tzzH7VNkW2t5AmP7Q1HBt+SThlLa0Jx
BN6Gd5BOPwrsk9YTjLj8ax2ncvGBq8jzQjYmm9jF4VgBak5DY+Q5JWdf9krumSlR+V8yneV9aQ6sVy2XgkCJQLQ8GoUTm/13XUTc3TCKQ2KOJ2FzA8VcNTfxqTDxalwnYrZ1tod7BRfMeff5MwxC5gzeB+hdOVC0zAZlvNtMxH6
SCxMBRCoX9IHL27E6WtSGXCj1SLYJWrFImjp+I1L                                                                                                                                   
|   256 c9:15:ff:cd:f3:97:ec:39:13:16:48:38:c5:58:d7:5f (ECDSA)                                                                                                            
| ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBM7uIYLogPsKP+c0QrezqQfB94ml7djfUOtG8ZAoMX6yK898l0TbgyAShcQSmdOsSMGdSO4GZpixCFJdsYkBi0M=         
|   256 90:7c:a3:44:73:b4:b4:4c:e3:9c:71:d1:87:ba:ca:7b (ED25519)                                                                                                          
|_ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKoHnGdMtb37ORTRBt2cTfWvQE7IB3fF3ewP/1tqn0JF                                                                                         
80/tcp   open   http         syn-ack ttl 61 Apache httpd 2.4.38 ((Debian))                                                                                                 
|_http-title: Enter a title, displayed at the top of the window.                                                                                                           
| http-methods:                                                                                                                                                            
|_  Supported Methods: GET POST OPTIONS HEAD
|_http-server-header: Apache/2.4.38 (Debian)
5437/tcp open   postgresql   syn-ack ttl 61 PostgreSQL DB 11.3 - 11.9
| ssl-cert: Subject: commonName=debian
| Subject Alternative Name: DNS:debian
| Issuer: commonName=debian
| Public Key type: rsa
| Public Key bits: 2048
| Signature Algorithm: sha256WithRSAEncryption
| Not valid before: 2020-04-27T15:41:47
| Not valid after:  2030-04-25T15:41:47
| MD5:   b086:6d30:4913:684e:16c1:8348:fc76:fe43
| SHA-1: cb30:5109:0fc1:14ab:0fb9:8e55:5874:4bb5:ba57:66af
| -----BEGIN CERTIFICATE-----
| MIIC0DCCAbigAwIBAgIUYoM4kALX3eWKWuCQ1/K5FujVbGowDQYJKoZIhvcNAQEL
<snipped>
|_-----END CERTIFICATE-----
|_ssl-date: TLS randomness does not represent time
Service Info: OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernel

<snipped>

This time we have postgresql service running on port 5437.

I enumerated all other services but nothing lead to find anything useful except for postgresql.

Postgresql (5437):

We can interact with postgresql through the command line tool called psql.

I tried some different combinations of default credentials such as admin:admin, etc. postgres:postgres worked for me:

I did not find anything interesting in the databases.

Exploitation:

From the nmap result we can guess the version of this service is between 11.3 to 11.9.

I searched for public exploits, and found that we can get command execution:

Or we can perform it manually ourselves, using the copy to/from program query.

First lets confirm we have command execution:

And send icmp packets through ping command:

Indeed we have blind RCE.

Get a reverse shell, I will use one of the exposed ports with netcat to avoid firewall issues with ports:

Going back to our netcat listener:

Stabilize our shell:

Post-Exploitation:

After enumerating the system a bit, we will find that we have find as one of the suid binaries that we can leverage to escalate our privileges:

Get the flags:

Last updated