国产成人精品18p,天天干成人网,无码专区狠狠躁天天躁,美女脱精光隐私扒开免费观看

iptables怎么實(shí)現字符串匹配

發(fā)布時(shí)間:2021-08-23 15:12 來(lái)源:億速云 閱讀:0 作者:chen 欄目: 網(wǎng)絡(luò )安全

這篇文章主要介紹“iptables怎么實(shí)現字符串匹配”,在日常操作中,相信很多人在iptables怎么實(shí)現字符串匹配問(wèn)題上存在疑惑,小編查閱了各式資料,整理出簡(jiǎn)單好用的操作方法,希望對大家解答”iptables怎么實(shí)現字符串匹配”的疑惑有所幫助!接下來(lái),請跟著(zhù)小編一起來(lái)學(xué)習吧!

iptables實(shí)現字符串匹配

分類(lèi): SHELL&linux命令 3172人閱讀 評論(0) 收藏 舉報

stringinputtcpoutputhexlinux

通過(guò)string匹配域名來(lái)過(guò)濾,范例如下:

iptables -I OUTPUT -p tcp -m string --string "qq.com" --algo bm -j DROP
iptables -I OUTPUT -p udp -m string --string "qq.com" --algo bm -j DROP

這樣就無(wú)法訪(fǎng)問(wèn)與QQ相關(guān)的業(yè)務(wù)了,但是代理好像還是可以

系統要求:

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 some
pattern 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 any
matching. If not passed, default is 0.

        --to offset

              Set the offset to which it starts looking for any
matching. If not passed, default  is  the

              packet size.

        --string pattern

              Matches the given pattern.  --hex-string pattern
Matches the given pattern in hex notation. 
常見(jiàn)的應用程序和有用的示例規則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服務(wù)
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
做個(gè)最優(yōu)規則
iptables -I INPUT -p tcp --dport 25 -m string --string "Subject"  --algo bm --to 15000 -j DROP

免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng )、來(lái)自互聯(lián)網(wǎng)轉載和分享為主,文章觀(guān)點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權請聯(lián)系QQ:712375056 進(jìn)行舉報,并提供相關(guān)證據,一經(jīng)查實(shí),將立刻刪除涉嫌侵權內容。

好吊色欧美一区二区三区视频| 业余 自由 性别 成熟视频 视频| 国产精品麻豆欧美日韩WW| 18禁无遮挡国产免费观看| 久久久久亚洲AV无码专区网站| 国产精品无码AV不卡顿|