-
Notifications
You must be signed in to change notification settings - Fork 546
Application unable to retrieve redirect data after WFP Connect Redirect with nmap or wireshark. #363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for this detailed bug report! I admit I don't yet know much about the WFP loopback capture mechanism of Npcap, so it will take a lot of research to bring me up to speed. In the meantime, could you try turning on Windows Driver Verifier with standard settings for |
Thanks Daniel, here are the Verifier results wfp8.1>verifier /query Time Stamp: 04/01/2019 11:36:30.359 Verifier Flags: 0x000209bb Standard Flags:
Additional Flags:
Verifier Statistics Summary
Driver Verification List
|
Thanks for the update. It looks like none of the default checks produced a crash. You could add additional check flags, but we will also be doing more research and manual review to see if we can identify the problem. |
Please let me know what additional checks will help you solve this. Thanks |
Hi Daniel, In order to solve this problem the nmap needs to be modified to inject the packet back into the network. Here is information that explains how NMap is interfering with the packet passing. The issue with npcap is that they have WFP classify in FWPS_LAYER_INBOUND_IPPACKET_V4 layer which when simplified does something like below:
…… status = FwpsAllocateCloneNetBufferList(pNetBufferList, NULL, NULL, 0, &pClonedNetBufferList); Upon discussion with the WFP product group when you clone nbl from a classify the expectation is that you block the original NBL and inject the cloned NBL, so the tag is transferred to the clone NBL which is by design. So for the nmap issue this needs to be reported to the nmap team to fix the driver. If they can provide a valid reason for why they need to do this (we can’t think of any reason) the product team is willing to re-visit this. Can we get a fix for this issue in the next version of nmap? |
Is there an update for this? We too are being impacted and are awaiting this to be resolved. |
Just a quick update: Here is what Microsoft stated: If you are going to do injection, depending upon the traffic direction you should be calling Receive (inbound) or Send(outbound) Btw, the right solution here is to not clone or inject and just pass the original NBL. Or ask them to contact Microsoft with their scenario so we can recommend the best/optimal solution. This is affecting us big time. |
Thanks for the very detailed info on how to go about fixing this! I will look into it and see if it's something we can get done for the next Npcap release. |
We believe this issue has been addressed in Npcap 0.9982. Please let us know if it passes your tests. |
Hi Daniel, I tried this version .9982 and it does not fix the issue. I tried to edit the loopback as you did (by injecting the clone) in the following lines npcap/packetWin7/npf/npf/Loopback.c Line 622 in b009a6c
It did not work for me either. I talked to Microsoft about it not working. Is it possible for you to contact Microsoft, they seem to have a better way to deal with this. Thanks, |
@keithdg Thanks for the update. Yes, if you look just above there at line 607, I have some dead code to use a different injection function based on the direction (inbound vs outbound) the NBL was coming. When I added it, there were other bugs preventing it from working, so I guarded it out ( |
We just released Npcap 0.9983 today, which includes the change above. Please let us know how this works for you. |
0.9983 does not fix this issue for me. |
This affects us as well. I tried 0.9983 and it does not resolve the issue. |
We have seen this on a recent deployment of Windows-10 Build 1909 using npcap for a card payment application. From the dates of this thread it looks like possibly Windows-10 Build 1903 is also affected. We do not have the issue on build 1803 or 1809, or Windows-7. Win10Pcap is not supported by the vendor. |
We made an extensive change to the Please let us know how the latest Npcap 0.9988 works for you: https://npcap.org/#download |
It looks like 0.9988 fixes the issue for us. Thanks! |
.9988 working for me too with Wireshark and NMAP/Zenmap. |
Fixed in Npcap 0.9988. |
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.
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
The text was updated successfully, but these errors were encountered: