[k/f] Labs KHANOS / LAB NOTES

IOT / PERSONAL HOME LAB

Controlling my light bulbs
from the local network

I used a Kali Linux virtual machine to find two LIFX bulbs on my home network, then change a lamp’s power and color without a device login. The biggest lesson was that a scan can miss useful information when it checks the wrong protocol.

Connect the Kali VM to my home network

I used Kali Linux, a Linux operating system with security testing tools, inside a virtual machine (VM) on my Windows computer. The targets were two LIFX smart bulbs I own. These are IoT (Internet of Things) devices: everyday objects with network connections.

I checked ipconfig in Windows and ip a in Kali. My home network was 10.0.0.0/24; the /24 describes its subnet size. Kali’s address was 10.0.0.209.

The VM used bridged networking, which placed it on the home LAN, or local area network, alongside the bulbs. This mattered because the discovery method sends messages to the local network. A typical VM’s NAT (network address translation) mode uses a separate virtual network, which can prevent that broadcast discovery from reaching the home LAN. VM networking reference ↗

Home LAN 10.0.0.0/24
Kali VM 10.0.0.209 · bridged adapter
Desk Lamp Left 10.0.0.7
Desk Lamp Right 10.0.0.147

Learning point: check the adapter mode and subnet before troubleshooting a scan. Matching address ranges alone do not prove that every device is reachable.

Find the bulbs with Nmap

Nmap is a tool for discovering reachable devices and checking their network services. From Kali, I ran host discovery on my own subnet:

sudo nmap -sn 10.0.0.0/24

-sn finds responding hosts without scanning their ports. Two results had the vendor label Lifi Labs Management, which pointed me toward the bulbs. Nmap can infer a vendor from a device’s MAC address, its local network interface identifier.

Remember: a vendor label is a useful clue. I confirmed the devices later through their LIFX names and behavior. Discovery can also miss devices that do not respond. Nmap host discovery ↗

Check TCP and understand the limit

I scanned 10.0.0.7, the left lamp’s address:

sudo nmap -sV -sC -p- 10.0.0.7

-p- covers ports 1–65535, -sV attempts service identification, and -sC runs Nmap’s default scripts. The recorded result was all TCP ports closed.

TCP and UDP are different ways of carrying network traffic. TCP establishes a connection; UDP sends messages without that connection setup. This command checked TCP, so it did not answer whether a UDP service was available.

Learning point: the result described the TCP scan. It was not enough to conclude that the bulb had no accessible services.

Try the protocol LIFX actually uses

I learned that LIFX’s local control protocol uses UDP port 56700. A protocol is the set of rules for formatting and exchanging messages. The vendor documentation confirms the transport and port used for these messages. LIFX LAN protocol ↗

sudo nmap -sU -sV -p 56700 10.0.0.7

-sU selects UDP. The result was 56700/udp open|filtered: Nmap could not tell whether a service was listening quietly or a filter was blocking traffic. The result alone did not explain the silence. Nmap’s UDP result meanings ↗

Next step: send a correctly formatted LIFX request and look for a response.

Discover the lamps with the LIFX library

I installed lifxlan, a community Python library that creates messages using the LIFX LAN protocol. A library is reusable code; this one let me communicate with the bulbs without building the packets myself. lifxlan project ↗

I used LifxLAN().get_devices() to discover devices, then requested their labels, addresses, and power states. My notes recorded Desk Lamp Left at 10.0.0.7 and Desk Lamp Right at 10.0.0.147. These requests required no LIFX account token or device password.

Python setup note for repeating the lab

My original install used --break-system-packages. For a future repeat, I would use a Python virtual environment, a separate package folder, to avoid changing Kali’s system Python packages. This is an improvement to the setup, not a step recorded in the original lab.

python3 -m venv .venv
source .venv/bin/activate
python -m pip install lifxlan

Kali’s Python package guidance ↗

Test power and color changes

I selected Desk Lamp Left by its label and used set_power() to turn it on, wait two seconds, then turn it off. I also used set_color() to cycle through red, green, and blue, one second apart.

The lamp visibly changed as requested. That was the evidence of control: discovery showed that the bulb responded, while the power and color tests showed that it accepted changes.

View the power test in readable Python

This is the original power-test command reformatted as Python for easier reading. It assumes lifxlan is installed and the lamp is reachable.

from lifxlan import LifxLAN
import time

devices = LifxLAN().get_devices()
lamp = next(d for d in devices
            if d.get_label() == "Desk Lamp Left")

lamp.set_power(True)
time.sleep(2)
lamp.set_power(False)

THE OBSERVED RESULT

Local access was enough to control the lamp

From my Kali VM on the same home network, I discovered both bulbs and changed the left lamp’s power and color without authenticating to the bulb. I was already connected to my home network; this did not bypass the Wi-Fi password.

This demonstrated access through the existing local control protocol. It did not establish access from the public internet, expose Wi-Fi credentials, or prove that I could run other software on the bulb.

What I would change

I would place IoT devices on a separate network and use firewall rules to limit communication with my computers. A VLAN separates devices into a logical network; the rules between networks determine what can cross. I would also check whether guest devices could reach each other and whether my phone could still control the lights.

Network isolation is a recommended next step here. The original notes do not record applying or testing that change.

QUICK RECALL

The things I want to remember

Useful terms and commands from this lab
Look forMeaning
-snDiscover responding hosts without a port scan.
-sUScan UDP. A TCP result does not cover UDP.
UDP 56700The LIFX LAN control port used in this lab.
open|filteredInconclusive. More evidence is needed to distinguish an open service from filtering.
AuthenticationProving identity. My network access allowed these controls without a separate bulb login.

If discovery fails: check the VM’s network adapter, subnet, device power, and network isolation rules. An empty result can have several causes.

For another device: keep the habit of identifying it, researching its protocol, and checking what the results actually prove. The port, tools, and control commands will depend on that device.

Recap

“I used a Kali VM to find two smart bulbs on my home network. My first scan checked TCP and found no open ports, but LIFX’s local protocol uses UDP. I then used a Python library to discover the bulbs and change a lamp’s power and color without a device login. The main lesson was to understand what a scan actually covers and verify a result with the right protocol. It also showed me why access between IoT devices and other computers needs attention.”