Rapid7 Vulnerability & Exploit Database

Pi-Hole Remove Commands Linux Priv Esc

Back to Search

Pi-Hole Remove Commands Linux Priv Esc

Disclosed
04/20/2021
Created
07/29/2021

Description

Pi-Hole versions 3.0 - 5.3 allows for command line input to the removecustomcname, removecustomdns, and removestaticdhcp functions without properly validating the parameters before passing to sed. When executed as the www-data user, this allows for a privilege escalation to root since www-data is in the sudoers.d/pihole file with no password.

Author(s)

  • h00die
  • Emanuele Barbeno <emanuele.barbeno@compass-security.com>

Platform

Linux,Unix

Architectures

cmd

Development

Module Options

To display the available options, load the module within the Metasploit console and run the commands 'show options' or 'show advanced':

msf > use exploit/linux/local/pihole_remove_commands_lpe
msf exploit(pihole_remove_commands_lpe) > show targets
    ...targets...
msf exploit(pihole_remove_commands_lpe) > set TARGET < target-id >
msf exploit(pihole_remove_commands_lpe) > show options
    ...show and set options...
msf exploit(pihole_remove_commands_lpe) > 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

;