TCP Port Scanning, DDoS Prevention/Firewall

I used the Nmap tool to perform a port scan on the target IP Address, Nmap highlighted all of the open ports on the website. The only necessary port to remain open is port 80. As it is the port where the internet runs on. So minimizing the ports open in a network can mitigate risk

this was the bash script that was used assist the Nmap scan, so that it can only filter and display the open ports. this is because the usual Nmap scan display whether all the ports are open ports or closed

I setup a firewall to only allow port 80 to be open on the target IP address. This was due to a DDoS attack that utilizes a vulnerability from the other ports. And closing the open ports stopped the DDoS attack.