Questions tagged [pyshark]

PyShark is a Python wrapper allowing packet parsing using Wireshark dissectors. This package allows parsing from a capture file or a live capture, using all installed Wireshark dissectors.

PyShark is a Python wrapper allowing packet parsing using Wireshark dissectors. This package allows parsing from a capture file or a live capture, using all installed Wireshark dissectors.

189 questions
1
vote
0 answers

How do I read data over IP by using pyshark in python?

I am using the livecapture method to capture data, which is showing zero packet capture even when I am sending/receiving a file. I am using this code to capture data by using live capture: This is the output which I get after running the code:
nipun garg
  • 11
  • 2
1
vote
1 answer

Is there an option: only_summaries in Scapy?

I am processing a huge pcap file by Scapy, but it's slow. When I am planning refactoring it by Pyshark, I found that there is an function named 'pyshark.FileCapture()' which offers a option: only_summaries. That's what I want. So, is there any…
edcSam
  • 97
  • 1
  • 13
1
vote
1 answer

How can I access a udp payload with pyshark?

With tcp packets I process with pyshark, I can get the payload simply enough. payload.append(p.tcp.payload) # assuming p is a packet How can I access the udp payload? There is no "payload" field accessible for the udp layer. This is probably…
ClayD
  • 332
  • 4
  • 14
1
vote
1 answer

Pyshark does not capture any packet

Hi I'm trying to sniff network with pyshark. I just want to capture the packet but pyshark does not capture any packet Hi is the basic code and result >>> cap = pyshark.LiveCapture(interface="wlan0") >>> cap.sniff(timeout=20) >>> cap
morten
  • 53
  • 11
1
vote
1 answer

using pyshark to filter and to choose the first GET packet

I am using pyshark to filter a saved pcap file . the filter I'm using is: http.request.method == GET && !ip.ttl==180 && ip.src==100.100.19.42 (at the end there is a link to a screenshot of the pcap file after using this filter.) my question is, how…
Elias Shourosh
  • 89
  • 3
  • 14
1
vote
0 answers

Pyshark doesn't free resources

I read a .pcap file in python using pyshark. If I read the file multiple times, it seems that pyshark doesn't free resources. The resources are freed only when I close the python program. import pyshark def foo(): for i in range(100): p =…
Konstantin
  • 2,937
  • 10
  • 41
  • 58
1
vote
0 answers

UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 61: ordinal not in range(128)

Im using python3 in windows 10 I try to use pyshark, but i get this error: Python 3.6.2rc1 (heads/3.6:268e1fb, Jun 17 2017, 19:01:44) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more…
1
vote
1 answer

Pyshark live capture

I would like to capture RTCP packets and parse its. As I see in the pyshark documentation for live capture I have to define timeout, our packet_count. As my understanding after this option the live capture is stopped, and I able to parse the data. I…
jtarjanyi
  • 17
  • 1
  • 7
1
vote
2 answers

running as sudo from python for pyshark / tshark

I'm trying to do a live capture with pyshark, but it wants to run tshark using sudo. I'm not sure how to run sudo out of python. The github thread states: "you can create a 'script' that just runs "sudo tshark" and tell pyshark to run that instead…
mishap_n
  • 578
  • 2
  • 10
  • 23
1
vote
1 answer

How to print all destination ports and source ports in the PCAP file?

import pyshark pkts = pyshark.FileCapture("test.pcap") for p in pkts: print I am trying to print all destination ports and source ports in the PCAP file. How could I do it?
Ed S
  • 385
  • 8
  • 31
1
vote
1 answer

using pyshark on python 2.7 encounter lxml.etree.XMLSyntaxError

This is really a simple script written in python, which I can run it normally on Linux. But when I moved it to Windows, there is a strange error. I wish some helps. Before running the code, I have made some preparation for the environment: 1.…
mortimer
  • 11
  • 4
1
vote
1 answer

install pyshark on python 3.5

I've installed python 3.5 on mac os x (el capitan). I want to import pyshark module in python, but I get error. I installed the pyshark requirement such as (logbook, lxml, trollies, py) but I couldn't import pyshark module. pip3 list >> syncio…
omid
  • 37
  • 1
  • 9
1
vote
1 answer

Trouble Importing Pyshark

I'm using Pyshark and Python 2.6 on OS X 10.10. I simply try to import pyshark in my code, and this error is thrown. Any idea of what could be going wrong? /System/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6…
freedomflyer
  • 2,431
  • 3
  • 26
  • 38
1
vote
2 answers

Import error while using pyshark

I am trying to install pyshark in windows. [Python 2.6]. When I try to import pyshark in my python code. I get the following error - **Traceback (most recent call last): File "", line 1, in File "pyshark\__init__.py", line 1, in…
Vishak
  • 13
  • 1
  • 3
1
vote
1 answer

pyshark to capture and parse packets in remote server

Can we use pyshark module to capture/parse packets in remote server ? Found it working in local interface : >>> import pyshark >>> capture = pyshark.LiveCapture(interface='eth2') >>> capture.sniff(timeout=50) >>> capture
agnel
  • 631
  • 1
  • 7
  • 9