iptables怎么实现字符串匹配
发表于:2025-12-02 作者:千家信息网编辑
千家信息网最后更新 2025年12月02日,这篇文章主要介绍"iptables怎么实现字符串匹配",在日常操作中,相信很多人在iptables怎么实现字符串匹配问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答"ipt
千家信息网最后更新 2025年12月02日iptables怎么实现字符串匹配
这篇文章主要介绍"iptables怎么实现字符串匹配",在日常操作中,相信很多人在iptables怎么实现字符串匹配问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答"iptables怎么实现字符串匹配"的疑惑有所帮助!接下来,请跟着小编一起来学习吧!
iptables实现字符串匹配
分类: SHELL&linux命令2012-07-03 18:25 3172人阅读 评论(0) 收藏 举报
stringinputtcpoutputhexlinux
通过string匹配域名来过滤,范例如下:
iptables -I OUTPUT -p tcp -m string --string "qq.com" --algo bm -j DROPiptables -I OUTPUT -p udp -m string --string "qq.com" --algo bm -j DROP
这样就无法访问与QQ相关的业务了,但是代理好像还是可以
系统要求:
1:内核在2.6.18以上
2:iptables在1.3.5以上
3:内核中包含字符串匹配模块。在.config文件中应有
CONFIG_NETFILTER_XT_MATCH_STRING=m
man手册
iptables -m string -helpstring This modules matches a given string by using somepattern matching strategy. It requires a linux kernel >= 2.6.14. --algo bm|kmp Select the pattern matching strategy. (bm = Boyer-Moore, kmp = Knuth-Pratt-Morris) --from offset Set the offset from which it starts looking for anymatching. If not passed, default is 0. --to offset Set the offset to which it starts looking for anymatching. If not passed, default is the packet size. --string pattern Matches the given pattern. --hex-string patternMatches the given pattern in hex notation. 常见的应用程序和有用的示例规则1:防止***的方法iptables -I INPUT 1 -p tcp --dport 80 -m string --string "cmd.exe" --algo bm -j DROPiptables -I INPUT -j DROP -p tcp -s 0.0.0.0/0 -m string --algo kmp --string "cmd.exe"2:保护DDOS服务iptables -I INPUT 1 -p tcp --dport 80 -m string --string "domain.com" --algo kmp -j DROP3:防止电子邮件欺骗iptables -I INPUT -p tcp --dport 25 -m string --string "Subject" --algo bm -j DROP做个最优规则iptables -I INPUT -p tcp --dport 25 -m string --string "Subject" --algo bm --to 15000 -j DROP
到此,关于"iptables怎么实现字符串匹配"的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注网站,小编会继续努力为大家带来更多实用的文章!
字符
字符串
学习
内核
方法
更多
规则
帮助
实用
接下来
业务
命令
域名
常见
应用程序
手册
文件
文章
有用
模块
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
红旗服务器操作系统
打车软件开发环境
数据库如何判断日期是否规范
国家网络安全监测网
淮安专业led大屏服务器
软件开发如何避坑
大型服务器的显卡叫什么
跟卖软件开发
贵州服务器企业云空间
软件开发需求分析怎么做
eps属于什么类型的数据库
杜亚DT300Te K数据库
未来数据库有哪些新的技术
南京安卓应用软件开发流程
暗黑破坏神2重制版服务器怎么开
用友程序更改服务器IP
13个服务器
做软件开发是怎样的一种体验
2核4g服务器装什么系统
山东智矩网络技术有限公司
arm存储服务器
分布式数据库部署架构
暖通数据库
惠普服务器主板教程
杭州教育网络技术
使用服务器资源进行管理的有
软件开发工程师证报考条件
联通云信创版 国产数据库
远程管理您的服务器
网络安全cailiao大全