Ethical hackers work with government and private firms to test their networks for vulnerabilities, loopholes and bugs to prevent an actual criminal from encroaching.