I'm following a wireshark course that requires me to write a simple pyshark script. The problem is the lecturer uses a Linux VM and the network name is given through ifconfig i.e eth0.
Since I'm operating on Windows, and unfamiliar with pyshark, I'm wondering what suffices for the network name while writing this argument. I can't seem to pinpoint specifically how my network adapter is referred to with the 'eth' naming convention. Would something simply like the index number i.e 3 suffice?
I've tried variations of eth to 'guess' the right network. Proof is in running the script and seeing it print the results. Otherwise its been a guessing game. So far nothing is printing out after running my script which i use as validation for not getting my adapter value right. (There is only one active network adapter on my pc).
Would appreciate someone with knowledge of pyshark arguments chiming in. This is the script:
import pyshark
capture = pyshark.LiveCapture(interface= 'eth3')
for packet in capture.sniff_continuously(packet_count=5):
try:
print('Source = ' + packet['ip'].src)
print('Destination =' + packet['ip'].dst)
except:
if LiveCapture == 0:
print ("No Packets on this interface")
print("~Fin~")
exit()