If we can execute "fail2ban" as root, we can gain access to privileges by modifying the configuration file.
We need to check if the config file is writable.
Look inside of "/etc/fail2ban/jail.conf" to know more about how fail2ban is configured.
less/etc/fail2ban/jail.conf# ---------------------------------------------# output...# "bantime" is the number of seconds that a host is banned.bantime=10s# A host is banned if it has generated "maxretry" during the last "findtime"# seconds.findtime=10s# "maxretry" is the number of failures before a host get banned.maxretry=5...Copied!
ls -al /etc/fail2ban/action.d/iptables-multiport.conf
# copy this file into the home directory for editing the content
cp /etc/fail2ban/action.d/iptables-multiport.conf ~
Copied!