网络出版日期: 2025-01-25
基金资助
国家重点研发项目(2021YFB3101403)
版权
Detection method for DoH tunnel traffic in backbone networks based on unidirectional flow features
Online published: 2025-01-25
Copyright
DoH使用加密的HTTPS连接来隐藏DNS查询和响应的流量,以解决传统DNS的安全问题。然而,攻击者也利用此特性实施DoH隧道攻击。目前,检测DoH隧道流量的方法主要是基于TLS指纹检测方法和基于双向流特征的机器学习方法。但是,由于主干网场景中非对称路由的广泛使用及TLS指纹的可改变性,上述2种方法不适用于主干网。针对以上问题,设计了一种面向主干网的基于单向流特征的DoH隧道流量检测方法,该方法从单向流量中快速提取精简的流量特征,通过机器学习构建检测模型,并对3种分类器的检测效果进行评估。结果显示,XGB算法性能最佳,即使攻击者增大查询时间间隔以规避检测,其各项指标均不低于99.75%。与类似方法的比较结果表明,本方法在具有相似检测准确率的情况下具有更快的特征提取速度。总体来说,本方法能够在主干网中快速有效地检测DoH隧道流量。
关键词: DNS over HTTPS; DoH隧道攻击; 主干网; 加密流量检测; 单向流特征
吴桦 , 全婧文 , 江初晴 , 杜加加 . 基于单向流特征的主干网DoH隧道流量检测方法[J]. 网络空间安全科学学报, 2024 , 2(6) : 110 -122 . DOI: 10.20172/j.issn.2097-3136.240608
DoH utilizes the encrypted HTTPS connections to conceal the traffic of DNS queries and responses, addressing security concerns in traditional DNS. However, attackers also leverage this feature to carry out the DoH tunneling attacks. Currently, the DoH tunnel traffic detection methods mainly involve the detection approaches based on TLS fingerprint and the machine learning approaches based on bidirectional flow features. Nevertheless, these approaches are unsuitable for backbone networks due to the widespread use of asymmetric routing in such scenarios, as well as the changeable nature of TLS fingerprints. To address these issues, a unidirectional flow feature-based detection method for DoH tunnel traffic was proposed specifically tailored for backbone networks. The method could rapidly extract the concise traffic features from unidirectional flows and construct a detection model using machine learning. The performance of three classifiers was evaluated with the XGB algorithm demonstrating the best performance. Even when attackers increased the query intervals to evade detection, the performance metrics of the XGB classifier remained above 99.75%. The proposed method had faster feature extraction speed than comparable methods while with a similar detection accuracy. In summary, this method could quickly and effectively detected the DoH tunnel traffic in backbone networks.
表 1 基于特征重要性算法的特征选择结果Table 1 Feature selection results based on feature importance algorithm |
| 特征 | 描述 |
| Total_Fwd_Packet | 在正向上发送包的数量 |
| Fwd_IAT_Mean | 在正向上发送的两个包之间的平均时间 |
| Fwd_IAT_Std | 在正向上发送的两个包之间的时间的标准差 |
| Fwd_IAT_Max | 在正向上发送的两个包之间的最大时间 |
| Fwd_IAT_Min | 在正向上发送的两个包之间的最小时间 |
| Fwd_Packets/s | 每秒正向包的数量 |
表 2 MAWI主干网流量与不同DoH隧道流量的混合数据集Table 2 Mixed dataset of MAWI backbone network traffic and different DoH tunnel traffic |
| 数据集 | 数据流条数 | MAWI数据流条数 | DoH隧道数据流条数 | 用途 |
| MAWI-CIC-dns2tcp | (90%) | (10%) | 75%训练 25%测试 | |
| MAWI-CIC-DNSCat2 | (90%) | (10%) | 75%训练 25%测试 | |
| MAWI-CIC-Iodine | (90%) | (10%) | 75%训练 25%测试 | |
| MAWI-DoHTunnel-C2 | (90%) | (10%) | 75%训练 25%测试 | |
| MAWI-DoHTunnel-DNSExfiltrator | (90%) | (10%) | 75%训练 25%测试 | |
| MAWI-DoHTunnel-godoh | (90%) | (10%) | 75%训练 25%测试 |
表 3 MAWI主干网流量与所有DoH隧道流量的混合数据集Table 3 Mixed dataset of MAWI backbone network traffic and all DoH tunnel traffic |
| 数据集 | 数据流条数 | MAWI数据流条数 | DoH隧道数据流条数 |
| MAWI-DoH1 | (89%) | (11%) | |
| MAWI-DoH2 | (89%) | (11%) |
表 4 MAWI-DoH1训练的机器学习模型检测结果Table 4 Detection results of machine learning model trained on MAWI-DoH1 |
| 分类器 | Precision | Recall | F1-score | Accuracy |
| RF | 99.91% | 99.91% | 99.91% | 99.91% |
| KNN | 98.04% | 98.00% | 98.02% | 98.00% |
| XGB | 99.99% | 99.99% | 99.99% | 99.99% |
表 5 MAWI-DoH2训练的机器学习模型检测结果Table 5 Detection results of the machine learning model trained on MAWI-DoH2 |
| 分类器 | Precision | Recall | F1-score | Accuracy |
| RF | 99.68% | 99.68% | 99.68% | 99.68% |
| KNN | 95.71% | 95.81% | 95.51% | 95.81% |
| XGB | 99.99% | 99.99% | 99.99% | 99.99% |
表 6 对不同种类DoH隧道流量的检测结果Table 6 Detection results for different types of DoH tunnel traffic |
| 数据集 | Precision | Recall | F1-score | Accuracy |
| MAWI-CIC- dns2tcp | 100% | 100% | 100% | 100% |
| MAWI-CIC-DNSCat2 | 99.93% | 99.93% | 99.93% | 99.93% |
| MAWI-CIC- Iodine | 99.88% | 99.88% | 99.88% | 99.88% |
| MAWI-DoHTunnel-C2 | 99.76% | 99.76% | 99.76% | 99.76% |
| MAWI-DoH Tunnel-DNSExfiltrator | 100% | 100% | 100% | 100% |
| MAWI-DoH Tunnel-godoh | 99.88% | 99.88% | 99.88% | 99.88% |
表 7 不同DoH查询时间间隔产生的数据集信息Table 7 Information about the datasets generated with different DoH query intervals |
| 数据集 | DoH查询时间 间隔/ms | MAWI数据 流条数 | DoH隧道 流条数 |
| M-DNSExfiltrator-20 | 20 | 173(10%) | |
| M-DNSExfiltrator-500 | 500 | 145(10%) | |
| M-DNSExfiltrator- | 161(10%) | ||
| M-DNSExfiltrator- |
表 8 基于RF使用不同DoH查询时间间隔的检测结果Table 8 Detection results based on RF using different DoH query intervals |
| 时间间隔/ms | Precision | Recall | F1-score | Accuracy |
| 20 | 100% | 100% | 100% | 100% |
| 500 | 100% | 100% | 100% | 100% |
| 100% | 100% | 100% | 100% | |
| 99.96% | 99.96% | 99.96% | 99.96% |
表 9 基于XGB使用不同DoH查询时间间隔的检测结果Table 9 Detection results based on XGB using different DoH query intervals |
| 时间间隔/ms | Precision | Recall | F1-score | Accuracy |
| 20 | 100% | 100% | 100% | 100% |
| 500 | 100% | 100% | 100% | 100% |
| 99.75% | 99.75% | 99.75% | 99.75% | |
| 99.96% | 99.96% | 99.96% | 99.96% |
表 10 基于双向流特征和单向流特征的对比检测结果Table 10 Comparison detection results based on bidirectional and unidirectional flow features |
| 特征 | Precision | Recall | F1-score | Accuracy |
| 双向流 | 99.10% | 99.10% | 99.09% | 99.10% |
| 单向流 | 99.99% | 99.99% | 99.99% | 99.99% |
| 1 |
FOUCHEREAU R. 2021 Global DNS threat report[R]. https://www.efficientip.com/resources/idc-dns-threat-report-2021/.
|
| 2 |
STEADMAN J,SCOTT-HAYWARD S. Detecting data exfiltration over encrypted DNS[C]//2022 IEEE 8th International Conference on Network Softwarization (NetSoft). IEEE,2022:429-437.
|
| 3 |
HU Z,ZHU L,HEIDEMANN J,et al. RFC 7858,DNS over TLS(DoT)[S]. IETF,2016:1-19.
|
| 4 |
LU C Y,LIU B J,LI Z,et al. An end-to-end,large-scale measurement of DNS-over-encryption:how far have we come[C]//Proceedings of the Internet Measurement Conference (IMC '19). 2019:22-35.
|
| 5 |
BOTTGER T ,CUADRADE F ,ANTICHI G,et al. An empirical study of the cost of DNS-over-HTTPS. [C]//Proceedings of the Internet Measurement Conference (IMC '19). 2019:15-21.
|
| 6 |
BORGOLTE K,CHATTOPADHYAY T,FEAMSTER N,et al. How DNS over https is reshaping privacy,performance,and policy in the internet ecosystem[C]//TPRC47:The 47th Research Conference on Communication,Information and Internet Policy. 2019:1-6.
|
| 7 |
LYU M, GHARAKHERILI H H, SIVARAMAN V. A survey on DNS encryption: current development, malware misuse, and inference techniques[J]. ACM Computing Surveys, 2022, (162): 1- 28.
|
| 8 |
HU G, FUKUDA K. Characterizing privacy leakage in encrypted DNS traffic[J]. IEICE Transactions on Communications, 2023, 106 (2): 156- 165.
|
| 9 |
BUSHART J,ROSSOW C. Padding ain't enough:assessing the privacy guarantees of encrypted DNS[C]// USENIX Security Symposium. 2020:1-6.
|
| 10 |
NIAKANLAHIJI A, ORLOWSKI S, VAHID A, et al. Toward practical defense against traffic analysis attacks on encrypted DNS traffic[J]. Computers & Security, 2023, 124, 103001.
|
| 11 |
WANG B,XIONG G,FU P,et al. A two-stage method for fine-grained DNS covert tunnel behavior detection[C]//Science of Cyber Security:4th International Conference,2022:201-216.
|
| 12 |
ZHAN M, LI Y, YU G, et al. Detecting DNS over HTTPS based data exfiltration[J]. Computer Networks, 2022, 209, 108919.
|
| 13 |
MONTAZERISHATOORI M,DAVIDSON L,KAUR G,et al. Detection of DOH tunnels using time-series classification of encrypted traffic[C]//2020 IEEE Intl Conf on Dependable,Autonomic and Secure Computing,Intl Conf on Pervasive Intelligence and Computing,Intl Conf on Cloud and Big Data Computing,Intl Conf on Cyber Science and Technology Congress (DASC/PiCom/CBDCom/CyberSciTech). IEEE,2020:63-70.
|
| 14 |
JAFAR M T,Al-FAWAREH M,Al-HRAHSHEH Z,et al. Analysis and investigation of malicious DNS queries using CIRA-CIC-DoHBrw-2020 dataset[J]. Manchester Journal of Artificial Intelligence and Applied Sciences (MJAIAS),2021.
|
| 15 |
ZEBIN T, REZVY S, LUO Y. An explainable AI-based intrusion detection system for DNS over HTTPs (DOH) attacks[J]. IEEE Transactions on Information Forensics and Security, 2022, 17, 2339- 2349.
|
| 16 |
BANADAKI Y M, ROBERT S. Detecting malicious DNS over HTTPS traffic in domain name system using machine learning classifiers[J]. Journal of Computer Sciences and Applications, 2020, 8 (2): 46- 55.
|
| 17 |
VEKSHIN D,HYNEK K,CEIJKA T,et al. DoH insight:detecting DNS over HTTPS by machine learning[C]// 15th International Conference on Availability,Reliability and Security. 2020:1-8.
|
| 18 |
KWAN C,JANISZEWSKI P,QIU S,et al. Exploring simple detection techniques for DNS-over-HTTPS tunnels[C]// SIGCOMM '21:ACM SIGCOMM 2021 Conference. ACM,2021:37-42.
|
| 19 |
ABU Al-HAIJA Q, ALOHALY M, ODEH A. A lightweight double-stage scheme to identify malicious DNS over HTTPS traffic using a hybrid learning approach[J]. Sensors, 2023, 23 (7): 3489.
|
| 20 |
NGUYEN T A, PARK M. DoH tunneling detection system for enterprise network using deep learning technique[J]. Applied Sciences, 2022, 12 (5): 2416.
|
| 21 |
WANG Y, SHEN C, HOU D, et al. FF-MR: a DoH-encrypted DNS covert channel detection method based on feature fusion[J]. Applied Sciences, 2022, 12 (24): 12644.
|
| 22 |
JERABEK K,RYSAVY O,BURGETOVA I. Analysis of well-known DNS over HTTPS resolvers[C]//2023 IEEE 13th Annual Computing and Communication Workshop and Conference (CCWC). IEEE,2023:0516-0524.
|
| 23 |
胡斌, 周志洪, 姚立红, 等. 结合报文负载与流指纹特征的恶意流量检测[J]. 计算机工程, 2020, 46 (11): 7.
HU B, ZHOU Z H, YAO L H, et al. Malicious Traffic Detection Combining Features of Packet Payload and Stream Fingerprint[J]. Computer Engineering, 2020, 46 (11): 7.
|
| 24 |
MAWI. Public dataset [EB/OL]. (2024-08-20)http://mawi.wide.ad.jp/mawi/samplepoint-G/2020/, 2020/2023.
MAWI. Public dataset [EB/OL]. (2024-08-20)http://mawi.wide.ad.jp/mawi/samplepoint-G/2020/,2020/2023.
|
/
| 〈 |
|
〉 |