Check for open ports or services

Identifying open ports on servers requires the port to be opened and unnecessary services to be disabled or shutdown. The server should have a minimal operating system configuration.

For Windows, run the following command using the Command Prompt:

netstat -a | findstr "LISTEN"

The ouptu of the preceding command is as shown in the screenshot:

For Linux/Unix, run the following command using the shell prompt:

netstat -antp | grep "LISTEN"

Get Practical Network Scanning 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.