Rapid7 Vulnerability & Exploit Database

AddressSanitizer (ASan) SUID Executable Privilege Escalation

Back to Search

AddressSanitizer (ASan) SUID Executable Privilege Escalation

Disclosed
02/17/2016
Created
03/19/2019

Description

This module attempts to gain root privileges on Linux systems using setuid executables compiled with AddressSanitizer (ASan). ASan configuration related environment variables are permitted when executing setuid executables built with libasan. The `log_path` option can be set using the `ASAN_OPTIONS` environment variable, allowing clobbering of arbitrary files, with the privileges of the setuid user. This module uploads a shared object and sprays symlinks to overwrite `/etc/ld.so.preload` in order to create a setuid root shell.

Author(s)

  • Szabolcs Nagy
  • infodox
  • bcoles <bcoles@gmail.com>

Platform

Linux

Architectures

x86, x64, armle, aarch64, ppc, mipsle, mipsbe

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

;