** permission on the Bash binary.
SUID is a special Linux permission that causes an executable to run with the privileges of the file owner.
If Bash is owned by root and has the SUID bit set, it can potentially be used to obtain a shell retaining root privileges.
The key issue is that Fail2Ban was operating with elevated privileges while we were able to manipulate an action through the privileged **fail2ban-client** interface.
The malicious action was triggered by banning an IP address:
sudo /usr/bin/fail2ban-client set ast-cli-attack banip 1.2.3.5
This caused Fail2Ban to execute the configured **actionban** command.
The SUID permission was therefore applied to Bash.
With the SUID permission applied to Bash, I launched Bash using:
The **-p** option is important because it tells Bash to preserve the privileged effective user ID instead of dropping it.
This confirmed successful privilege escalation.
With root access obtained, the root flag was retrieved: