ARP virus prevents the batch processing of ARP virus _dos/bat

Source: Internet
Author: User
Copy Code code as follows:

@echo off
::::::::::::::::::::::::::::::::::::::::::::::::::::
: Native and gateway IP and MAC address binding batch program::
::::::::::::::::::::::::::::::::::::::::::::::::::::
Arp-d
:::::::: Read the local MAC address
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
:::::::: Read native IP address
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
:::::::: Binding Machine IP address and MAC address
Arp-s%ip%%mac%
:::::::: Read gateway Address
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
:::::::: Get the Gateway MAC address
Ping 192.168.0.1-n 1
:::::::: Read Gateway MAC address
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
::::::::: Binding Gateway Mac and IP
Arp-s%gateip%%gatemac%
Del GateIP.txt
Del GateMac.txt
Del IPAddr.txt
Del Ipconfig.txt
Del Phyaddr.txt
Exit
Copy the above code to save as a bat file. Load to startup item, this should be able to protect!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.