回环的捕获设置

</pre><pre name="code" class="html">Loopback capture setupThe following will explain capturing on loopback interfaces a bit.If you are trying to capture traffic from a machine to itself, that traffic will not be sent over a real network interface, even if it's being sent to an address on one of the machine's network adapters. This means that you will not see it if you are trying to capture on, for example, the interface device for the adapter to which the destination address is assigned. You will only see it if you capture on the "loopback interface", if there is such an interface and it is possible to capture on it; see the next section for information on the platforms on which you can capture on the "loopback interface".Supported PlatformsSee CaptureSetup/NetworkMedia for Wireshark capturing support on various platforms. Summary: you can capture on the loopback interface on Linux, on various BSDs including Mac OS X, and on Digital/Tru64 UNIX, and you might be able to do it on Irix and AIX, but you definitely cannot do so on Solaris, HP-UX, or Windows.WindowsStarting from Windows Vista: NpcapNpcap is an update of WinPcap using NDIS 6 Light-Weight Filter (LWF), done by Yang Luo for Nmap project during Google Summer of Code 2013 and 2015. Npcap has added many features compared to the legacy WinPcap.1) NDIS 6 Support2) "Admin-only Mode" Support3) "WinPcap Compatible Mode" Support4) Loopback Packets Capture Support (either as fake Ethernet or Null/Loopback frames)5) Loopback Packets Send SupportWhen installed on Windows Vista or later (including Win7, Win8 and Win10), it will create an Npcap Loopback Adapter that can be selected in Wireshark so as to capture IPv4/IPv6 loopback traffic.When installed on Windows XP or earlier, it will install the legacy WinPcap driver.While waiting for an official download page, the current latest installer can be found here: https://github.com/nmap/npcap/releases, the source code can be found here: https://github.com/nmap/npcapStarting from Wireshark 1.12.8 and 1.99.9, the Windows installer will detect Npcap presence (when installed in WinPcap compatible mode) and will not try to install WinPcap 4.1.3.IP 127.0.0.1You can't capture on the local loopback address 127.0.0.1 with a Windows packet capture driver like WinPcap. The following page from "Windows network services internals" explains why: The missing network loopback interface.You can, however, use a raw socket sniffer like RawCap to capture localhost network traffic in Windows. Read more here: http://www.netresec.com/?page=Blog&month=2011-04&post=RawCap-sniffer-for-Windows-releasedIP otherYou can add a virtual network card called Microsoft Loopback Adapter, but in most cases that might not give results as expected either.This adapter is available from Microsoft:Microsoft: How to install the Microsoft Loopback Adapter in Microsoft Windows Server 2003Microsoft: How to install the Microsoft Loopback adapter in Windows XPMicrosoft: How To Install Microsoft Loopback Adapter in Windows 2000... and is quite different than the ones available for various UN*X systems. This adapter is a virtual network adapter you can add, but it will not work on the 127.0.0.1 IP addresses; it will take its own IP address. BTW: You can only add one Loopback Adapter to the system!/!\ Beware: Capturing from this Loopback Adapter requires the WinPcap 3.1 release, 3.1 beta versions won't work!Let's suppose you have set the IP address of the loopback adapter to 10.0.0.10 and are capturing on that interface. If you ping to this 10.0.0.10 address the ping will get ping replies, but you won't see any of this traffic in Wireshark (much like the 127.0.0.1 problem). If you ping on 10.0.0.11, you won't get ping replies as there is obviously no remote host, but you will see the corresponding ARP requests in Wireshark.The only benefit I can see so far is if you use it with colinux (and probably other PC virtualization software) to capture the traffic between Windows and the virtual machine. - UlfLamping:) Recipe (to capture traffic on ms loopback adapter / Windows XP): --- by mitra1. go to MS Loopback adapter properties, set IP 10.0.0.10, MASK 255.255.255.02. ipconfig /all and look at the MAC-ID for your new adapter.3. arp -s 10.0.0.10 4. route add 10.0.0.10 10.0.0.10 mask 255.255.255.2555. to test: "telnet 10.0.0.10"{OK} I am now using the loopback adapter to capture traffic that I source into a Dyanmips/Dynagen virtual router network. This is a potentially very useful tool/feature that I will be testing further in the weeks to come. As it stands, I can connect my loopback adapter to a virtual router interface and capture ping, arp, etc. In the near future, I hope to tie a server w/ a loopback adapter to a virtual router and then capture a full client/server type of exchange across a Dynamips/Dynagen emulated network. -- Scott VermillionNOTE: To get to the Microsoft Loopback Adapter Properties: Start -> Settings -> Control Panel -> System -> Device Manager -> Network Adapters and right click Microsoft Loopback Adapter to select Properties. -- saranCommercial AlternativesA commercial network sniffer called CommView (from TamoSoft) allows you to capture packets on the localhost network adapter but it dissects fewer protocols, so you can capture packets with CommView and save them into a file and open it with Wireshark.Local Network Monitor 3.2Atelier Web Ports Traffic AnalyzerOther AlternativesAdd a route to your local machine going through the network gateway:route add mask 255.255.255.255 metric 1with being different from 127.0.0.1. It should (has to) be the result of ipconfig command (ip address field) has to be the default gateway field taken from ipconfig /all result.Doing so, every network traffic from your machine to itself will use the physical network interface, it will then go to the gateway, back to you. Therefor, you will see each packet twice, but it can be filtered on the view.Be careful, since your machine will use the actual network to talk to itself, it may overload the network. It may be wise to remove the new route once you are done with the tests:route delete Proxocket - A Winsock Proxy Sniffer Written by Luigi Auriemma, this great tool appears to be a Layered Service Provider that can be used to capture calls between an application and the Winsock functions in Windows. By doing this, one is able to effectively capture loopback traffic on a per-process basis.My own experience with proxocket is as follows: After installing the ws2_32.dll from proxocket into a directory containing 3 binaries that communicate with each other over the loopback interface and starting them all up, it generated 3 separate capture files, one for each process, which I was then able to merge together into a single capture file using mergecap. After filtering out the duplicate packets in the file, which contained the source IP address of 0.0.0.0, I had a pretty good capture file containing loopback traffic on Windows. Some packets were clearly ordered incorrectly, but it was easy enough for me to spot them and tell what was going on.While certainly not as good/easy as capturing loopback traffic on a *NIX platform, prior to using RawCap, this was the best way for me to obtain loopback traffic on Windows. Having said that, after using RawCap, I don't see why anyone would want to use this.Setup localhost capturing from powershellRecipes and explanation is here.This is translated from French, based on the method described here.See AlsoCapturing on Ethernet NetworksCapturing on 802.11 Wireless NetworksCapturing on Token Ring NetworksCapturing on VLAN Protected NetworksCapturing on PPP NetworksCapturing on Frame Relay NetworksCapturing DOCSIS TrafficCapturing Bluetooth TrafficCapturing on ATM NetworksCapturing USB TrafficCapturing IrDA TrafficCapturing on Cisco HDLC NetworksCapturing SS7 TrafficCategoryHowTo

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值