Anti-arp spoofing, batch processing, automatic gateway binding, batch processing

Source: Internet
Author: User

Run the following code. Save as doarp. bat and add it to auto run. Copy codeThe Code is as follows: @ echo OFF
If % ~ N0 = arp exit
If % ~ N0 = Arp exit
If % ~ N0 = ARP exit
Echo is obtaining local information .....
: IP
FOR/f "skip = 13 tokens = 15 usebackq" % I in ('ipconfig/all') do Set IP = % I & GOTO MAC
: MAC
Echo IP: % IP %
FOR/f "skip = 13 tokens = 12 usebackq" % I in ('ipconfig/all') do Set MAC = % I & GOTO custom IP
: Elastic IP
Echo MAC: % MAC %
Arp-s % IP % MAC %
Echo is obtaining gateway information .....
FOR/f "skip = 17 tokens = 13 usebackq" % I in ('ipconfig/all') do Set multicast IP = % I & GOTO encrypt Mac
: Running Mac
Echo IP: % GateIP %
FOR/f "skip = 3 tokens = 2 usebackq" % I in ('Arp-a % Taobao IP % ') do Set hosts MAC = % I & GOTO Start
: Start
Echo MAC: % running MAC %
Arp-d
Arp-s % GateIP % GateMAC %
Echo operation completed !!!
Exit

A detailed description is provided below:
This script is an anti-ARP attack. You can manually add local ip addresses, mac addresses, gateway ip addresses, and mac programs.

If % ~ N0 = arp exit
If % ~ N0 = Arp exit
If % ~ N0 = ARP exit // determine if the virus has been infected and exited

Echo is obtaining local information .....
: IP
FOR/f "skip = 13 tokens = 15 usebackq" % I in ('ipconfig/all') do Set IP = % I & GOTO MAC
: MAC
Echo IP: % IP %
FOR/f "skip = 13 tokens = 12 usebackq" % I in ('ipconfig/all') do Set MAC = % I & GOTO custom IP
: Elastic IP
Echo MAC: % MAC %
Arp-s % IP % MAC %
// Obtain the local IP address and mac address as prompted above. arp-s % IP % MAC % adds the local ip Address/mac address to the corresponding table of the local ip/mac address.

Echo is obtaining gateway information .....
FOR/f "skip = 17 tokens = 13 usebackq" % I in ('ipconfig/all') do Set multicast IP = % I & GOTO encrypt Mac
: Running Mac
Echo IP: % GateIP %
FOR/f "skip = 3 tokens = 2 usebackq" % I in ('Arp-a % Taobao IP % ') do Set hosts MAC = % I & GOTO Start
: Start
Echo MAC: % running MAC %
Arp-d
Arp-s % GateIP % GateMAC %
// Obtain the ip address/mac address of the Gateway. arp-s % GateIP % GateMAC % loads the ip address and mac address of the gateway to the corresponding table of the local machine.

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.