iptables 字串封鎖功能 - Linux

By Yedda
at 2019-09-16T18:48
at 2019-09-16T18:48
Table of Contents
※ 引述《fordmvp (無名氏)》之銘言:
: 之前用Ubuntu 14.04桌面版安裝iptables 用string封鎖字串可以成功,後來改安裝
: centos7.6安裝iptables但同樣的指令雖然可以執行確實際沒有封鎖,請問何解?
: 後來有看到網路上有webstr和weburl指令,確卻無法執行。
: 補充說明
: 原來是
: iptables -t mangle -A POSTROUTING -s xxx.xxx.xxx.xxx -m string --algo bm
: --string "game" -j DROP
: 現在是還可以執行,但沒效果。
: 我的iptables 是v1.4.21
: 我的架構是將兩張網卡橋接,但不用nat和虛擬ip等,是用真實ip。
: 網路上的指令
: iptables -A FORWARD -m webstr --url "www.google.com" -j DROP
: iptables -A FORWARD -m weburl --contains "yahoo" -j DROP
: 都無法執行
: 是因為缺模組嗎?
: 懇請高手解答。
如果不要求太嚴格的話,可以測試看看 https://github.com/Lochnair/xt_tls
這個套件,透過 SNI 的資訊過濾...
官方範例裡面有個雷的地方,用 "\*.yahoo.com" 擋結果沒用,測了幾次後發現
直接用 "*.yahoo.com" 就可以了,你可以測試看看...
--
Resistance is futile.
https://blog.gslin.org/ & <[email protected]>
--
: 之前用Ubuntu 14.04桌面版安裝iptables 用string封鎖字串可以成功,後來改安裝
: centos7.6安裝iptables但同樣的指令雖然可以執行確實際沒有封鎖,請問何解?
: 後來有看到網路上有webstr和weburl指令,確卻無法執行。
: 補充說明
: 原來是
: iptables -t mangle -A POSTROUTING -s xxx.xxx.xxx.xxx -m string --algo bm
: --string "game" -j DROP
: 現在是還可以執行,但沒效果。
: 我的iptables 是v1.4.21
: 我的架構是將兩張網卡橋接,但不用nat和虛擬ip等,是用真實ip。
: 網路上的指令
: iptables -A FORWARD -m webstr --url "www.google.com" -j DROP
: iptables -A FORWARD -m weburl --contains "yahoo" -j DROP
: 都無法執行
: 是因為缺模組嗎?
: 懇請高手解答。
如果不要求太嚴格的話,可以測試看看 https://github.com/Lochnair/xt_tls
這個套件,透過 SNI 的資訊過濾...
官方範例裡面有個雷的地方,用 "\*.yahoo.com" 擋結果沒用,測了幾次後發現
直接用 "*.yahoo.com" 就可以了,你可以測試看看...
--
Resistance is futile.
https://blog.gslin.org/ & <[email protected]>
--
Tags:
Linux
All Comments

By Harry
at 2019-09-20T11:12
at 2019-09-20T11:12
Related Posts
X11 connection rejected

By Hedy
at 2019-09-13T11:07
at 2019-09-13T11:07
老硬體用哪個虛擬系統裝Ubuntu佳?

By Daniel
at 2019-09-12T12:59
at 2019-09-12T12:59
Ubuntu 19.04 Gnome 調整

By Vanessa
at 2019-09-11T16:43
at 2019-09-11T16:43
win10+ubuntu18.04雙系統會當機

By Enid
at 2019-09-11T16:32
at 2019-09-11T16:32
雙網卡都想要link local...

By Skylar Davis
at 2019-09-10T22:20
at 2019-09-10T22:20