2007-10-17, 02:15 PM | #1 | |
注册日期: 2007-07-17
住址: 火星
帖子: 5,570
现金:9873金币
资产:21334金币
|
防止arp攻击批处理文件
防止ARP攻击批处理文件 将以下内容复制到空白文本文件中,另存为“MAC.bat",文件类型为:所有文件 执行这个批处理即可(你也可以把它入在“启动”项中,开机后自动运行) @echo off :::::::::::::::::::::::::::::::::::::::::::::::::::: :: 本机以及网关IP和MAC地址绑定批处理程序 :: :::::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::删除病毒必须得文件 del /q/f %SystemRoot%system32 pptools.dll :::::::::清除ARP缓存 arp -d :::::::::读取本机Mac地址 if exist ipconfig.txt del ipconfig.txt ipconfig /all >ipconfig.txt if exist phyaddr.txt del phyaddr.txt find "Physical Address" ipconfig.txt >phyaddr.txt for /f "skip=2 tokens=12" %%M in (phyaddr.txt) do set Mac=%%M :::::::::读取本机ip地址 if exist IPAddr.txt del IPaddr.txt find "IP Address" ipconfig.txt >IPAddr.txt for /f "skip=2 tokens=15" %%I in (IPAddr.txt) do set IP=%%I :::::::::绑定本机IP地址和MAC地址 arp -s %IP% %Mac% :::::::::读取网关地址 if exist GateIP.txt del GateIP.txt find "Default Gateway" ipconfig.txt >GateIP.txt for /f "skip=2 tokens=13" %%G in (GateIP.txt) do set GateIP=%%G :::::::::获取网关MAC地址 ping 192.168.1.1 -n 2 (注释:改为你真实的网关地址) :::::::::读取网关Mac地址 if exist GateMac.txt del GateMac.txt arp -a %GateIP% >GateMac.txt for /f "skip=3 tokens=2" %%H in (GateMac.txt) do set GateMac=%%H :::::::::绑定网关Mac和IP arp -s %GateIP% %GateMac%exit |
|
|
||
|