while am trying to use pyshark for some ctf tasks i got this output:
traceback (most recent call last): File "test.py", line 5, in if ("TCP" or "TLSv1.2") and ((packet.ip.src=="172.217.18.227" or packet.ip.src=="192.168.1.100")) in packet: File "/home/shanx/.local/lib/python2.7/site-packages/pyshark/packet/packet.py", line 119, in getattr raise AttributeError("No attribute named %s" % item) AttributeError: No attribute named ip
here's my python code :
import pyshark
capture = pyshark.FileCapture("/home/shanx/Desktop/TASKS1.1/advancedNetwork")
val=""
for packet in capture:
if ("TCP" or "TLSv1.2") and ((packet.ip.src=="172.217.18.227" or packet.ip.src=="192.168.1.100")) in packet:
val= val+packet.sll.unused
val.replace(":","")
print(val)
note: it worked just fine without this instruction:
((packet.ip.src=="172.217.18.227" or packet.ip.src=="192.168.1.100"))
question: is there any fair documentation or tutorials for these kind of libraries ?
thank you so much for answering!