Knowing port and protocol usage allows for disabling unnecessary services, avoiding default admin ports like RDP 3389, restricting access to only trusted IP addresses, encrypting cleartext protocols like HTTP, and keeping systems patched against protocol-based vulnerabilities. Ports and protocols represent a significant part of the attack surface that must be secured.