Linux抓包最新工具tcpdump的運用

來源:互聯網
上載者:User

Linux抓包最新工具tcpdump的運用
系統

Centos6.5

步驟
  • 預設系統裡面沒有按照tcpdump的,無法直接使用,因此需要先安裝
    安裝命令:yum install -y tcpdump
  • 一般我們的伺服器裡面只有一個網卡,使用tcpdump可以直接抓取資料包,但看太麻煩了,所以都會添加參數來進行擷取的。
    例如截取本機(192.168.30.122)和主機120.110.111.101之間的資料
    tcpdump -n -i eth0 host 192.168.30.122 and 120.110.111.101
  • 截取全部進入伺服器的資料可以使用以下的格式
    tcpdump -n -i eth0 dst 192.168.30.122
    或者伺服器有多個ip可以使用參數
    tcpdump -n -i eth0 dst 192.168.30.122 or 192.168.30.120
    抓取全部進入伺服器的TCP資料包使用以下的格式,大家可以參考下
    tcpdump -n -i eth0 dst 192.168.31.147 or 192.168.31.157 and tcp
    從本機出去的資料包
    tcpdump -n -i eth0 src 192.168.31.147 or 192.168.31.157
    tcpdump -n -i eth0 src 192.168.31.147 or 192.168.31.157 and port ! 22 and tcp

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.