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
2
votes
0 answers

How to retrieve packet in a VpnService

I have the following implementation of ToyVpnService which I got frome here public class ToyVpnService extends VpnService implements Handler.Callback, Runnable { private static final String TAG = "ToyVpnService"; private Handler mHandler; …
Liam de Haas
  • 1,258
  • 3
  • 18
  • 39
2
votes
2 answers

Does libpcap get a copy of the packet?

Does libpcap get a copy of the packet or the actual packet? By copy, I mean: the application using libpcap gets packet A, and the kernel also gets packet A. By actual, I mean: only the application using libpcap gets packet A, but the kernel didn't…
sivabudh
  • 31,807
  • 63
  • 162
  • 228
2
votes
2 answers

NDIS or TDI for packet redirection to a local proxy

I need to develop a transparent filter to redirect outgoing HTTP packets to a local proxy, to do transparent content filtering. Which is the best technology to do it, TDI or NDIS IM? My main constraint is to avoid conflicts with antivirus software,…
Enrico Detoma
  • 3,159
  • 3
  • 37
  • 53
2
votes
3 answers

How can I edit a js file sent by the server before it gets to my browser?

During a normal browsing session I want to edit a specific javascript file before the browser receives since once it gets there it's impossible to edit. Is there are any tool for this? For what I need it I can't just save it and edit it on my…
2
votes
2 answers

SharpPcap - A Packet Capture problem to extract information from the packet

I'm using SharpPcap to capture packets. I'm trying to get Traffic Class value and I'm using udp.ipv6.TrafficClass.ToString(). the problem that I'm getting this exception: Object reference not set to an instance of an object. private void…
Eyla
  • 5,751
  • 20
  • 71
  • 116
2
votes
1 answer

Android device using "Shark for Root" to capture packets but receive "Empty file opened" error

I'm using the "Shark for Root" to capture packets in my Android device. Here is the app in play store: https://play.google.com/store/apps/details?id=lv.n3o.shark I just use the default parameters : -vv -s 0 , and as the log shown below it really…
Yong
  • 2,943
  • 1
  • 13
  • 11
2
votes
2 answers

Windows based C++ application consumes more CPU over time

We have a C++ based Multi-threaded application on Windows that captures network packets in real-time using the WinPCAP library and then processes these packets for monitoring the network. This application is intended to run 24x7. Our applicatin…
2
votes
2 answers

missing elements from pcap?

When I check the attributes available to the module pcap, I expect to see something like [ ...snip... 'dltvalue', 'findalldevs', 'lookupdev', 'lookupnet', 'ntoa', 'pcapObject', 'pcapObjectPtr'] With note on pcapObject. However, all I get when…
Matthew
  • 261
  • 1
  • 2
  • 6
2
votes
1 answer

Packet Capture in SPARK using Scala

How to capture packets in SPARK using scala? Is there a library like jpcap in java ? Can anyone please tell me how to write a scala program to capture live packets?
2
votes
3 answers

HTTP sniffer not working in a LAN setting

I wrote a HTTP sniffer program, first ran it in my standalone pc (Fedora), and it worked well. And when I tried this in a LAN setting (bus-LAN, Fedora OS again), and set the eth0 to promisc mode, the program captures only the URLs browsed by the…
trinity
  • 10,394
  • 15
  • 49
  • 67
2
votes
3 answers

capturing packets from network and saving in database using jpcap library

I am capturing packets using jpcap library and saving in Mysql database. I want to do these two functions separately. My program captures packet and saves in database then captures another packet and saves in database. I want is that one Method…
user3578992
2
votes
3 answers

Network programming with C#

I have a project to do which is packet monitoring. I want to capture each packet receive by specified network interface. I want to know what I should start with to do my project .... should I learn socket programming first or what? should I learn…
Eyla
  • 5,751
  • 20
  • 71
  • 116
2
votes
1 answer

python-dpkt: ICMP packet parsing

How can I parse a ICMP packet (using dpkt) to check if it is a request or a response coming from A to B? I found some examples for TCP and UDP packets (below) but I can't find anything for IP packets. import dpkt f = open('test.pcap') pcap =…
bulkmoustache
  • 1,875
  • 3
  • 20
  • 24
2
votes
1 answer

netem loopback interface reordering packets

I have two apps communicating over UDP on the same host and I would like to send packets with varying delays (jitter) but no out of order packets. I have this rule for loopback interface: sudo tc qdisc add dev lo root handle 1: netem delay 10ms…
2
votes
1 answer

how to intercept and modify tcp packets sent and received by a certain process?

Assuming there is a process under my control (I can run it and send it commands) that sends and receives tcp packets (maybe some other types of protocol) How can I intercept its outgoing packets and change their payload? Netfilter was suggested as a…
dandroid
  • 395
  • 1
  • 3
  • 12