To address the limitations of traditional methods in secure shell (SSH) man-in-the-middle attack detection, particularly insufficient generalization capability and low application efficiency, a detection method incorporating temporal features and self-learning mechanisms is proposed. In the method, the feature tokenizer transformer (FT-Transformer) architecture is adopted and time series analysis is integrated with squeeze-and-excitation network(SE-Net) self-learning mechanisms to construct the SAFE-Former detection model. Representative features are constructed from delay ratio and proportion characteristics of negotiation packets by analyzing critical packets during the key exchange and algorithm negotiation phases of SSH connection establishment. The feature tokenization mechanism and SE-Net self-learning mechanism are utilized to capture temporal dependencies and anomalous patterns in protocol interactions, enabling effective differentiation between normal and attack traffic. Experimental results demonstrate that the method achieves an accuracy exceeding 98% on Internet environment test datasets. The effectiveness of the proposed features and model is validated through the ablation studies and multi-model comparative analysis. Compared with existing mainstream approaches, SAFE-Former exhibits significant advantages in SSH man-in-the-middle attack detection.
CONTIM, DRAGONIN, LESYKV. A survey of man in the middle attacks[J]. IEEE Communications Surveys & Tutorials, 2016,18(3):2027-2051.
[2]
MALLIKA, AHSANA, SHAHADATM M Z, et al. Understanding man-in-the-middle-attack through survey of literature[J]. Indonesian Journal of Computing, Engineering and Design, 2019,1(1):44.
[3]
张杰.SSH协议的研究与实现[D].合肥:中国科学技术大学,2002:11-13.
[4]
DEVLINJ, CHANGM W, LEEK,et al. BERT: pre-training of deep bidirectional transformers for language understanding[C]//Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies. Minnesota, USA:Association for Computational Linguistics, 2019:4171-4186.
[5]
HUJ, SHENL, SUNG. Squeeze-and-excitation networks[C]//Proceedings of the 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Piscataway, USA: IEEE, 2018:7132-7141.
GONZÁLEZS, HERREROÁ, SEDANOJ, et al. Different approaches for the detection of SSH anomalous connections[J]. Logic Journal of the IGPL, 2016,24(1):104-114.
[9]
AL-HABABIA, TOKGOZS C. Man-in-the-middle attacks to detect and identify services in encrypted network flows using machine learning[C]//Proceedings of the 3rd International Conference on Advanced Communication Technologies and Networking. Piscataway, USA: IEEE, 2020:1-5.
[10]
KUMARA, SHARMAI, MITTALS, et al. Enhancing security through a machine learning approach to mitigate man-in-the-middle attacks[C]// Proceedings of the 2024 IEEE International Conference for Convergence in Technology. Piscataway, USA: IEEE, 2024:1-6.
[11]
HWANGR H, PENGM C, NGUYENV L, et al. An LSTM-based deep learning approach for classifying malicious traffic at the packet level[J]. Applied Sciences, 2019,9(16):No.3414.
[12]
MANHASS, TATERHS, SINGHD. Deep Q learning-based mitigation of man in the middle attack over secure sockets layer websites[J]. Modern Physics Letters B, 2020,34(32):No.2050366.
BERGSMAF, DOWLINGB, KOHLARF,et al.Multi-ciphersuite security of the secure shell (SSH) protocol[C]// Proceedings of the 2014 ACM SIGSAC Conference on Computer and Communications Security. New York, USA: ACM, 2014:369-381.
LIUC, HEL T, XIONGG, et al. FS-net: a flow sequence network for encrypted traffic classification[C]// Proceedings of the IEEE INFOCOM 2019-IEEE Conference on Computer Communications. Piscataway, USA: IEEE, 2019:1171-1179.
[18]
LOTFOLLAHIM, JAFARI SIAVOSHANIM, SHIRALI HOSSEIN ZADER, et al. Deep packet: a novel approach for encrypted traffic classification using deep learning[J]. Soft Computing, 2020,24(3):1999-2012.
[19]
LINK D, XUX L, GAOH H. TSCRnn: a novel classification scheme of encrypted traffic based on flow spatiotemporal features for efficient management of IIoT[J]. Computer Networks, 2021,190:No.107974.