Information Technology Reference
In-Depth Information
ports and services are open and running, respectively. Here we will list a few commonly
used utilities for such purposes.
netstat netstat is a utility used to print network connections, routing tables, interface
statistics, masquerade connections, and multicast memberships. The following command
can be used to view local addresses and ports, foreign addresses and ports, the state of the
connection, and timer information. We have also included example output.
$ netstat -an
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN
tcp 0 1 10.0.0.254:46692 10.0.4.22:5666 SYN_SENT
tcp 0 0 10.0.0.254:38127 10.0.3.104:8807 TIME_
WAIT
nmap nmap is another network exploration tool and port scanner. A user can run the
following command on the local machine to see which ports are open and listening.
$ nmap localhost
PORT STATE SERVICE
22/tcp open ssh
25/tcp open smtp
53/tcp open domain
80/tcp open http
443/tcp open https
3306/tcp open mysql
5666/tcp open nrpe
8083/tcp open unknown
8443/tcp open https-alt
8649/tcp open unknown
8651/tcp open unknown
8652/tcp open unknown
inetd inetd listens for connections that are on Internet sockets that are defined by the port
numbers. The ports are listed in a configuration file located on the host system at /etc/
inetd.conf . A user can activate or deactivate ports and services by commenting out lines
from the configuration file. Upon creation of a connection, inetd invokes a server process with
the service socket as its standard input (STDIN), output (STDOUT), and error (STDERR)
descriptors. To see which ports are open, a user can execute the following command.
$ grep -v "^s*#" /etc/inetd.conf
printer stream tcp nowait lp /usr/local/libexec/cups/daemon/cups-lpd
cups-lpd -o document-format=application/octet/stream
Search WWH ::




Custom Search