Web


Nmap discovered a Web server on the target port 80 The running service is Apache httpd 2.4.41 ((Ubuntu))

┌──(kali㉿kali)-[~/PEN-200/PG_PLAY/potato]
└─$ curl -I -X OPTIONS http://$IP/
HTTP/1.1 200 OK
Date: Sun, 27 Apr 2025 16:11:25 GMT
Server: Apache/2.4.41 (Ubuntu)
Vary: Accept-Encoding
Content-Length: 245
Content-Type: text/html; charset=UTF-8
 
 
┌──(kali㉿kali)-[~/PEN-200/PG_PLAY/potato]
└─$ curl -I http://$IP/        
HTTP/1.1 200 OK
Date: Sun, 27 Apr 2025 16:11:27 GMT
Server: Apache/2.4.41 (Ubuntu)
Content-Type: text/html; charset=UTF-8

Webroot

Fuzzing


┌──(kali㉿kali)-[~/PEN-200/PG_PLAY/potato]
└─$ ffuf -c -w /usr/share/wordlists/seclists/Discovery/Web-Content/big.txt -u http://$IP/FUZZ -ic -e .html,.txt,.php -fc 403
________________________________________________
 :: Method           : GET
 :: URL              : http://192.168.120.101/FUZZ
 :: Wordlist         : FUZZ: /usr/share/wordlists/seclists/Discovery/Web-Content/big.txt
 :: Extensions       : .html .txt .php 
 :: Follow redirects : false
 :: Calibration      : false
 :: Timeout          : 10
 :: Threads          : 40
 :: Matcher          : Response status: 200-299,301,302,307,401,403,405,500
 :: Filter           : Response status: 403
________________________________________________
admin                   [Status: 301, Size: 318, Words: 20, Lines: 10, Duration: 26ms]
index.php               [Status: 200, Size: 245, Words: 31, Lines: 9, Duration: 26ms]
:: Progress: [81912/81912] :: Job [1/1] :: 1600 req/sec :: Duration: [0:01:06] :: Errors: 0 ::
 
 
┌──(kali㉿kali)-[~/PEN-200/PG_PLAY/potato]
└─$ ffuf -c -w /usr/share/wordlists/seclists/Discovery/Web-Content/directory-list-lowercase-2.3-medium.txt -u http://$IP/FUZZ/ -ic -fc 403
________________________________________________
 :: Method           : GET
 :: URL              : http://192.168.120.101/FUZZ/
 :: Wordlist         : FUZZ: /usr/share/wordlists/seclists/Discovery/Web-Content/directory-list-lowercase-2.3-medium.txt
 :: Follow redirects : false
 :: Calibration      : false
 :: Timeout          : 10
 :: Threads          : 40
 :: Matcher          : Response status: 200-299,301,302,307,401,403,405,500
 :: Filter           : Response status: 403
________________________________________________
                        [Status: 200, Size: 245, Words: 31, Lines: 9, Duration: 2629ms]
admin                   [Status: 200, Size: 466, Words: 145, Lines: 20, Duration: 47ms]
potato                  [Status: 200, Size: 744, Words: 52, Lines: 16, Duration: 38ms]
:: Progress: [207630/207630] :: Job [1/1] :: 1600 req/sec :: Duration: [0:02:30] :: Errors: 0 ::
  • /index.php
  • /admin/
  • /potato/

/index.php


N/A

/potato/


Empty

/admin/


Login page

Backup file for the login page found in the target FTP server Credential failed; admin:potato

strcmp


Checking back at the source code, it uses the PHP’s vulnerable strcmp function This could easily be bypassed by sending an empty array; username=admin&password[]=

Authentication Bypass

Like so

Authentication successfully bypassed

Dashboard


Several features are available at the /admin/dashboard endpoint

Logs

The Logs feature is interesting as it seems to fetch a target file via the file parameter

LFI

LFI confirmed Moving on to the Exploitation phase