{ "info": { "author": "Benjamin Bertrand", "author_email": "beenje@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Topic :: Software Development" ], "description": "txshark\n=======\n\nAsynchronous `TShark`_ wrapper for `Twisted`_.\n\nIntroduction\n------------\n\n**txshark** is based on `pyshark`_.\n\nAs pyshark, it uses TShark (Wireshark command-line utility) to analyze\nnetwork traffic by simply parsing the TShark pdml output (XML-based format).\n\nParsing TShark pdml output is not the most efficient way (in terms of\nperformance) to analyze network traffic. It might not keep up with very\nheavy traffic. But it works very well to decode low/specific traffic (using\na capture filter) and allows to take advantage of all the existing\nWireshark dissectors.\n\nThis package provides a Twisted service to start and stop TShark.\nIt allows a Twisted app to decode packets from a live network or a file.\n\nRequirements\n------------\n\n- Tool required:\n\n * TShark! (should be in your PATH)\n\n- Python packages required:\n\n * Twisted\n * lxml\n\nUsage\n-----\n\nTsharkService\n+++++++++++++\n\nCreate a service that inherits from *TsharkService* and\noverride the *packetReceived* method to handle incoming packets::\n\n from twisted.python import log\n from txshark import TsharkService\n\n\n class SnifferService(TsharkService):\n\n def packetReceived(self, packet):\n \"\"\"Override the TsharkService method\"\"\"\n log.msg(\"Packet received: {}\".format(packet)\n\nThe interfaces to listen to should be given as a list of\n``{\"name\": , \"filter\": }``.\nThis allows to give a specific filter to each interface::\n\n service = SnifferService(\n [{\"name\": \"eth0\", \"filter\": \"tcp and port 8521\"},\n {\"name\": \"eth1\", \"filter\": \"tcp and port 8522\"}])\n\nTo read packets from a captured file, just give the name of the file\ninstead of the interface. If a filter is used in this case, it should\nbe a display filter (syntax different from a capture filter)::\n\n service = SnifferService(\n [{\"name\": \"test.pcap\", \"filter\": \"tcp.port == 8501\"}])\n\nThe filter is optional in both case.\n\nThe service can be started with the *startService* method::\n\n service.startService()\n\nBut as a *Twisted Service*, it is designed to be started automatically by a\n*Twisted Application*. Refer to `Twisted`_ documentation for more\ninformation.\n\nAccessing packet data\n+++++++++++++++++++++\n\nData can be accessed in multiple ways. Packets are divided into layers,\nfirst you have to reach the appropriate layer and then you can select your\nfield.\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.. _TShark: http://www.wireshark.org/docs/man-pages/tshark.html\n.. _Twisted: https://twistedmatrix.com\n.. _pyshark: https://github.com/KimiNewt/pyshark", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/beenje/txshark", "keywords": "wireshark packet parsing twisted", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "txshark", "package_url": "https://pypi.org/project/txshark/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/txshark/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/beenje/txshark" }, "release_url": "https://pypi.org/project/txshark/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "Python/Twisted wrapper for tshark", "version": "0.1.0" }, "last_serial": 1167298, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "137de58b4f33fbee1d6f6ede5ef49297", "sha256": "52027b80d55a1b87ec43ae6516ec6594e0832a648899ffb4ffb2c4ca2a2b9d07" }, "downloads": -1, "filename": "txshark-0.1.0.tar.gz", "has_sig": false, "md5_digest": "137de58b4f33fbee1d6f6ede5ef49297", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8132, "upload_time": "2014-07-23T20:49:02", "url": "https://files.pythonhosted.org/packages/95/48/0399bbf01715e550dae717912bcd448d7c75e8e494b29072c1579f3da8e5/txshark-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "137de58b4f33fbee1d6f6ede5ef49297", "sha256": "52027b80d55a1b87ec43ae6516ec6594e0832a648899ffb4ffb2c4ca2a2b9d07" }, "downloads": -1, "filename": "txshark-0.1.0.tar.gz", "has_sig": false, "md5_digest": "137de58b4f33fbee1d6f6ede5ef49297", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8132, "upload_time": "2014-07-23T20:49:02", "url": "https://files.pythonhosted.org/packages/95/48/0399bbf01715e550dae717912bcd448d7c75e8e494b29072c1579f3da8e5/txshark-0.1.0.tar.gz" } ] }