Get the App
SLTechnology News&Howtos  ›  Development  › 

How to implement anti-arp spoofing batch processing, ARP double binding script and no temporary files on the server?

Shulou Source: shulou.com Published: 2022-06-03 06:05:26 10月03日 Update

This article mainly introduces how the server to achieve anti-arp spoofing batch, ARP double binding script, no temporary files, the article is very detailed, has a certain reference value, interested friends must read it!

ARP double binding script, no temporary file (LZ-Myst version) below the horizontal line, save to BAT format can be used.

The code is as follows:

For / f "tokens=13"% I in ('ipconfig / all ^ | find "Default Gateway"') do set GatewayIP=%%I

For / f "tokens=1,2"% I in ('arp-a ^ | find "% GatewayIP%"') do if% Illumination% GatewayIP% arp-s% I%% J

For / f "tokens=15"% I in ('ipconfig / all ^ | find "IP Address"') do set ip=%%i

For / f "tokens=12"% I in ('ipconfig / all ^ | find "Physical Address"') do set mac=%%i

Arp-s% ip%% mac%

Note that the above code will have some problems in practical application, because if a machine with ARP virus already exists in the local area network, it will continue to send deceptive packets, so there will be a problem in automatically obtaining the gateway, so another piece of code has been modified to handwrite the MAC address of the real gateway. There is no need to write the IP address of the real gateway. The code is as follows.

Change the scarlet letter in the code box below to your real MAC address!

The MAC address format is: 00-14-78-32-14-f2 is the format displayed by ARP-A.

The code is as follows:

For / f "tokens=13"% I in ('ipconfig / all ^ | find "Default Gateway"') do set GatewayIP=%%I

Arp-s% GatewayIP% Real Gateway MAC

For / f "tokens=15"% I in ('ipconfig / all ^ | find "IP Address"') do set ip=%%i

For / f "tokens=12"% I in ('ipconfig / all ^ | find "Physical Address"') do set mac=%%i

Arp-s% ip%% mac%

The above is all the contents of the article "how to achieve anti-arp spoofing batches, ARP double-binding scripts, no temporary files". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Tags: Code address gateway file script content format server service article question for this reason constant value interest actual guy partner that is local Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Xiaomi Huawei MariaDB Linux