Adhyan Agarwal logoadhyan agarwal
BACK TO ARCHIVE
HTB|2017.10.21

Sense — pfSense Default Creds to Authenticated RCE

OS

Linux

Difficulty

Easy

Category

WEB

Released

2017.10.21

Fuzzed the HTTPS portal to find system-users.txt leaking the rohit username, then logged into pfSense 2.1.3 with the default password. Exploited the authenticated status_rrd_graph_img.php command injection for a direct root shell.

Want to try this box yourself?

Spoiler-free mode is on by default — every solution stays hidden behind a reveal. Peek the hints, attempt each step, then unlock the answer when you're stuck. Turn it off to read every solution inline.

Nmap

pfSense HTTPS login page over TLS

Web Enumeration

Visiting the web page at https://10.10.10.60/index.php redirects us to a login page served over HTTPS.

Login page served over HTTPS

FFUF

Using the default credentials does not work, so the next step is to fuzz for hidden subdomains and subdirectories.

Fuzzing subdirectories and directories with the .php extension returns nothing, so we move on to look for .txt files:

The above command returns a file named changelog.txt.

changelog.txt discovered by fuzzing

This file is a message stating that two of the three vulnerabilities have been fixed, and one is yet to be fixed.

changelog noting two of three vulnerabilities fixed

The information is good but not really useful. Since we found a file, we keep fuzzing for more files using different wordlists.

This box is from 2017, so ffuf might not be the best tool to enumerate the application.

We use DirBuster, since it was the best tool in 2017 and allows for a much more in-depth search.

DirBuster running an in-depth content scan

DirBuster finds a file named system-users.txt, which is very interesting.

Navigating to the page reveals a user's information.

system-users.txt revealing the user rohit

We get the username, but the password is not mentioned. A quick Google search shows that the default password for pfSense is pfsense.

So the credentials are rohit:pfsense.

Login is successful.

pfSense dashboard after logging in as rohit

The dashboard shows that the version is 2.1.3-RELEASE. Let's see if there are any public exploits for this version.

Initial Foothold

Version 2.1.3 has a Metasploit module that can be used.

The module works, and we get a shell.

Metasploit module yielding a shell on Sense

We find the user flag in /home/rohit/user.txt.

Privilege Escalation

We use the following command to get a reverse shell in our terminal instead of a Meterpreter shell:

The Metasploit exploit already gives us a root shell on the system, so no privilege escalation is required.

Root shell and flags captured on Sense