2

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]
fadedbee
  • 2,068
  • 5
  • 24
  • 36

2 Answers2

2

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.txt

Dusan Bajic
  • 2,056
  • 1
  • 18
  • 21
  • 1
    Actually I imagine a lot of implementations would puke on that services file, although it is certainly more informative for humans. – quadruplebucky Mar 14 '14 at 11:15
1

You 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

quadruplebucky
  • 5,139
  • 20
  • 23