Questions tagged [pcapy]

Pcapy is a Python extension module that interfaces with the libpcap packet capture library.

11 questions
3
votes
3 answers

Packet sniffer in python using pcapy impacket

I'm trying to create a packet sniffer using pcapy and impacket. I'm stuck with data extraction phase. Unfortunately impacket is not properly documented. At least i could n't find one. Could anyone tel me where to find the documentation or what…
AEla
  • 173
  • 2
  • 2
  • 9
2
votes
1 answer

Changing the packet data with pcapy/impacket

I'm writing a small program in Python on Linux that will intercept packets flying over the wire on specific port from host A to host B. Host C will act as a man in the middle so all traffic will be going through host C (arp poisoning method). I've…
rapid
  • 157
  • 3
  • 9
1
vote
1 answer

Why won't pcapy install the latest version on my Ubuntu 18.04 server?

I can see pcapy is on 0.11.4 here: https://pypi.org/project/pcapy/ For me, I can't seem to get a later version: pip install pcapy pcapy (0.10.8) How do I go about getting the latest? 0.10.8 seems to have a memory leak, and while its not such a…
Andrew Newby
  • 4,941
  • 6
  • 40
  • 81
1
vote
1 answer

Byte slicing using brackets for unpack

I'm trying to slice a variable containing a number of bytes, so I can use unpack with a buffer of 14 bytes. But apparently it's not working. What am I doing wrong here? import pcapy from struct import * import sys devs = pcapy.findalldevs() cap =…
1
vote
0 answers

How to use the pcapy library in python to capture UDP packet by the method pcapy.next()

I am using cap.next() to capture UDP packets. Once it starts receiving packets it never comes out even if no packet is coming. Please help me. I have given the code below If I would be using .loop attribute I could use p = pcapy.open_live(dev,…
Amit Kumar
  • 11
  • 3
1
vote
4 answers

IPv6 decoder for pcapy/impacket

I use the pcapy/impacket library to decode network packets in Python. It has an IP decoder which knows about the syntax of IPv4 packets but apparently no IPv6 decoder. Does anyone get one? In a private correspondance, the Impacket maintainers say…
bortzmeyer
  • 34,164
  • 12
  • 67
  • 91
1
vote
1 answer

How can I extract plain text from a packet Hex dump?

I'm using pycapy and Impacket to write a script that records and analyzes network traffic. The output looks like this: Ether: 00:1b:21:50:aa:b2 -> 00:25:11:2c:12:56 IP DF xxx.xxx.xxx.xx1 -> xxx.xxx.xxx.xx1 TCP ack push 17500 -> 49669 1703 0100…
0
votes
1 answer

Compiling pcapy on pyCharm

I am trying to use import pcapy on one of my python files on PyCharm. So, I have successfully installed pcapy on "Project Interpreter" but when I run the python file including import pcapy it says, ImportError: DLL load failed: The specified…
0
votes
1 answer

how do i use the timestamp from the header of a live capture in dpkt writer?

I'm having some trouble with a packet capture utility that I am writing. I'm currently using pcapy to open a live bytestream and dpkt to decode the packets. I want to also write the packets to a .pcap file, which workse with the dpkt.Writer…
psi
  • 1
  • 2
0
votes
0 answers

Sending a ICMPv6 Packet with VLAN while using Impacket

Hey guys I am quite a bind I have this function def send_ra_packet(self,source_link_layer, send_frequency,vlan_id = 0): ip = IP6.IP6() ip.set_source_address(self.get_source_address()) …
0
votes
0 answers

Sending ICMPv6 Messages using Impacket (ImpactPacket and Impact Decoder)

I can't seem to find a good documentation for sending packets on ICMPv6 Messages. There is a sample from Impacket but it uses Ping6 so it simply calls ICMP6.ICMP6.Echo_Request(1, seq_id,payload) and it will return a ping message. How should I…