Abstract
The rapid expansion of smart home and smart city technologies has introduced a complex array of interconnected Internet of Things (IoT) devices, exposing both cyber and physical infrastructures to a growing spectrum of security threats. Traditional cybersecurity models are insufficient to address the dynamic and distributed nature of modern cyber-physical environments, particularly in emerging economies where standardized security frameworks are often lacking. This research proposes a unified, hybrid cyber-physical security framework tailored for smart home and smart city IoT systems. Leveraging publicly available datasets such as UNSW-NB15, TON_IoT, and CICIDS2019, we simulate various attack vectors and evaluate a multi-layered intrusion detection system (IDS) that combines both signature-based and anomaly-based machine learning models. The proposed framework is validated using simulated network topologies built with NS-3 and Cooja, focusing on performance metrics including detection accuracy, false-positive rate, and computational overhead. Results demonstrate that our hybrid approach achieves over 95% accuracy in detecting complex multi-stage attacks, while maintaining scalability and adaptability across different IoT environments. The findings contribute to the development of more secure, resilient, and context-aware smart infrastructure systems offering a practical foundation for real-world deployment in smart cities and connected home ecosystems, especially within developing regions such as Iraq.