久久久精品一区ed2k-女人被男人叉到高潮的视频-中文字幕乱码一区久久麻豆樱花-俄罗斯熟妇真实视频

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

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

為饒平等地區(qū)用戶提供了全套網(wǎng)頁設(shè)計(jì)制作服務(wù),及饒平網(wǎng)站建設(shè)行業(yè)解決方案。主營(yíng)業(yè)務(wù)為成都網(wǎng)站制作、成都網(wǎng)站設(shè)計(jì)、饒平網(wǎng)站設(shè)計(jì),以傳統(tǒng)方式定制建設(shè)網(wǎng)站,并提供域名空間備案等一條龍服務(wù),秉承以專業(yè)、用心的態(tài)度為用戶提供真誠(chéng)的服務(wù)。我們深信只要達(dá)到每一位用戶的要求,就會(huì)得到認(rèn)可,從而選擇與我們長(zhǎng)期合作。這樣,我們也可以走得更遠(yuǎn)!

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

分類: SHELL&linux命令2012-07-03 18:25 3172人閱讀 評(píng)論(0) 收藏 舉報(bào)

stringinputtcpoutputhexlinux

通過string匹配域名來過濾,范例如下:

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

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

系統(tǒng)要求:

1:內(nèi)核在2.6.18以上

2:iptables在1.3.5以上

3:內(nèi)核中包含字符串匹配模塊。在.config文件中應(yīng)有

CONFIG_NETFILTER_XT_MATCH_STRING=m

man手冊(cè)
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. 
常見的應(yīng)用程序和有用的示例規(guī)則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:
保護(hù)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)規(guī)則
iptables -I INPUT -p tcp --dport 25 -m string --string "Subject"  --algo bm --to 15000 -j DROP

到此,關(guān)于“iptables怎么實(shí)現(xiàn)字符串匹配”的學(xué)習(xí)就結(jié)束了,希望能夠解決大家的疑惑。理論與實(shí)踐的搭配能更好的幫助大家學(xué)習(xí),快去試試吧!若想繼續(xù)學(xué)習(xí)更多相關(guān)知識(shí),請(qǐng)繼續(xù)關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編會(huì)繼續(xù)努力為大家?guī)砀鄬?shí)用的文章!

網(wǎng)頁名稱:iptables怎么實(shí)現(xiàn)字符串匹配
URL鏈接:http://sd-ha.com/article16/pepgdg.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站收錄、用戶體驗(yàn)、自適應(yīng)網(wǎng)站、定制開發(fā)、網(wǎng)站設(shè)計(jì)、域名注冊(cè)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

成都網(wǎng)頁設(shè)計(jì)公司