-
Notifications
You must be signed in to change notification settings - Fork 563
Description
Application unable to retrieve redirect data after WFP Connect Redirect with nmap or wireshark.
The issue occurs when npcap is configured by nmap or wireshark data.
WFP Connect Redirect “SIO_QUERY_WFP_CONNECTION_REDIRECT_CONTEXT” fails to retrieve redirect data when using nmap or wireshark with npcap loopback
Steps to Reproduce using MS WFP Sampler
-
Get a copy of Windows Driver Kit (WDK) 8.1 Samples
https://code.msdn.microsoft.com/windowsapps/Windows-Driver-Kit-WDK-81-cf35e953/view/SourceCode -
Make sure the 8.1 DDK is installed on the machine
-
Compile the Windows Filtering Platform Sample
-
Create a program "testprogram.exe"
a. Listens to 127.0.0.1:4443
b. Upon connect accept
status = WSAIoctl(originalSocket,
SIO_QUERY_WFP_CONNECTION_REDIRECT_CONTEXT,
0,
0,
(BYTE*)ppRedirectContext,
REDIRECT_CONTEXT_SIZE,
(LPDWORD)&redirectContextSize,
0,
0);
if(status != NO_ERROR)
{
status = WSAGetLastError();
print the "status
}
else
{
print the redirectContext data //you will see the IP address the browser attempts to go to.
} -
Download nmap and make sure it is using npcap loopback driver
-
On your test system install the WFP Sample driver following the steps in
the "description.html" in the Windows Filtering Platform Sample directory. -
Start your testprogram.exe, get pid of the "testprogram.exe" from task manager.
-
Configure the WFP Sampler to redirect to your Proxy Program.
WFPSampler.Exe -s PROXY -l FWPM_LAYER_ALE_CONNECT_REDIRECT_V4 -p TCP -pra 127.0.0.1 -prp 4443 -v -plspid
-
Run nmap -sV 3128 localhost
Open chrome browser and go to an address 10.10.10.1:520 for example
Expectation:
The testprogram should not receive and error and be able to retrieve redirectContext data.
Actual:
The testprogram receives an error that an invalid arguement error.
Note:
If you do net stop npcap the testprogram will retrieve the redirectContext with out error and the IP Address used in the browser will
be in the redirectContext data