Questions tagged [pcap]

pcap (packet capture) consists of an application programming interface (API) for capturing network traffic. The pcap file format is a binary format, and is the de facto standard format for network packet capture.

pcap (packet capture) consists of an application programming interface (API) for capturing network traffic. Unix-like systems implement pcap in the libpcap library; Windows uses a port of libpcap known as .

Source: Wikipedia

pcap also refers to the file format originally generated by the libpcap library. This binary format has become a de facto standard format for packet capture, and is now generated by other network analyzer tools, such as Wireshark.

Source: https://www.lesliesikos.com/pcap

1410 questions
-2
votes
1 answer

Where can I find the source code for pcap dump?

I need to figure out the inner workings of the function pcap_dump (https://linux.die.net/man/3/pcap_dump) however I cannot seem to find the source code for it anywhere. Does anyone know where I can find this (and possibly the starting line of the…
-2
votes
1 answer

text2pcap is not detecting the below format

I am trying to convert the hex dump obtained from a Cisco router via embedded packet capture feature to pcap file. My input format is as listed below 0 0000: 70E42273 90D2003A 7D36A502 81000183 p."s...:}6...... 0010: 080045C0 003BB1BF…
-2
votes
1 answer

Loading pcap file in spark using python

I am new to Spark. I have pcap file. How can Spark read that file using python? How can I upload pcap file in Spark using python and how can it process? conf = SparkConf().setMaster("local").setAppName("SparkStreamingPcap") sc = SparkContext(conf =…
Zainub Wahid
  • 251
  • 2
  • 6
-2
votes
1 answer

A simple C program to analyze pcap file ,but it can not read entire pcap file

I post the main function, the struct header is normal. After I run this program, it often stops at some packet, different packet stops at different position,but the certain pcap always stops at certain position. It prints "read end of pcap file", I…
NX.Guo
  • 7
  • 3
-2
votes
1 answer

How to find retransmitted TCP packets

I'm trying to write a C++ program to scan a pcap file and filter out certain packets. I tried using winpcap to scan and filter but I can't find a way to separate retransmissions. Does anyone know how this filtering can be done?
-2
votes
1 answer

Set a TCP port > 65535 with pcap and dnet

I have been injecting packets on the network and watching the effects via wireshark. I am able to correctly set and change tcp ports and set the source and destination. However, I am now having an issue. One of the things I need to do is to set a…
Alex
  • 53
  • 8
-2
votes
2 answers

`mkdir': Permission denied (Errno::EACCES)

i'm trying to open a pcap file but a get this error I did deniel@ubuntu:~/Sites Ruby on Rails/helloWorld$ pcap_tools out.pcap I got /home/deniel/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/fileutils.rb:245:in 'mkdir':Permission denied -…
Skeitho
  • 113
  • 1
  • 9
-2
votes
1 answer

pcap_if_t : how to pick an element from this structure

: The result of pcap_findalldevs function : Finding available devices ... 1:eth0 -- (null) 2:wlan0 -- (null) 3:nflog -- Linux netfilter log (NFLOG) interface 4:any -- Pseudo-device that captures on all interfaces 5:lo -- (null) I want to…
N.B
  • 31
  • 1
  • 8
-2
votes
1 answer

How to open a pcap file using SharpPcap

im making a c# packet analyzer that would open a pcap file which was created by wireshark...and load the packets into the graphical list.soo,how can i make sharppcap parse the file and show the packets(even in a console window) thanks
SteppeHawk
  • 15
  • 1
  • 7
-3
votes
1 answer

Could someone explain these code snippets?

In the following code, could someone explain to me how the following works? /* * sniffex.c * * Sniffer example of TCP/IP packet capture using libpcap. * * Version 0.1.1 (2005-07-05) * Copyright (c) 2005 The Tcpdump Group * * This software…
Quintin
  • 109
  • 1
  • 7
-3
votes
1 answer

I asking about pcap library (See nothing about data.)

I installed libpcap library (libpcap-dev) and making a pcap test code about find default interface devices. #include #include int main(){ char *dev=0; char ebuf[PCAP_ERRBUF_SIZE]=""; dev = pcap_lookupdev(ebuf); …
lee
  • 5
  • 5
-3
votes
1 answer

Reading pcap file into some buffer

Can anyone provide me c++ code to read a pcap file into buffer? please specify the header file that i need to add to perform the task efficiently. I haven't tried anything because i have no idea about this.
-3
votes
2 answers

Built-in next method acting strange

When I use a imported package, I use an object that it gives to me. I found it has a next method so I just try use next() build-in function to generate next item of it,but something is wrong. And i wonder what is the built-in method of an Object, I…
kyle
  • 1
  • 1
-4
votes
2 answers

How to perform scanning of wifi ap available nearby using pcap in c

Basically I want a simple C code which illustrates capturing packet in promiscuous mode and extracts out ssid from them. Edit1 I am writing the code which I wrote to perform basic sniffing. #include #include int main(int argc,…
Abhishek Singh
  • 87
  • 2
  • 13
-4
votes
2 answers

Reconstruct HTTP Webpage from libpcap python script

I am trying to reconstruct a webpage from a libpcap file from a python script. I have all the packets so the goal I guess is to have a libpcap file as input and you find all the necessary packets and somehow have a webpage file as output with all…
user2976594
1 2 3
93
94