Questions tagged [packet-capture]

is for questions about capturing packets of various protocols that are transmitted over a network.

A lot of computer network protocols transmit their contents in packets. Packet capture is the interception of these packets as they are moved over a network of some type.

A packet sniffer captures raw data traveling over a network segment and saves it to a file for analysis.

Software

A software sniffer can generally only capture network data either originating from or going to the computer running it, plus any "broadcast" messages, if the computer is connected to the network via a switch. If the computer is connected to the network via a router, it may be able to capture network data for any device on connected to the same router.

Hardware

A hardware packet sniffer is physically connected to the network by connecting it to a router or switch. Sometimes the router or switch has to be configured to allow the sniffer to capture traffic being routed through it; this is called port mirroring.

Analysis

The captured data can be analyzed by the software that captured it, or by a program specifically designed to analyze the network data.

See Also

  • Wikipedia Article on Packet Analyzers
  • The term packet sniffer is also common and can be considered a synonym.
659 questions
3
votes
4 answers

How to analyze/intercept packets before they are sent/received by the OS?

I have always wondered how software firewalls work under the covers, and would like to be able to write my own custom tools to analyze or intercept packets before they are sent or received by the OS. I'm fairly acquainted with core networking…
Phil
  • 6,561
  • 4
  • 44
  • 69
3
votes
4 answers

Sniffing/capturing all traffic between Apache and Weblogic on Solaris

We have an application where an embedded device talks to weblogic via Apache. Weblogic and Apache are on the same Solaris server, and we are using the weblogic module for Apache. The communication works over http It does not work over https,…
The Archetypal Paul
  • 41,321
  • 20
  • 104
  • 134
3
votes
4 answers

Is there a utility for generating UDP and TCP packets from raw data in a file?

I am looking for a utility which can generate UDP or TCP packets from the raw data which I provide to it in a file. Certainly I have to provide the parameters for generating those packets like below: UDP port #, TCP IP address, which IP type (IPv4…
Bob
3
votes
1 answer

How to capture network traffic by process name in mac?

I am trying to automate the process of capturing network packets send by a particular application.I don't have problem in windows as I am using Microsoft Network Monitoring tool and that gives all the traffic send based on the process.Now the…
user1537909
  • 33
  • 1
  • 4
3
votes
2 answers

zero copy mechanism and libpcap

Is it possible to use zero-copy packets mechanism for reading packets using libpcap on Linux? (I'm using CentOS 6.2) If yes, can I see any example of code?
Dima
  • 1,253
  • 3
  • 21
  • 31
2
votes
2 answers

Capturing, forging and injecting packets

In order to build a measurement tool, I need to capture packets, forge them and re-inject them into the network. What are some tools or libraries that I could look into? Thanks.
Ricky Robinson
  • 21,798
  • 42
  • 129
  • 185
2
votes
8 answers

Best OS App for Outbound SMTP Packet Capture?

Okay, so this probably sounds terribly nefarious, but I need such capabilities for my senior project. Essentially I'm tasked with writing something that will cut down outbound spam on a zombified pc through a system of packet interception and…
Gopherkhan
  • 4,317
  • 4
  • 32
  • 54
2
votes
0 answers

Why can't we make tcpdump to not stop/exit when an interface on which it is capturing is brought down?

If tcpdump is started with -i exits if that is brought down. However, if it is started with "-i any" option, it doesn't stop if wlanX/ethX interfaces are removed because the other interfaces (like lo, dummy, rmnet) are…
Vaibhav S
  • 115
  • 1
  • 12
2
votes
1 answer

How can I capture packets from a PPP interface with pypcap?

It's dpkt.ethernet.Ethernet(pkt) for an ethernet interface, what is it for the ppp0 interface?
2
votes
2 answers

Pylibpcap for python-3.x

There was a library pylibpcap for python2 that contained the functionality to create pcap objects like this: import pcap pc = pcap.pcapObject() Now I'm looking for an analogue for python3, but from what I found (pypcap, pcap-ct), these libraries…
Helen
  • 463
  • 2
  • 9
  • 23
2
votes
1 answer

Azure Functions Packet Capture and Network Trace

Is there a way to use Azure Network Watcher or any other service to capture packets from an Azure Functions App? I have tried with Azure Network Watcher, but it only gives me an option to capture packets from a VM. The functions app is hosted on an…
Asiful Nobel
  • 323
  • 4
  • 14
2
votes
1 answer

DPDK packet drop?

I am trying to debug a issue related to packet loss when using DPDK. When using the application without DPDK, there is no issue seen. To explain: I have a process A which receives packets from process B (from different server). Initial issue: When…
nmurshed
  • 77
  • 6
2
votes
1 answer

how to timeout periodically in libpcap packet receiving functions

I found this post in stackoverflow.com listening using Pcap with timeout I am facing a similar (but different) problem: what is the GENERIC (platform-independent) method to timeout periodically when receiving captured packets by using libpcap packet…
dumbcoder
  • 21
  • 1
  • 3
2
votes
1 answer

Python - Not Expecting Data by Unpacking Ethernet Frame Getting 0xc0a8 on Type Expecting 0x800

I have this Python function which unpacks ethernet frame: def ethernet_frame(data): ipheader = struct.unpack('!6s6sH', data[0:14]) dest_mac = binascii.hexlify(ipheader[0]) src_mac = binascii.hexlify(ipheader[1]) …
Muath
  • 4,351
  • 12
  • 42
  • 69
2
votes
1 answer

Packets getting dropped with Libpcap in C on 1 Gig Traffic

I'm writing a packets parser in C using libpcap library. Here is the simple code int main(int argc, char *argv[]) { pcap_t *pcap; const unsigned char *packet; char errbuf[PCAP_ERRBUF_SIZE]; struct pcap_pkthdr header; clock_t…
Alamgir Qazi
  • 763
  • 1
  • 11
  • 25