Fork me on GitHub

netsniff-ng


the packet sniffing beast

Frequently asked questions (FAQ)

If your question is not answered here, please consult our mailing list.

General questions

Usage questions

Licensing questions

Development questions

Misc questions


What is netsniff-ng?

netsniff-ng is a high performance Linux network sniffer for packet inspection. The project started during my B. Sc. thesis at the Max Planck Institute and continued to grow into a useful toolkit ever since. At the time of its initial development, the famous libpcap library did not support the zero-copy extensions of the Linux kernel. Therefore, I closed this gap by developing a sniffer that had a significantly better performance than existing ones that used libpcap.

What are the main goals?

netsniff-ngs main goal is to be a high performance network sniffer that focuses on usability, robustness and functionality. Its aim is to support the daily work for networking engineers, developers, admins or Linux users by providing support with or in network monitoring, protocol analysis, reverse engineering, network debugging and penetration testing. Also, since 0.5.6.0 we've added further tools for high-performance traffic generation and reliable top-like networking statistics.

I like your project. Can I donate something?

Sure, we're always happy to hear that. If you think this software is good, then please consider donating (Flattr) some money for our development. For non-money stuff, we'd prefer hardware like servers, switches, routers, access points, specific NICs or wireless cards or other (also exotic) kinds of embedded systems in order to do research, test our software and integrate new features. You are welcome to leave us a short message at .

How can I be notified of new releases?

New releases will be announced on our homepage, mailing list and Freshmeat. We have a project page at Freshmeat where you can subscribe.

Is there a mailing list?

Yes, of course there is. It's a moderated, spam-free mailing list on GoogleGroups where you can add yourself and post your questions to .

Is there an IRC channel?

Sometimes we're reachable via #netsniff-ng which is located at Freenode.

Do you have a blog? Is there a RSS feed for your blog?

Yes, it's http://dev.netsniff-ng.org/. The RSS feed can be found here: http://blog.cryptoism.org/t_netsniff-ng.xml

Can you change the design of your blog?

No, sorry. ;-)

Why can't I post comments to your blog?

Because we like HTML too much. ;-) Moderating all those comments costs too much time that we could also spend on development. If you'd like to discuss certain issues, then please use our mailing list.

Is there a commercial support?

No.

How good is the throughput of RX_RING/TX_RING?

Have a look at our Wiki within the benchmark section. For instance, on commodity hardware with Gigabit-Ethernet, we've reached nearly wirespeed with trafgen (64 Byte, 1.2 Mio pps).

Are the statistics generated by ifpps 'reliable'?

Yes. The statistics are extracted from the kernel directly, so this is what the NICs device driver gets to see. There is no sniffing or the like involved to generate these figures.

What's a primer document and why should I read it first?

It's netsniff-ngs manpage. The manpage is shipped with the latest stable netsniff-ng release. Everything that needs to be known for using netsniff-ng is documented within this manpage.

What platforms are supported?

Currently only operating systems running on Linux kernels with CONFIG_PACKET_MMAP enabled. This feature can be found even back to the days of 2.4 kernels. Most operating systems ship pre-compiled kernels that have this config option enabled and even the latest kernel versions got rid of this option and have this functionality built-in. However, we recommend using a kernel >= 2.6.31, because the TX_RING support has been added since then.

What libraries are required?

Well, for version 0.5.5.0 libc is the only one. Most operating systems already have their libc shipped. That's it, nothing else. For version 0.5.6.0 you'll need libncurses, zlib, libgcrypt. All of them are usually available via your operating systems packet management system.

What version of netsniff-ng should I use?

That depends. If you prefer to use the latest features, use the version that is marked as -next on the frontpage. The source is available via tarball and Git. Note that -next is our development tree and nearly daily changes are made. Otherwise there is a stable version that is usually recommended.

Can netsniff-ng read network dumps of Wireshark or others and vice versa?

Yes, if the dumps are formatted as pcap files. This is default on Wireshark for instance. On the other hand, Wireshark can also read netsniff-ng dumps.

How can I create Berkeley Packet Filters?

