Use Wireshark to capture loopback traffic without a loopback adapter (转)
Use Wireshark to capture loopback traffic without a loopback adapter
If you’ve ever used Wireshark for debugging applications you may have noticed that it only seems to pick up traffic that is actually transmitted over the wire and ignores all traffic sent to your local ip address or localhost. If you want to watch this traffic without having to install a special loopback adapter you can use the following trick.
How to force local traffic to your default gateway
1) Open a command prompt (Run as Administrator for Vista/7)
2) Type ipconfig/all (note your local ip address(es) and default gateway)
3) Type “route add <your ip address> mask 255.255.255.255 <default gateway IP address> metric 1″
This instructs windows to send any requests for your local ip address to your default gateway, which will in turn forward the request back to your machine. Be aware that this route will disappear once you restart your machine unless you include the -p switch after the route command. You may also notice an echo effect if you’re using Wireshark because you see each request and response twice. You can remove this problem by applying the following filter at the top.
ip.src==<default gateway> or ip.dst==<default gateway>
Consider the default gateway as a client trying to reach your machine and all traffic sent to the default gateway as your machine’s response.
To remove the route, type “route delete <the ip address you entered>”.
If you have an application running locally that uses localhost, you can map localhost to the IP address you added a route for. Just don’t forget you mapped localhost to a different IP than 127.0.0.1!
How to map localhost
1) Open notepad (Run as Administrator in Vista/7)
2) Navigate to C:\Windows\System32\drivers\etc\ and open the hosts file (there’s no extension).
3) Add this entry “<the IP address you added a route for> localhost”. Note that the space between the ip address and localhost is a tab.
Now, when your machine tries to send something to localhost, it will resolve to the IP address you added a route for and send its traffic to your default gateway.
(Important!) Remember to unblock the port used for incoming traffic on your machine. Also, if you find that an application you’re using doesn’t seem to send out traffic the way you expect, try flushing the dns cache with ipconfig/flushdns.
转自:http://blog.sina.com.cn/s/blog_53d3653e0100t2kq.html
Use Wireshark to capture loopback traffic without a loopback adapter (转)的更多相关文章
- Cannot capture jmeter traffic in fiddler
Cannot capture jmeter traffic in fiddler First, change Fiddler's port back to 8888 as it was origina ...
- WireShark Flow capture analysis
Wiresharkl流量分析 1.图示是对WiFi数据接口的80号端口进行数据捕获,设置混杂模式 过滤表达式设置: IP地址设置过滤 ip.src==191.168.1.102 ip.dst ...
- 使用开源的工具解析erspan流量
Decapsulation ERSPAN Traffic With Open Source Tools Posted on May 3, 2015 by Radovan BrezulaUpdated ...
- wireshark, loopback
swapondd if=/dev/zero of=/data/mnt/swap bs=1024 count=8024000 sudo apt-get install wireshark sudo gr ...
- How To: Capture Android & iOS Traffic with Fiddler
How To: Capture iOS Traffic with Fiddlerhttps://www.telerik.com/blogs/how-to-capture-ios-traffic-wit ...
- wireshark & fiddler
wireshark display filterhttps://www.wireshark.org/docs/wsug_html_chunked/ChWorkBuildDisplayFilterSec ...
- how to use fiddler and wireshark to decrypt ssl
原文地址: http://security14.blogspot.jp/2010/07/how-to-use-fiddler-and-wireshark-to.html Requirements2 C ...
- Ubuntu下用wireshark抓取802.11封包并进行过滤分析
要用wireshark抓802.11的包 需要在linux下进行. 要在linux下抓802.11的包 需要在linux下安装无线网卡驱动. 所以 在正式抓取之前先把这两样东西搞起来. *没有特殊说明 ...
- 新版本wireshark tshark使用
Wireshark-tshark wireshark 指令模式 => tshark Windows 及Linux 可至安裝目錄執行>tshark tshark.exe -i 7(利用-D找 ...
随机推荐
- CentOS6下配置Django+Apache+mod_wsgi+Sqlite3过程
0. 安装环境: CentOs版本: VMWare中CentOs 6.4 Apache版本: Httpd 2.2.15 http://httpd.apache.org/ Sqlit ...
- android--listview设置高度
android:layout_height="25dp"这么设置根本就没有用. 我们必须要设置android:minHeight="25dp"这样才行.
- Codeforces Round #349 (Div. 2) C. Reberland Linguistics (DP)
C. Reberland Linguistics time limit per test 1 second memory limit per test 256 megabytes input stan ...
- Android Fragment 真正的完全解析(下)---转
转载请标明出处:http://blog.csdn.net/lmj623565791/article/details/37992017 上篇博客中已经介绍了Fragment产生原因,以及一些基本的用法和 ...
- CentOS 6.3下NTP服务安装和配置
测试环境: NTPserver 192.168.1.252 NTPclient 192.168.1.251 准备工作: 关闭selinux: vi /etc/selinux/config SELINU ...
- HDU 1217 Arbitrage(Floyd的应用)
给出一些国家之间的汇率,看看能否从中发现某些肮脏的......朋友交易. 这是Floyd的应用,dp思想,每次都选取最大值,最后看看自己跟自己的.....交易是否大于一.... #include< ...
- Myeclipse配置优化
http://blog.csdn.net/chen_zw/article/details/7525277
- web开发没有服务器
额,今天在学习pixi,用的是webstorm 开发的,但是用file://xxx的方式进去的话老是会报错 Image from origin 'file://' has been blocked f ...
- PAT (Advanced Level) 1084. Broken Keyboard (20)
简单题. #include<cstdio> #include<cstring> #include<cmath> #include<vector> #in ...
- CodeForces 614C Peter and Snow Blower
简单计算几何,只要算出圆心到多边形上的最短距离和最长距离即可 #include<cstdio> #include<cstring> #include<cmath> ...