A port scanner is an program that probes a host to identify open network ports. Malicious actors use port scanners to find network services running on a host in order to find and exploit vulnerabilities. Security analysts and network administrators use port scanners to confirm network security policies are being complied with.
Build your own port scanner is available with a project breakdown on Coding Challenges.