This module exploits an arbitrary file creation vulnerability in the pfSense HTTP interface (CVE-2021-41282). The vulnerability affects versions <= 2.5.2 and can be exploited by an authenticated user if they have the "WebCfg - Diagnostics: Routing tables" privilege. This module uses the vulnerability to create a web shell and execute payloads with root privileges.
BSD,Unix
cmd, x64
To display the available options, load the module within the Metasploit console and run the commands 'show options' or 'show advanced':
msf > use exploit/unix/http/pfsense_diag_routes_webshell
msf exploit(pfsense_diag_routes_webshell) > show targets
...targets...
msf exploit(pfsense_diag_routes_webshell) > set TARGET < target-id >
msf exploit(pfsense_diag_routes_webshell) > show options
...show and set options...
msf exploit(pfsense_diag_routes_webshell) > exploit
Time is precious, so I don’t want to do something manually that I can automate. Leveraging the Metasploit Framework when automating any task keeps us from having to re-create the wheel as we can use the existing libraries and focus our efforts where it matters.
– Jim O’Gorman | President, Offensive Security