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

推荐订阅源

W
WeLiveSecurity
T
Tenable Blog
Project Zero
Project Zero
C
Cybersecurity and Infrastructure Security Agency CISA
T
The Exploit Database - CXSecurity.com
P
Palo Alto Networks Blog
S
Schneier on Security
Scott Helme
Scott Helme
S
Securelist
Know Your Adversary
Know Your Adversary
Vercel News
Vercel News
IT之家
IT之家
V
V2EX
F
Fortinet All Blogs
Simon Willison's Weblog
Simon Willison's Weblog
K
Kaspersky official blog
博客园_首页
T
Tailwind CSS Blog
The GitHub Blog
The GitHub Blog
Spread Privacy
Spread Privacy
Microsoft Security Blog
Microsoft Security Blog
Cisco Talos Blog
Cisco Talos Blog
The Register - Security
The Register - Security
有赞技术团队
有赞技术团队
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Cyberwarzone
Cyberwarzone
Google DeepMind News
Google DeepMind News
The Hacker News
The Hacker News
L
LINUX DO - 热门话题
Hugging Face - Blog
Hugging Face - Blog
博客园 - 三生石上(FineUI控件)
A
Arctic Wolf
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
C
CXSECURITY Database RSS Feed - CXSecurity.com
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
Threat Research - Cisco Blogs
P
Proofpoint News Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
P
Privacy & Cybersecurity Law Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
CERT Recently Published Vulnerability Notes
S
SegmentFault 最新的问题
AWS News Blog
AWS News Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
罗磊的独立博客
Apple Machine Learning Research
Apple Machine Learning Research
P
Proofpoint News Feed
The Cloudflare Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Vulnerabilities – Threatpost

博客园 - 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