QR Code Phishing Detection Using QR And URL Feature Extraction with Machine Learning
Author
A. Samiha, E Julie Ruth
Abstract
QR codes provide a convenient way to access websites and online services, but they can also be misused to redirect users to phishing websites. Since the destination URL is not directly visible from the QR code image, users may unknowingly access potentially harmful websites. This paper presents a machine learning-based QR Code Phishing Detection System that analyzes both QR code image characteristics and the URL embedded within the QR code. A dataset containing 5,000 labeled URL samples, consisting of 2,515 legitimate and 2,485 phishing samples, is used for developing and evaluating the system. Five QR code features and fifteen URL-based features are extracted and combined to form a 20-feature representation. The data is preprocessed, including TLD encoding, and divided into training and testing sets using an 80:20 split. Four machine learning algorithms, namely Logistic Regression, Decision Tree, Random Forest, and Support Vector Machine, are trained and evaluated using accuracy, precision, recall, F1-score, and ROC-AUC. Random Forest provides the best overall performance, achieving 94.90% accuracy, 97.71% precision, 92.16% recall, 94.85% F1-score, and 98.61% ROC-AUC. The model also achieves a mean accuracy of 95.06% using 5-fold cross-validation. The final system supports QR code image upload and webcam scanning, followed by QR code detection, decoding, feature extraction, and classification. A Python Tkinter-based graphical user interface provides the decoded URL, prediction result, and model performance comparison. The proposed system demonstrates that combining QR image and URL features can provide an effective approach for identifying potentially phishing QR codes.
Keywords
QR Code Security, Phishing Detection, Machine Learning, URL Feature Extraction, Random Forest
Full Text:
Download Paper PDF
References
- Joshi, L. Lloyd, P. Westin, and S. Seethapathy, “Using Lexical Features for Malicious URL Detection—A Machine Learning Approach,” arXiv preprint arXiv:1910.06277, 2019.
- Rafsanjani, N. B. Kamaruddin, H. M. Rusli, and M. Dabbagh, “QsecR: Secure QR Code Scanner According to a Novel Malicious URL Detection Framework,” IEEE Access, vol. 11, pp. 92523–92539, 2023, doi: 10.1109/ACCESS.2023.3291811.
- Rashid, B. Doyle, S. C. Han, and S. Seneviratne, “Phishing URL Detection Generalisation Using Unsupervised Domain Adaptation,” Computer Networks, vol. 245, Art. no. 110398, 2024, doi: 10.1016/j.comnet.2024.110398.
- Trad and A. Chehab, “Detecting Quishing Attacks with Machine Learning Techniques Through QR Code Analysis,” arXiv preprint arXiv:2505.03451, 2025.
- R. Charan and K. D. Thilak, “Detection of Phishing Link and QR Code of UPI Transaction Using Machine Learning,” in 2023 3rd International Conference on Innovative Mechanisms for Industry Applications (ICIMIA), 2023, doi: 10.1109/ICIMIA60377.2023.10426613.
- A. Tamal, M. K. Islam, T. Bhuiyan, A. Sattar, and N. U. Prince, “Unveiling Suspicious Phishing Attacks: Enhancing Detection with an Optimal Feature Vectorization Algorithm and Supervised Machine Learning,” Frontiers in Computer Science, vol. 6, Art. no. 1428013, 2024, doi: 10.3389/fcomp.2024.1428013.
- Mossano, M. F. Veit, T. Länge, B. M. Berens, F. Sharevski, and M. Volkamer, “Development, Evaluation, and Implementation of SEQR—A Usable Secure QR Code Scanner,” in Proceedings of the 2026 CHI Conference on Human Factors in Computing Systems (CHI ’26), Art. no. 1306, pp. 1–33, 2026, doi: 10.1145/3772318.3793213.
- S. Aljabri, H. S. Altamimi, S. A. Albelali, M. Al-Harbi, H. T. Alhuraib, N. K. Alotaibi, A. A. Alahmadi, F. Alhaidari, R. M. A. Mohammad, and K. Salah, “Detecting Malicious URLs Using Machine Learning Techniques: Review and Research Directions,” IEEE Access, vol. 10, pp. 121395–121417, 2022, doi: 10.1109/ACCESS.2022.3222307.
- Reyes-Dorta, P. Caballero-Gil, and C. Rosa-Remedios, “Detection of Malicious URLs Using Machine Learning,” Wireless Networks, vol. 30, pp. 7543–7560, 2024, doi: 10.1007/s11276-024-03700-w.
- Raja, R. Vinodini, and A. Kavitha, “Lexical Features Based Malicious URL Detection Using Machine Learning Techniques,” Materials Today: Proceedings, vol. 47, no. 1, pp. 163–166, 2021, doi: 10.1016/j.matpr.2021.04.041.
Share your valuable work from Social Media Buttons