惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Security Affairs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Jina AI
Jina AI
P
Palo Alto Networks Blog
GbyAI
GbyAI
大猫的无限游戏
大猫的无限游戏
A
Arctic Wolf
Hugging Face - Blog
Hugging Face - Blog
小众软件
小众软件
Y
Y Combinator Blog
T
The Blog of Author Tim Ferriss
Blog — PlanetScale
Blog — PlanetScale
S
Schneier on Security
V
Vulnerabilities – Threatpost
C
Cybersecurity and Infrastructure Security Agency CISA
雷峰网
雷峰网
T
Tenable Blog
人人都是产品经理
人人都是产品经理
T
Tor Project blog
C
Cyber Attacks, Cyber Crime and Cyber Security
AWS News Blog
AWS News Blog
Microsoft Security Blog
Microsoft Security Blog
J
Java Code Geeks
Scott Helme
Scott Helme
SecWiki News
SecWiki News
C
CERT Recently Published Vulnerability Notes
Recorded Future
Recorded Future
I
InfoQ
Security Archives - TechRepublic
Security Archives - TechRepublic
Help Net Security
Help Net Security
Cloudbric
Cloudbric
C
Check Point Blog
Engineering at Meta
Engineering at Meta
TaoSecurity Blog
TaoSecurity Blog
B
Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园_首页
N
News and Events Feed by Topic
云风的 BLOG
云风的 BLOG
MyScale Blog
MyScale Blog
腾讯CDC
量子位
Application and Cybersecurity Blog
Application and Cybersecurity Blog
K
Kaspersky official blog
Vercel News
Vercel News
F
Full Disclosure
T
Troy Hunt's Blog
Forbes - Security
Forbes - Security
S
Security @ Cisco Blogs

博客园 - dhb133

ftp被动模式和主动模式分析 mysql 开启慢查询命令【转】 SQL SERVER 2005 数据库状态为“可疑”的解决方法 【转自网络】 命令mstsc.exe /console不能登陆console模式了 bind 安装与简单配置文档 iptables配置 使用blackice黑冰防火墙拦截ping的方法【转】 sql2005阻止了对组件 'Ad Hoc Distributed Queries' 的 问题 mssql 2005 开启1433端口(转) - dhb133 清除tempdb数据库日志 ODBC 驱动程序不支持所需的属性的解决办法 - dhb133 - 博客园 计算表空间的存储过程 按小时查询总数 改了机器名后不能修改sql任务解决办法 msxml3.dll error '80072efd' 错误的解决办法 - dhb133 安全设置【转】 恢复删除的系统存储过程 sql恢复xp_regread - dhb133 - 博客园 总结windows下堆溢出的三种利用方式 - dhb133 - 博客园
用iptables来防止web服务器被CC攻击
dhb133 · 2010-01-15 · via 博客园 - dhb133

转自 xiaomei's blog
当apache站点受到严重的cc攻击,我们可以用iptables来防止web服务器被CC攻击,实现自动屏蔽IP的功能。
1.系统要求
(1)LINUX 内核版本:2.6.9-42ELsmp或2.6.9-55ELsmp(其它内核版本需要重新编译内核,比较麻烦,但是也是可以实现的)。
(2)iptables版本:1.3.7
2. 安装
安装iptables1.3.7和系统内核版本对应的内核模块kernel-smp-modules-connlimit
3. 配置相应的iptables规则
示例如下:

(1)控制单个IP的最大并发连接数
iptables -I INPUT -p tcp –dport 80 -m connlimit \
–connlimit-above 50 -j REJECT
#允许单个IP的最大连接数为 30
(2)控制单个IP在一定的时间(比如60秒)内允许新建立的连接数
iptables -A INPUT -p tcp –dport 80 -m recent \
–name BAD_HTTP_ACCESS –update –seconds 60 \
–hitcount 30 -j REJECT
iptables -A INPUT -p tcp –dport 80 -m recent \
–name BAD_HTTP_ACCESS –set -j ACCEPT
#单个IP在60秒内只允许最多新建30个连接
4. 验证
(1)工具:flood_connect.c(用来模拟攻击)
(2)查看效果:
使用
watch ‘netstat -an | grep:21 | \ grep< 模拟攻击客户机的IP>| wc -l’
实时查看模拟攻击客户机建立起来的连接数,
使用
watch ‘iptables -L -n -v | \grep< 模拟攻击客户机的IP>’
查看模拟攻击客户机被 DROP 的数据包数。
5.注意
为了增强iptables防止CC攻击的能力,最好调整一下ipt_recent的参数如下:
#cat/etc/modprobe.conf
options ipt_recent ip_list_tot=1000 ip_pkt_list_tot=60
#记录1000个IP地址,每个地址记录60个数据包
#modprobe ipt_recent