Netcat is a goof network debugging tool . It can read and write the data through network.Both TCP and UDP supported. We mostly face issues with firewalls while we hosting our application in servers. In AWS also there are security settings for restricting the network access. But we need to check whether a port is accessible from public internet. netcat will be very useful to check this.
Suppose we are hosting a web server with port 80. We installed server properly and accessible from same system but not from the network. So we need to test whether request is coming till the server and any web server configuration causing the issue.To test this first stop the webserver then run the command "nc -l 80"
This will open 80 port ( TCP) in current system's IP. Then try to telnet from remote host to webservers 80 port. If it succeeds then you will get connection accpetd message in terminal where we ran "nc -l 80 " command.