Description
This module exploits a vulnerability in the OpenBSD `ld.so` dynamic loader (CVE-2019-19726).
The `_dl_getenv()` function fails to reset the `LD_LIBRARY_PATH` environment variable when set with approximately `ARG_MAX` colons.
This can be abused to load `libutil.so` from an untrusted path, using `LD_LIBRARY_PATH` in combination with the `chpass` set-uid executable, resulting in privileged code execution.
This module has been tested successfully on:
OpenBSD 6.1 (amd64); and OpenBSD 6.6 (amd64)
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/openbsd/local/dynamic/loader_chpass_privescmsf undefined(loader_chpass_privesc) > show actions ...actions...msf undefined(loader_chpass_privesc) > set ACTION < action-name >msf undefined(loader_chpass_privesc) > show options ...show and set options...msf undefined(loader_chpass_privesc) > 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