If you want to run netsniff-ng in combination with -f or --filter <file> you need to build a so called Berkeley Packet Filter program within a plaintext file (here, marked as: <file>). The Berkeley Packet Filters language description can be obtained from netsniff-ngs documentation section. One way to create a custom filter for the non-lazy people is to hack the opcodes by hand according to the specification. In this case you have all the freedom to build your filters for your needs. The alternative way is to use tcpdumps -dd option. Simply pipe the output into a textfile and pass this to netsniff-ng.

Furthermore, we already ship some common filters and we are planning our own filter compiler! Most distributions put these files into /etc/netsniff-ng/rules/.

I've created a custom Berkeley Packet Filter program with tcpdump, but netsniff-ng cuts the packet payload?

If you try to create custom socket filters with tcpdump -dd, you have to edit the ret opcode (0x6) of the resulting filter, otherwise your payload will be cut off:

0x6, 0, 0, 0xFFFFFFFF instead of 0x6, 0, 0, 0x00000060

The Linux kernel now takes skb->len instead of 0xFFFFFFFF. If you do not change it, the kernel will take 0x00000060 as buffer length and packets larger than 96 Byte will be cut off (filled with zero Bytes)! It's a bug in libpcaps filter compiler. Detailed information about this issue can be found on our blog post.

How do I sniff in a switched environment?

I rudely refer to the dSniff documentation that says:

The easiest route is simply to impersonate the local gateway, stealing client traffic en route to some remote destination. Of course, the traffic must be forwarded by your attacking machine, either by enabling kernel IP forwarding or with a userland program that acccomplishes the same (fragrouter -B1).

Several people have reportedly destroyed connectivity on their LAN to the outside world by arpspoof'ing the gateway, and forgetting to enable IP forwarding on the attacking machine. Don't do this. You have been warned.

Can I run netsniff-ng as a normal user?

No, you need to be root on your box in oder to run netsniff-ng.

What's the license of netsniff-ng?

It's the GNU GPL, version 2. Here's the licensing text.

Can you change your license e.g. to BSD or have you ever considered it?

No. We've thought this through and the GPL version 2 is the best that suits our needs.

Can I use netsniff-ng commercially?

Yes, if you mean "I work for a commercial organization and I'd like to use netsniff-ng for capturing and analyzing network traffic in our company's networks or in our customer's networks.".

It depends, if you mean "Can I use netsniff-ng as a part of my commercial product?". See below.

Can I use netsniff-ng as a part of my commercial product?

As long as your commercial product then stays compatible with the GNU GPL, version 2, then it should be no problem. Have a look at the frequently asked questions of gnu.org in order to clarify your questions.

How much does netsniff-ng cost?

netsniff-ng is "free software"; you can download it without paying any license fee. The version of netsniff-ng you download isn't a "demo" version, with limitations not present in a "full" version; it is the full version. And the good thing is: it will always stay that way!

netsniff-ng is licensed under the GNU GPL, version 2. Read more about this here.

Really, then why are you doing this?

For the fun and freedom of contributing to the open source community and for learning and researching purposes. Simple, isn't it?

Do you have release cycles?

No, we don't. We used to, but since netsniff-ng is a spare time project and sometimes there's lots of other stuff to do and sometimes not, we think we are more flexible this way without making hard deadline promises. Nevertheless, netsniff-ng is a long-term project, so even if there's hard times for weeks of not pushing to Git, there will be others with the opposite situation. We think netsniff-ng is useful for our daily network engineering work and research and we will do our best that it stays this way! This should be your take-home message! ;-)

Can you add feature xy to netsniff-ng?

Well, that depends. If it's a good feature and you make us think that adding this would make sense, then why not. You are also free to discuss this specific feature with us and post a patch.

Are there other source repositories than on your homepage?

No! Only the repositories stated on our homepage are official ones!

Is your GoogleCode page still up to date?

No, it isn't. We completely moved to repo.or.cz and do not use any of the functionality from GoogleCode. Please consider our repo.or.cz page http://repo.or.cz/w/netsniff-ng.git as our official repository.

Can I participate in the development of netsniff-ng?

