A TCP layer in Scapy contains source port:
>>> a[TCP].sport
80
Is there a simple way to convert port number to service name? I've seen Scapy has TCP_SERVICES
and UDP_SERVICES
to translate port number, but
print TCP_SERVICES[80] # fails
print TCP_SERVICES['80'] # fails
print TCP_SERVICES.__getitem__(80) # fails
print TCP_SERVICES['www'] # works, but it's not what i need
80
Someone know how can I map ports to services?
Thank you in advance