Nota Acap
  • Introduction
  • Linux Guide
    • Fresh Installed Centos 7
    • Changing Network Interfaces in Centos 7
    • Lockdown SSH
    • Recursively change permission Linux
    • Proxy Server IPtables
    • Provisioning Web Server with Custombuild
    • MySQL Basic Management
    • Increasing Existing LVM Disk
  • Windows Guide
  • Application Guide
    • WEB Port IPtables Rate Limit
    • Simple Email Piping Script
    • HTTP Dead
    • Email Relay Outgoing
    • Compiling Extra PHP version (Directadmin)
    • Finding the SPAM (cPanel)
    • HTTP Basic Virtual Host
    • Update Kernel for DRBD Hosts
  • Migration Related
    • Cpanel -> Cpanel (Bulk)
    • IMAPSYNC Basic Scripts
    • Directadmin -> cPanel (Copy/Sync Emails)
    • Basic Rsync Script
Powered by GitBook
On this page

Was this helpful?

  1. Application Guide

WEB Port IPtables Rate Limit

#!/bin/bash

set -x

IPTABLES=`which iptables`
TIME_PERIOD=60
BLOCKCOUNT=15
ACTION="DROP"

$IPTABLES -F INPUT
$IPTABLES -F OUTPUT
$IPTABLES -F FORWARD
$IPTABLES -F POSTROUTING -t nat

$IPTABLES -I INPUT -m string --algo bm --string "Ubuntu" -j DROP

$IPTABLES -A INPUT -p tcp --dport 80 -i eth0 -m state --state NEW -m recent --set
$IPTABLES -A INPUT -p tcp --dport 80 -i eth0 -m state --state NEW -m recent --update --seconds $TIME_PERIOD --hitcount $BLOCKCOUNT -j $ACTION

$IPTABLES -A INPUT -p tcp --dport 443 -i eth0 -m state --state NEW -m recent --set
$IPTABLES -A INPUT -p tcp --dport 443 -i eth0 -m state --state NEW -m recent --update --seconds $TIME_PERIOD --hitcount $BLOCKCOUNT -j $ACTION
PreviousIncreasing Existing LVM DiskNextSimple Email Piping Script

Last updated 4 years ago

Was this helpful?