Description
Local attackers can execute arbitrary code as root by tricking needrestart into running the Python interpreter with an attacker-controlled PYTHONPATH environment variable.
Verified against Ubuntu 22.04 with needrestart 3.5-5ubuntu2.1 Attempted exploitation against Debian 12, expliotation failed
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/ubuntu/needrestart_lpemsf undefined(needrestart_lpe) > show actions ...actions...msf undefined(needrestart_lpe) > set ACTION < action-name >msf undefined(needrestart_lpe) > show options ...show and set options...msf undefined(needrestart_lpe) > runPrioritise with Active Threat Intelligence
With curated Threat Intelligence, you can see which vulnerabilities truly put you at risk, prioritize what matters most, and act before attackers do.
Explore Intelligence Hub