Skip to content

Smart Home & IoT Device Security

💡
Before you start

Python 3 and a terminal. No device is scanned, contacted or logged into, and nothing connects to your network or to the internet. macOS and Linux include Python; on Windows install it from python.org with “Add python.exe to PATH” ticked, then check with python3 --version.

Everything below is modelled on paper, deliberately. Scanning a network is a reasonable thing to do on your own equipment but a poor way to learn, because the interesting question is not which ports are open — it is what each device could reach if it were taken over, which no scanner tells you. Each step ends with something to change in the real world, and step 5 collects them.

A Camera Is a Computer With a Lens

A smart doorbell, a robot vacuum, a television, a baby monitor and a plug that switches your lamp are all the same thing in different shells: a small Linux computer with a network connection, running software you did not write, talking to a company's servers you cannot inspect. Treating them as appliances rather than computers is what creates the risk.

The scale is not theoretical. Security reporting through 2025 counted billions of attacks against consumer connected devices, with an estimated fifth of them still protected only by factory-default credentials that anyone can look up. In March 2026 the US Department of Justice disrupted four IoT botnets built almost entirely from devices with default or weak passwords and unpatched firmware, together comprising millions of infected devices.

💡
Two different worries, one setup.

Compromise — a stranger watching your camera, or your fridge quietly joining a botnet. Surveillance — the manufacturer legitimately collecting more than you expected, under a policy you agreed to. The steps below reduce both, but they are different problems and only the first is a "hack".

The Setup That Matters Most

1
Change the default password before anything else.

Do it during setup, not later. Default credentials are published in searchable databases, and automated scanners find exposed devices within minutes. This single step removes the cause of most consumer IoT compromise.

2
Secure the account, not just the device.

The vendor account is what actually holds your camera feed. Give it a unique password from your password manager and turn on two-factor authentication — a passkey if offered. Nearly every "my camera was hacked" story is really a reused password plus a credential-stuffing attack on the vendor's app.

3
Put them on a separate network.

Most routers offer a guest network. Put every smart device on it and your phones and computers on the main one. If a device is compromised it then sits in a room with nothing worth stealing, rather than beside your laptop and network storage.

4
Turn on automatic firmware updates.

Then check occasionally that they are actually arriving. A device that has not received an update in two years is not stable — it is abandoned.

5
Never expose a device directly to the internet.

Do not forward ports to a camera, and turn off UPnP on your router so devices cannot open holes by themselves. Use the vendor's app or a VPN into your home network instead. Port-forwarded cameras are precisely what public device-search engines index.

Buying Decisions Are Security Decisions

The most consequential choice happens before setup, in the shop.

  • Check the support commitment -- reputable manufacturers publish how many years a model will receive security updates. If you cannot find that promise, assume there is none
  • Prefer devices that work without the cloud -- local control means the device keeps functioning when the company loses interest, and less of your home leaves the building
  • Prefer local recording for cameras -- footage on a card in your house is not footage in someone else's datacentre
  • Be wary of unbranded bargains -- the very cheap camera has no security team and no update pipeline. There is a reason it costs what it costs
  • Read what the app demands -- a light bulb requesting contacts, precise location and call logs is telling you what the actual product is

Placement and Settings

  • Think before putting a camera indoors, and never in a bedroom or bathroom. The safest footage is the footage that was never recorded
  • Point cameras at your own property -- in many countries recording a neighbour's garden or a public pavement carries real legal obligations
  • Turn off features you do not use -- remote access, cloud backup, voice purchasing, "improve the product" telemetry. Every feature is attack surface
  • Mute or unplug when it matters -- a microphone switch you can see is worth more than a setting you have to trust
  • Review who has access -- shared logins for ex-partners, former housemates and old tenants are a recurring and under-appreciated problem
  • Check what is on your network -- your router's device list will show things you have forgotten. Remove what you no longer use
⚠️
Second-hand and hand-me-down devices carry their old owner.

Always factory-reset a used smart device and create a fresh vendor account. A previous owner who remains linked keeps access to the feed. The same applies when you sell or give one away — reset it and remove it from your account.

