InfraFenceInfraFence

Live Security Operations

Get started

Emergency guide · free check

Server under attack? Check it now, free

Find out what is hitting your server, stop it without locking yourself out, and check that nobody got in. Start with the free check below, then follow the steps for the next 10 minutes.

  • Free
  • No sign-up
  • Read-only
  • Nothing installed

Check your domain from the outside, now

Type the domain of the server: in seconds you see what anyone on the internet can see, from HTTPS to exposed files and blocklists, each with a one-line fix.

The outside check sends a few requests to the site, about 15, as a browser would (user agent InfraFence-Audit/1.0), and never scans ports. To report abuse or ask us never to check your domain, write to info@infrafence.com.

See the attacks of the last 24 hours, from inside the server

Run this as root: in about a minute it counts the SSH and web attacks of the last 24 hours, lists the addresses behind them and the weak spots, read-only.

curl -fsSL https://infrafence.com/audit.sh | sh
What the command reads and sends
What to do in the next 10 minutes

Last updated:

What to do in the next 10 minutes

Safe steps for any Linux server, in this order. Copy the commands as root; replace 198.51.100.10 with your own address and 203.0.113.7 with the attacker's.

  1. 1. Find out what kind of attack it is

    Most attacks are one of three: SSH brute force (thousands of failed logins), a web flood (a few addresses sending huge numbers of requests) or WordPress xmlrpc.php and wp-login.php abuse. The logs tell you which, and from where. On RHEL-based systems the SSH log is /var/log/secure; for Apache, use /var/log/apache2/access.log or /var/log/httpd/access_log.

    # SSH: the addresses with the most failed logins
    grep -E "Failed password|Invalid user" /var/log/auth.log | grep -oE "from [0-9a-f.:]+" | sort | uniq -c | sort -rn | head
    # Web: the addresses with the most requests
    awk '{print $1}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head
    # WordPress: requests to xmlrpc.php
    grep -c "POST /xmlrpc.php" /var/log/nginx/access.log
  2. 2. Protect your own access first

    Before you touch the firewall, find your own address and allow it (with ufw, before you run ufw enable), keep your current SSH session open, and test a second login before you close it. If you do lock yourself out, your provider's web console still reaches the server.

    # Your address: the first field
    echo $SSH_CLIENT
    # Allow it before any block (ufw)
    ufw allow from 198.51.100.10 to any port 22 proto tcp
  3. 3. Block the addresses that attack

    Block the few addresses at the top of the lists from step 1. For xmlrpc.php abuse, deny the file in the web server if nothing on the site uses it. If the attack fills your network link (a volumetric DDoS), the server cannot filter it: ask your provider for DDoS protection, or put the site behind a CDN.

    # With ufw
    ufw insert 1 deny from 203.0.113.7
    # Without ufw
    iptables -I INPUT -s 203.0.113.7 -j DROP
  4. 4. Check that nobody got in

    Thousands of failed logins are noise; one successful login from an address you do not know is an intrusion. Look for logins you do not recognise, accounts with root powers, SSH keys, cron jobs and processes you did not create, and a non-empty /etc/ld.so.preload.

    last -ai | head -20
    grep "Accepted" /var/log/auth.log | tail -20
    awk -F: '$3 == 0 {print $1}' /etc/passwd
    cat /root/.ssh/authorized_keys
    ls -la /etc/cron.d /var/spool/cron*
    ps aux --sort=-%cpu | head -15
    cat /etc/ld.so.preload
  5. 5. Change what may be exposed

    If a login succeeded, or a file such as .env or a backup was public, treat its passwords and keys as known: change the root and user passwords, replace the SSH keys, and rotate the database, mail and API credentials your sites use. Then turn off SSH password logins.

    passwd root
    ssh-keygen -t ed25519
    # Then, in /etc/ssh/sshd_config: PasswordAuthentication no
    systemctl reload sshd
  6. 6. Keep the evidence

    Copy the logs before they rotate, and before you clean or reinstall anything, then note the times and addresses. If personal data or an essential service may be affected, the NIS2 and GDPR deadlines (24 and 72 hours) may apply.

    tar czf /root/evidence-$(date +%F-%H%M).tar.gz /var/log /etc/passwd /etc/crontab /root/.ssh

How InfraFence stops it

The steps above stop this attack. InfraFence stops the next ones, on its own, and tells you what it did.

  • Installed with one command

    A small Go agent for Linux, installed as root with one command from the dashboard. It starts detecting and banning as soon as it connects.

  • Bans in real time

    SSH, mail, database and FTP brute force, web attacks scored by its web firewall and bad bots: the attacking address is banned in the server's firewall. Your whitelist and the addresses you logged in from in the last 30 days are never banned.

  • The "Under attack" button

    The red button in the dashboard starts the emergency mode: for 24 hours InfraFence responds by itself, banning the attackers, blocking the countries the attack comes from, turning on extra protections and applying safe fixes. What is risky waits for your approval, every action can be undone, and you can stop it at any time. Basic and Pro: twice every 30 days. AutoMode: always on.

  • The network's shared bans

    Organizations that choose to share attacker addresses help each other: on Basic and above your servers can also ban the addresses that other paying organizations, or several servers of InfraFence's own hosting infrastructure, banned, and on AutoMode an address that two organizations (or two of InfraFence's own servers) ban within an hour on strong evidence is banned by every AutoMode organization that shares, for 6 hours.

  • Learning, if you want to watch first

    Not ready to let it block? Start the server in Learning: it detects and reports everything and blocks nothing. Switch it to Full protection on the server's page when you are ready.

Stop this attack and the next ones

14 days of AutoMode free, no card: during the trial InfraFence responds to attacks by itself. Then Starter keeps one server protected for free.

Questions

How do I know my server is under attack?

The usual signs: the SSH log fills with failed logins, the web log with requests from a handful of addresses, the CPU or bandwidth climbs for no reason, the site slows down, or your provider sends an abuse notice. The commands in step 1, or the free check, show you which attack and from where.

Is a brute-force attack the same as being hacked?

No. Every public server receives failed login attempts all day: that is noise. You are hacked when an attempt succeeds or foreign code runs: an unknown successful login, a new account with root powers, an SSH key, cron job or process nobody created. Step 4 shows how to check.

Can InfraFence stop a DDoS attack?

It bans the addresses behind brute force, application-level floods and web attacks on the server itself. A volumetric DDoS that fills the network link has to be stopped before it reaches the server, by your provider's DDoS protection or a CDN: no software on the server can do that.

Will installing InfraFence during an attack lock me out?

It never bans whitelisted addresses or the addresses you logged in from over SSH in the last 30 days. If you prefer to watch first, start the server in Learning: it detects and reports everything and blocks nothing until you switch it to Full protection.

What does the "Under attack" button do?

It starts the emergency mode: for 24 hours InfraFence responds to the attack by itself, with the same safe catalog as AutoMode. It never runs commands of its own, never blocks your own addresses, and sends anything risky to Approvals. Everything it does appears in Activity and can be undone.

My server was hacked: should I reinstall it?

If you find signs of an intrusion, the safest path is to keep the evidence, rebuild the server from a clean image, restore the data from a backup made before the intrusion and change every password and key. Cleaning in place is possible, but you can never be fully sure nothing was left behind.

Is the check really free?

Yes. The outside check of a domain is free and needs no sign-up. InfraFence itself comes with 14 days of AutoMode free, without a card; after that, Starter protects one server for free.