window下使用wireshark远程抓包

    因为须要调试pc服务器打印胶片和设备上直接打印胶片之间的区别,研发要求我抓包分析2者之间的差异,可是很快面临一个问题,我没有权限动交换机的权限,他们也没有在交换机上配置端口镜像,因而只好去找小HUB,淘汰了块10几年的集线器,这个几乎快被遗忘的网络设备,因为他是共享网络,容易形成网络事故,不少场地上是禁止使用的,可是他是网络抓包的好工具。。。我找遍每个角落,都找不到小hub,因而乎让北京的同事给我快递一个过来,惋惜EMS再次发扬国企的老大做风,都4天了,我等到花儿都谢了,个人快递还没到,没办法,只好另想办法。。。服务器

    在QQ群里问的时候,有人建议我远程抓包试试,因而我用百度了下,发现wireshark从1.2开始的版本已经开始支持远程抓包了,那么让咱们来试验下wireshark远程抓包吧。。。
    首先要在咱们须要被抓包的remote机器上确保安装了WinPcap,尽可能找最新的版本,安装路径按默认便可。在remote端,进入命令行模式下,切换到winpcap的路径下: C:\Program Files\WinPcap,运行rpcapd -h,能够看到各个参数的用法,下面列出参数的用法:
 
 
  
  
           
  
  
  1. C:\Program Files\WinPcap>rpcapd.exe -h 
  2. USAGE: 
  3.  rpcapd [-b <address>] [-p <port>] [-6] [-l <host_list>] [-a <host,port>
  4.         [-n] [-v] [-d] [-s <file>] [-f <file>
  5.   -b <address>: the address to bind to (either numeric or literal). 
  6.       Default: it binds to all local IPv4 addresses 
  7.   -p <port>: the port to bind to. Default: it binds to port 2002 
  8.   -4: use only IPv4 (default both IPv4 and IPv6 waiting sockets are used) 
  9.   -l <host_list>: a file that keeps the list of the hosts which are allowed 
  10.       to connect to this server (if more than one, list them one per line). 
  11.       We suggest to use literal names (instead of numeric ones) in order to 
  12.       avoid problems with different address families 
  13.   -n: permit NULL authentication (usually used with '-l') 
  14.   -a <host,port>: run in active mode when connecting to 'host' on port 'port' 
  15.       In case 'port' is omitted, the default port (2003) is used 
  16.   -v: run in active mode only (default: if '-a' is specified, it accepts 
  17.       passive connections as well 
  18.   -d: run in daemon mode (UNIX only) or as a service (Win32 only) 
  19.       Warning (Win32): this switch is provided automatically when the service 
  20.       is started from the control panel 
  21.   -s <file>: save the current configuration to file 
  22.   -f <file>: load the current configuration from file; all the switches 
  23.       specified from the command line are ignored 
  24.   -h: print this help screen 
   看了参数的含义,咱们须要3个经常使用的便可:
-l 容许远端能够链接本机,次参数必须
-d 容许rpcapd服务以daemon的方式运行,此参数必须
-n 此参数加上可让远程链接抓包时不须要输入用户名和密码
 
以上为我抓包时在remote端运行是加的参数, rpcapd -lnd  便可,可是奇怪的是我用netstat 看机器上运行的端口时,没发现2002端口开着,很诡异,可是无论那么多了,remote这里已经搞定了。
    接着咱们在本机打开wireshark,在菜单: Capture---Options,打开以后能够看到

咱们点击“Add Remote Interface”,弹出添加远程接口的窗口:网络

 

咱们在host里面填入remote端的IP,端口时2002,若是不知道能够从rcapd的参数里面看到服务的端口号,若是你在开remote端的服务没有加-n参数的话,这里须要输入用户名和密码,而后点击"OK"就能够了,最后的页面应该是这样的:socket

 

上面能够看到3块网卡,由于我这里的remote端由2个网卡,本机一块网卡,因此有3快,我吧要抓包的那块网卡勾上,而后点击下面的start按钮,就能够开始抓包了。。。ide

  呵呵,抓包配置基本到此为止,最后附上一张抓到包后的截图作为收尾:工具

 

相关文章
相关标签/搜索