When the Vendor Walks Away

This is the failure mode nobody plans for: the company is acquired, pivots, or simply shuts down the servers, and a working device becomes either a brick or an unpatched liability on your network.

  • Decide deliberately -- keep it offline-only, move it to a local-control platform if one supports it, or retire it. Leaving it connected and unpatched is the one choice with no upside
  • Watch for the warning signs -- no firmware update in a year, an app removed from the store, or support that has gone quiet
  • Prefer open standards when replacing -- devices that speak a common protocol can usually be adopted by another controller and outlive their maker
  • Retire, do not hoard -- an unused device still on the network is pure liability. Unplug it and remove it from the account

Audit Your Own Smart Home on Paper, in Five Steps

The trouble with a smart-home device is not that it might be hacked. It is that it is a small computer, running software nobody will ever update, sitting on the same network as the laptop with your tax returns on it — and that it will still be doing that in eight years, working perfectly, which is precisely why you will never replace it. In the next twenty minutes you will model all of that: which devices open on the first guess, how far an intruder gets from the weakest one, what stops working the day the manufacturer loses interest, and the seventy minutes of work that fixes most of it. Every line of output below came from running these files.

1
Try the list everyone tries first

Go: open a terminal in a folder you can write to — cd ~/Desktop on macOS or Linux, cd %USERPROFILE%\Desktop on Windows.

Do: save this as defaults.py and run python3 defaults.py.

"""The first thing anyone tries, and how often it still works."""

DEVICES = [
    ("front door camera",   "admin",  "admin"),
    ("baby monitor",        "admin",  "123456"),
    ("robot vacuum",        "root",   "Xk9$mQ2vLp"),
    ("network printer",     "admin",  ""),
    ("smart plug",          "user",   "user"),
    ("NAS",                 "admin",  "correct-horse-battery-staple"),
]

# The list every scanner ships with. It is a few hundred lines long in reality.
DEFAULTS = {("admin", "admin"), ("admin", "123456"), ("admin", "password"),
            ("admin", ""), ("root", "root"), ("root", ""), ("user", "user"),
            ("admin", "1234"), ("support", "support")}

print("%-22s %-10s %s" % ("DEVICE", "USERNAME", "STATUS"))
print("-" * 62)
open_devices = 0
for name, user, password in DEVICES:
    if (user, password) in DEFAULTS:
        status = "OPEN -- factory credentials unchanged"
        open_devices += 1
    else:
        status = "password changed"
    print("%-22s %-10s %s" % (name, user, status))

print()
print("devices on this network :", len(DEVICES))
print("openable with a list    :", open_devices)
print()
print("No exploit, no vulnerability, no skill. The scanner tries the list,")
print("and on four of these it is let in on the first or second attempt.")

You should see: four of six devices opening without anything you could call an attack:

DEVICE                 USERNAME   STATUS
--------------------------------------------------------------
front door camera      admin      OPEN -- factory credentials unchanged
baby monitor           admin      OPEN -- factory credentials unchanged
robot vacuum           root       password changed
network printer        admin      OPEN -- factory credentials unchanged
smart plug             user       OPEN -- factory credentials unchanged
NAS                    admin      password changed

devices on this network : 6
openable with a list    : 4

No exploit, no vulnerability, no skill. The scanner tries the list,
and on four of these it is let in on the first or second attempt.

The real list has several hundred entries and is published, because it is compiled from manufacturers' own manuals. Automated scanners work through it against every address they can reach, continuously, with no target in mind — which is why “nobody would bother with my house” is not a defence: nobody chose your house.

The awkward part is that some devices have no password to change, or one hidden behind a menu nobody opens, or a maintenance account the manual does not mention. Those are the ones step 2 exists for.

If not: if fewer devices show as open, one of the credential pairs no longer matches an entry in DEFAULTS — the comparison is on the exact tuple, including the empty string for the printer.

2
Measure how far the weakest device gets you

Go: the same folder.

Do: save this as reach.py and run python3 reach.py.

