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

  呵呵,抓包配置基本到此爲止,最後附上一張抓到包後的截圖作爲收尾:工具

 

相關文章
相關標籤/搜索