packet-sniffer | Basic raw packet sniffer in Python - Cybrary | Learning library
kandi X-RAY | packet-sniffer Summary
kandi X-RAY | packet-sniffer Summary
Basic raw packet sniffer in Python - Cybrary
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 packet-sniffer
packet-sniffer Key Features
packet-sniffer Examples and Code Snippets
Community Discussions
Trending Discussions on packet-sniffer
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 packet-sniffer
You can use packet-sniffer like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
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