I'm in search of a solution to stop devices that are connected to the same WIFI network programmatically.
Usecase:
Hypothetically assume that an intruder already has access to my local WIFI network and injects malicious programs/attacks over to the connected devices in the Same WIFI network. At the same time, assume you cannot change the local WIFI password.
What I'm looking for is a .net core-based solution to find unfamiliar devices which are connected to a WIFI network by providing the username and password of that WIFI network (which I already know) and disabling the unfamiliar devices in that WIFI network.
So far as the working sample I have is the suggestion posted by @Melvyn here as a partial solution that does not contain login into the local WIFI network
SelectQuery wmiQuery = new SelectQuery("SELECT * FROM Win32_NetworkAdapter WHERE NetConnectionId != NULL");
ManagementObjectSearcher searchProcedure = new ManagementObjectSearcher(wmiQuery);
foreach (ManagementObject item in searchProcedure.Get())
{
if (((string)item["NetConnectionId"]) == "Local Network Connection")
{
item.InvokeMethod("Disable", null);
}
}
As an alternative approach Im okay to try out the PowerShell mechanism as well which can be invoke via a .net core application
Appreciate it if anyone can guide me to a workable solution.