Anti-ARP spoofing batch (binding ARP) _dos/bat

Source: Internet
Author: User
Tags goto

Copy Code code as follows:

@echo off
Arp-d
If%~n0==arp exit
If%~n0==arp exit
If%~n0==arp exit
Echo is getting native 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 Gateip
: Gateip
Echo mac:%mac%
Arp-s%ip%%mac%
ECHO is getting gateway information .....
for/f "skip=17 tokens=13 usebackq"%%i in (' Ipconfig/all ') do Set gateip=%%i && GOTO Gatemac
: Gatemac
Echo gateip:%gateip%
Ping%gateip%-t-n 1
for/f "skip=3 tokens=2 usebackq"%%i in (' Arp-a%gateip% ') do Set gatemac=%%i && GOTO Start
: Start
Echo gatemac:%gatemac%
Arp-s%gateip%%gatemac%
echo Operation completed!!!
Exit

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.