Pendekatan Machine Learning untuk Deteksi Serangan Man-in-the-Middle Menggunakan K-Nearest Neighbor

Keywords: Machine Learning, K-Nearest Neighbor, Man-in-the-Middle

Abstract

Wireless networking (Wi-Fi) technology has improved data transmission capabilities, but it has also increased vulnerability to cybersecurity threats, particularly Man-in-the-Middle (MitM) attacks. The vulnerabilities created by these attacks allow unauthorized individuals to intercept and alter communications surreptitiously. The K-Nearest Neighbor (KNN) method is proposed for use in a machine learning-based intrusion detection system. With a dataset of 800,000 entries divided in an 80:20 ratio for training and testing, the model achieved an accuracy rate of 89.22%. The test results showed uniform performance with a balance of precision, recall, and F1 score metrics across both classes, as well as maximum computational time efficiency. These results validate the KNN algorithm's ability to categorize network traffic and its ability to function as an automated MitM attack detection system

References

Abdallah, Emad E., Wafa’ Eleisah, and Ahmed Fawzi Otoom. 2022. “Intrusion Detection Systems Using Supervised Machine Learning Techniques: A Survey.” Procedia Computer Science 201(C):205–12. doi:10.1016/j.procs.2022.03.029.
Ali, Muhanna Ahmed, and Salah Alawi Hussein Al-Sharafi. 2025. “Intrusion Detection in IoT Networks Using Machine Learning and Deep Learning Approaches for MitM Attack Mitigation.” Discover Internet of Things 5(1). doi:10.1007/s43926-025-00104-w.
Aryanti, Aryanti, Feriska Putri Daviana, Nida Dhia Ulhaq, Muhammad Riswanto, Muhammad Dio Alfajri, and Nur Trisya Novita. 2025. “Perbandingan Metode K-Nearest Neighbor Dan Logistic Regression Dalam Klasifikasi Dini Anemia Berdasarkan Parameter Hematologi Dasar.” Jurnal Riset Rekayasa Elektro 7(2):251–58.
Auliafitri, Desita, Erry RizkiSuro, Muhamad Rangga Maulana Malik, and Aep Setiawan. 2024. “Optimalisasi Pengujian Penetrasi: Penerapan Serangan MITM (Man in the Middle Attack) Menggunakan Websploit.” Journal of Internet and Software Engineering 1(3):12. doi:10.47134/pjise.v1i3.2620.
B, Nawal A. L. Mabsali, Hothefa Jassim, and Joseph Mani. 2023. Proceedings of the 1st International Conference on Innovation in Information Technology and Business (ICIITB 2022). Atlantis Press International BV.
Berhili, Mohammed, Omar Chaieb, and Mohammed Benabdellah. 2024. “Intrusion Detection Systems in IoT Based on Machine Learning: A State of the Art.” Procedia Computer Science 251:99–107. doi:10.1016/j.procs.2024.11.089.
Fereidouni, Hamidreza, Olga Fadeitcheva, and Mehdi Zalai. 2025. “IoT and Man‐in‐the‐Middle Attacks.” Security and Privacy 8(2). doi:10.1002/spy2.70016.
Gurav, Rohan. 2026. “Detect Man-In-The-Middle Attack Using ARP Analysis.” 1–10. doi:10.55041/ISJEM05445.
Muchlinski, David. 2022. “Machine Learning and Deep Learning.” Elgar Encyclopedia of Technology and Politics 114–18. doi:10.4337/9781800374263.machine.learning.deep.
Mustofa, Dinar, Dhanar Intan Surya Saputra, and Satyo Dwi Apitiadi. 2025. “Analisis Kinerja Kualitas Layanan Jaringan Internet Dengan HTB Dan OLT Menggunakan Wireshark Di Media Computindo.” Jurnal Pendidikan Dan Teknologi Indonesia 5(11):3051–60. doi:10.52436/1.jpti.911.
Rahman, Rakhmadi, Abriel Yosua Nathanael Leksona, and Afiqah. 2025. “Serangan Man-In-The-Middle (MITM) Di Jaringan Publik: Studi Dan Solusi Simulasi Serangan Password Cracking Menggunakan Hydra ).” Jejak Digital Jurnal Ilmiah Multidisplin 1(4b):2145–56. https://doi.org/10.63822/np7skj98.
Rakhmadi Rahman; Ghina R.S Odja. 2024. “Technology Sciences Insights Journal.” d:0–3.
Soepeno, Ryufath Alief Adhyaksa Putera. 2023. “Wireshark: An Effective Tool for Network Analysis.” CYBV - Introductory Methods of Network Analysis (September):1–15. https://www.researchgate.net/publication/374675769_Wireshark_An_Effective_Tool_for_Network_Analysis.
Syafrizal, M. Afdal, and Rice Novita. 2024. “Sentiment Analysis of PLN Mobile Application Review Using Naïve Bayes Classifier and K-Nearest Neighbor Algorithm.” MALCOM: Indonesian Journal of Machine Learning and Computer Science 4(January):10–19.
Syahril Dwi Prasetyo, Shofa Shofiah Hilabi, and Fitri Nurapriani. 2023. “Analisis Sentimen Relokasi Ibukota Nusantara Menggunakan Algoritma Naïve Bayes Dan KNN.” Jurnal KomtekInfo 10:1–7. doi:10.35134/komtekinfo.v10i1.330.
Syaiful Haq, Muh. 2025. “Analisis Keamanan Jaringan Nirkabel Dari Packet Sniffing Pada Kantor Dinas Penanaman Modal Dan Pelayanan Terpadu Satu Pintu Kota Palopo.” Jurnal Ilmu Komputer 1(2). https://e-journal.my.id/Peripheral/index.
Tan, Feiliana, and Ali Akbar. 2021. “Sistem Informasi Pemetaan Wifi Gratis Diskominfo Kabupaten Hulu Sungai Selatan.” Jurnal Pranala 16(1):19–26
Published
2026-07-01
How to Cite
nugraha, ahmad, aryanti, aryanti, & anugraha, nurhajar. (2026). Pendekatan Machine Learning untuk Deteksi Serangan Man-in-the-Middle Menggunakan K-Nearest Neighbor. JIIFKOM (Jurnal Ilmiah Informatika Dan Komputer), 5(2), 103-110. https://doi.org/https://doi.org/10.51901/jiifkom.v5i02.742
Section
Articles