Let us say, we open a port, say port 123, so that upon listening, an application on the server can receive incoming packets through the port 123.

If there is no way that an inside application on the server listens the port 123, how can an attacker use this open port to attack the server?

  • Simply put, they don't.
    – user163495
    Commented Apr 20, 2020 at 10:48
  • @MechMK1 they don't? or they can't?
    – Our
    Commented Apr 20, 2020 at 10:51
  • I'll turn the question around: What makes you think they can?
    – user163495
    Commented Apr 20, 2020 at 10:52
  • 1
    OTOH, when you answer, a notice appears saying "onurcanbektas is a new contributor, be nice". It is pretty difficult to understand how this community works at first, so don't worry. What I suggest is doing a lot of research before asking a question, also using the search function on this community to find related or duplicate questions.
    – reed
    Commented Apr 20, 2020 at 13:17
  • 1
    Now a quick answer to your question: if you open a port, but there are no services listening to that port, then nothing happens. Whether you open that port or not is then irrelevant. However it is still considered a best practice to keep ports closed. Why? Because of defense in depth. What if one day you install a misconfigured local web server for development and you forget to close the ports? As you can see, as a precaution, you'd better keep a port closed even if nothing is using it at the moment.
    – reed
    Commented Apr 20, 2020 at 13:24

1 Answer 1


If there is no application listening to a port, the operating system will reject incoming packages sent to this port. So no attack is possible related to intrusion into the system via this port.

Not the answer you're looking for? Browse other questions tagged .