2
2

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 5 years have passed since last update.

tcpdump によるキャプチャ取得

Last updated at Posted at 2019-05-15

参考サイト

様々なオプションが載っていたのでいつか試したい。
https://milestone-of-se.nesuke.com/sv-basic/linux-basic/tcpdump/

実施環境

Ubuntu 16.04 (LTS)

コマンド一覧

1分ごとに1ファイルに出力(最大2ファイル)

sudo tcpdump port 443 -G 60 -W 2 -w tcp-capture-at-%H%M%S.pcap

1時間ごとに1ファイルに出力(最大24ファイル:24時間分)

【フォアグラウンド】
sudo tcpdump -A port 443 -G 3600 -W 24 -w tcp-capture-at-%H%M%S.pcap
【バックグラウンド】
sudo tcpdump -A port 443 -G 3600 -W 24 -w tcp-capture-at-%H%M%S.pcap &

キャプチャ確認コマンド

sudo tcpdump -r capture-at-hhmmss.pcap | grep xxx.xxx.xxx.xxx
※「hhmmss」と「xxx.xxx.xxx.xxx」は適宜置き換えてください。

キャプチャ確認(特定IPを除去)

「192.168.1.1」をキャプチャから除きたい場合

sudo tcpdump -r tcp-capture-at-173204.pcap | grep -v 192.168.1.1

「10.56.0.20」「192.168.1.1」をキャプチャから除きたい場合

sudo tcpdump -r tcp-capture-at-173204.pcap | grep -v 10.56.0.20 | grep -v 192.168.1.1
2
2
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
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?