Linux system shell scripts are powerful, used to execute a variety of commands, the site can be defended by a small amount of ddos attacks through shell scripts, the following small series will explain to you the Linux shell script to analyze how Nginx logs resist ddos attacks.
implementation:
1. attack signatures, different ip constantly POST HOME, causing 2. Analysis nginx access log excessive resource consumption
, determine characteristic POST Get client access ip
3. Block the attack ip with more than 50 connections
4. Record the attack ip to the document
5. Each time the attack ip is obtained Existing attack ip comparison
View source code:
#! /bin/bash
WEBSITES=(
example.com
)
minute_now=`date +%M`
max_connections =50
banips=“/wwwdata/jobs/banips.txt”
for site in ${WEBSITES[*]}
do
Access_log_file=“/wwwdata/logs/${site}.access.log”
if [ -f “${access_log_file}” ]
then
Cat ${access_log_file}
The Linux system process is composed of threads. Of course, the number of threads u
Understand the Linux system commands, the sed command is often used for the process
In the system operation, closed source software and open source software are relative, there are alw
In Ubuntu10.10 system, g77 has been completely replaced by gfortran, but not fully compatible with t
Linux recovery method was mistakenly deleted root user
How to configure yum source in CentOS system
How to quickly switch the old server IP to the new server under Linux
Linux system NBMA and BMA exchange method introduction
Linux network card binding setting method
How to manually upgrade Gentoo and its kernels
What should I do if I install a graphics card driver error on Ubuntu 13.10?
What should I do when Linux upgrades Glibc?
Linux df command using instance summary
Windows 8 lock screen has customizable background
Win10 is going to surpass Win7 to become the most popular game operating system
Win8 is not the same gameplay: use the calendar to display the weather
Win 7 memory usage is not equal to the system speed is slow
Win10 Mobile Preview 10536 Known Issues Summary
Win8 system personalized desktop icon method
Win10 system broadband connection error 720 solution
Win8.1 system in the run window input gpedit.msc can not open the group policy how to solve?
Enterprises choose the right server Five attentions should not forget