wireshark method of fetching local loopback packets and fetching data

  • 2020-11-30 08:16:17
  • OfStack

1: The NPF driver isn 't running

This error was caused by not starting the NPF service.

NPF, or network packet filter (Netgroup Packet Filter, NPF), is the core part of Winpcap, which is the component of Winpcap that does the hard work. It handles packets transmitted over the network and provides capture (capture), send (injection), and analysis performance (analysis capabilities) at the user level.

It provides not only basic features (such as capturing packets), but also more advanced features (such as a programmable filter system). The former can be used to constrain a packet capture session to target only a subset of network traffic, while the latter provides a powerful and simple mechanism for counting network traffic.

The solution is as follows:

(1) make sure you have installed WinPcap (this will prompt you to install when installing Wireshark) can also be downloaded from the website: address: http: / / www winpcap. org /

(2) At the command prompt, type net start npf and you will be prompted to open the driver service successfully. As shown in the figure below:

To close the service, type net stop npf.


2: Grab local loop data

From the command line under windows, enter the following statement:


route add 192.168.1.106 mask 255.255.255.255 192.168.1.1metric 1

Among them, 192.168.1.106 is native ip and 192.168.1.1 is routing gateway. Nothing else changes.

Note: IP 192.168.1.106 of this machine is needed to establish the connection, but 127.0.0.1 cannot be used, as follows:


socket.Connect("192.168.1.106", 4530);


Related articles: