<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      網絡抓包文件太大,如何切分

      背景

      節前最后幾天了,隨便寫點水文吧,今天就記錄一下,當我們拿到的網絡抓包文件太大,應該怎么分析。

      一般來說,我們個人抓包的話,linux上用tcpdump比較多,抓的時候也會用捕獲表達式,抓出來的包一般不大,用wireshark分析就很容易。

      但是,前一陣的一個晚上,dba突然找我,看能不能幫忙一起分析一個網絡抓包文件,連了會議后一看,大小有4g,這么大的包,wireshark打開都很是困難,分析也很卡。

      這么大的包,怎么來的呢,原來是網絡同事直接在路由器上抓的,過濾條件就是某個數據庫服務器的ip:1433端口(sql server數據庫)。既然過濾了,包還這么大?問了下,原來在路由器上抓了整整一個半小時,然后這個庫流量又大,所以最終就有4g。

      dba的訴求是,某個數據庫客戶端發了某些sql,導致把數據庫服務器搞死了,現在就是要找出來是哪個客戶端,哪個sql。

      最終呢,我只是給dba同事說了下,怎么拆分包,怎么查看包里的sql;后續忙起來后,我也沒問進度,估計已經解決了吧。

      這里就簡單記錄下,遇到這種大的包,怎么拆分。

      editcap

      editcap這個命令是wireshark自帶的,一般就在wireshark目錄下,像我這邊在:C:\Program Files\Wireshark\editcap.exe,我一般會加入到環境變量PATH。

      介紹如下:

      Editcap is a program that reads some or all of the captured packets from the infile, optionally converts them in various ways and writes the resulting packets to the capture outfile (or outfiles).

      即,可以讀取pcap/pcapng類型的文件,通過各種方式進行一些處理、轉換,然后將結果寫入到另外的文件。

      說明文檔:

      image-20250122161700554

      在我們場景中,一般使用如下幾個選項就行了:

      image-20250122162346067

      按時間

      按包的開始時間

      -A

      Saves only the packets whose timestamp is on or after start time. The time is given in the following format YYYY-MM-DD HH:MM:SS[.nnnnnnnnn] (the decimal and fractional seconds are optional).

      比如,對于如下這個包:

      editcap  file20230325.pcap file20230325-after-pm-3.pcap -A "2023-03-25 15:00:00"
      

      其中,file20230325-after-pm-3.pcap就是要保存的文件名,-A就是選擇15點以后的報文。

      可以看下圖示例效果:

      image-20250122162808207

      獲取包的時間范圍

      但你可能有個疑問,如果不知道包的時間范圍呢?

      可以先用如下命令獲取:

      capinfos file20230325.pcap
      

      image-20250122163028108

      按包的結束時間

      -B

      Saves only the packets whose timestamp is before stop time. The time is given in the following format YYYY-MM-DD HH:MM:SS[.nnnnnnnnn] (the decimal and fractional seconds are optional).

      editcap  file20230325.pcap file20230325-start3-end310.pcap -A "2023-03-25 15:00:00" -B "2023-03-25 15:10:00"
      

      image-20250122163358633

      按包的數量

      -c <packets per file>
      Splits the packet output to different files based on uniform packet counts with a maximum of <packets per file> each. Each output file will be created with a suffix -nnnnn, starting with 00000. If the specified number of packets is written to the output file, the next output file is opened. The default is to use a single output file.
      

      這個是把大文件拆分,按照包的數量,屆時,每個子文件里的包的數量是一致的。

      editcap  file20230325.pcap -c 100000 file20230325-by-packets-number.pcap
      

      效果:

      image-20250122163917848

      但可以看到,每個里面都有1w個包

      image-20250122164009642

      image-20250122164036502

      按時間間隔

      -i

      Splits the packet output to different files based on uniform time intervals using a maximum interval of each. Floating point values (e.g. 0.5) are allowed. Each output file will be created with a suffix -nnnnn, starting with 00000. If packets for the specified time interval are written to the output file, the next output file is opened. The default is to use a single output file.

      單位是秒。

      我們示例文件總共是1000多秒。

      image-20250122164317496

      editcap  file20230325.pcap -i 100 file20230325-by-seconds.pcap
      

      image-20250122164429164

      image-20250122164648284

      image-20250122164708275

      組合時間范圍、包的數量兩個選項

      editcap  file20230325.pcap file20230325-start3-end310-packets-number.pcap -A "2023-03-25 15:00:00" -B "2023-03-25 15:10:00" -c 10000
      

      image-20250122164946525

      這個就是,本來按照時間范圍,只會生成一個包。加了-C后,就繼續按包的數量拆分了。

      組合時間范圍、時間間隔兩個選項

      editcap  file20230325.pcap file20230325-start3-end310-seconds.pcap -A "2023-03-25 15:00:00" -B "2023-03-25 15:10:00" -i 100
      

      image-20250122170035066

      按序號

      image-20250122170742237

      命令中可以指定序號,但是默認是刪掉這些序號的包。

      -r

      Reverse the packet selection. Causes the packets whose packet numbers are specified on the command line to be written to the output capture file, instead of discarding them.

      加了-r后,意味著反選。即保留這些序號的包。

      官方示例:
      To limit a capture file to packets from number 200 to 750 (inclusive) use:
      
      editcap -r capture.pcapng small.pcapng 200-750
      

      image-20250122170404907

      我這邊也試了下:

      editcap  -r file20230325.pcap file20230325-frame-number.pcap 1-100
      

      image-20250122170654536

      總結

      也沒啥好總結的。

      posted @ 2025-01-22 17:15  三國夢回  閱讀(558)  評論(0)    收藏  舉報
      主站蜘蛛池模板: 亚洲av成人午夜福利| 日本深夜福利在线观看| 在线观看无码av五月花| 99久9在线视频 | 传媒| 日日摸天天爽天天爽视频| 国产精品中文字幕第一区| 国产一区二区在线有码| 97se亚洲国产综合自在线观看| 久久精品免视看国产成人| 粉嫩在线一区二区三区视频| 亚洲国产精品高清久久久| 国产精品普通话国语对白露脸| 亚洲一区二区三区在线| 人妻体体内射精一区二区| 国产精品美女久久久久久麻豆| 国产一级特黄高清大片一| 欧美啪啪网| 精品九九人人做人人爱| 99精品国产精品一区二区| 亚洲av无码精品色午夜蛋壳| 国产自产在线视频一区| 国产在线精彩自拍视频| 老司机精品成人无码AV| 上司的丰满人妻中文字幕| 国内揄拍国内精品对久久| 国产精品一区中文字幕| 国产乱妇无码大片在线观看| 和黑人中出一区二区三区| 中文字幕日韩有码国产| 吴桥县| 久久精品无码免费不卡| 国产精品人妻中文字幕| 老司机午夜免费精品视频| 亚洲一级特黄大片一级特黄| 少妇办公室好紧好爽再浪一点| 67194熟妇人妻欧美日韩| 国产一区二区不卡在线| 亚洲av二区伊人久久| 影视先锋av资源噜噜| 最近中文字幕日韩有码| 一区二区亚洲人妻精品|