国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > BAT > 正文

Ip安全策略批處理腳本及注釋(netsh)

2020-06-09 13:48:58
字體:
來源:轉載
供稿:網友
"netsh"是Windows 2000/XP/2003操作系統自身提供的命令行腳本實用工具,它允許用戶在本地或遠程顯示或修改當前正在運行的計算機的網絡配置。
  netsh ipsec,聽聞只有windows2003才能運行。在2003下測試的。
  IP安全策略,我自身的理解就是:一個安全策略由一條條規則組成,而這些規則是由2部分組成的。首先要建立一個ip篩選器(用來指定那些地址)。然后呢是篩選器操作(用來指定對這些ip的操作,就是動作)一個安全策略編寫完成了,首先要激活,才能使用,那就是指派。
  下面用實例來說明,然后附帶一些常用的。這個例子就是不允許ip為192.168.1.2的機器訪問我的3389端口。'后面是注析
  '建立一個名字叫XBLUE的安全策略先
  netsh ipsec static add policy name=XBLUE
  '建立一個ip篩選器,指定192.168.1.2
  netsh ipsec static add filterlist name=denyip
  netsh ipsec static add filter filterlist=denyip srcaddr=192.168.1.2 dstaddr=Me dstport=3389 protocol=TCP
  '建立一個篩選器操作
  netsh ipsec static ad

d filteraction name=denyact action=block
  '加入規則到安全策略XBLUE
  netsh ipsec static add rule name=kill3389 policy=XBLUE filterlist=denyip filteraction=denyact
  '激活這個策略
  netsh ipsec static set policy name=XBLUE assign=y
  把安全策略導出
  netsh ipsec static exportpolicy d:/ip.ipsec
  刪除所有安全策略
  netsh ipsec static del all
  把安全策略導入
  netsh ipsec static importpolicy d:/ip.ipsec
  激活這個策略
  netsh ipsec static set policy name=策略名稱 assign=y
  入侵靈活運用
  得到了61.90.227.136的sa權限。不過有策略限制,訪問不到他的3389。我想用他的3389。
  netsh ipsec static add filterlist name=welcomexblue
  netsh ipsec static add filter filterlist=welcomexblue srcaddr=220.207.31.249 dstaddr=Me dstport=7892 protocol=TCP
  netsh ipsec static add rule name=letxblue policy=ConnRest filterlist=welcomexblue filteraction=Permit
  訪問結果
  可以訪問了。
  netsh ipsec static del rule name=letxblue policy=ConnRest
  更改
  netsh ipsec static set filter filterlist=welcomexblue srcaddr=220.207.31.249 dstaddr=Me dstport=3389 protocol=TCP
  刪除
  netsh ipsec static del rule name=letxblue policy=ConnRest
  netsh ipsec static del filterlist name=welcomexblue
  以下是Win2K的
  win2k下的ip安全策略添加需要用到ipsecpol這個程序,在windows的resource kit里有,包括一個exe和2個dll。我在這里不解釋他的使用方法,你可以ipsecpol* 〉 ipsecpolhelp.txt察看。這是我自己使用的腳本。
  rem 首先限制所有
  ipsecpol -w REG -p "Haishion" -r "Block All IP" -f *+0 -n BLOCK
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 庆元县| 泽普县| 建瓯市| 南宫市| 三原县| 疏勒县| 遵义县| 休宁县| 浠水县| 贵州省| 菏泽市| 伊金霍洛旗| 眉山市| 深州市| 榕江县| 靖安县| 金阳县| 抚顺县| 新巴尔虎右旗| 泰安市| 鄂托克旗| 韩城市| 凤翔县| 康定县| 太原市| 连南| 同仁县| 衡阳县| 谷城县| 建始县| 涟源市| 新干县| 运城市| 建水县| 江山市| 息烽县| 安丘市| 苏尼特右旗| 洛扎县| 定州市| 小金县|