"""One flat network: everything can reach everything."""

DEVICES = ["front door camera", "baby monitor", "smart plug", "network printer",
           "your laptop", "your phone", "the NAS with the family photos"]

def flat_network(devices):
    return {d: [x for x in devices if x != d] for d in devices}

def segmented(devices, iot, trusted):
    reach = {}
    for d in devices:
        if d in iot:
            reach[d] = [x for x in iot if x != d]          # IoT talks only to IoT
        else:
            reach[d] = [x for x in devices if x != d]      # trusted talks to all
    return reach

IOT = ["front door camera", "baby monitor", "smart plug", "network printer"]
TRUSTED = [d for d in DEVICES if d not in IOT]

flat = flat_network(DEVICES)
seg = segmented(DEVICES, IOT, TRUSTED)

print("if the baby monitor is taken over, it can reach:")
print("   flat network    :", len(flat["baby monitor"]), "devices")
for d in flat["baby monitor"]:
    print("      -", d)
print()
print("   segmented       :", len(seg["baby monitor"]), "devices")
for d in seg["baby monitor"]:
    print("      -", d)
print()
print("The NAS with the family photos moves from 'reachable' to 'not on the")
print("same network'. Nothing about the camera's security changed -- only")
print("what it is standing next to.")

You should see: the same compromised device reaching six things, then three:

if the baby monitor is taken over, it can reach:
   flat network    : 6 devices
      - front door camera
      - smart plug
      - network printer
      - your laptop
      - your phone
      - the NAS with the family photos

   segmented       : 3 devices
      - front door camera
      - smart plug
      - network printer

The NAS with the family photos moves from 'reachable' to 'not on the
same network'. Nothing about the camera's security changed -- only
what it is standing next to.

Home networks are flat by default: everything plugged into the router can talk to everything else, because that is what makes printers and media players work without configuration. The consequence is that the security of your laptop is bounded by the security of the cheapest thing you own.

The fix is one setting on almost every router made in the last decade: the guest network. It exists to keep visitors' devices away from your own machines, which is exactly the job. Put every gadget on it — cameras, plugs, TV, speaker — and keep the laptop, the phone and the file storage on the main one. The gadgets keep working, because they talk to the internet rather than to your laptop.

If not: if both counts are the same, the device names in IOT do not match the strings in DEVICES exactly — they are compared as text, so a single character difference puts a device in the trusted group.

3
Find out what the device is without its manufacturer

Go: the same folder.

Do: save this as cloud.py and run python3 cloud.py.

"""Which functions survive the vendor switching off the servers?"""

FUNCTIONS = [
    ("turn the light on with the wall switch",      False),
    ("turn the light on with the app, at home",     True),
    ("turn the light on from the office",           True),
    ("the camera records to its own SD card",       False),
    ("the camera records to the cloud",             True),
    ("view the camera on the local network",        True),
    ("the door lock opens with the physical key",   False),
    ("the door lock opens with the app",            True),
    ("the thermostat follows its schedule",         False),
]

print("%-46s %s" % ("FUNCTION", "NEEDS THE VENDOR'S SERVERS?"))
print("-" * 78)
for what, needs_cloud in FUNCTIONS:
    print("%-46s %s" % (what, "yes" if needs_cloud else "no"))

lost = sum(1 for _, c in FUNCTIONS if c)
print()
print("functions lost the day the vendor shuts down:", lost, "of", len(FUNCTIONS))
print("functions that keep working                 :", len(FUNCTIONS) - lost)
print()
print("Note which ones survive: the wall switch, the physical key, the SD")
print("card, the on-device schedule. Every survivor is a function that never")
print("left the building.")
print()
print("The question to ask before buying: what does this still do with no")
print("internet at all? Whatever the answer is, that is what you are buying.")

You should see: five of nine functions depending on somebody else's servers:

