Ravindra BagaleCourses & study guides मराठी Track your progress

43. IoT and OT Security – Cameras, Smart Devices, Plant Networks

43.9 Lab – Mosquitto MQTT or Fake Camera UI on OWN VM

Pick Path A (MQTT – preferred) or Path B (tiny HTTP "camera" page). Host-only only.

Path A – Mosquitto on Amazon Linux / Ubuntu (192.168.56.50 or .40):

# Amazon Linux
sudo yum install mosquitto mosquitto-clients
# Ubuntu:
# sudo apt update && sudo apt install -y mosquitto mosquitto-clients
sudo service mosquitto start
sudo service mosquitto status
# Weak start (lab only – then FIX in project): anonymous open on all interfaces
# Edit /etc/mosquitto/mosquitto.conf (paths vary) toward:
#   listener 1883 0.0.0.0
#   allow_anonymous true
sudo service mosquitto restart
# From same VM or Kali – OWN lab only:
mosquitto_sub -h 192.168.56.50 -t 'sahyadri/warehouse/#' -v
# Other terminal:
mosquitto_pub -h 192.168.56.50 -t 'sahyadri/warehouse/door' -m 'open'

Path B – tiny "camera" web UI (Python http.server or Nginx static page) with a login form that accepts anything at first (lab), then you fix to a real password check + firewalld source allow from Kali only. Keep it on host-only .50.

# Optional: firewalld on the IoT VM – start open, later tighten
sudo yum install firewalld
sudo systemctl enable firewalld
sudo service firewalld start
sudo firewall-cmd --list-all

From Kali 192.168.56.10 (OWN only): nmap -sS -T2 -p 1883,80,22 192.168.56.50 – document open ports. Do not aim at anything outside 192.168.56.0/24.

Red team (attacker) does Blue team (defender) detects / stops
Anonymous MQTT pub to sahyadri/# After fix: auth required; ACL; log shows denied
Nmap finds 1883/80 on IoT VM Expected in weak phase; after fix only needed ports
Uses Metasploitable .20 as side practice Still host-only; don't bridge IoT to internet

Ravindra Bagale's Tip

Students copy-paste systemctl start – in the notes it is sudo service mosquitto start, with enable only for boot. Keep a snapshot of the weak config before the fix. Interview walk-through: weak → prove → harden → prove. Remember this.

Lab

Pair: Salman installs Path A on .50; Ravina runs mosquitto_pub / sub from Kali. Screenshot anonymous success. Ethics line signed (host-only). Then jump to project box to harden.

Extended teaching notes

Why this lesson matters

Cameras, sensors and plant controllers often ship with weak defaults. Segment them from IT, change passwords, block inbound internet, and watch outbound traffic.

Real examples

Global: Mirai showed what default passwords on routers/cameras can do at scale. Indian SME (sample): a factory puts PLCs on a separate VLAN reachable only via a jump host.

Mini case study

Suppose we are on a purple-team exercise for an Indian mid-size company (sample data). Red notes a technique from this lesson against a lab clone. Blue must show the control that stops it, the log that would have fired, and the ticket that hardens production. That is the standard this course trains you for.

Defender's worksheet (do this today)

  1. Write the lesson title, date and the exact lab target you are allowed to use.
  2. List three owned systems (VMs, apps, or cloud accounts) where this lesson applies.
  3. Run one safe check from the lesson on a lab system only. Paste the command and output.
  4. Write a two-sentence fix you would give a teammate.
  5. Name one related public advisory (CERT-In, CISA, NVD, or a vendor bulletin) with its date.

Indian workplace (sample data)

Suppose we are a junior analyst at Infosys, TCS, Wipro or a fintech SOC in Bengaluru/Pune. Turn this lesson into one checklist item with an owner, a due date and a place to store evidence (ticket + screenshot).

Global practice

Compare your notes with OWASP, CIS Benchmarks, NIST CSF/IR guidance or a cloud Well-Architected security question. Write five lines on what overlaps.

Everyday analogy

Explain the risk and the fix to a family member without jargon. If they can repeat the warning, you understand it well enough to teach juniors.

Key terms

  • Control: a safeguard (patch, config, process, detection).
  • Finding: a weakness backed by evidence.
  • Remediation: the fix plus how you verified it.
  • Scope: systems you have written permission to touch.
  • Least privilege: only the access the task needs.
  • Defence in depth: several layers so one failure does not end the story.

Common mistakes

  • Skipping written permission "just for a quick scan".
  • Practising on hostel, office or public targets without authorisation.
  • Collecting tool output without writing the fix.
  • Copying attack steps onto production to "verify". Defenders verify with versions, configs and patches.
  • Publishing screenshots that contain secrets, cookies or internal hostnames.

Recap

  • Evidence, fix, owner, date.
  • Own lab only.
  • Fix > spectacle.