Linux compiled Wireshark and support for LUA plugins

Source: Internet
Author: User
Tags gtk lua

Because of the work required, I have written a wireshark plugin that resolves the internal communication protocol, and the plugin was written in Lua, so the Wireshark had to support LUA access.

Typically, wireshark in Windows is supported with LUA after it is installed with the installation package. Just the default LUA support is off, and a search on the web will tell you how to open LUA support.

However, it is not necessarily supported under Linux. Our company uses the CentOS operating system, and the default Wireshark installed using the operating system CD is not supported by Lua. So, I can only explore the following steps to recompile Wireshark, and let IT support the LUA plugin.

Yes, we're all machines that can't be networked. You can only use the CD as a Yum source. How to use the CD Yum source, please refer to the online information, or my previous article.

Test environment

Operating system: CentOS 6.3

Software preparation

1. CentOS DVD CD

However, because of the need to support LUA, DVD1 and DVD2 are required. If the virtual machine is used, download the following two images as well.

If you can connect with the students, there is no need to prepare these two things, direct networking with Yum. I'm a little bitter force 650) this.width=650; "src=" Http://img.baidu.com/hi/tsj/t_0027.gif "alt=" T_0027.gif "/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/74/FE/wKioL1YwcoHQBaYEAADb3rWyc4I880.jpg "title=" 2015-10-28 14:57:25 screen. png "alt=" wkiol1ywcohqbayeaadb3rwyc4i880.jpg "/>

2, Wireshark source package

Go to wireshark official website download is good https://www.wireshark.org/download/src/all-versions/


Notice, now the official website homepage lets the download is the new version Wireshark uses the QT development interface, I also will not solve the dependency, therefore still is to download the old version of the source package of download page. The experiment uses the following linked package

https://www.wireshark.org/download/src/all-versions/wireshark-1.10.5.tar.bz2


3, Libpcap source package

As a good wireshark, libpcap we can not forget. 650) this.width=650; "src=" Http://img.baidu.com/hi/jx2/j_0002.gif "alt=" j_0002.gif "/> So go to the official website to download it www.tcpdump.org

is the link indicated by the red arrow.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/74/FE/wKioL1Ywc_Sikk_NAAGbl3KgzCY004.jpg "title=" 2015-10-28 14:40:45 screen. png "alt=" wkiol1ywc_sikk_naagbl3kgzcy004.jpg "/>

The experiment is using the link to the homepage of the package

Http://www.tcpdump.org/release/libpcap-1.7.4.tar.gz

Are you ready for everything you need? Now will Wireshark and Libpcap source packages are placed in the need to compile Wireshark machine bar, the system disk DVD1 also push the CD-ROM it!


Start compiling

1. Compiling Libpcap

Let's say we put the source package under directory/home/and start executing the command

CD/HOME/TAR-ZXVF LIBPCAP-1.7.4.TAR.GZCD Libpcap-1.7.4./configure

As a result, the error in the following illustration appears.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/74/FF/wKioL1YweIHyB-mOAAFP1Xo4JgI994.jpg "title=" 2015-10-28 15:24:29 screen. png "alt=" wkiol1yweihyb-moaafp1xo4jgi994.jpg "/>

At this point, if there is an error, it proves that we did not install the development tools, at least GCC or not installed. Therefore, you need to install the development tools. For specific methods, please refer to the article in front of me.

Yum Groupinstall "Development tools"

Next we can execute the above compile command again.

./configuremakemake Install

At this point, compiling Libpcap is finished.


2. Try compiling wireshark for the first time

Still the old method, unzip the source package, and then compile

CD/HOMETAR-JXVF WIRESHARK-1.10.5.TAR.BZ2CD Wireshark-1.10.5./configure

The following error has occurred, stating that we do not have QT or GTK support and dependencies.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/75/04/wKiom1Ywg9Hy2tyhAAFoNgrnkus175.jpg "title=" 2015-10-28 16:03:22 screen. png "alt=" wkiom1ywg9hy2tyhaafongrnkus175.jpg "/>


3. GTK + Install graphics library Support

So use Yum to solve it, we install GTK support. Perform the following command installation.

Yum Install Gtk2-devel

After the installation is complete. Next, we can continue to execute the above command to try Precompiling.

./configure

The summary appears as shown:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/75/01/wKioL1YwicOz1F_bAAKUTON-jgM628.jpg "title=" 2015-10-28 16:36:30 screen. png "alt=" wkiol1ywicoz1f_baakuton-jgm628.jpg "/>

There is no prompt error, there is no need to support the LUA plug-in students can directly make the compilation. However, if you need the plugin of the classmate, the output text of this hint:

Use Lua Library:no

Here's what we're going to do with this ...


4. Install LUA dependencies

Of course, this is still treated with Yum. Do not need Lua, just need to wireshark students to skip this step! This time will be inserted DVD2, of course, the students have nets do not have to worry about, directly run the command is good.

Welcome to the Great God of yum ...

Yum Install Lua-devel

After the installation is complete, you should be able to see the following precompiled commands:

Use Lua Library:yes

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/75/04/wKiom1YwjN7Q8UgoAAMrJ4BxmE0274.jpg "title=" 2015-10-28 16:52:32 screen. png "alt=" wkiom1ywjn7q8ugoaamrj4bxme0274.jpg "/>


5, formally began compiling wireshark.

or those orders?

./configuremakemake Install

Wait very long, after a long time. Wireshark finally compiled the finished.

Let's check it out.

Call it, ~ ~ ~

Wireshark &

Click "Help" on the menu and "About Wireshark"

The following window appears:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/75/05/wKiom1YwjqjAxdtnAAMXGVhlDu4059.jpg "title=" 2015-10-28 17:00:10 screen. png "alt=" wkiom1ywjqjaxdtnaamxgvhldu4059.jpg "/>


Finally, it took me an afternoon to write this thing. I'm drunk, too. 650) this.width=650; "src=" Http://img.baidu.com/hi/tsj/t_0024.gif "alt=" T_0024.gif "/>

This article is from the "Star Wind Memories" blog, please be sure to keep this source http://yuyongid.blog.51cto.com/10626891/1707357

Linux compiled Wireshark and support for LUA plugins

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.