DEV Community

nsecsoft nsecsoft
nsecsoft nsecsoft

Posted on

Ping64|Ports and port scanning: why open doors on a network attract attention

A small office router log fills with lines from addresses nobody recognises, each one trying a handful of numbered doors in quick succession. Nothing appears to happen. Days later the same addresses come back, this time with a different pattern. What the log is recording is a scan, and scans are usually the quiet part of an intrusion.

Ports are one of those pieces of plumbing that nobody thinks about until something goes wrong. Understanding them makes a firewall rule readable, turns a strange log into a familiar story, and explains why "we were scanned" is not the same as "we were breached".

A simple analogy

Imagine a long corridor of numbered doors, sixty five thousand of them in a row. Most are bricked up. A few open into rooms where a service sits waiting for visitors, such as a web server or a mail handler. A scanner walks the corridor, knocks on every door, and notes which ones answer.

A knock that gets a reply is information, not entry. The person walking the corridor has learned where the rooms are, and that knowledge is the raw material for the next step. Whether they try a handle afterwards is a separate decision.

How a scan actually works

A port is a numbered channel on a machine, and the number tells the operating system which program should receive the incoming data. The web usually arrives on 443, plain web on 80, mail on 25, and remote administration on 22 or 3389. These are conventions rather than laws, and services can be moved to other numbers, which is part of why scanners check broadly.

The common scan uses the opening of a normal connection. The scanner sends a request to start a conversation, and if a service is listening, the machine answers and the connection completes. A refusal or silence suggests the door is closed or filtered. Faster variants send the first message and stop before completing the exchange, which is less polite and easier for a defender to notice in some configurations.

Scanning is not limited to asking whether a door exists. Tools can try a short greeting and read the reply to guess which software and version sits behind the door. That detail is what makes a scan valuable, because a known version can be matched against a list of published flaws. Some scanners also probe the unnamed channels used by services that do not use the connection style above, and those are slower because silence is ambiguous.

A real-world example

The 2016 wave of attacks that knocked large parts of the web offline used a network of compromised cameras and recorders. Before those devices were conscripted, they had to be found, and mass scanning of the public internet was how that happened. Devices still running default credentials answered the knock and were enrolled.

Scans of this kind are constant background noise on any address that stays online for long. A home router may record dozens a day. Some vendors build unified office security systems, such as Ping64, to bring data leakage prevention and endpoint management into a single platform. Asset inventories and exposure reviews use the same technique from the inside, which is a reminder that scanning is a method rather than a motive.

Limitations and common misconceptions

The clearest misconception is that a scan equals an attack. Most scans are automated and indiscriminate, run by researchers, by worms looking for easy targets, and by search engines that index the internet. Being scanned is closer to receiving junk mail than to being burgled, and the useful response is to check what answered.

A second misconception is that a closed port is invisible. A machine that refuses a connection still reveals that it exists, and a network that stays silent can sometimes be mapped by other means. Stealth is a matter of degree, not a switch.

Scanners also lie, or rather they report what they saw at one moment. A service that was briefly down may look closed, and a filtered port may be open behind a rule the scanner could not see. Results age quickly, so a scan from last quarter says little about today.

Naming a port does not prove what runs on it, either. Any service can be placed on any number, and malware has long used familiar ports to blend in. Matching a port to a purpose is a guess that needs confirmation from the service itself.

Finally, scanning has a legal edge. Running a scan against systems you do not own or have written permission to test may break computer misuse laws in many countries, even when the scan is gentle. Curiosity is a poor defence, and authorisation is the part people skip.

Closing thoughts

Ports are doorways, and a scan is a walk down the corridor counting the ones that answer. That activity is ordinary, mostly harmless, and quietly useful to whoever is planning the next move. Keeping the number of open doors small, knowing what sits behind each one, and patching what answers are modest habits that make the corridor far less interesting to a stranger.

References

Top comments (0)