pcapy | Python extension module that interfaces with the libpcap | Monitoring library
kandi X-RAY | pcapy Summary
kandi X-RAY | pcapy Summary
Pcapy is a Python extension module that enables software written in Python to access the routines from the pcap packet capture library. From libpcap's documentation: "Libpcap is a system-independent interface for user-level packet capture. Libpcap provides a portable framework for low-level network monitoring. Applications include network statistics collection, security monitoring, network debugging, etc.".
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of pcapy
pcapy Key Features
pcapy Examples and Code Snippets
Community Discussions
Trending Discussions on pcapy
QUESTION
my the initial task is to install pcapy for python2.7. But I get error
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
after googling, I found three basic tips on how to solve the problem:
1 ) install libffi-dev But its already installed: libffi-dev is already the newest version (3.4.2-4)
2 ) install libpcap-dev But its already installed: libpcap-dev is already the newest version (1.10.1-4).
3 ) install python-dev
And here I get an error:
└─# apt-get install python2-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
python-twisted-web : Depends: python (>= 2.7.1-0ubuntu2) but it is not installable
Depends: python (< 2.8) but it is not installable
Depends: python-twisted-core (>= 11.0) but it is not installable
python2-dev : Depends: libpython2-dev (= 2.7.18-3) but it is not going to be installed
Depends: python2.7-dev (>= 2.7.18~) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
Kali version:
Linux kali 5.14.0-kali4-amd64 #1 SMP Debian 5.14.16-1kali1 (2021-11-05) x86_64 GNU/Linux
if someone can suggest what else I can try to install pcapy, I will also be grateful for advice.
...ANSWER
Answered 2022-Feb-21 at 09:14Tells you to perform in terminal:
QUESTION
I am currently creating a packet sniffer using python and pcap. After following this code: https://www.binarytides.com/code-a-packet-sniffer-in-python-with-pcapy-extension/
I am able to parse IP and TCP header to get the values such as source address, port number, etc. I only need HTTP request/response so I filtered out to only keep the ones that have the port number 80.
However, I am really confused on how to print out the actual values of HTTP header. Where and how am I supposed to get the image below to appear on my MacOS terminal?
Thanks in advance.
...ANSWER
Answered 2020-Sep-26 at 09:42If you have your HTTP response packet data in http_response_data
variable as python bytes
type you can get response headers just in one line:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install pcapy
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page