When I need to choose a new port to use (internal to an organisation) I used to look in /etc/services. This is no longer sufficient, as Wireshark knows about many other ports that are not in /etc/services and therefore mislabels traffic.
I would like to get a list of all the (TCP and UDP) ports that Wireshark knows about, so that I can use a different one.
Where can I find (or how can I generate) this list?
Update, wrote a script:
#!/usr/bin/env python
import urllib2
response = urllib2.urlopen('http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.txt')
text = response.read()
for line in text.splitlines():
words = line.split()
if len(words) < 2: continue
if words[1] != 'Unassigned': continue
print words[0]
There is a file named
services
in your Wireshark installation. It is a clone of http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.txtYou could read the source, that's the first place I'd look:
https://code.wireshark.org/review/gitweb?p=wireshark.git;a=blob_plain;f=services;hb=HEAD