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找 ...
随机推荐
- MongoDB如何设置权限(类似关系型数据库的用户名和密码)
MongoDB 缺省是没有设置鉴权的,业界大部分使用 MongoDB 的项目也没有设置访问权限.这就意味着只要知道 MongoDB 服务器的端口,任何能访问到这台服务器的人都可以查询和操作 Mongo ...
- 使用C语言扩展Python
开发环境:Ubuntu9.10,python2.6,gcc4.4.1 1,ubuntu下的python运行包和开发包是分开的,因此需要在新利得里面安装python-all-dev,从而可以在代码中引用 ...
- call_grant_exec.sql
set echo off feedback off verify off pagesize 0 linesize 120 define v_grantee = & ...
- 2015 HDU 计算机学院 院赛 1003 玩骰子
Problem Description Nias与Ains都特别喜欢玩骰子,而且都自以为比对方玩得更溜. 终于有一天,他们决定用骰子来一决高下! 一般的骰子玩法已经不足以体现他们的水平了,于是 ...
- iomanip头
#include <iomanip>主要是输入输出控制. Dec 十进制: hex 十六进制: oct 八进制: setw 设置宽度: setfill 设置填充值: setbase 将数字 ...
- html5中的postMessage解决跨域问题
解决跨域问题的方法有很多,如:图像ping(简单).jsonp(缺点是不能实现跨域post).CROS(CORS的本质让服务器通过新增响应头Access-Control-Allow-Origin,通过 ...
- Tower Defense Game
Tower Defense Game 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 There is a tower defense game with n level ...
- hadoop第一篇
1 hadoop整体架构 2 各组件关系 hdfs只是一个存储空间,他的完整名字是分布式文件系统.有名可知他的作用了. hbase是一个内存数据库,简单点说hbase把表啊什么的存在hdfs上.
- 转载:org.apache.catalina.util.DefaultAnnotationProcessor cannot be cast to org.apache.Annotation
转载:org.apache.catalina.util.DefaultAnnotationProcessor cannot be cast to org.apache.Annotation (2012 ...
- Jquery 源码学习
https://www.youtube.com/watch?v=qeMFEz_ufZc http://stackoverflow.com/questions/7194784/analysing-the ...