Sure, we'd be happy about that. Send us your ideas or code and we're going to evaluate and probably integrate it. Have a look at the HACKING file. The release Git repository is located at http://repo.or.cz/w/netsniff-ng.git, so you are free to clone and hack.

How do I post a patch?

Have a look at the HACKING file of netsniff-ngs source for further instructions.

How do I use Git?

Have a look at the Git documentation at http://www.kernel.org/pub/software/scm/git/docs/.

Will you ship a GUI like Wireshark?

Probably not, at least this is not our main interest. netsniff-ng is intened to run on any Linux boxes including the ones without graphical user interfaces, so that you are able to run netsniff-ng on your server or router. But of course, you are free to develop a GUI and let us know about it! :-)

Will you support the future pcapng (so called 'PCAP Next Generation Dump File Format') format?

Yes, we're planning it.

Do you plan some fancy version other than kernelspace RX_RING/TX_RING?

We're experimenting on our own kernelspace zero-copy mechanism and also enhancements of the PACKET_MMAP. Nevertheless, the official netsniff-ng version will have the kernel-supported packet mmap, as is. If our findings really outperform the RX_RING/TX_RING and are worth publishing, then it will be shipped as a patch and contribute it to netdev.

Will you support the PF_RING from the ntop project?

Well, no. There are two reasons for this: First reason is, that it's not part of the mainline kernel. A interesting discussion about getting PF_RING into the kernel can be found at the netdev lists (http://lists.openwall.net/netdev/2009/10/14/37) and obviously there are no further efforts (browse the netdev/LKML, also netfilter) from the ntop project to merge both architectures or add features to PF_PACKET. Second reason is that we've evaluated the PF_RING (without the commercial Direct NIC Access [DNA]) regarding its performance and came to the conclusion, that there is no significant performance enhancement on our IBM HS21 Bladeserver test system. ntopi's DNA ships its own versions of some modified device drivers like Broadcoms tg3 and NetXtreme, Intels e1000(e), igb and ixgbe. Since these modifications are not official, neither to the kernel, nor to the vendors and cover only a small amout of what is out there, we're not doing further investigations at the moment. Also, netsniff-ng users have reported similar observations. A benchmark with PF_RING in transparent_mode 0 and 1 is even slower than netsniff-ng and in transparent_mode 2 both have the same performance. The test was done on a Dell PowerEdge 2850. Nevertheless, ntop is a very interesting project you definately should check out!

Are you also maintaining distribution specific packages?

Yes, but only for Debian GNU/Linux, which then automatically gets updated in some other distros like GRML. People that maintain netsniff-ng in other distributions are listed within the CREDITS file.

Will you port netsniff-ng to Windows?

No, at least we are not doing this simply because we don't have any Windows box! Why would we? Why would we encourage people to stay at a fucked up operating system? Have a look at the FSF site for more information, if you don't know why you should switch to Linux or *BSD.

Will you port netsniff-ng to *BSD?

Could be possible for the future.

Do you have your own personal devel trees? Which one should I patch against?

Yes, we have. Emmanuels devel tree is at http://github.com/eroullit/netsniff-ng/ and Daniels devel tree can be found at http://repo.or.cz/w/netsniff-ng.git. Unlike otherwise clarified, you normally patch against the tree stated on our website, which is http://repo.or.cz/w/netsniff-ng.git.

Why don't you answer my mails? Isn't that rude?

No, it isn't rude. We're focusing on answering every mail, but in some rare cases it's mostly because of sheer lack of time to answer each email that gets sent to us. Furthermore, some hints for writing good e-mails can be found in rfc2635 and rfc1855.

How do you pronounce netsniff-ng?

$ flite -o play -t "netsniff n g"

Do you have netsniff-ng t-shirts, ...?

Yes, here (note: we do not take any commission for the products).

I've got some artwork for you!?

Great! We'd very much like to see it. Please mail it to us ;-)

powered by Debian  powered by vim  best viewed with vt100  no epatents  qdn

Copyright (C) 2009-2012 Daniel Borkmann , Emmanuel Roullit and others