linuxPathway

Enumeration:

Port Scanning:

┌──(kali㉿kali)-[~/…/Machines/OffsecPG/Practice/Pathway]
└─$ sudo nmap -sCV -p- --min-rate 4000 -oA nmap/services -vv 192.168.210.230 --open
Starting Nmap 7.95 ( https://nmap.org ) at 2025-11-04 19:50 UTC
Nmap scan report for 192.168.210.230                                                                                                                                        
Host is up, received echo-reply ttl 61 (0.15s latency).                                                                                                                     
Scanned at 2025-11-04 19:50:43 UTC for 152s                                                                                                                                 
Not shown: 65520 closed tcp ports (reset), 11 filtered tcp ports (no-response)                                                                                              
Some closed ports may be reported as filtered due to --defeat-rst-ratelimit                                                                                                 
PORT     STATE SERVICE    REASON         VERSION                                                                                                                            
22/tcp   open  ssh        syn-ack ttl 61 OpenSSH 9.2p1 Debian 2+deb12u5 (protocol 2.0)                                                                                      
| ssh-hostkey:                                                                                                                                                              
|   256 fc:72:06:8f:ef:ec:9b:87:f3:95:ca:f2:e7:1f:ea:dc (ECDSA)                                                                                                             
| ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFyksaWzSNfPbN6T3ts7+fGJ0/9aIXrN7HimSzjO+W6pfa1Qq4QZb/hnkglJwvjgcTOQiraq2M9EQ9JtbRC1ROY=
|   256 42:c2:f0:fd:85:f6:93:cb:bd:a0:e8:ed:c1:a2:6d:60 (ED25519)                     
|_ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHbDRRUQ2YifMbadcFEg6fdgQ2bcGEHcQyrud/UFwLiy                                                                                          
80/tcp   open  http       syn-ack ttl 61 nginx 1.22.1                                 
|_http-title: Chain App Dev                                                           
|_http-server-header: nginx/1.22.1                                                                                                                                          
| http-methods:                                                                       
|_  Supported Methods: GET HEAD POST                                                  
3089/tcp open  ptk-alink? syn-ack ttl 61                                              
| fingerprint-strings:                                                                
|   DNSStatusRequestTCP, DNSVersionBindReqTCP, Help, Kerberos, LANDesk-RC, LDAPBindReq, LDAPSearchReq, LPDString, RPCCheck, SIPOptions, SMBProgNeg, SSLSessionReq, TLSSessio
nReq, TerminalServerCookie, X11Probe:                                                                                                                                       
|     HTTP/1.1 400 Bad Request                                                        
|     Connection: close                                                               
|   FourOhFourRequest:                                                                
|     HTTP/1.1 400 Bad Request                                                        
|     content-type: text/plain; charset=UTF-8                                         
|     Date: Tue, 04 Nov 2025 19:51:22 GMT                                             
|     Connection: close                                                                                                                                                     
|   GetRequest, HTTPOptions:                                                          
|     HTTP/1.1 400 Bad Request                                                        
|     content-type: text/plain; charset=UTF-8                                                                                                                               
|     Date: Tue, 04 Nov 2025 19:51:18 GMT                                             
|     Connection: close                                                                                                                                                     
|   RTSPRequest:                                                                      
|     HTTP/1.1 400 Bad Request                                                        
|     content-type: text/plain; charset=UTF-8                                                                                                                               
|     Date: Tue, 04 Nov 2025 19:51:19 GMT                                             
|_    Connection: close                                                               
4566/tcp open  http       syn-ack ttl 60 TwistedWeb httpd 24.3.0                      
| http-methods:                                                                       
|_  Supported Methods: GET HEAD POST OPTIONS                                                                                                                                
|_http-server-header: TwistedWeb/24.3.0|_http-title: Site doesn't have a title (text/plain; charset=utf-8).
<snipped>
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

<snipped>

We have ssh open on port 22, http on port 80, and other two open ports.

SSH (20):

Since we do not have set of credentials, we will skip interacting with ssh at the moment.

HTTP (80):

On port 80, only a static page without any further functioanlities.

? (3089):

It asks for the url parameter, lets set it and put any value to see how we can paly with this.

Here we identified SSRF vulnerability.

Check also with other scheme like file:// to see if we can access the internal files:

There is a real vulnerability in an application called url to png which likely the one we have here.

I stopped enumerating this port because I did not find anything useful.

? (4566):

Just a blank page.

If we directory busted this:

Lets navigate to that directory:

Here we have an internal bucket named internal, and one key object in it called users.json.

Get into that:

We will have set of credentials for two users.

See if those are valid:

Both are valid.

Post-Exploitation:

The first local enumeration we can do, is to check what we can run with sudo:

We will see LD_PRELOAD is preserved by sudo due to env_keep misconfiguration, allowing library injection into privileged processes.

First we will create a shared object then assign it to the env_keep variable:

Now we can use this to get root access:

Get the flags:

After I solved the box, I found this was not the intended way to get intial access.

We should read a file called .env under url-to-png-2.0.2 directory to get credentials for aws access:

Pull the access key id and secret access key from the image so we can interact with aws services if we have permissions:

Within aws cli we can view who we are using this subcommand sts get-caller-identity:

We are an iam user called root in that aws account.

Now lets view the bucket named internal:

It contains a bunch of images, but what we are most interested in is that users.json file we saw earlier.

We can copy it to our machine using cp:

We will get the same result and we can continue from here what we did to elevate our privileges.

Last updated