GoAdmio

blacklist

Block a downloaded list of attacker IPs and a list of datacenter networks on the server firewall and on Cloudflare for every hosted domain, or reset the server firewall to remove them

On this page: Overview · Quick start · Syntax · Arguments · Output · Examples · Troubleshooting · Details · Risks · See also


Overview

/go/blacklist blocks traffic from known bad sources before it reaches your websites. It uses two lists:

List What it contains Where it comes from
Blacklist IP addresses of bots and attackers, such as DDoS and brute-force sources Downloaded from go.blackhost.com each time you run the command
Datacenter Network ranges of hosting providers and datacenters that GoAdmio has marked to block The Datacenter table in /var/lib/sqlite/datacenter.db, where Block is 1

It blocks them in two places:

[!WARNING] Read Risks before you run it. The blocks apply to all ports, they can hit legitimate services, and reset resets the whole server firewall, not only the blacklist.

The command refuses to run (exit status 1) when a folder in /home has goadmio in its name. See Troubleshooting.


Quick start

# Block on the server firewall and on Cloudflare
/go/blacklist

This can take a long time. See Troubleshooting.


Syntax

/go/blacklist [local | cloudflare | reset | remove]

The command runs itself again with sudo when you are not root. It writes the call and a timestamp to /var/log/go/blacklist.log.


Arguments

You type What happens
Nothing Blocks on the server firewall and on Cloudflare.
local Blocks on the server firewall only.
cloudflare Blocks on Cloudflare only.
reset or remove Resets the whole server firewall with firewall reset. Cloudflare is not changed.
Anything else Nothing is blocked, and nothing is printed.

The check for goadmio folders applies to every mode except reset and remove.


Output

Server firewall:

Blocking DDoS Attack (2500 IPs)...
[1/2500] Blocking IPv4 203.0.113.5
[2/2500] Blocking IPv6 2001:db8::1
...
Blocking Datacenter (2500 IPs)...
[1/2500] Blocking IPv4 198.51.100.0/24
...

Cloudflare, one line for each hosted domain:

[1/3] Bulk Blocking [example.com]...

The responses from Cloudflare are thrown away, so errors are not shown. Check the rules in the Cloudflare dashboard to confirm. The counts say "IPs", but the datacenter list holds network ranges.


Examples

# Server firewall and Cloudflare
/go/blacklist
# Server firewall only
/go/blacklist local
# Cloudflare only
/go/blacklist cloudflare
# Reset the server firewall to GoAdmio's defaults
/go/blacklist reset
# On AlmaLinux, Rocky, CentOS, Red Hat, Fedora: activate the new rules
sudo firewall-cmd --reload
# Let an address through again
/go/unblock 203.0.113.5

Troubleshooting

Symptom Likely cause Fix
GoAdmio Website(s) exists, followed by folder names, and nothing happens A folder in /home has goadmio in its name. The command refuses to block on such servers. By design. reset and remove still work.
It runs for a very long time It runs one firewall command per address, for up to 5,000 addresses. Run it in screen or tmux, at a quiet time.
Blocks don't work on AlmaLinux, Rocky, CentOS, Red Hat, or Fedora Rules are saved as permanent, but firewalld is never reloaded by the command. Run sudo firewall-cmd --reload.
An address from the list is still not blocked on Debian or Ubuntu The check for existing rules matches part of an address, for example 1.2.3.4 and 1.2.3.45. Also, ufw uses the first matching rule, so a deny rule added after an allow for the same port has no effect. Check sudo ufw status numbered. Insert the deny rule above the allow rules.
A real visitor, service, or mail server is blocked The address is on one of the lists, or inside a blocked datacenter network. Run unblock for it. Check the ranges marked in datacenter.db.
You can no longer reach the server over SSH Your own address or network is on a list. All ports are blocked. Use the server's console, then run unblock with your address.
Blocking DDoS Attack (1 IPs)... and nothing blocked The list could not be downloaded. Check that the server can reach go.blackhost.com.
No new rules appear on Cloudflare The domain has no zone, the Cloudflare plan has a rule limit that is already used, or Cloudflare no longer accepts these requests. Errors are hidden. Check the domain, the credentials, and the rules in the dashboard. Cloudflare has been replacing "Firewall Rules" with WAF custom rules.
The rules named "Block DDoS Attack IPs" or "Block Datacenter IPs" are still on Cloudflare after reset reset does not touch Cloudflare. Delete those rules in the Cloudflare dashboard.
Your own Cloudflare block rules or filters disappeared The command deletes existing block rules and filters on each domain. See Cloudflare. Recreate them.

Details

What it does

  1. Records the call in /var/log/go/blacklist.log.
  2. Unless the argument is reset or remove, stops if a /home folder has goadmio in its name.
  3. On Debian and Ubuntu, saves the list of existing ufw rules, to avoid adding the same rule twice.
  4. reset or remove: runs firewall reset and stops. Nothing else is done.
  5. No argument or local: blocks the lists on the server firewall (see below).
  6. No argument or cloudflare: blocks the lists on Cloudflare for every hosted domain (see below).
flowchart TD
    A["blacklist [argument]"] --> B{"reset or remove?"}
    B -- "Yes" --> R["firewall reset, then stop"]
    B -- "No" --> G{"/home folder with goadmio in its name?"}
    G -- "Yes" --> X["Print the folders, exit 1"]
    G -- "No" --> L{"Argument is none or local?"}
    L -- "Yes" --> L2["Block blacklist and datacenter on the server firewall"]
    L -- "No" --> C
    L2 --> C{"Argument is none or cloudflare?"}
    C -- "Yes" --> C2["For each domain: delete old rules, add new Cloudflare rules"]
    C -- "No" --> Z["Done"]
    C2 --> Z

Server firewall

Blacklist Datacenter
Size Up to 2,500 addresses Up to 2,500 IPv4 networks
AlmaLinux, Rocky, CentOS, Red Hat, Fedora A permanent firewalld rich rule that rejects the source (IPv4 or IPv6), if it is not already in public.xml Same
Debian, Ubuntu ufw deny from <address> to any, if it is not already in the saved rule list Same

Each address is cleaned first, so that only letters, numbers, ., :, / remain. Rules are only added. Addresses that later leave the lists stay blocked until you reset the firewall.

Cloudflare

For every hosted domain that has a www folder, the command:

  1. Deletes up to 5 existing firewall rules with the action block.
  2. Deletes up to 5 existing filters.
  3. Creates up to five new rules, each blocking a list of addresses (ip.src in {...}):
Rule description Contents
Block DDoS Attack IPs (1) First 248 blacklist addresses
Block DDoS Attack IPs (2) Next 248
Block DDoS Attack IPs (3) Next 248
Block Datacenter IPs (1) First 248 datacenter networks (IPv4 and IPv6)
Block Datacenter IPs (2) Next 248

The limits of 248 per rule and five rules are there to fit Cloudflare's rule size and the Free plan's rule count. A rule is created only if its list is not empty.


Risks


See also

Command Description
block Block an IP address in the server firewall and in Cloudflare
unblock Unblock an IP address in the server firewall and in Cloudflare
white Whitelist an IP address on this server and in Cloudflare's firewall
firewall Install and configure the server firewall
waf Block IPs via Cloudflare WAF
bottop Block bad bots from visiting your server
bot Enable or disable malicious-bot blocking for one domain or for all domains
sshtop Report the top SSH brute-force sources and optionally block them
ddos Report the busiest IP addresses in the access log and block those that exceed a limit
securitylevel Set the Cloudflare security level for a domain or all hosted domains