Posted inApps / Linux / Open Source

Sniffnet: See Which Apps Are Using Your Internet Connection

Original blue and amber Sniffnet logo surrounded by flowing network connection paths.

Let’s say you want to find out why your Mac is downloading data even though you’ve closed your browser and you’re not downloading anything. You can open Activity Monitor and check the Network tab. But what if you also want to know what servers an app is connecting to?

That’s where Sniffnet comes in. Written in Rust, Sniffnet is a free and open source network monitor for macOS, Linux and Windows.

If you’ve ever opened Wireshark just to figure out what an app is doing on your network, you’ll probably appreciate Sniffnet. You don’t need to go through individual packets to find out which apps are eating up your bandwidth.

Using Sniffnet

Open up Sniffnet and you’ll be presented with a list of network adapters along with a preview of the traffic on each one. Select the one you want to monitor (your Wi-Fi or Ethernet adapter, for example). You can set a bunch of filters before you start monitoring, but I’d suggest leaving them alone for now.

Once you start the capture, you’ll get an overview of incoming and outgoing traffic, a graph of your network activity and a breakdown of traffic by host, service and program.

Sniffnet Overview showing incoming and outgoing network traffic, bandwidth charts, network hosts, services and programs.

What’s particularly useful in Sniffnet 1.6 is that you can switch from displaying the total amount of data transferred to displaying current data rates. Your browser might have downloaded 2 GB since you started Sniffnet, but it might not be the app that’s eating up your bandwidth right now.

OK, so you’ve identified the program. What servers is it connecting to? Go to the Inspect tab and use the Program filter. You’ll get a list of connections with info about the source and destination IP addresses and ports, protocol, service and how much data was transferred. You can also filter by domain, country or organization.

Sniffnet Inspect tab displaying network connections filtered by country, domain and HTTPS service.

The annoying thing about investigating background traffic is that by the time you’ve opened Sniffnet, whatever was downloading data might’ve stopped. And you’re not going to sit there staring at a graph waiting for it to happen again. This is where the thumbnail mode comes in handy. Or, if I already knew which program to look out for, I’d mark it as a favorite and enable notifications for favorites. You’ll get a notification when Sniffnet detects traffic from that program again.

You can do the same thing with a host or a service. You can also get notified when traffic exceeds a certain threshold or when there’s traffic associated with an IP address from a blacklist you’ve imported. The latter is a notification, NOT a way to block those IP addresses.

Once you’ve narrowed it down to a particular app, try closing the app and starting a new capture before opening it again (assuming it’s an app you can safely close). Look at what happens when you first open it, use it for a bit and then leave it alone. Is it still sending/receiving data? You can do the same thing with an app you’ve just installed and want to check out.

NOTE: Sniffnet identifies programs by looking up the processes associated with local ports and protocols. Some connections (especially ones that don’t last very long) might show up under an unknown program or be attributed incorrectly. And you only get program identification when monitoring a local adapter, not when opening a PCAP file or collecting IPFIX flows.

Let’s assume the app connects to a server and you don’t recognize the domain. Before you go looking for a replacement for the app, keep in mind that the domain obtained via reverse DNS might be that of the hosting company. And that the name of a service (identified largely by port and protocol) doesn’t necessarily tell you what the app is sending. It could simply be checking for updates. Sniffnet isn’t a malware detector.

So, can you use Sniffnet instead of an application firewall? No. You can see what apps are doing on your network but you can’t allow or deny their connections from within Sniffnet. For that you can use LuLu or Little Snitch on macOS, or OpenSnitch on Linux. Or you can run Sniffnet alongside the firewall. I think the distinction is important, especially if you’re looking at Sniffnet as a free and open source alternative to GlassWire. You get a network monitor, not a firewall. Nor do you get GlassWire’s permanent traffic history.

If you want to keep a record of what that app was doing, you’ll need to enable PCAP export BEFORE starting the capture. You can then open that file in Sniffnet or, if you want to look at the individual packets and their contents, open it in Wireshark. I’d start with Sniffnet and only fire up Wireshark if there’s a reason to dig deeper.

NOTE: Sniffnet doesn’t display packet payloads in the UI but the .pcap file can contain them. It’s not encrypted. Think twice before uploading one of these files somewhere. The app’s saved settings can also contain info about your favorites and notification configuration.

Does Sniffnet itself access the internet?

Since the idea is to see what other apps are doing on your network, what about Sniffnet itself? Traffic analysis is done locally. The databases used to find out where an IP address is located and what organization it’s associated with are included with the app.

However, the reverse DNS lookups can reveal the IP addresses you’re looking up to your DNS resolver. By default Sniffnet also connects to GitHub to check for updates (you can turn this off) and, if you set up remote notifications, it’ll send notification data to whatever endpoint you’ve configured.

I’d keep an app like this up to date. Depending on how you’ve installed it, it can run with elevated privileges and it’s processing potentially untrusted network traffic. Only capture traffic you’re authorized to monitor.

What about the other devices on your network?

Let’s go back to the Mac. What if it’s not the Mac that’s using up your bandwidth, but your TV? Monitoring your Mac’s Wi-Fi adapter won’t magically show you all the traffic generated by your TV. You’re only seeing the traffic that’s visible to that adapter.

With Sniffnet 1.6 there’s another way to get network data into the app. If your router (or firewall or server) supports IPFIX, aka IP Flow Information Export, you can configure it to send flow data to Sniffnet. You can have more than one device sending data to the app. Keep in mind that these are flows, not a capture of the actual packets on your Mac. You won’t get local program identification or be able to export a PCAP of those flows.

NOTE: If all you want is to monitor the apps on your computer, you don’t need to set up IPFIX. If you do use it, keep in mind that by default Sniffnet listens on 0.0.0.0:4739 (UDP on all IPv4 interfaces) and doesn’t authenticate the devices sending it data. Version 1.6.0 can also accept part of a malformed IPFIX message and mishandle template withdrawals. There are fixes in the development branch for these issues that aren’t included in 1.6.0. Bind the collector to the appropriate private address and use your firewall to restrict access to trusted exporters. Don’t expose the port to the internet.

For more info on IPFIX support, check out the Sniffnet 1.6 announcement.

How to install Sniffnet

Sniffnet is licensed under MIT or Apache 2.0 and you can download it for free from the project’s page on GitHub.

macOS

Download the appropriate .dmg for your Mac (Apple Silicon or Intel), mount it and drag Sniffnet into your Applications folder. When you open the app it’ll ask for administrator privileges so it can capture network traffic.

Alternatively, if you’re using Homebrew, install it with:

brew install sniffnet

And run it with:

sudo sniffnet

If macOS won’t let you open the downloaded app, verify where it came from and check the macOS installation instructions. Don’t disable Gatekeeper globally just to run Sniffnet.

Linux

There are .deb, .rpm and AppImage packages available. I’d go with the native package for your distro if there’s one available. For example, the .deb package takes care of granting the executable the necessary capture capabilities.

Arch users can install Sniffnet with:

sudo pacman -S sniffnet

Depending on how you install it, you might need to grant the executable network capture capabilities yourself. If you’re using the AppImage, the developer’s instructions specify running it with elevated privileges. Check the required dependencies and Linux installation instructions.

Windows

Download and install the .msi for your system (x64, x86 or ARM64). You’ll also need Npcap. When installing Npcap, make sure you select WinPcap API-compatible Mode.

NOTE: If you’re installing Sniffnet via a package manager, keep in mind that you might not get the latest version.

For more info on Sniffnet and all the things you can do with it, check out the official website and the Wiki.

Support FSMdotCOM on Liberapay