FUNCTION                                       NEEDS THE VENDOR'S SERVERS?
------------------------------------------------------------------------------
turn the light on with the wall switch         no
turn the light on with the app, at home        yes
turn the light on from the office              yes
the camera records to its own SD card          no
the camera records to the cloud                yes
view the camera on the local network           yes
the door lock opens with the physical key      no
the door lock opens with the app               yes
the thermostat follows its schedule            no

functions lost the day the vendor shuts down: 5 of 9
functions that keep working                 : 4

Note which ones survive: the wall switch, the physical key, the SD
card, the on-device schedule. Every survivor is a function that never
left the building.

The question to ask before buying: what does this still do with no
internet at all? Whatever the answer is, that is what you are buying.

The row that surprises people is view the camera on the local network. Many cameras route even a same-room connection through the manufacturer's servers, because it is far easier to build than local discovery — so a camera two metres away goes dark when a company in another country has an outage, and the video was travelling to that company all along.

This is a buying decision more than a security setting. Before you buy, ask what the device still does with no internet at all, and whether it works with an open standard — Matter, Zigbee, Z-Wave, ONVIF, or plain local access — rather than only the maker's own app. A device that keeps its core function locally is one you own; a device that does not is one you are renting for as long as the company feels like it.

If not: the two counts are computed from the table, so editing a row changes them correctly; if functions lost reads 0, every boolean was set to False.

4
Compare how long it works with how long it is defended

Go: the same folder.

Do: save this as lifetime.py and run python3 lifetime.py.

"""How long the device works, versus how long it is patched."""

DEVICES = [
    ("smart doorbell",   10, 3),
    ("IP camera",        10, 2),
    ("smart TV",         12, 4),
    ("smart plug",        8, 2),
    ("wi-fi router",      7, 5),
    ("laptop",            7, 8),
]

print("%-18s %10s %12s %14s" % ("DEVICE", "LASTS (y)", "PATCHED (y)", "UNPATCHED (y)"))
print("-" * 60)
total_gap = 0
for name, lifespan, support in DEVICES:
    gap = max(0, lifespan - support)
    total_gap += gap
    print("%-18s %10d %12d %14d" % (name, lifespan, support, gap))

print()
print("combined years running without security updates:", total_gap)
print("devices that outlive their support window       :",
      sum(1 for _, l, s in DEVICES if l > s), "of", len(DEVICES))
print()
print("The laptop is the odd one out, and it is the only device on the list")
print("people expect to update. The others keep working perfectly, which is")
print("exactly why nobody replaces them.")

You should see: five of six devices outliving their support:

DEVICE              LASTS (y)  PATCHED (y)  UNPATCHED (y)
------------------------------------------------------------
smart doorbell             10            3              7
IP camera                  10            2              8
smart TV                   12            4              8
smart plug                  8            2              6
wi-fi router                7            5              2
laptop                      7            8              0

combined years running without security updates: 31
devices that outlive their support window       : 5 of 6

The laptop is the odd one out, and it is the only device on the list
people expect to update. The others keep working perfectly, which is
exactly why nobody replaces them.

The figures are illustrative rather than measured — support windows vary enormously between manufacturers, and some are excellent. What is not illustrative is the shape of the problem, and it is the opposite of how people think about physical goods: a doorbell that lasts ten years is normally a good doorbell, and here it is ten years of exposure with three years of defence.

So the question to ask before buying is one manufacturers increasingly answer in writing: until what date will this receive security updates? Regulations in the UK and EU now require that period to be declared for consumer connected devices, so it is usually findable on the product page or in the manual. A device with no stated date should be assumed to have none.

If not: the last column is max(0, lifespan - support), so the laptop correctly shows 0 rather than a negative number; if you see one, the max was removed.

5
Do the seventy minutes that fixes most of it

Go: the same folder.

Do: save this as checklist.py and run python3 checklist.py.

"""What to do this weekend, ordered by what it costs you."""

ACTIONS = [
    ("change the password on every device that has one",   20, "high"),
    ("move the gadgets to the router's guest network",      15, "high"),
    ("turn off remote access on anything that works local", 10, "high"),
    ("check each device for firmware updates, then yearly", 20, "medium"),
    ("turn off UPnP on the router",                          2, "medium"),
    ("unplug anything you stopped using",                    5, "medium"),
    ("replace a device that is out of support",           None, "low"),
]

print("%-54s %8s %8s" % ("ACTION", "MINUTES", "VALUE"))
print("-" * 72)
for what, minutes, value in ACTIONS:
    print("%-54s %8s %8s" % (what, minutes if minutes else "money", value))

free = [m for _, m, _ in ACTIONS if m]
print()
print("actions costing nothing but time:", len(free), "of", len(ACTIONS))
print("total minutes for all of them   :", sum(free))
print()
print("The guest network is the single best one. Almost every router made in")
print("the last decade has it, it exists to keep visitors away from your own")
print("machines, and that is exactly the job that needs doing here.")

You should see: six actions that cost only time:

ACTION                                                  MINUTES    VALUE
------------------------------------------------------------------------
change the password on every device that has one             20     high
move the gadgets to the router's guest network               15     high
turn off remote access on anything that works local          10     high
check each device for firmware updates, then yearly          20   medium
turn off UPnP on the router                                   2   medium
unplug anything you stopped using                             5   medium
replace a device that is out of support                   money      low

actions costing nothing but time: 6 of 7
total minutes for all of them   : 72

The guest network is the single best one. Almost every router made in
the last decade has it, it exists to keep visitors away from your own
machines, and that is exactly the job that needs doing here.

Two of these need a word of explanation. UPnP lets a device on your network ask the router to open a path from the internet straight to it, without asking you — convenient for games consoles, and precisely how a compromised gadget makes itself reachable from outside. Turning it off occasionally breaks a console feature, which you will notice and can undo; leaving it on is silent.

And unplugging what you stopped using is the most underrated row in the table. The abandoned tablet running an operating system from six years ago, the old camera in a drawer still on the wi-fi, the printer nobody has printed to since 2021 — each is a small computer with no updates, and none of them is doing anything for you.

If you do exactly one thing from this page, do the guest network. It takes fifteen minutes and it converts every other weakness here from “a route to your laptop” into “a compromised plug that can only talk to other plugs”.

If not: the total is summed from the table rather than written in, so adding a row updates it; if the total prints 0, the None entry is being included — the filter keeps only truthy values.

🎉
Check yourself before moving on

Without scrolling up: a friend has a video doorbell, two smart plugs and a robot vacuum, all with strong unique passwords, and says that since nothing uses a default password there is nothing left to worry about. Name two risks that remain, and the one change you would ask them to make. Answer: first, the flat network: step 2 showed that a compromised device on a normal home network can reach every other device on it, and the password on the doorbell is irrelevant if the compromise comes through a flaw in its software rather than through the login. Second, the support window: step 4 showed these devices typically outlive their security updates by several years, so a strong password protects the login while the unpatched software underneath it stays exactly as vulnerable as the day support ended — and the device keeps working, so nothing prompts a replacement. A third, if they use the vacuum's app remotely, is the cloud dependency from step 3, which is both an outage risk and a question about where the floor plan of their home is stored. The one change is the guest network: move all three devices onto it, so that the worst case becomes a compromised plug that can only reach other plugs.

Now do it without the page: write out your own version of reach.py — list every device on your home network, which takes longer than people expect and is itself the exercise, since most households find two or three they had forgotten. Then open your router's settings, find the guest network, and move the gadgets onto it. If you cannot find the setting, search for your router model plus “guest network”; almost every model made since about 2015 has one.

Summary

  • Every smart device is a small computer running someone else's software on your network
  • Default passwords cause most compromises -- change them during setup, not later
  • The vendor account is the real target -- unique password plus 2FA
  • Guest network isolation turns a compromised gadget into a contained one
  • Never port-forward to a camera, and disable UPnP
  • Buy for the update promise, and plan for the day the vendor stops caring
🎉
Twenty minutes, once.

Change the defaults, secure the vendor account, move everything onto the guest network, and switch automatic updates on. That is the whole job for most homes, and it removes the causes behind nearly every consumer IoT incident you will read about.