Purpose: This research aims to identify and analyze cyber attacks on health devices connected via WiFi and MQTT protocols, as well as to develop an effective detection model using machine learning techniques. Design/methodology/approach: The methodology includes collecting data from open datasets, preprocessing the data, and applying several machine learning algorithms, including Random Forest, Support Vector Machine (SVM), KNN, LightGBM, SGD Classifier, Catboost, and XGBoost. This process involves testing and evaluating the models to determine their accuracy and effectiveness in detecting attacks. Findings/result: The findings indicate that the developed model is capable of detecting attacks with high accuracy, achieving 99.5% for detecting 2 categories of attacks, 91.5% for detecting 6 categories, and 86.9% for detecting 19 categories in several testing scenarios. This demonstrates that the application of machine learning techniques can enhance the detection capabilities of cyber attacks on health devices. Originality/value/state of the art: This research makes a significant contribution to the development of security solutions for the Internet of Medical Things (IoMT). By employing advanced machine learning techniques, the study highlights the importance of innovation in cyber attack detection and provides recommendations for further research in developing more efficient algorithms.