Linux上安装无UI的wireshark

是在一台比较干净的服务器上面安装的。末尾就是对wireshark的某个文件的翻译部分

cmake也是通过源码安装的。这个我没有在root权限下安装。指定了--prefix路径。并且在该用户xjy的

隐藏文件末尾加了搜索路径.profile  【 ls  -a  #查看隐藏文件】。所以该cmake 其它的用户要使用还要在该目录下面

source   .profile  

# set PATH so it includes user's private bin directories
PATH="/home/xjy/local/bin:$PATH"
LD_LIBRARY_PATH="/home/xjy/local/lib"
C_INCLUDE_PATH="/home/xjy/local/include"
#Linux  wget  获得 我链接备忘录里面没有存。 wget url

#tar xzvf解压

#根据readme 直接脚本--编译--安装
#进入解压后的文件夹,执行脚本
./bootstrap  --no-qt-gui   --prefix=/home/xjy/local  --bindir=bin  --docdir=share/cmake-3.12 --mandir=man  --xdgdatadir=share
#-----------
make
#-----------
make install
#--------------------------------

平常很少使用包管理软件。

备注一下。

搜索软件包

apt-cache search libpcree

我本来想要全部尝试源码安装的,结果有的cmake平台兼容性编译,有的configure平台兼容性编译。然后我就放弃了。直接用root权限,安装。

sudo apt-get install  cmake
sudo apt-get install flex
sudo apt-get install bison
#glib
#https://www.cnblogs.com/pcat/p/5520317.html
#==http://www.zlib.net/
#root 权限 sudo  su
wget http://www.zlib.net/zlib1211.zip
unzip zlib1211.zip 
cmake  -DCMAKE_INSTALL_PREFIX=/usr/local
make help 
make
make install
#===========
sudo apt-get install libffi-dev 
sudo apt-get install gettext
sudo apt-get install libmount-dev
sudo apt-get install  libpcre3-dev
#====== http://download.gnome.org/sources/glib
wget  http://gemmei.ftp.acc.umu.se/pub/gnome/sources/glib/2.54/glib-2.54.2.tar.xz
xz   -d   *.tar.xz
tar -xvf   *.tar
./configure   
make
sudo  make install
#=====
sudo apt-get install libgcrypt20-dev
#=====
cmake    .
make
#=====


./configure --prefix=$HOME/local --enable-wireshark=no --enable-tfshark=yes --wi
th-qt=no -DENABLE_PCAP=OFF 
#=====

 

根目录INSTALL是Unix和之类的系统的安装结构

在当前目录运行configure脚本。

这些不是windows的系统。win的查看README

0软件注意

1如果要编译要安装了Qt和GLib的开发包【development】

尝试pkg-config glib-2.0 --modversion查看是否有GLib 2.x

运行pkg-config Qt5Widgets --modversion查看是否有QT

版本需要4.8或以上的QT,建议5.2或以上。需要2.22.0或以上额glib.2

如果你需要下载或重新下载GLIB,可以在 找到包https://www.gtk.org

QT在 https://www.qt.io/download找到。在binary的包中下载development的包

。那里会有user‘s和developer’s的区别包。前者不包含头文件之流。例如Red Hat

要下 glib2-devel.rpm

 

编译wireshark的tshark命令行版,需要检查GLib

如果要抓包,取人有libpcap,最新的official版本下载http://www.tcpdump.org .

binary包下载development,例如libpcap0 Debian包,但是只包含共享lib,

版本声明、变更文件、readme文件。如果需要下载libpcap-dev包头文件,

非共享lib和手册页。Red Hat users 需要安装 "libpcap-devel"

.rpm和 the "libpcap" .rpm.一起使用

 

4.编译需要Perl(特别是pod2man程序)以便建立文档

5可以在一个脱离原source目录的目录编译,可以是任何位置,必须保证有充足空间。

6在你的编译目录运行 cmake <选项> <路径/指向/wireshark/的原>

运行cmake -LH <选项> <路径/指向/wireshark/的原> 打印完整的选项清单

Tool Reference章节开发指南包含CMake的使用架构。wireshark的一些特性选项如下

-G Ninja

CMake支持不同的编译系统。UNIX Make, MSBuild, and Ninja . 默认UNIX Make 但是Ninja

更快

 

-DBUILD_wireshark=OFF

默认寻找qt库,所以ws可以界面分析可以编译。你可以利用该选项禁用编译带有界面的版本

 

-DBUILD_tshark=OFF

默认编译行分析捕获包,可以使用避免。

 

-DBUILD_editcap=OFF

more人编译捕获文件编辑程序。可以使用该选项避免编译。

 

-DBUILD_capinfos=OFF

默认编译捕获文件统计报告程序,可以使用该选项避免编译。

 

-DBUILD_captype=OFF

默认编译捕获文件类型报告程序,可以使用该选项避免编译。

 

-DBUILD_mergecap=OFF

默认编译捕获文件合并程序,可以使用该选项避免编译。

-DBUILD_reordercap=OFF

默认编译捕获文件重排序,可以使用该选项避免编译。

 

-DBUILD_text2pcap=OFF

默认编译16进制到捕获文件的转换程序,可以使用该选项避免编译。

 

-DBUILD_dftest=OFF

默认编译显示过滤编译测试程序,可以使用该选项避免编译。

 

-DBUILD_randpkt=OFF

默认编译创建随机分组分发器,可以使用该选项避免编译。

 

-DBUILD_dumpcap=OFF

默认编译网络流量捕获程序,可以使用该选项避免编译。

 

-DBUILD_rawshark=OFF

默认编译转存和分析未加工libpcap数据程序。By default the program used to dump and

analyze raw libpcap data

is built. Use this switch to avoid building it.

 

-DDUMPCAP_INSTALL_OPTION=suid

-DDUMPCAP_INSTALL_OPTION=capabilities

Wireshark and TShark rely on dumpcap for packet capture. Setting

this flag to "suid" installs dumpcap with setuid root

permissions, which lets any user on the system capture live

traffic. If this is not desired, you can restrict dumpcap's

permissions so that only a single user or group can run it and

set the "capabilities" flag.

 

Running Wireshark or TShark as root is not recommended.

 

-DENABLE_CAP=OFF

By default, if 'cmake' finds libcap (the POSIX capabilities

library) dumpcap will be built so that if it is installed setuid

root, it will attempt to retain CAP_NET_RAW and CAP_NET_ADMIN

before dropping root privileges. Use this option to disable this

behavior.

 

-DENABLE_PCAP=OFF

编译一个分析器但本身不能抓包,但是又安装了libpcap。或者

试图在没有libpcap的系统安装wireshark。(分析包文件但本身不抓包。

可以启用这个选项避免)

If you choose to build a packet analyzer that can analyze

capture files but cannot capture packets on its own, but you

*do* have libpcap installed, or if you are trying to build

Wireshark on a system that doesn't have libpcap installed (in

which case you have no choice but to build a version that can

analyze capture files but cannot capture packets on its own),

use -DENABLE_PCAP=OFF to avoid using libpcap.

 

-DENABLE_ZLIB=OFF

By default, if 'configure' finds zlib (a.k.a, libz), the

wiretap library will be built so that it can read compressed

capture files. If you have zlib but do not wish to build

it into the wiretap library, used by Wireshark, TShark, and

the capture-file utilities that come in this package, use

this switch.

 

-DENABLE_PLUGINS=OFF

默认,可以使用该选项避免编译。

By default, if your system can support run-time loadable modules,

the packet analyzers are build with support for plugins.

Use this switch to build packet analyzers without plugin support.

 

==================

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值