Last active
February 23, 2024 15:10
-
-
Save mikebranstein/ef123e29a500541b7929ebb36396763b to your computer and use it in GitHub Desktop.
PowerShell script to hydrate ARP table via subnet pings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for ($i = 1; $i -lt 255; $i++) { | |
ping "$networkSegment$i" -n 1 -l 1 -4 -w 500 | Out-Null | |
$ip = arp -a "$networkSegment$i" | Select-String $macAddress |% { $_.ToString().Trim().Split(" ")[0] } | |
if ($ip -ne $null) { | |
Write-Host "Found $macAddress during deep scan, IP: $ip" | |
break | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment