__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
#
# Author: Mike Rushton
#
# IMPORTANT
#
# Please set jail.local's permission to 640 because it contains your CF API key.
#
# This action depends on curl (and optionally jq).
# Referenced from http://www.normyee.net/blog/2012/02/02/adding-cloudflare-support-to-fail2ban by NORM YEE
#
# To get your CloudFlare API Key: https://www.cloudflare.com/a/account/my-account
#
# CloudFlare API error codes: https://www.cloudflare.com/docs/host-api.html#s4.2
[Definition]
# Option: actionstart
# Notes.: command executed on demand at the first ban (or at the start of Fail2Ban if actionstart_on_demand is set to false).
# Values: CMD
#
actionstart =
# Option: actionstop
# Notes.: command executed at the stop of jail (or at the end of Fail2Ban)
# Values: CMD
#
actionstop =
# Option: actioncheck
# Notes.: command executed once before each actionban command
# Values: CMD
#
actioncheck =
# Option: actionban
# Notes.: command executed when banning an IP. Take care that the
# command is executed with Fail2Ban user rights.
# Tags: <ip> IP address
# <failures> number of failures
# <time> unix timestamp of the ban time
# Values: CMD
#
# API v1
#actionban = curl -s -o /dev/null https://www.cloudflare.com/api_json.html -d 'a=ban' -d 'tkn=<cftoken>' -d 'email=<cfuser>' -d 'key=<ip>'
# API v4
actionban = curl -s -o /dev/null -X POST <_cf_api_prms> \
-d '{"mode":"block","configuration":{"target":"<cftarget>","value":"<ip>"},"notes":"Fail2Ban <name>"}' \
<_cf_api_url>
# Option: actionunban
# Notes.: command executed when unbanning an IP. Take care that the
# command is executed with Fail2Ban user rights.
# Tags: <ip> IP address
# <failures> number of failures
# <time> unix timestamp of the ban time
# Values: CMD
#
# API v1
#actionunban = curl -s -o /dev/null https://www.cloudflare.com/api_json.html -d 'a=nul' -d 'tkn=<cftoken>' -d 'email=<cfuser>' -d 'key=<ip>'
# API v4
actionunban = id=$(curl -s -X GET <_cf_api_prms> \
"<_cf_api_url>?mode=block&configuration_target=<cftarget>&configuration_value=<ip>&page=1&per_page=1¬es=Fail2Ban%%20<name>" \
| { jq -r '.result[0].id' 2>/dev/null || tr -d '\n' | sed -nE 's/^.*"result"\s*:\s*\[\s*\{\s*"id"\s*:\s*"([^"]+)".*$/\1/p'; })
if [ -z "$id" ]; then echo "<name>: id for <ip> cannot be found"; exit 0; fi;
curl -s -o /dev/null -X DELETE <_cf_api_prms> "<_cf_api_url>/$id"
_cf_api_url = https://api.cloudflare.com/client/v4/user/firewall/access_rules/rules
_cf_api_prms = -H 'X-Auth-Email: <cfuser>' -H 'X-Auth-Key: <cftoken>' -H 'Content-Type: application/json'
[Init]
# If you like to use this action with mailing whois lines, you could use the composite action
# action_cf_mwl predefined in jail.conf, just define in your jail:
#
# action = %(action_cf_mwl)s
# # Your CF account e-mail
# cfemail =
# # Your CF API Key
# cfapikey =
cftoken =
cfuser =
cftarget = ip
[Init?family=inet6]
cftarget = ip6
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| abuseipdb.conf | File | 3.66 KB | 0644 |
|
| apf.conf | File | 587 B | 0644 |
|
| apprise.conf | File | 1.38 KB | 0644 |
|
| blocklist_de.conf | File | 2.65 KB | 0644 |
|
| bsd-ipfw.conf | File | 3.15 KB | 0644 |
|
| cloudflare-token.conf | File | 2.93 KB | 0644 |
|
| cloudflare.conf | File | 2.97 KB | 0644 |
|
| complain.conf | File | 4.66 KB | 0644 |
|
| dshield.conf | File | 7.5 KB | 0644 |
|
| dummy.conf | File | 1.68 KB | 0644 |
|
| firewallcmd-allports.conf | File | 1.47 KB | 0644 |
|
| firewallcmd-common.conf | File | 2.59 KB | 0644 |
|
| firewallcmd-ipset.conf | File | 3.58 KB | 0644 |
|
| firewallcmd-multiport.conf | File | 1.24 KB | 0644 |
|
| firewallcmd-new.conf | File | 1.85 KB | 0644 |
|
| firewallcmd-rich-logging.conf | File | 1021 B | 0644 |
|
| firewallcmd-rich-rules.conf | File | 1.71 KB | 0644 |
|
| helpers-common.conf | File | 592 B | 0644 |
|
| hostsdeny.conf | File | 1.62 KB | 0644 |
|
| ipfilter.conf | File | 1.54 KB | 0644 |
|
| ipfw.conf | File | 1.47 KB | 0644 |
|
| iptables-allports.conf | File | 291 B | 0644 |
|
| iptables-ipset-proto4.conf | File | 1.93 KB | 0644 |
|
| iptables-ipset-proto6-allports.conf | File | 814 B | 0644 |
|
| iptables-ipset-proto6.conf | File | 773 B | 0644 |
|
| iptables-ipset.conf | File | 2.52 KB | 0644 |
|
| iptables-multiport-log.conf | File | 2.11 KB | 0644 |
|
| iptables-multiport.conf | File | 232 B | 0644 |
|
| iptables-new.conf | File | 332 B | 0644 |
|
| iptables-xt_recent-echo.conf | File | 2.78 KB | 0644 |
|
| iptables.conf | File | 4.68 KB | 0644 |
|
| ipthreat.conf | File | 4.19 KB | 0644 |
|
| mail-buffered.conf | File | 2.44 KB | 0644 |
|
| mail-whois-common.conf | File | 1.03 KB | 0644 |
|
| mail-whois-lines.conf | File | 2.4 KB | 0644 |
|
| mail-whois.conf | File | 1.85 KB | 0644 |
|
| mail.conf | File | 1.72 KB | 0644 |
|
| mynetwatchman.conf | File | 5.2 KB | 0644 |
|
| netscaler.conf | File | 1.46 KB | 0644 |
|
| nftables-allports.conf | File | 383 B | 0644 |
|
| nftables-multiport.conf | File | 384 B | 0644 |
|
| nftables.conf | File | 6.17 KB | 0644 |
|
| nginx-block-map.conf | File | 3.92 KB | 0644 |
|
| npf.conf | File | 1.49 KB | 0644 |
|
| nsupdate.conf | File | 3.16 KB | 0644 |
|
| osx-afctl.conf | File | 497 B | 0644 |
|
| osx-ipfw.conf | File | 2.25 KB | 0644 |
|
| pf.conf | File | 3.66 KB | 0644 |
|
| route.conf | File | 1023 B | 0644 |
|
| sendmail-buffered.conf | File | 2.74 KB | 0644 |
|
| sendmail-common.conf | File | 1.89 KB | 0644 |
|
| sendmail-geoip-lines.conf | File | 1.72 KB | 0644 |
|
| sendmail-whois-ipjailmatches.conf | File | 1.03 KB | 0644 |
|
| sendmail-whois-ipmatches.conf | File | 1.01 KB | 0644 |
|
| sendmail-whois-lines.conf | File | 1.27 KB | 0644 |
|
| sendmail-whois-matches.conf | File | 1000 B | 0644 |
|
| sendmail-whois.conf | File | 950 B | 0644 |
|
| sendmail.conf | File | 829 B | 0644 |
|
| shorewall-ipset-proto6.conf | File | 3.44 KB | 0644 |
|
| shorewall.conf | File | 2.11 KB | 0644 |
|
| smtp.py | File | 6.13 KB | 0644 |
|
| symbiosis-blacklist-allports.conf | File | 1.47 KB | 0644 |
|
| ufw.conf | File | 2.32 KB | 0644 |
|
| xarf-login-attack.conf | File | 6.29 KB | 0644 |
|