Skip to content
Open
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
ed2f211
wip
hojmark Dec 13, 2025
04235ee
windows ping tool implementation
hojmark Dec 13, 2025
42452ef
ci: windows workflow
hojmark Dec 13, 2025
9c2915b
linux only tests
hojmark Dec 13, 2025
2de69a1
windows multiline command backticks
hojmark Dec 13, 2025
c770f75
oops
hojmark Dec 13, 2025
3f5f8e6
temp skip e2e on windows
hojmark Dec 13, 2025
e70cb9c
f
hojmark Dec 13, 2025
7a9e35a
platform
hojmark Dec 13, 2025
c26eca9
f
hojmark Dec 13, 2025
54c614f
fix test
hojmark Dec 13, 2025
5016aef
fix tests
hojmark Dec 13, 2025
41d3d79
fix test
hojmark Dec 13, 2025
1639084
enable test on windows
hojmark Dec 13, 2025
5e9958a
temp disable test on Windows
hojmark Dec 13, 2025
e467f42
test on windows
hojmark Dec 13, 2025
542f905
test on windows
hojmark Dec 13, 2025
484cd35
fix test
hojmark Dec 13, 2025
d78f608
refactor arp tables
hojmark Dec 13, 2025
b882a35
blind windows arp table implementation
hojmark Dec 13, 2025
27e5bfb
blind windows ping subnet scanner implementation
hojmark Dec 13, 2025
995cc36
disable test on windows
hojmark Dec 14, 2025
4a65f75
more specific disable
hojmark Dec 14, 2025
34d5d84
enable e2e
hojmark Dec 14, 2025
bc96a89
build binaries on the right platforms
hojmark Dec 14, 2025
2336943
default platform when localbuild
hojmark Dec 14, 2025
6324afe
fix RID
hojmark Dec 14, 2025
85b6d4b
platform dependant binary name
hojmark Dec 14, 2025
6cafa7e
f
hojmark Dec 14, 2025
7d318a7
bump windows timeout to 10 minutes
hojmark Dec 14, 2025
dbfd4e7
f
hojmark Dec 14, 2025
2e22dff
f
hojmark Dec 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
blind windows arp table implementation
  • Loading branch information
hojmark committed Dec 13, 2025
commit b882a358cd2961880dbb8c68cffee1b41b438c6f
54 changes: 54 additions & 0 deletions src/Scanning/Arp/WindowsArpTableProvider.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
using System.Diagnostics;
using System.Net;
using System.Runtime.Versioning;
using Drift.Domain.Device.Addresses;

namespace Drift.Scanning.Arp;

[SupportedOSPlatform( "windows" )]
internal class WindowsArpTableProvider : ArpTableProviderBase {
protected override ArpTable ReadSystemArpCache() {
var map = new Dictionary<IPAddress, MacAddress>();

var startInfo = new ProcessStartInfo {
FileName = "arp",
Arguments = "-a",
RedirectStandardOutput = true,
UseShellExecute = false,
CreateNoWindow = true
};

using var proc = Process.Start( startInfo );
if ( proc == null ) {
throw new InvalidOperationException( "Failed to start 'arp' process." );
}

while ( !proc.StandardOutput.EndOfStream ) {
var line = proc.StandardOutput.ReadLine();
// Console.WriteLine( line );
if ( string.IsNullOrWhiteSpace( line ) ) {
continue;
}

if ( line.StartsWith( "Interface" ) ) {
continue; // skip header
}

var parts = line.Split( (char[]?) null, StringSplitOptions.RemoveEmptyEntries );

// Defensive: expects at least Internet Address, Physical Address, Type
if ( parts.Length >= 3 &&
parts[0].Count( c => c == '.' ) == 3 && // Looks like an IP
parts[1].Contains( ':' ) // Looks like a MAC
) {
var ip = parts[0];
var mac = parts[1].ToUpperInvariant();

var ipParsed = IPAddress.Parse( ip );
map[ipParsed] = new MacAddress( mac );
}
}

return new ArpTable( map );
}
}
Loading