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
-1
votes
3 answers

Traceroute Theory

I am toying with trace route, my application send a ICMP echo request with a ttl of 0 every time i receive a time exceeded message i increment the ttl by one and resent the package, but what happens is I have 2 routers on my network i can trace the…
Hamza Yerlikaya
  • 49,047
  • 44
  • 147
  • 241
-1
votes
1 answer

Ways to Convert pcap File to Byte Streams

I wonder if there's a way to convert pcap packets to byte streams that are usable in C or Python? That would be the best if the conversion can also be done in C or Python. What I want to do is to regenerate the packets to do some testings, and due…
J Freebird
  • 3,664
  • 7
  • 46
  • 81
-1
votes
2 answers

Python dpkt packet analysis

I'm wanting to find the timestamping from pcap file using python dpkt package; similar to tcpdump -tttt option which would provide me the details of time with date of the packet that was generated.
user3045498
  • 31
  • 1
  • 5
-1
votes
2 answers

using pcap library after pcap_creat and pcap_set_rfmon the handler in pcap_loop does not work

#include #include #include #include #include #include #include #include #include #include struct usf { …
-1
votes
2 answers

pcap_loop does just wait

I'm trying to do a little sniffer using pcap in C like explained here My problem is that pcap_loop absolutly catch no packets and/or does nothing, my callback function is never called. my guess was the time out value but even if i set it to 20 (ms),…
Nikkolasg
  • 444
  • 4
  • 18
-1
votes
2 answers

How to program pcap with Objective-C and get HTTP request and response values in text format

I am working with pcap in an OS X application to understand packet analysis. I am working with a app https://github.com/jpiccari/MacAlyzer but I am getting only raw data but I want to differentiate every domain request into separate and clear way…
Retro
  • 3,985
  • 2
  • 17
  • 41
-1
votes
1 answer

Testing WinPCAP with a Console Application

I want to check if I could successfully load the dll's for WinPCAP and want to do it by writing a simple C/C++ console application. However I do not have neither experience nor an idea about how to do it. What I know is according to its def…
Xentius
  • 459
  • 1
  • 10
  • 21
-1
votes
2 answers

Output the dump of a sniffer to an external file in C

I was creating a simple sniffer, just for fun, and I want to output the dump to a file. Here's the code of the sniffer: #include #include #define MAX_PACKET_NUM 5 int main(void) { struct pcap_pkthdr header; const u_char…
jndok
  • 909
  • 3
  • 14
  • 28
-1
votes
1 answer

pcap asynchronous packet capturing

I am capturing IEEE802.11 packets with the pcap library. As yet i used pcap_loop and a callback function for receiving and then processing the packets. But now I have switch the wifi channel the device is listening on periodically. Unfortunately,…
Cravid
  • 653
  • 2
  • 7
  • 22
-1
votes
1 answer

Store IP Addresses in Java

I want to store a list of IP Addresses in Java from pcap file (I am able to get all the packets information from pcap file and list of ipaddresses as well )and than compare these IP Addresses for port scanning detection. I couldn't figure out how to…
Aj.
  • 25
  • 1
  • 4
-1
votes
2 answers

Size of 802.11 packet

Given the below declaration for pcap callback: void my_callback(u_char *args, const struct pcap_pkthdr *header, const u_char *packet) How to ascertain the total number of bytes present in the packet? I need that value so that I can pass it to…
bengaluriga
  • 319
  • 2
  • 5
  • 9
-1
votes
1 answer

PPP Network Detection for OSPF Demand Circuit Validation

I am looking for a way to detect if any incoming or outgoing network traffic is PPP (Point to Point). Is there a way that I can sniff for this type of traffic using the pcap library? The reason I need to know if the traffic is PPP to validate a…
THE DOCTOR
  • 4,399
  • 10
  • 43
  • 64
-2
votes
2 answers

Cannot open include file: 'pcap.h'

I am trying to do one small pcap program in c++ and I am getting an error mentioned above. Below is the program I have written. #include #include #include #include void got_packet(u_char *args, const struct…
-2
votes
3 answers

How to read perfectly a .pcap file

Using tcpdump im trying to sniff some packets. The result is this: reading from file /tmp/prueba.pcap, link-type LINUX_SLL (Linux cooked v1) 13:35:51.767194 IP6 fdc1:41d:9c3:dbef:a6e9:69f0:59aa:b70a.47193 > fdc1:41d:9c3:dbef:0:ff:fe00:8c00.47193:…
Johnny
  • 1
  • 3
-2
votes
1 answer

Install libpcap

Can someone explain me how to install libpcap? I downloaded libpcap-1.9.1 from official site (tcpdump). There are a lot of files and i cant understand what to do. i tried: project(test) set(CMAKE_CXX_STANDARD…
Qada
  • 119
  • 6
1 2 3
93
94