Vulnerability & Exploit Database

Back to search

glibc 'realpath()' Privilege Escalation

This module attempts to gain root privileges on Linux systems by abusing a vulnerability in GNU C Library (glibc) version 2.26 and prior. This module uses halfdog's RationalLove exploit to exploit a buffer underflow in glibc realpath() and create a SUID root shell. The exploit has offsets for glibc versions 2.23-0ubuntu9 and 2.24-11+deb9u1. The target system must have unprivileged user namespaces enabled. This module has been tested successfully on Ubuntu Linux 16.04.3 (x86_64) with glibc version 2.23-0ubuntu9; and Debian 9.0 (x86_64) with glibc version 2.24-11+deb9u1.

Free Metasploit Download

Get your copy of the world's leading penetration testing tool

 Download Now

Module Name



  • halfdog
  • bcoles <bcoles [at]>



  • Auto


  • linux


  • x86
  • x64



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

Related Vulnerabilities