1

Among some other servers installed in my Ubuntu system, one is the dictd server. The documentation says it uses port 2628. Running

sudo nmap 192.168.1.74 -p 0-9000

results in:

Nmap scan report for 192.168.1.74
Host is up (0.000010s latency).
Not shown: 8995 closed ports
PORT     STATE SERVICE
21/tcp   open  ftp
80/tcp   open  http
111/tcp  open  rpcbind
139/tcp  open  netbios-ssn
445/tcp  open  microsoft-ds
3128/tcp open  squid-http

It does not list port 2628 used by dictd server (which is up, I checked with ps.) I don't know what's wrong with the command that I used!

My question is how can I list all servers (like dictd and others including some games serves) along with their port numbers? (preferably using console tools)

5
  • Only I can say is to try with netcat. command: netcat -z -n -v -w 1 192.168.1.74 1-9000 2>&1 | grep succeeded. Netcat will try to make connection and if service run you will see
    – 2707974
    Mar 26, 2014 at 8:44
  • @2707974 that gives the same ports as listed above with nmap..
    – rusty
    Mar 26, 2014 at 8:53
  • dictd work on tcp port by default, I think. Try to scan udp ports nc -vvzu 192.168.1.74 1-9000 -w 1
    – 2707974
    Mar 26, 2014 at 8:57
  • no positives with udp ports either..
    – rusty
    Mar 26, 2014 at 9:07
  • 1
    If service work and use tcp must be in LISTEN state because waiting for connection. netstat -l, must see it.
    – 2707974
    Mar 26, 2014 at 9:26

2 Answers 2

1

This task is what the netstat tool is for. Nmap is a great port scanner, but the kernel is more authoritative, since firewalls can block a port scan.

0

You can see a list of processes running:

netstat -nltp

Output:

(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 127.0.0.1:27017         0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.1:37261         0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.1:46624         0.0.0.0:*               LISTEN      44178/kited         
tcp6       0      0 ::1:631                 :::*                    LISTEN      -    

See netcat --help for each one of the flags used.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .