2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

netshでパケットキャプチャ 2

Last updated at Posted at 2020-12-08

つづき

4回目

Windows Server 2016
C5.large (2コア, Intel Platinum)

実行して

c:\tmp>netsh trace start capture=yes traceFile=C:\tmp\NetTrace.etl maxsize=1MB

トレース構成:
-------------------------------------------------------------------
ステータス:           実行中
トレース ファイル:    C:\tmp\NetTrace.etl
追加:                 オフ
循環:                 オン
最大サイズ:           1 MB
レポート:             オフ

終了かける

c:\tmp>netsh trace stop
トレースを関連付けています... 完了
トレースの結合中... 完了
データ収集を生成しています ... 完了

ここでCPU使用率が40%~70%台で2分間推移
Win10と変わらなかったか
仮想化されて性能下がってるとは言え、現行の最新世代でCPU良いインスタンスタイプなんだが..

2分後、以下が出力されてcabが生成される

トレース ファイルと追加のトラブルシューティング情報は、"C:\tmp\NetTrace.cab" としてコンパイルされました。
ファイルの場所 = C:\tmp\NetTrace.etl
トレース セッションは正常に停止しました。

うーん、netshでのキャプチャは終了時のデータ生成の負荷が高くて本番では使えないという結果に..

あとやはり生成されるetlはWireSharkではエラーで開けない やり方があった。後述
ただ解析の仕方調べても結局負荷高くて実用性ないから調べなくていいか..
気が向いたらnetshの使用事例を調べてみようか
>調べた

WireSharkでの解析

https://github.com/microsoft/etl2pcapng/releases
から最新の (今だとv1.4.0) etl2pcapng.zipをDLする

etl2pcapng.zipを適当なフォルダに配置し、中にあるetl2pcapng,exeを利用してetlをpcapngに変換する

c:\tmp>C:\app\etl2pcapng\etl2pcapng.exe NetTrace.etl NetTrace.pcapng
IF: medium=eth  ID=0    IfIndex=3
Converted 830 frames

(VCRUNTIME140.dllがないエラーがでる場合)
https://visualstudio.microsoft.com/ja/downloads/
Visual Studio 2019 の Microsoft Visual C++ 再頒布可能パッケージ
の64bit用をDLしてインストールする

WireSharkでpcapngを開けば普通に解析できるようになる

image.png

ネット上の情報だとnetshのキャプチャだと送信元IP、宛先IPが含まれてないって書いてあったけど、そんなことなく、送信元/宛先の、IPアドレス/ポート番号、他の情報も揃ってるように見える。

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?