Rapid7 Vulnerability & Exploit Database

Xorg X11 Server Local Privilege Escalation

Back to Search

Xorg X11 Server Local Privilege Escalation

Disclosed
10/25/2018
Created
11/12/2019

Description

WARNING: Successful execution of this module results in /etc/passwd being overwritten. This module is a port of the OpenBSD X11 Xorg exploit to run on AIX. A permission check flaw exists for -modulepath and -logfile options when starting Xorg. This allows unprivileged users that can start the server the ability to elevate privileges and run arbitrary code under root privileges. This module has been tested with AIX 7.1 and 7.2, and should also work with 6.1. Due to permission restrictions of the crontab in AIX, this module does not use cron, and instead overwrites /etc/passwd in order to create a new user with root privileges. All currently logged in users need to be included when /etc/passwd is overwritten, else AIX will throw 'Cannot get "LOGNAME" variable' when attempting to change user. The Xorg '-fp' parameter used in the OpenBSD exploit does not work on AIX, and is replaced by '-config', in conjuction with ANSI-C quotes to inject newlines when overwriting /etc/passwd.

Author(s)

  • Narendra Shinde
  • Zack Flack <dzflack@gmail.com>

Platform

Unix

Architectures

cmd

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

;