I have set my firewall ufw / firewall rules as follows:

Default: deny (incoming), allow (outgoing), disabled (routed)

To                                      Action      From
--                                      ------      ----
OpenSSH (22/tcp)                        ALLOW       Anywhere                  
Nginx Full (80,443/tcp)                 ALLOW       Anywhere 

But if I make a Zenmap/nmap scan it shows me the following ports are open (or also closed):

enter image description here

Why is ufw showing me a different result if by defauls all ports are closed except ssh(22) and nginx (80, 443) and why are two closed ports shown? shouldn't all other closed ports be also shown then?

1 Answer 1


To list current open ports, use netstat -atnp

for you Zenmap / nmap result. it depends on where did you run the command. same machine / local network/ external network

  • Thank you for the answer. I made the scan from an external network. Its also strange that this result only appeared one time. On my other tries I got port 22&80 as open and 443 as closed (as it should be, because of the ufw configuration). All other ports (shown by netstat) are not shown in the zenmap result on my other tries.
    – sunwarr10r
    Mar 25, 2018 at 11:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.