Block IP Addresses With IPtables & APF
Have a user that keeps hammering your FTP or trying to login over and over and over again that you just want to ban and never see again? We’ll show a quick and dirty method to ban an IP address from the server.
We commonly receive questions like:
“I would like to ban that ip address to prevent the access to the server.
how can i ban that Ip address from the server?”
Simple !
Login to the server as root.
- If you are running iptables, you can enter:
iptables -A INPUT -s IP_ADDRESS -j DROP
Ex: Block IP 68.72.72.25
iptables -A INPUT -s 68.72.72.25 -j DROP
Script to daily email APF status
You are running APF on your server, but sometimes you think “is APF running fine ?”
This script sends you an email with APF satus.
Log in to your server as root
Create the script:
nano apfstatus.sh
Put this on the file:
#!/bin/bash
tail -200 /var/log/apf_log | mail -s "APF Status" youemail@domain.com
Save and Exit
Ctrl+X and Y
Read more…
How To install BFD (Brute Force Detection)
What is BFD (Brute Force Detection)?
BFD is a modular shell script for parsing applicable logs and checking for authentication failures. There is not much complexity or detail to BFD yet and likewise it is very straight-forward in its installation, configuration and usage. The reason behind BFD is very simple; the fact there is little to no authentication and brute force auditing programs in the linux community that work in conjunction with a firewall or real-time facility to place bans.
Note: You MUST have APF Firewall Installed before installing BFD – it works with APF and requires some APF files to operate.
Installation:
Read more…
How to install APF (Advanced Policy Firewall)
What is APF (Advanced Policy Firewall)? APF Firewall
APF is a policy based iptables firewall system designed for ease of use and configuration. It employs a subset of features to satisfy the veteran Linux user and the novice alike. Packaged in tar.gz format and RPM formats, make APF ideal for deployment in many server environments based on Linux. APF is developed and maintained by R-fx Networks: http://www.rfxn.com/projects/advanced-policy-firewall/
This guide will show you how to install and configure APF firewall, one of the better known Linux firewalls available.
Read more…