Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Linux IPTables anti-DDOS attack Shell Scripting     - Docker installation under CentOS7 (Linux)

- Linux shell script to adjust the Task Scheduler (Linux)

- How Linux Log Analysis (Linux)

- Digital jQuery scrolling effect (Programming)

- NAT and firewall under Linux (Linux)

- Increase Linux system security --chattr (Linux)

- Let you Fun Ubuntu desktop eleven weapon (Linux)

- Linux Powerful command Awk Introduction (Linux)

- Java memory area (Programming)

- Binary search and modification (Programming)

- Oracle 10g, 11g database silent installation of small differences (Database)

- Docker build private warehouse (Server)

- Windows 7 hard disk installation notes Debian (Linux)

- Linux System Getting Started Tutorial: permission to permanently modify the USB device in Linux (Linux)

- Java synchronization mechanism: synchronized, wait, notify (Programming)

- Nginx high concurrency optimization ideas (Server)

- How to use GRUB2 files directly from the hard disk to run ISO (Linux)

- jQuery get value drop-down list and select text (Programming)

- Oracle RAC node on the expulsion of the inspection process on OEL6.3 (Database)

- php for Linux the MySQL extension module installation and configuration (Database)

 
         
  Linux IPTables anti-DDOS attack Shell Scripting
     
  Add Date : 2018-11-21      
         
         
         
  1, Shell Scripting
#! / Bin / bash
/ Bin / netstat -na | grep ESTABLISHED | awk '{print $ 5}' | awk -F: '{print $ 1}' | sed '/ ^ $ / d' | sort | uniq -c | sort -rn | head - n 10 | grep -v -E '192.168 | 127.0' | sed '/ ^ $ / d' | awk '{if; {print $ 2} ($ 2 = null && $ 1> 10!)}'> / tmp / dropip

for i in $ (cat / tmp / dropip)
do
/ Sbin / iptables -A INPUT -s $ i -j DROP
echo "$ i kill at` date` ">> / var / log / ddos
done


2. Increase execute permissions
chmod + x /root/bin/dropip.sh

3. Add to the scheduled task, once per minute
crontab -e
* / 1 * * * * /root/bin/dropip.sh

Explanation:
The above script is relatively simple, but very practical, the most important is the second line, to get the most ESTABLISHED connections before 10 ip and written to a temporary file / tmp / dropip, excluding the internal ip section 192.168 |. 127.0 for beginning through loop dropip inside ip iptables through all drop off, and then written to the log file / var / log / ddos
     
         
         
         
  More:      
 
- These days have been tossing in the Linux under the ASP.NET 5, on the next in the other operating systems in the ASP.NET 5 or. NET applications, in order to complete the MS VM (CoreCLR) run is not far Reach, the effect of the application.

Cur
(Server)
- Ubuntu 14.04 How to install Cinnamon 2.4.5 (Linux)
- How to modify the Linux NIC eth1 to eth0 (Linux)
- Eclipse, Tomcat configuration JNDI connection Oracle data source example (Server)
- Echo Command Examples (Linux)
- Oracle physical storage structure outline (Database)
- OpenSIPS offline messaging feature set (Server)
- Linux commands to access the cheat sheet (Linux)
- Linux Live CD lets your PC is no longer secure (Linux)
- iOS Sensor Development - add to APP phone password, fingerprint security authentication (Programming)
- Use Oracle 11g show spparameter command (Database)
- Make Windows boot disk to install USB in Ubuntu Linux (Linux)
- Linux kernel network subsystem analysis (Programming)
- Ubuntu install Eclipse for C / C ++ and related configuration (Linux)
- pureftpd basis: Install, configure, implement, anonymous logon (Linux)
- MySQL monitoring tool -Innotop (Database)
- Docker + Nginx + Tomcat7 simple load balancing configuration (Server)
- Redmine Installation (Linux)
- CentOS7 minimized installation can not find the 'ifconfig' command - Repair Tips (Linux)
- Linux remote connectivity tools -OpenSSH (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.