zoukankan      html  css  js  c++  java
  • CentOS 安装抓包工具wireshark-tshark抓包工具

    原文出处:razeen -> https://razeen.me/post/how-to-install-tshark-on-centos.html

    准备在服务器上用tshark抓包,分析一下数据。直接yum install tshark却发现没有这个包。网上搜索一下,各种奇葩安装方式,又是安装apt?又是安装各种环境?我相信既然CentOS已经有了yum这么好的包管理工具,那么一定有更简单的方式。
    最后只好在Google上直接用我这蹩脚的英文搜索一下。果然,一句how to install tshark on centos顺利解决了我的问题。
    原来一直是自己对yum这个命令了解太少了,平时只会yum install,yum update :first_quarter_moon_with_face: 。那么到底故事如何,客官且听我细细道来。
    当我试图直接安装时:

    $ yum install tshark
    已加载插件:fastestmirror
    Loading mirror speeds from cached hostfile
    没有可用软件包 tshark。
    错误:无须任何处理
    

    那么,该怎么办呢? 原来yum提供了搜索功能。

    $ yum whatprovides *tshark*
    已加载插件:fastestmirror
    Loading mirror speeds from cached hostfile
    base/7/x86_64/filelists_db                                                    | 6.9 MB  00:00:00
    epel/x86_64/filelists                                                         |  10 MB  00:00:00
    extras/7/x86_64/filelists_db                                                  | 524 kB  00:00:00
    updates/7/x86_64/filelists_db                                                 | 2.1 MB  00:00:00
    1:bash-completion-extras-2.1-11.el7.noarch : Additional programmable completions for Bash
    源    :epel
    匹配来源:
    文件名    :/usr/share/bash-completion/completions/tshark
    
    wireshark-1.10.14-14.el7.i686 : Network traffic analyzer
    源    :base
    匹配来源:
    文件名    :/usr/sbin/tshark
    文件名    :/usr/share/wireshark/tshark.html
    文件名    :/usr/share/man/man1/tshark.1.gz
    
    wireshark-1.10.14-14.el7.x86_64 : Network traffic analyzer
    源    :base
    匹配来源:
    文件名    :/usr/sbin/tshark
    文件名    :/usr/share/wireshark/tshark.html
    文件名    :/usr/share/man/man1/tshark.1.gz
    

    我们可以看到wireshark包已经包含了tshark包。

    接下来就是我们熟悉的步骤了==。

    $ yum install wireshark
    已加载插件:fastestmirror
    Loading mirror speeds from cached hostfile
    正在解决依赖关系
    --> 正在检查事务
    ---> 软件包 wireshark.x86_64.0.1.10.14-14.el7 将被 安装
    --> 正在处理依赖关系 libsmi.so.2()(64bit),它被软件包 wireshark-1.10.14-14.el7.x86_64 需要
    --> 正在处理依赖关系 libcares.so.2()(64bit),它被软件包 wireshark-1.10.14-14.el7.x86_64 需要
    --> 正在检查事务
    ---> 软件包 c-ares.x86_64.0.1.10.0-3.el7 将被 安装
    ---> 软件包 libsmi.x86_64.0.0.4.8-13.el7 将被 安装
    --> 解决依赖关系完成
    
    ...
    
    已安装:
      wireshark.x86_64 0:1.10.14-14.el7
    
    作为依赖被安装:
        c-ares.x86_64 0:1.10.0-3.el7                                                                        libsmi.x86_64 0:0.4.8-13.el7
    
    完毕!
    

    最后我们验证一下:

     $ tshark -v
    TShark 1.10.14 (Git Rev Unknown from unknown)
    
    Copyright 1998-2015 Gerald Combs <gerald@wireshark.org> and contributors.
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    
    Compiled (64-bit) with GLib 2.50.3, with libpcap, with libz 1.2.7, with POSIX
    capabilities (Linux), without libnl, with SMI 0.4.8, with c-ares 1.10.0, with
    Lua 5.1, without Python, with GnuTLS 3.3.26, with Gcrypt 1.5.3, with MIT
    Kerberos, without GeoIP.
    
    Running on Linux 3.10.0-693.11.1.el7.x86_64, with locale zh_CN.UTF-8, with
    libpcap version 1.5.3, with libz 1.2.7.
    Intel(R) Xeon(R) CPU E5-2682 v4 @ 2.50GHz
    
    Built using gcc 4.8.5 20150623 (Red Hat 4.8.5-16).
    

    写这边文章并不只是只是为了说明tshark怎么在centos怎么安装,更多的是有时候我们需要扩展自己的知识面,避免重复造轮子。

    注:rpm离线安装参考安装部分的依赖即可,离线安装的都是.rpm包,提示的是so。

     

  • 相关阅读:
    相对定位和绝对定位
    一切重新开始
    Oracle Profile 使用
    使用javamail发送邮件错误:550 5.7.1 Unable to relay
    gvim 备份文件去除 配置
    解决Maven中OutOfMemory错误
    sqlplus启动后的环境SQLPATH的设置
    ORA-30004 错误处理
    oracle 锁表查询及解决、表字段查询
    如何进行软件架构设计
  • 原文地址:https://www.cnblogs.com/boonya/p/11289405.html
Copyright © 2011-2022 走看看