window下使用wireshark远程抓包简介

来源:互联网 发布:淘宝小号批量购买 编辑:程序博客网 时间:2024/05/18 00:40

1、简介

     首先要在我们需要被抓包的remote机器上确保安装了WinPcap,尽量找最新的版本,安装路径按默认即可。在remote端,进入命令行模式下,切换到winpcap的路径下:C:\Program Files\WinPcap,运行rpcapd -h,可以看到各个参数的用法,下面列出参数的用法:

C:\Program Files\WinPcap>rpcapd.exe -h 
USAGE: 
 rpcapd [-b <address>] [-p <port>] [-6] [-l <host_list>] [-a <host,port>] 
        [-n] [-v] [-d] [-s <file>] [-f <file>] 
  -b <address>: the address to bind to (either numeric or literal). 
      Default: it binds to all local IPv4 addresses 
  -p <port>: the port to bind to. Default: it binds to port 2002 
  -4: use only IPv4 (default both IPv4 and IPv6 waiting sockets are used) 
  -l <host_list>: a file that keeps the list of the hosts which are allowed 
      to connect to this server (if more than one, list them one per line). 
      We suggest to use literal names (instead of numeric ones) in order to 
      avoid problems with different address families 
  -n: permit NULL authentication (usually used with '-l') 
  -a <host,port>: run in active mode when connecting to 'host' on port 'port' 
      In case 'port' is omitted, the default port (2003) is used 
  -v: run in active mode only (default: if '-a' is specified, it accepts 
      passive connections as well 
  -d: run in daemon mode (UNIX only) or as a service (Win32 only) 
      Warning (Win32): this switch is provided automatically when the service 
      is started from the control panel 
  -s <file>: save the current configuration to file 
  -f <file>: load the current configuration from file; all the switches 
      specified from the command line are ignored 
  -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"就可以了,最后的页面应该是这样的:




     上面可以看到3块网卡,因为我这里的remote端由2个网卡,本机一块网卡,所以有3快,我吧要抓包的那块网卡勾上,然后点击下面的start按钮,就可以开始抓包了。。。
       呵呵,抓包配置基本到此为止,最后附上一张抓到包后的截图做为收尾:



参考文献:红黑联盟

原创粉丝点击