《计算机应用》唯一官方网站 ›› 2025, Vol. 45 ›› Issue (3): 864-871.DOI: 10.11772/j.issn.1001-9081.2024030327
陈瑞龙1, 胡涛1(), 卜佑军1, 伊鹏1, 胡先君2, 乔伟2
收稿日期:
2024-03-27
修回日期:
2024-06-04
接受日期:
2024-06-11
发布日期:
2024-07-16
出版日期:
2025-03-10
通讯作者:
胡涛
作者简介:
陈瑞龙(2000—),男,河南鹤壁人,硕士研究生,主要研究方向:网络入侵检测、深度学习基金资助:
Ruilong CHEN1, Tao HU1(), Youjun BU1, Peng YI1, Xianjun HU2, Wei QIAO2
Received:
2024-03-27
Revised:
2024-06-04
Accepted:
2024-06-11
Online:
2024-07-16
Published:
2025-03-10
Contact:
Tao HU
About author:
CHEN Ruilong, born in 2000, M. S. candidate. His research interests include network intrusion detection, deep learning.Supported by:
摘要:
当前,基于深度学习的流量分类模型已广泛应用于加密恶意流量分类,然而深度学习模型所面临的对抗样本攻击问题严重影响了这些模型的检测精度和可用性。因此,提出一种面向加密恶意流量检测模型的堆叠集成对抗防御方法D-SE(Detector-Stacking Ensemble)。D-SE采用堆叠集成学习框架,分为对抗防御层和决策层。对抗防御层用于检测潜在的对抗攻击流量样本,在该层中包括由残差网络(ResNet)、CNN-LSTM、ViT(Vision Transformer)这3种分类器以及多层感知机组成的对抗攻击检测器,多层感知机根据分类器预测概率的分布检测是否发生对抗攻击。为提高检测器的对抗样本检测效果,对检测器进行对抗训练。在决策层中设计一种基于投票和权重机制的联合决策模块,并通过择多判决机制和高权重者优先机制避免最终预测结果过度依赖部分分类器。在USTC-TFC2016数据集上对D-SE进行测试的结果表明:在非对抗环境下,D-SE的准确率达到96%以上;在白盒攻击环境下,D-SE的准确率达到89%以上。可见,D-SE具有一定的对抗防御能力。
中图分类号:
陈瑞龙, 胡涛, 卜佑军, 伊鹏, 胡先君, 乔伟. 面向加密恶意流量检测模型的堆叠集成对抗防御方法[J]. 计算机应用, 2025, 45(3): 864-871.
Ruilong CHEN, Tao HU, Youjun BU, Peng YI, Xianjun HU, Wei QIAO. Stacking ensemble adversarial defense method for encrypted malicious traffic detection model[J]. Journal of Computer Applications, 2025, 45(3): 864-871.
ResNet-18 | CNN-LSTM | Vision Transformer | ||||||
---|---|---|---|---|---|---|---|---|
模块 | 操作 | 层数 | 模块 | 操作 | 层数 | 模块 | 操作 | 层数 |
卷积层1 | Conv2d-3×3,64 | 1 | 卷积层1 | Conv1d-2×2,32 | 2 | 嵌入层 | PatchEmbedding | 1 |
Conv2d-3×3,64 | 4 | 池化层1 | Maxpooling-2×2,32 | 1 | Transformer 编码器 | LayerNorm | 8 | |
池化层1 | Maxpooling-2×2,64 | 1 | 卷积层2 | Conv1d-2×2,64 | 2 | MultiHeadAttention | ||
卷积层2 | Conv2d-3×3,128 | 4 | 池化层2 | Maxpooling-2×2,64 | 1 | Dropout | ||
池化层2 | Maxpooling-2×2,128 | 1 | LSTM | LSTM,64 | 1 | ResidualAdd | ||
卷积层3 | Conv2d-3×3,256 | 4 | 全连接层 | Linear1,32 | 1 | LayerNorm | ||
池化层3 | Maxpooling-2×2,256 | 1 | Linear2+Softmax | 1 | Linear | |||
卷积层4 | Conv2d-3×3,512 | 4 | Dropout | |||||
池化层4 | Maxpooling-2×2,512 | 1 | Linear | |||||
池化层5 | 全局平均池化1×1,1 000 | 1 | Dropout | |||||
全连接层 | Linear+Softmax | 1 | 全连接层 | Linear | 1 |
表1 3种分类器的网络结构
Tab. 1 Network structures of three classifiers
ResNet-18 | CNN-LSTM | Vision Transformer | ||||||
---|---|---|---|---|---|---|---|---|
模块 | 操作 | 层数 | 模块 | 操作 | 层数 | 模块 | 操作 | 层数 |
卷积层1 | Conv2d-3×3,64 | 1 | 卷积层1 | Conv1d-2×2,32 | 2 | 嵌入层 | PatchEmbedding | 1 |
Conv2d-3×3,64 | 4 | 池化层1 | Maxpooling-2×2,32 | 1 | Transformer 编码器 | LayerNorm | 8 | |
池化层1 | Maxpooling-2×2,64 | 1 | 卷积层2 | Conv1d-2×2,64 | 2 | MultiHeadAttention | ||
卷积层2 | Conv2d-3×3,128 | 4 | 池化层2 | Maxpooling-2×2,64 | 1 | Dropout | ||
池化层2 | Maxpooling-2×2,128 | 1 | LSTM | LSTM,64 | 1 | ResidualAdd | ||
卷积层3 | Conv2d-3×3,256 | 4 | 全连接层 | Linear1,32 | 1 | LayerNorm | ||
池化层3 | Maxpooling-2×2,256 | 1 | Linear2+Softmax | 1 | Linear | |||
卷积层4 | Conv2d-3×3,512 | 4 | Dropout | |||||
池化层4 | Maxpooling-2×2,512 | 1 | Linear | |||||
池化层5 | 全局平均池化1×1,1 000 | 1 | Dropout | |||||
全连接层 | Linear+Softmax | 1 | 全连接层 | Linear | 1 |
加密流量类型 | 训练集样本数 | 测试集样本数 |
---|---|---|
Benign traffic | 210 206 | 52 549 |
Cridex | 13 108 | 3 277 |
Geodo | 32 758 | 8 189 |
Htbot | 5 093 | 1 273 |
Miuref | 10 784 | 2 696 |
Neris | 27 032 | 6 758 |
Nsis | 5 140 | 1 285 |
Shifu | 7 707 | 1 926 |
Tinba | 6 803 | 1 700 |
Virut | 26 482 | 6 620 |
Zeus | 8 776 | 2 194 |
表2 USTC-TFC2016数据集信息
Tab. 2 Information of USTC-TFC2016 dataset
加密流量类型 | 训练集样本数 | 测试集样本数 |
---|---|---|
Benign traffic | 210 206 | 52 549 |
Cridex | 13 108 | 3 277 |
Geodo | 32 758 | 8 189 |
Htbot | 5 093 | 1 273 |
Miuref | 10 784 | 2 696 |
Neris | 27 032 | 6 758 |
Nsis | 5 140 | 1 285 |
Shifu | 7 707 | 1 926 |
Tinba | 6 803 | 1 700 |
Virut | 26 482 | 6 620 |
Zeus | 8 776 | 2 194 |
场景编号 | ResNet-18 | ViT | CNN-LSTM | D-SE |
---|---|---|---|---|
1 | 98.61 | 99.52 | 99.21 | 99.65 |
2 | 80.73 | 96.25 | 95.64 | 96.88 |
3 | 82.78 | 96.84 | 96.34 | 97.36 |
4 | 77.13 | 94.92 | 95.70 | 96.86 |
表3 非对抗环境下4个实验场景的准确率对比 (%)
Tab. 3 Accuracy comparison for four experimental scenarios in non-adversarial environment
场景编号 | ResNet-18 | ViT | CNN-LSTM | D-SE |
---|---|---|---|---|
1 | 98.61 | 99.52 | 99.21 | 99.65 |
2 | 80.73 | 96.25 | 95.64 | 96.88 |
3 | 82.78 | 96.84 | 96.34 | 97.36 |
4 | 77.13 | 94.92 | 95.70 | 96.86 |
对抗攻击 | 基于ViT的白盒攻击 | 基于CNN-LSTM的白盒攻击 | ||||||
---|---|---|---|---|---|---|---|---|
ResNet-18 | ViT | CNN-LSTM | D-SE | ResNet-18 | ViT | CNN-LSTM | D-SE | |
Normal | 77.13 | 94.92 | 95.70 | 96.86 | 77.13 | 94.92 | 95.70 | 96.86 |
FGSM | 72.10 | 81.50 | 81.72 | 90.42 | 72.46 | 85.71 | 73.32 | 89.15 |
PGD | 71.75 | 82.16 | 82.13 | 89.57 | 72.02 | 92.61 | 70.36 | 93.68 |
DeepFool | 80.19 | 77.76 | 91.63 | 92.65 | 75.75 | 94.18 | 68.51 | 94.31 |
C&W | 80.00 | 68.19 | 94.64 | 95.28 | 78.95 | 94.22 | 66.23 | 96.64 |
表4 针对分类器的白盒攻击的准确率对比 (%)
Tab. 4 Accuracy comparison of white box attacks aiming at classifiers
对抗攻击 | 基于ViT的白盒攻击 | 基于CNN-LSTM的白盒攻击 | ||||||
---|---|---|---|---|---|---|---|---|
ResNet-18 | ViT | CNN-LSTM | D-SE | ResNet-18 | ViT | CNN-LSTM | D-SE | |
Normal | 77.13 | 94.92 | 95.70 | 96.86 | 77.13 | 94.92 | 95.70 | 96.86 |
FGSM | 72.10 | 81.50 | 81.72 | 90.42 | 72.46 | 85.71 | 73.32 | 89.15 |
PGD | 71.75 | 82.16 | 82.13 | 89.57 | 72.02 | 92.61 | 70.36 | 93.68 |
DeepFool | 80.19 | 77.76 | 91.63 | 92.65 | 75.75 | 94.18 | 68.51 | 94.31 |
C&W | 80.00 | 68.19 | 94.64 | 95.28 | 78.95 | 94.22 | 66.23 | 96.64 |
攻击对象 | ResNet-18 | ViT | CNN-LSTM | D-SE |
---|---|---|---|---|
Normal | 77.10 | 94.95 | 95.43 | 96.86 |
ViT | 74.82 | 82.64 | 91.66 | 94.03 |
CNN-LSTM | 75.17 | 96.22 | 67.93 | 95.81 |
表5 RAP攻击的准确率对比 (%)
Tab. 5 Accuracy comparison of RAP attack
攻击对象 | ResNet-18 | ViT | CNN-LSTM | D-SE |
---|---|---|---|---|
Normal | 77.10 | 94.95 | 95.43 | 96.86 |
ViT | 74.82 | 82.64 | 91.66 | 94.03 |
CNN-LSTM | 75.17 | 96.22 | 67.93 | 95.81 |
模型 | 检测器 | 联合决策模块 | 不同攻击下的准确率 | ||||
---|---|---|---|---|---|---|---|
Normal | FGSM | PGD-20 | DeepFool | C&W | |||
模型0 | √ | √ | 96.86 | 90.42 | 89.57 | 92.65 | 95.28 |
模型1 | × | √ | 98.21 | 59.95 | 58.98 | 69.67 | 77.12 |
模型2 | √ | × | 95.75 | 88.47 | 86.44 | 75.26 | 73.36 |
模型3 | × | × | 95.23 | 53.64 | 52.93 | 54.32 | 62.16 |
表6 消融实验结果 (%)
Tab. 6 Results of ablation experiments
模型 | 检测器 | 联合决策模块 | 不同攻击下的准确率 | ||||
---|---|---|---|---|---|---|---|
Normal | FGSM | PGD-20 | DeepFool | C&W | |||
模型0 | √ | √ | 96.86 | 90.42 | 89.57 | 92.65 | 95.28 |
模型1 | × | √ | 98.21 | 59.95 | 58.98 | 69.67 | 77.12 |
模型2 | √ | × | 95.75 | 88.47 | 86.44 | 75.26 | 73.36 |
模型3 | × | × | 95.23 | 53.64 | 52.93 | 54.32 | 62.16 |
对抗攻击 | D-SE | Def-IDS | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
Accuracy | Precision | Recall | F1 | ASR | Accuracy | Precision | Recall | F1 | ASR | |
FGSM | 90.42 | 98.94 | 77.94 | 87.19 | 19.15 | 87.51 | 96.45 | 77.91 | 86.21 | 22.58 |
PGD | 89.57 | 99.28 | 78.04 | 87.39 | 21.74 | 89.46 | 96.51 | 81.93 | 88.67 | 18.51 |
DeepFool | 92.65 | 99.31 | 89.56 | 94.24 | 9.71 | 87.88 | 96.45 | 78.41 | 86.57 | 21.57 |
C&W | 95.28 | 99.28 | 93.21 | 94.02 | 6.77 | 89.64 | 96.54 | 82.12 | 88.74 | 17.83 |
表7 对比实验结果 (%)
Tab. 7 Results of comparison experiments
对抗攻击 | D-SE | Def-IDS | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
Accuracy | Precision | Recall | F1 | ASR | Accuracy | Precision | Recall | F1 | ASR | |
FGSM | 90.42 | 98.94 | 77.94 | 87.19 | 19.15 | 87.51 | 96.45 | 77.91 | 86.21 | 22.58 |
PGD | 89.57 | 99.28 | 78.04 | 87.39 | 21.74 | 89.46 | 96.51 | 81.93 | 88.67 | 18.51 |
DeepFool | 92.65 | 99.31 | 89.56 | 94.24 | 9.71 | 87.88 | 96.45 | 78.41 | 86.57 | 21.57 |
C&W | 95.28 | 99.28 | 93.21 | 94.02 | 6.77 | 89.64 | 96.54 | 82.12 | 88.74 | 17.83 |
1 | 中国互联网络信息中心. 第52 次中国互联网络发展状况统计报告[R/OL]. [2024-02-14]. . |
China Internet Network Information Center. The 52nd statistical report on Internet development in China[EB/OL]. [2024-02-14]. . | |
2 | IBM. Cost of a data breach report 2022 [R/OL]. [2024-03-13].. |
3 | APRUZZESE G, ANDREOLINI M, FERRETTI L, et al. Modeling realistic adversarial attacks against network intrusion detection systems [J]. Digital Threats: Research and Practice, 2022, 3(3): No.31. |
4 | AHMAD Z, KHAN A S, SHIANG C W, et al. Network intrusion detection system: a systematic study of machine learning and deep learning approaches [J]. Transactions on Emerging Telecommunications Technologies, 2021, 32(1): No.e4150. |
5 | GOODFELLOW I, McDANIEL P, PAPERNOT N. Making machine learning robust against adversarial inputs [J]. Communications of the ACM, 2018, 61(7): 56-66. |
6 | HE K, KIM D D, ASGHAR M R. Adversarial machine learning for network intrusion detection systems: a comprehensive survey [J]. IEEE Communications Surveys and Tutorials, 2023, 25(1): 538-566. |
7 | QIU H, DONG T, ZHANG T, et al. Adversarial attacks against network intrusion detection in IoT systems [J]. IEEE Internet of Things Journal, 2021, 8(13): 10327-10335. |
8 | ZHANG C, COSTA-PÉREZ X, PATRAS P. Adversarial attacks against deep learning-based network intrusion detection systems and defense mechanisms [J]. IEEE/ACM Transactions on Networking, 2022, 30(3): 1294-1311. |
9 | WANG N, CHEN Y, XIAO Y, et al. Manda: on adversarial example detection for network intrusion detection system [J]. IEEE Transactions on Dependable and Secure Computing, 2023, 20(2): 1139-1153. |
10 | DEBICHA I, COCHEZ B, KENAZA T, et al. Adv-Bot: realistic adversarial Botnet attacks against network intrusion detection systems [J]. Computers and Security, 2023, 129: No.103176. |
11 | RUST-NGUYEN N, SHARMA S, STAMP M. Darknet traffic classification and adversarial attacks using machine learning [J]. Computers and Security, 2023, 127: No.103098. |
12 | SUN P, LI S, XIE J, et al. GPMT: generating practical malicious traffic based on adversarial attacks with little prior knowledge [J]. Computers and Security, 2023, 130: No.103257. |
13 | WANG J, PAN J, AlQERM I, et al. Def-IDS: an ensemble defense mechanism against adversarial attacks for deep learning-based network intrusion detection [C]// Proceedings of the 2021 International Conference on Computer Communications and Networks. Piscataway: IEEE, 2021: 1-9. |
14 | VITORINO J, PRAÇA I, MAIA E. SoK: realistic adversarial attacks and defenses for intelligent network intrusion detection [J]. Computers and Security, 2023, 134: No.103433. |
15 | XIONG W D, LUO K L, LI R. AIDTF: adversarial training framework for network intrusion detection [J]. Computers and Security, 2023, 128: No.103141. |
16 | McCARTHY A, GHADAFI E, ANDRIOTIS P, et al. Defending against adversarial machine learning attacks using hierarchical learning: a case study on network traffic attack classification [J]. Journal of Information Security and Applications, 2023, 72: No.103398. |
17 | PUJARI M, CHERUKURI B P, JAVAID A Y, et al. An approach to improve the robustness of machine learning based intrusion detection system models against the Carlini-Wagner attack [C]// Proceedings of the 2022 IEEE International Conference on Cyber Security and Resilience. Piscataway: IEEE, 2022: 62-67. |
18 | MOHANTY H, HAGHIGHIAN ROUDSARI A, LASHKARI A H. Robust stacking ensemble model for darknet traffic classification under adversarial settings [J]. Computers and Security, 2022, 120: No.102830. |
19 | WANG W, ZHU M, WANG J, et al. End-to-end encrypted traffic classification with one-dimensional convolution neural networks[C]// Proceedings of the 2017 IEEE International Conference on Intelligence and Security Informatics. Piscataway: IEEE, 2017: 43-48. |
20 | GOODFELLOW I J, SHLENS J, SZEGEDY C. Explaining and harnessing adversarial examples [EB/OL]. [2023-12-23]. . |
21 | YUAN X, HE P, ZHU Q, et al. Adversarial examples: attacks and defenses for deep learning [J]. IEEE Transactions on Neural Networks and Learning Systems, 2019, 30(9): 2805-2824. |
22 | FRANKLE J, CARBIN M. The lottery ticket hypothesis: finding sparse, trainable neural networks [EB/OL]. [2024-01-23].. |
23 | FU Y, YU Q, ZHANG Y, et al. Drawing robust scratch tickets: Subnetworks with inborn robustness are found within randomly initialized networks [C]// Proceedings of the 35th International Conference on Neural Information Processing Systems. Red Hook: Curran Associates Inc., 2021: 13059-13072. |
24 | DOSOVITSKIY A, BEYER L, KOLESNIKOV A, et al. An image is worth 16x16 words: Transformers for image recognition at scale[EB/OL]. [2023-11-08]. . |
25 | DING Y, ZHU G, CHEN D, et al. Adversarial sample attack and defense method for encrypted traffic data [J]. IEEE Transactions on Intelligent Transportation Systems, 2022, 23(10): 18024-18039. |
26 | 杨有欢,孙磊,戴乐育,等. 使用RAP生成可传输的对抗网络流量[J]. 计算机科学, 2023, 50(12): 359-367. |
YANG Y H, SUN L, DAI L Y, et al. Generate transferable adversarial network traffic using reversible adversarial padding [J]. Computer Science, 2023, 50(12): 359-367. |
[1] | 薛振华, 李强, 黄超. 视觉基础模型驱动的像素级图像异常检测方法[J]. 《计算机应用》唯一官方网站, 2025, 45(3): 823-831. |
[2] | 洪梓榕, 包广清. 基于集成学习的雷达自动目标识别综述[J]. 《计算机应用》唯一官方网站, 2025, 45(2): 371-382. |
[3] | 张众维, 王俊, 刘树东, 王志恒. 多尺度特征融合与加权框融合的遥感图像目标检测[J]. 《计算机应用》唯一官方网站, 2025, 45(2): 633-639. |
[4] | 李严, 叶冠华, 李雅文, 梁美玉. 基于丰度协调技术的企业ESG指标预测模型[J]. 《计算机应用》唯一官方网站, 2025, 45(2): 670-676. |
[5] | 邓淼磊, 阚雨培, 孙川川, 徐海航, 樊少珺, 周鑫. 基于深度学习的网络入侵检测系统综述[J]. 《计算机应用》唯一官方网站, 2025, 45(2): 453-466. |
[6] | 余松森, 林智凡, 薛国鹏, 徐建宇. 基于改进YOLOv8的轻量级大幅面瓷砖缺陷检测算法[J]. 《计算机应用》唯一官方网站, 2025, 45(2): 647-654. |
[7] | 丁丹妮, 彭博, 吴锡. 受腹侧通路启发的脂肪肝超声图像分类方法VPNet[J]. 《计算机应用》唯一官方网站, 2025, 45(2): 662-669. |
[8] | 张天骐, 谭霜, 沈夕文, 唐娟. 融合注意力机制和多尺度特征的图像水印方法[J]. 《计算机应用》唯一官方网站, 2025, 45(2): 616-623. |
[9] | 郑宗生, 杜嘉, 成雨荷, 赵泽骋, 张月维, 王绪龙. 用于红外-可见光图像分类的跨模态双流交替交互网络[J]. 《计算机应用》唯一官方网站, 2025, 45(1): 275-283. |
[10] | 徐欣然, 张绍兵, 成苗, 张洋, 曾尚. 基于多路层次化混合专家模型的轴承故障诊断方法[J]. 《计算机应用》唯一官方网站, 2025, 45(1): 59-68. |
[11] | 梁杰涛, 罗兵, 付兰慧, 常青玲, 李楠楠, 易宁波, 冯其, 何鑫, 邓辅秦. 基于坐标几何采样的点云配准方法[J]. 《计算机应用》唯一官方网站, 2025, 45(1): 214-222. |
[12] | 晏燕, 钱星颖, 闫鹏斌, 杨杰. 位置大数据的联邦学习统计预测与差分隐私保护方法[J]. 《计算机应用》唯一官方网站, 2025, 45(1): 127-135. |
[13] | 张思齐, 张金俊, 王天一, 秦小林. 基于信号时态逻辑的深度时序事件检测算法[J]. 《计算机应用》唯一官方网站, 2025, 45(1): 90-97. |
[14] | 李顺勇, 李师毅, 胥瑞, 赵兴旺. 基于自注意力融合的不完整多视图聚类算法[J]. 《计算机应用》唯一官方网站, 2024, 44(9): 2696-2703. |
[15] | 潘烨新, 杨哲. 基于多级特征双向融合的小目标检测优化模型[J]. 《计算机应用》唯一官方网站, 2024, 44(9): 2871-2877. |
阅读次数 | ||||||
全文 |
|
|||||
摘要 |
|
|||||