標題:
How to block whatsapp
[打印本頁]
作者:
ckleea
時間:
2016-1-2 20:41
標題:
How to block whatsapp
剛剛看到這個script
http://forum.mikrotik.com/viewtopic.php?f=13&t=75263
# Copy and Paste the above to WinBox New Terminal #
/system scheduler
add comment="Whatsapp Blocker" interval=2m name="Whatsapp Blocker" on-event="#\
\_Use DNS Entrys and add Address to the Firewall Address-list #\r\
\n:foreach i in=[/ip dns cache all find where (name~\"whatsapp\") && (type\
=\"A\") ] do={\r\
\n :local tmpAddress [/ip dns cache get \$i address];\r\
\ndelay delay-time=10ms\r\
\n# prevent script from using all cpu time #\r\
\n :if ( [/ip firewall address-list find where address=\$tmpAddress] = \
\"\") do={ \r\
\n :local cacheName [/ip dns cache get \$i name] ;\r\
\n :log info (\"added entry: \$cacheName \$tmpAddress\");\r\
\n /ip firewall address-list add address=\$tmpAddress list=Whatsapp co\
mment=\$cacheName;\r\
\n}\r\
\n}" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
start-time=startup
/ip firewall filter add chain=forward action=drop dst-address-list=Whatsapp disabled=no comment="Whatsapp Blocker"
複製代碼
作者:
gfx86674
時間:
2016-1-3 00:56
蠻容易理解的script.
到dns cache裡找name的關鍵字含"whatsapp" ,然後將address記錄到list=Whatsapp
最後用利用firewall filter ,將dst-address-list=Whatsapp的連線全給封鎖.
作者:
ckleea
時間:
2016-1-3 15:35
回復
2#
gfx86674
我不明白我的DNS cache 沒有whatsapp
所以用下面的方法
https://virtualitsupport.wordpre ... senger-in-mikrotik/
作者:
ckleea
時間:
2016-1-4 07:12
現在用這方法去動態留意 Whatsapp使用的IP,然後在指定時間內禁止使用
/ip firewall mangle
add action=add-dst-to-address-list address-list=Whatsapp \
address-list-timeout=10m chain=prerouting content=whatsapp.com dst-port=\
80 in-interface=!wan protocol=tcp
add action=add-dst-to-address-list address-list=Whatsapp \
address-list-timeout=10m chain=prerouting content=whatsapp.com dst-port=\
443 in-interface=!wan protocol=tcp
add action=add-dst-to-address-list address-list=Whatsapp \
address-list-timeout=10m chain=prerouting content=whatsapp.com dst-port=\
5222 in-interface=!wan protocol=tcp
add action=add-dst-to-address-list address-list=Whatsapp \
address-list-timeout=10m chain=prerouting content=whatsapp.com dst-port=\
5223 in-interface=!wan protocol=tcp
add action=add-dst-to-address-list address-list=Whatsapp \
address-list-timeout=10m chain=prerouting content=whatsapp.com dst-port=\
5228 in-interface=!wan protocol=tcp
複製代碼
/ip firewall filter
add action=drop chain=forward comment="Whatsapp Drop" dst-address-list=\
Whatsapp time=9h-11h59m59s,sun,mon,tue,wed,thu,fri,sat
add action=drop chain=input comment="Whatsapp Drop" src-address-list=Whatsapp \
time=9h-11h59m59s,sun,mon,tue,wed,thu,fri,sat
複製代碼
歡迎光臨 電訊茶室 (http://telecom-cafe.com/forum/)
Powered by Discuz! 7.2