Rapid7 Vulnerability & Exploit Database

FreeBSD Intel SYSRET Privilege Escalation

Back to Search

FreeBSD Intel SYSRET Privilege Escalation

Disclosed
06/12/2012
Created
03/19/2019

Description

This module exploits a vulnerability in the FreeBSD kernel, when running on 64-bit Intel processors. By design, 64-bit processors following the X86-64 specification will trigger a general protection fault (GPF) when executing a SYSRET instruction with a non-canonical address in the RCX register. However, Intel processors check for a non-canonical address prior to dropping privileges, causing a GPF in privileged mode. As a result, the current userland RSP stack pointer is restored and executed, resulting in privileged code execution. This module has been tested successfully on: FreeBSD 8.3-RELEASE (amd64); and FreeBSD 9.0-RELEASE (amd64).

Author(s)

  • Rafal Wojtczuk
  • John Baldwin
  • iZsh
  • bcoles <bcoles@gmail.com>

Platform

BSD

Architectures

x64

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

;