- @echo off
- title 創(chuàng)建IP安全策略,屏蔽135、139、445等端口
- echo “正在關(guān)閉,請(qǐng)等待”
- netsh ipsec static add policy name=whds
- netsh ipsec static add filterlist name=Filter1
- netsh ipsec static add filter filterlist=Filter1 srcaddr=any dstaddr=Me dstport=135 protocol=TCP
- echo “135端口已經(jīng)關(guān)閉”
- netsh ipsec static add filter filterlist=Filter1 srcaddr=any dstaddr=Me dstport=136 protocol=TCP
- echo “136端口已經(jīng)關(guān)閉”
- netsh ipsec static add filter filterlist=Filter1 srcaddr=any dstaddr=Me dstport=137 protocol=TCP
- echo “137端口已經(jīng)關(guān)閉”
- netsh ipsec static add filter filterlist=Filter1 srcaddr=any dstaddr=Me dstport=138 protocol=TCP
- echo “138端口已經(jīng)關(guān)閉”
- netsh ipsec static add filter filterlist=Filter1 srcaddr=any dstaddr=Me dstport=139 protocol=TCP
- echo “139端口已經(jīng)關(guān)閉”
- netsh ipsec static add filter filterlist=Filter1 srcaddr=any dstaddr=Me dstport=445 protocol=TCP
- echo “445端口已經(jīng)關(guān)閉”
- netsh ipsec static add filter filterlist=Filter1 srcaddr=any dstaddr=Me dstport=1443 protocol=TCP
- echo “1443端口已經(jīng)關(guān)閉”
- netsh ipsec static add filter filterlist=Filter1 srcaddr=any dstaddr=Me dstport=1444 protocol=TCP
- echo “1444端口已經(jīng)關(guān)閉”
- netsh ipsec static add filter filterlist=Filter1 srcaddr=any dstaddr=Me dstport=135 protocol=UDP
- netsh ipsec static add filter filterlist=Filter1 srcaddr=any dstaddr=Me dstport=136 protocol=UDP
- netsh ipsec static add filter filterlist=Filter1 srcaddr=any dstaddr=Me dstport=137 protocol=UDP
- netsh ipsec static add filter filterlist=Filter1 srcaddr=any dstaddr=Me dstport=138 protocol=UDP
- netsh ipsec static add filter filterlist=Filter1 srcaddr=any dstaddr=Me dstport=139 protocol=UDP
- netsh ipsec static add filter filterlist=Filter1 srcaddr=any dstaddr=Me dstport=445 protocol=UDP
- netsh ipsec static add filter filterlist=Filter1 srcaddr=any dstaddr=Me dstport=1443 protocol=UDP
- netsh ipsec static add filter filterlist=Filter1 srcaddr=any dstaddr=Me dstport=1444 protocol=UDP
- netsh ipsec static add filteraction name=FilteraAtion1 action=block
- netsh ipsec static add rule name=Rule1 policy=whds filterlist=Filter1 filteraction=FilteraAtion1
- netsh ipsec static set policy name=whds assign=y
- echo “危險(xiǎn)端口已經(jīng)關(guān)閉,按任意鍵退出”
- pause
將上面代碼復(fù)制到文檔,然后另存為.bat格式就可以了。
版權(quán)聲明:文章圖片資源來源于網(wǎng)絡(luò),如有侵權(quán),請(qǐng)留言刪除!!!
評(píng)論