Skip to content

Instantly share code, notes, and snippets.

@mikebranstein
Last active February 23, 2024 15:10
Show Gist options
  • Save mikebranstein/ef123e29a500541b7929ebb36396763b to your computer and use it in GitHub Desktop.
Save mikebranstein/ef123e29a500541b7929ebb36396763b to your computer and use it in GitHub Desktop.
PowerShell script to hydrate ARP table via subnet pings
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