Someone Found Your Sensor Network on the Internet: Protecting an Ethernet-Exposed Modbus Bus
Share
- Modbus TCP carries no authentication and no encryption, so any device that can reach port 502 can read the registers and write to the outputs, and a device server on a public address exposes both.
- Most stations only need to push data out, so the default should be a firewall that blocks all inbound connections, with inbound access as a deliberate, recorded exception.
- Use a VPN for remote access and never forward port 502 or any device-server port directly to the internet.
- Change every factory password during commissioning, remove every commissioning port forward after installation, and segment the sensor devices onto their own subnet or VLAN.
- Scan the site's public address from outside for port 502 and the device-server web interface after every network change, and review firewall logs for connection attempts from unfamiliar addresses.
Table of contents
Someone found your sensor network on the internet — and Modbus never asked who they were.
A facilities manager got an unsettling email from a security researcher: a public scan had found the site's sensor network exposed on the internet, and the researcher had been able to read the Modbus registers of a weather station — temperature, humidity, wind speed — without any password, and could see the device's web configuration page too. Nothing had been changed and nothing had been damaged, but the researcher had proved the point with a screenshot, and the point was hard to argue with: the sensor network, which the installer had assumed was private, was sitting on a public address, and the protocol it spoke had no way of asking who was on the other end.
The cause was not a sophisticated attack. It was an ordinary chain of small decisions: a serial device server had been given a public address so the installer could reach it from the office, the router had a port forwarded to it for convenience during commissioning and was never closed, and the device's web interface still had its factory password. The protocol itself did the rest. Modbus TCP was designed in an era when industrial networks were physically isolated, and it carries no authentication and no encryption: any device that can reach port 502 can read registers, and any device that can write can change setpoints, open a relay, or reconfigure a gateway. The network was not hacked. It was left open, and the protocol trusted everyone who walked in.
Why Modbus trusts everyone — and why that was once acceptable
Modbus began as a serial protocol, Modbus RTU, running over RS485 cable inside a building or a plant. On a serial bus, the security model is physical: to talk to the devices, you have to be standing next to the cable, holding a laptop and a converter. There is no password because there is no remote access — the wire itself is the boundary. A serial device server, the box that turns an RS485 bus into Ethernet, removes that boundary. It takes a protocol that assumed physical access and puts it on a network where anyone in the world can reach it, and it does so without adding any of the protections that network protocols are expected to have.
Modbus TCP is simply Modbus RTU wrapped in a TCP packet, and it inherits the original protocol's assumptions. A Modbus TCP request contains a device address, a function code, and a register number — nothing that identifies the sender, nothing that proves the sender is authorised, and nothing that encrypts the data. Function codes that read sensor values sit next to function codes that write to outputs, and the protocol treats both the same way: if the packet arrives, it is obeyed. A device server that exposes port 502 to the internet is therefore exposing both the readings and the controls, and the only thing standing between the internet and the station's actuators is the hope that nobody finds the port.
That hope is not realistic. Internet-wide scanners probe every public address for open ports continuously, and port 502 is one of the ports they look for, because Modbus devices are common and the protocol is well known. A search engine for internet-connected devices can list exposed Modbus endpoints by country, by organisation, and by device type. The facilities manager's network was found the same way any of them are found: a scanner tried the port, the device answered, and the answer was recorded. There was no targeting and no skill involved — just a device that answered when it should not have been reachable at all.
Choosing the right way to reach a remote station
The first selection question is whether the station needs to be reachable from the internet at all. Most sensor stations do not: they push their data out to a cloud dashboard, and nobody needs to reach in. A station that only pushes data can sit behind a firewall that allows outbound connections and blocks all inbound connections, and it is secure by default. The decision to allow inbound access should be a deliberate exception, not the default, and it should be recorded with a reason and a review date.
The second question is how remote access is done when it is genuinely needed. The safe answer is a virtual private network (VPN): a remote user connects to the site's VPN, the VPN authenticates them, and only then can they reach the sensor network. A VPN adds the authentication and encryption that Modbus lacks, and it means the Modbus port is never exposed to the internet at all. The unsafe answers are the common ones: a port forwarded directly to the device server, a device server with a public address, or a remote-access feature left enabled with its factory credentials. If the only way to reach the station is a forwarded port, the station is not remotely managed — it is publicly exposed.
The third question is what the device server itself offers. Some serial device servers include a firewall, an access list, or a management interface that can be disabled; others offer nothing but a password on the web page. When choosing a device server for a site that will be networked, check whether it can restrict management access to specific addresses, whether its web interface can be turned off after commissioning, and whether it supports being placed behind a VPN or a firewall without breaking its Modbus function. A device server that cannot be locked down should not be given a network connection that leaves the building.
Installation pitfalls: the small decisions that expose a network
The most common mistake is the commissioning port forward. During installation, someone forwards a port on the router so they can configure the device server from the office, and when the installation is finished, the forward stays. Audit the router's port-forwarding rules after every installation, and remove every forward that was created for commissioning. A port forward that exists "just in case" is a door that exists just in case someone finds it.
The second mistake is the factory password. Device servers, routers and gateways ship with a default password printed in the manual — and therefore known to everyone, including every scanner on the internet. Change every default password during commissioning, use a different password for each device, and record the passwords in a controlled place, not on a sticky note on the cabinet. A device whose web interface is exposed with a factory password is not protected at all.
The third mistake is a flat network. When the sensor network, the office network and the guest Wi-Fi all share one network with no separation, a compromised office computer or a guest's device can reach the Modbus bus directly. Segment the network: put the sensor devices on their own subnet or VLAN, allow only the gateway and the monitoring server to talk to them, and block everything else. Segmentation does not fix Modbus, but it confines the damage when something else on the site is compromised.
The fourth mistake is leaving management interfaces enabled. A device server's web configuration page, its Telnet interface, and its firmware update service are all useful during commissioning and all dangerous afterwards. Disable every management interface that is not needed, restrict the ones that remain to specific addresses, and keep the firmware updated — old firmware on a device server is a known target, and the vulnerabilities are public. And keep an inventory: every device on the sensor network, its address, its firmware version, and who can reach it. A network whose inventory is unknown cannot be secured.
Verification: proving your network is not on the internet
The most useful verification is a scan from outside. From a connection that is not on the site's network — a phone on mobile data, or an external scanning service — check the site's public address for open ports, and specifically for port 502 and for the device server's web interface. If the scan finds anything, the network is exposed, whatever the installation notes say. Repeat the scan after any change to the router, the firewall, or the device configuration, and schedule it as a recurring check: a port that was closed last year can be reopened by a router reset or a well-meaning colleague.
The second check is an inventory audit. List every device on the sensor network, confirm each one is behind the firewall or the VPN, and confirm that no device has a public address or a forwarded port. Check the router's rules against the inventory: every rule should have a reason, an owner, and a review date, and any rule without one should be removed. Check the passwords too: every device should have a unique, non-default password, and any device that still has its factory password should be treated as exposed, even if it is behind a firewall.
The third check is a test of the controls themselves. From a machine on the sensor network, try to write to a Modbus register that should be protected, and confirm that the write is blocked by the firewall or the VPN, not by the protocol — because the protocol will not block it. Test the alarm path as well: if someone does reach the network, does anyone get notified? An exposed network that nobody is watching is a network that will be found and used quietly. Set up logging on the firewall and the device server, and review the logs for connection attempts from unfamiliar addresses. A log full of failed connections from the internet is not a curiosity; it is evidence that the network is being probed, and it is a reason to check the exposure again.
Troubleshooting
| Symptom | Likely cause | How to check |
|---|---|---|
| A public scan lists the site's Modbus devices | Port 502 forwarded or the device server has a public address | Scan the public address from outside the site; remove the port forward or move the device behind the firewall or VPN |
| The device server's web page is reachable from the internet | Management interface exposed, or the same port forward as the Modbus port | Try the web interface from a mobile-data connection; disable the interface or restrict it to the local network |
| Unknown devices appear on the sensor network | Flat network with no segmentation, or a compromised device on the same subnet | Audit the network inventory against the device list; move sensor devices onto their own subnet or VLAN |
| A Modbus write changed a setpoint and nobody knows who did it | Modbus has no authentication, so any device on the network can write | Check the firewall and device-server logs for the source address; restrict write access to the gateway only |
| Remote access stopped working after the VPN was installed | The VPN is blocking legitimate traffic, or the device server is on the wrong subnet | Check the VPN's routing and firewall rules; confirm the device server's address is reachable through the VPN |
| The router was reset and the sensor network is reachable again | The reset restored default rules or reopened a commissioning port forward | Re-audit the router rules after any reset, firmware update or power event; keep a saved copy of the correct configuration |
Checklist: keeping a Modbus network off the internet
- Decide whether the station needs inbound access at all — most stations only need to push data out.
- Use a VPN for remote access; never forward port 502, or any device-server port, directly to the internet.
- Change every factory password during commissioning, use a different password per device, and record them securely.
- Remove every commissioning port forward after installation, and audit the router's rules after any change.
- Segment the network: sensor devices on their own subnet or VLAN, reachable only by the gateway and the monitoring server.
- Disable management interfaces that are not needed, and restrict the rest to specific addresses.
- Keep device-server and router firmware updated, and keep an inventory of every device, its address, and its firmware version.
- Scan the site's public address from outside, for port 502 and the device-server web interface, after every network change.
- Log firewall and device-server connections, and review the logs for attempts from unfamiliar addresses.
- Test the controls: confirm from the sensor network that a Modbus write from an unauthorised address is blocked by the firewall, not by the protocol.
Modbus was built for a world where the wire was the boundary, and it still behaves that way. Put it on Ethernet without a firewall, a VPN and a password change, and it will trust the whole internet exactly as it trusted the person standing next to the cable. The fix is not a different protocol; it is the network around the protocol — no forwarded ports, no factory passwords, a segmented network, and a scan from outside to prove it. Check your own public address today: if a scanner can find your sensor network, it already has. The device at the centre of this article is the Modbus RTU Serial Device Server | RS232/RS485 to Ethernet Converter, the box that puts an RS485 bus on Ethernet — and the box whose network placement decides whether the bus stays private.
Our engineers can help you pick the right model, check compatibility, and get your installation right the first time.
Modbus RTU Serial Device Server | RS232/RS485 to Ethernet ConverterView product →



