{ "info": { "author": "KimiNewt", "author_email": "", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.5" ], "description": "pyshark\n=======\n\nPython wrapper for tshark, allowing python packet parsing using wireshark dissectors.\n\nThere are quite a few python packet parsing modules, this one is different because it doesn't actually parse any packets, it simply uses tshark's (wireshark command-line utility) ability to export XMLs to use its parsing.\n\nThis package allows parsing from a capture file or a live capture, using all wireshark dissectors you have installed.\nTested on windows/linux.\n\nUsage\n=====\n\nReading from a capture file:\n----------------------------\n\n::\n\n import pyshark\n cap = pyshark.FileCapture('/tmp/mycapture.cap')\n cap\n >>> \n print cap[0]\n Packet (Length: 698)\n Layer ETH:\n Destination: BLANKED\n Source: BLANKED\n Type: IP (0x0800)\n Layer IP:\n Version: 4\n Header Length: 20 bytes\n Differentiated Services Field: 0x00 (DSCP 0x00: Default; ECN: 0x00: Not-ECT (Not ECN-Capable Transport))\n Total Length: 684s\n Identification: 0x254f (9551)\n Flags: 0x00\n Fragment offset: 0\n Time to live: 1\n Protocol: UDP (17)\n Header checksum: 0xe148 [correct]\n Source: BLANKED\n Destination: BLANKED\n ...\n\n\nReading from a live interface:\n------------------------------\n\n::\n\n capture = pyshark.LiveCapture(interface='eth0')\n capture.sniff(timeout=50)\n capture\n >>> \n capture[3]\n \n\n for packet in capture.sniff_continuously(packet_count=5):\n print 'Just arrived:', packet\n\nInfinite reading from a live interface with capture filter:\n------------------------------\n\n::\n\n def packet_captured(packet):\n print 'Just arrived:', packet\n\n capture = pyshark.LiveCapture(interface='eth0', capture_filter='tcp')\n capture.apply_on_packets(packet_captured)\n\nAccessing packet data:\n----------------------\n\nData can be accessed in multiple ways. \nPackets are divided into layers, first you have to reach the appropriate layer and then you can select your field.\n\nAll of the following work::\n\n packet['ip'].dst\n >>> 192.168.0.1\n packet.ip.src\n >>> 192.168.0.100\n packet[2].src\n >>> 192.168.0.100\n\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/laixintao/py3shark", "keywords": "wireshark capture packets parsing packet", "license": "", "maintainer": "", "maintainer_email": "", "name": "py3shark", "package_url": "https://pypi.org/project/py3shark/", "platform": "", "project_url": "https://pypi.org/project/py3shark/", "project_urls": { "Homepage": "https://github.com/laixintao/py3shark" }, "release_url": "https://pypi.org/project/py3shark/0.4.0/", "requires_dist": [ "lxml", "py", "logbook" ], "requires_python": "", "summary": "Python wrapper for tshark, a fork for pyshark support Python3.5+", "version": "0.4.0" }, "last_serial": 3624699, "releases": { "0.4.0": [ { "comment_text": "", "digests": { "md5": "4821d7ca2a4b05c23b49ee746bb3f7d7", "sha256": "a543d10e162a32e82ed071ef89fb14904fbf6ab51a51c9a7164de8d8130de015" }, "downloads": -1, "filename": "py3shark-0.4.0-py3-none-any.whl", "has_sig": false, "md5_digest": "4821d7ca2a4b05c23b49ee746bb3f7d7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 31472, "upload_time": "2018-02-28T10:44:14", "url": "https://files.pythonhosted.org/packages/04/ba/fb9d2b5d21f6e00b7583fe44b88659755c5faf31ef7fd7ab7e80bd6bccd4/py3shark-0.4.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3be10ba7f16c7e9c42c62b02f52303ef", "sha256": "6cdfc547fce76bfeffede7e0807dd8bda487e5393a4ec28743d1836f9d35bfdc" }, "downloads": -1, "filename": "py3shark-0.4.0.tar.gz", "has_sig": false, "md5_digest": "3be10ba7f16c7e9c42c62b02f52303ef", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21201, "upload_time": "2018-02-28T10:44:15", "url": "https://files.pythonhosted.org/packages/3e/6a/2e6da925b931ab7d5cf6469a1bbc35ea5b389a47ac999748c8384e07f5fd/py3shark-0.4.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4821d7ca2a4b05c23b49ee746bb3f7d7", "sha256": "a543d10e162a32e82ed071ef89fb14904fbf6ab51a51c9a7164de8d8130de015" }, "downloads": -1, "filename": "py3shark-0.4.0-py3-none-any.whl", "has_sig": false, "md5_digest": "4821d7ca2a4b05c23b49ee746bb3f7d7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 31472, "upload_time": "2018-02-28T10:44:14", "url": "https://files.pythonhosted.org/packages/04/ba/fb9d2b5d21f6e00b7583fe44b88659755c5faf31ef7fd7ab7e80bd6bccd4/py3shark-0.4.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3be10ba7f16c7e9c42c62b02f52303ef", "sha256": "6cdfc547fce76bfeffede7e0807dd8bda487e5393a4ec28743d1836f9d35bfdc" }, "downloads": -1, "filename": "py3shark-0.4.0.tar.gz", "has_sig": false, "md5_digest": "3be10ba7f16c7e9c42c62b02f52303ef", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21201, "upload_time": "2018-02-28T10:44:15", "url": "https://files.pythonhosted.org/packages/3e/6a/2e6da925b931ab7d5cf6469a1bbc35ea5b389a47ac999748c8384e07f5fd/py3shark-0.4.0.tar.gz" } ] }