Bash eq Privilege Escalation
The `-eq` comaparison in bash script is vulnerable to arbitrary command execution.
sudo -l
(root) /bin/bash /opt/example.sh
Copied!#!/bin/bash
read -rp "Enter guess: " num
if [[ $num -eq 42 ]]
then
echo "Correct"
else
echo "Wrong"
fi
Copied!References
Last updated
