Is it possible to capture localhost packets (127.0.0.1 as destination) in NDIS layer?

StackOverflow https://stackoverflow.com/questions/18164876

  •  24-06-2022
  •  | 
  •  

質問

I am developing an NDIS 6 filter driver of Win7 and Win8 for WinPcap and Nmap. As you know, Nmap is a network scanner. A requirement of Nmap is to capture localhost packets like "ping 127.0.0.1", so that Nmap can test the local machine itself, too. However, it seems that the localhost packets will just return in the TCP/IP stack and never comes to the NDIS layer. Is there any way to resolve this issue? Like adding a loopback adapter or what? Thanks.

役に立ちましたか?

解決

You'll need a WFP callout to capture layer-3 loopback packets. TCPIP has a fast-path for loopback that never reaches layer-2 in NDIS.

他のヒント

You can capture localhost (127.0.0.1) traffic in Windows by using raw sockets. There is a great tool called RawCap that sniffs localhost and saves the captured packets in the PCAP format. http://www.netresec.com/?page=RawCap

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top