Using the hosts and services commands

Next, we see the results of running the following commands:

hosts
services

With the hosts command, we get a list of all active IP addresses, any collected machine names, and the operating system of the machine. By running the services command, we get a list of all running services on the network and their related IP address. You can change the table listings from the command by using the -c flag. The help information for these commands is shown in the following screenshot.

Using the hosts and services commands

Get Penetration Testing: A Survival Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.