pcap

Can libpcap reassemble TCP segments

血红的双手。 提交于 2019-12-04 04:43:22
问题 I need to sniff TCP traffic into my application. Can libpcap reassemble TCP segments or I have to do it manually? The home page says "Full documentation is provided with the source packages in man page format". After I sudo apt-get install libpcap-dev I only find one man pcap. Is it all the documentation available or I simply missed something? Thanks 回答1: Packet or stream reassembly is not mentioned in pcap(3). If I remember correctly, the dsniff tools use libnids to reassemble IP packets and

Installing pypcap on Windows 10 python 2.7 (64 bit)

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 01:30:47
问题 I'm trying to install pypcap from: https://github.com/dugsong/pypcap/blob/master/INSTALL#L75 I'm trying to install it on Windows 10 - 64 bit and python 2.7.11 64 bit. I downloaded the source and moved it to c:\pypcap . downloaded pyrex and installed it as well. It put the wpdpack files in c:\wpdpack like the install page says. Created the config file and changed the makefile. I also installed the mingw from their website with the basic package and the g++ package. I try to do: C:\pypcap> set

Confused by libcap (pcap) and wireless

*爱你&永不变心* 提交于 2019-12-03 18:57:55
Background: I'm teaching myself about packet sniffing. I run a very simple server in one shell, telnet to it from another, then try different methods to sniff on traffic. When I use raw sockets (IPPROTO_TCP), I capture what I send fine. I capture merely what I send, nothing else from the internet. libcap's behavior confuses me as follows: (1) First, to check it out, I capture all devices with pcap_findalldevs (see (2) below as well). I find wlan0 fine. If I connect to 'all traffic' (per the man page) using if ( !( pcap_handle = pcap_open_live(NULL, 4096, 1, 0, errbuf) ) ) I capture what I send

C PCAP library unknown types error

会有一股神秘感。 提交于 2019-12-03 12:15:42
问题 I installed the pcap library on my linux system but when including it I get the errors /usr/include/pcap/bpf.h:88:1: error: unknown type name ‘u_int’ /usr/include/pcap/bpf.h:108:2: error: unknown type name ‘u_int’ /usr/include/pcap/bpf.h:1260:2: error: unknown type name ‘u_short’ /usr/include/pcap/bpf.h:1261:2: error: unknown type name ‘u_char’ /usr/include/pcap/bpf.h:1262:2: error: unknown type name ‘u_char’ In file included from ../src/test.c:1:0: /usr/include/pcap/pcap.h:125:2: error:

read from a PCap file and print out IP addresses and port numbers in c, but my result seem wrong

妖精的绣舞 提交于 2019-12-03 08:47:38
I am reading a pcap file and I want to print out the ip address and port number of each packet. I am using code from http://www.tcpdump.org/pcap.htm and http://www.rhyous.com/2011/11/13/how-to-read-a-pcap-file-from-wireshark-with-c/ . Here is my code: #define SIZE_ETHERNET 14 #define ETHER_ADDR_LEN 6 /* Ethernet header */ struct sniff_ethernet { u_char ether_dhost[ETHER_ADDR_LEN]; /* Destination host address */ u_char ether_shost[ETHER_ADDR_LEN]; /* Source host address */ u_short ether_type; /* IP? ARP? RARP? etc */ }; /* IP header */ struct sniff_ip { u_char ip_vhl; /* version << 4 | header

How to read .cap files other than Pyshark that is faster than Scapy's rdpcap ()?

岁酱吖の 提交于 2019-12-03 08:35:20
I have been looking for a way to get 802.11 Packets from a .cap file into an Array. So far I have found: Scapy: which is kind of nice, documentation available, but too slow, when I try to open a file with size > 40 Mb, I just keeps hanging on until it consumes all my Ram (all 16 gigs of it) at which point my pc just blocks and I have to reboot it Pyshark: doesn't have any of Scapy's problems, but documentation is too scarce, I can't find a way to handle and get attributes for 802.11 Packets So I was thinking maybe there are better solutions out there, or maybe someone does have some experience

set a filter of packet length in wireshark

谁都会走 提交于 2019-12-03 08:16:44
问题 I've capture a pcap file and display it on wireshark. I want to analysis those udp packets with 'Length' column equals to 443. On wireshark, I try to found what's the proper filter. udp && length 443 # invalid usage udp && eth.len == 443 # wrong result udp && ip.len == 443 # wrong result By the way, could the wireshark's filter directly apply on libpcap's filter? 回答1: All these workable on wireshark's filter frame.len==243 <- I use this ip.len=229 udp.length==209 data.len=201 来源: https:/

Parsing pcap taken from wireshark file using - Java

拟墨画扇 提交于 2019-12-03 06:32:16
I am working on converting PCAP file taken from wireshark using JAVA without using native or ready libraries. i converted the bytes to string directly just for checking the meaningful parts of it. then i tried to convert it from hexadecimal to string. It was not meaningful. there is java library jNetPcap which is wrapping all the libpcap library native calls which is written in c. The following picture is captured the wireless network. so the pcap contains the same information: Source ip, destination ip, protocol, length and info I am trying to get the same result form the pcap file which

pcap struct pcap_pkthdr len vs caplen

眉间皱痕 提交于 2019-12-03 05:36:01
问题 We're sniffing packets using libpcap on linux The header we get on each packet looks like: struct pcap_pkthdr { struct timeval ts; /* time stamp */ bpf_u_int32 caplen; /* length of portion present */ bpf_u_int32 len; /* length this packet (off wire) */ }; Now, It is my understanding that caplen is the length of the data we have captured while len is the length of the packet on the wire. In some cases (e.g. when setting the snaplen too low when opening the pcap device) we might capture only

C PCAP library unknown types error

一笑奈何 提交于 2019-12-03 02:39:45
I installed the pcap library on my linux system but when including it I get the errors /usr/include/pcap/bpf.h:88:1: error: unknown type name ‘u_int’ /usr/include/pcap/bpf.h:108:2: error: unknown type name ‘u_int’ /usr/include/pcap/bpf.h:1260:2: error: unknown type name ‘u_short’ /usr/include/pcap/bpf.h:1261:2: error: unknown type name ‘u_char’ /usr/include/pcap/bpf.h:1262:2: error: unknown type name ‘u_char’ In file included from ../src/test.c:1:0: /usr/include/pcap/pcap.h:125:2: error: unknown type name ‘u_short’ /usr/include/pcap/pcap.h:126:2: error: unknown type name ‘u_short’ /usr/include