Key Laboratory of Aerospace Information Security and Trusted Computing,Ministry of Education,School of Cyber Science and Engineering,Wuhan University,Wuhan 430072,Hubei,China
In recent years, work on malware detection has continued to progress, but methods for detecting malicious components inside malware are insufficient. Traditional detection methods based on manual signatures and machine learning are ineffective. Analysts must conduct tedious manual reverse analysis of malicious samples to locate malicious components. To improve the efficiency of reverse analysts, a malicious function anomaly detection method based on binary reconstruction, MalMiner, is proposed, which targets functions with potential malicious behavior inside malware generating interprocedural call graphs from samples and extracting features that can characterize the function, according to the statistical characteristics, structural characteristics and malicious characteristics of the function in the graph. Simultaneously, the characteristics of unsupervised autoencoder model compression and reconstruction are leveraged to understand the data characteristics of normal software functions. The reconstruction error serves as an anomaly score to detect malicious functions. The experimental results show that the recall rate is 0.801 0,and the accuracy rate of MalMiner on the ground truth dataset reaches 0.848 4 . Compared with DeepReflect, the recall rate is the same,and the false positive rate is reduced by 0.157 8,and the accuracy rate increased by 0.145 7. Compared with CAPA, the recall rate is improved by 0.107 1, and the accuracy rate increased by 0.094 2, which verified the effectiveness of the MalMiner method.
现有的内部组件检测方面的研究工作较少,主要有基于自编码器的方法[13]与基于人工签名的方法[14]。Downing等[13]提出了基于二进制重构发现恶意功能的方法DeepReflect,备受学术界关注。该方法基于控制流程图(Control Flow Graph,CFG)提取基本块的特征,使用自编码器模型进行训练和预测,识别可能具有恶意功能的基本块,这些基本块正是分析人员关注的区域(Regions of Interest,ROI),具有多个ROI的函数则可能是具有恶意功能的函数。此外,FLARE团队开发的工具CAPA[14]在工业界受到高度认可。该工具通过人工签名识别样本内部的恶意代码,借助开源社区收集启发式规则,在反汇编样本的基础上,对字节码、字符串、汇编代码、静态结构等特征进行匹配。
本文将特征分为结构特征、统计特征与恶意特征。结构特征代表了函数在样本内部的位置特性,统计特征描述了函数内的局部特点。一些特殊的静态结构在恶意代码中具有较高的出现频率,例如循环、跨函数节跳转、非零异或等,这些“恶意特征”与恶意功能密切关联。由于提取上述特征需要完整的ICFG,因此,本文将这种特征称为带属性的过程间控制流图(Attributed Interprocedural Control Flow Graph,AICFG)特征。
本文的正常程序来自CNET(https://download.cnet.com/windows),包括22种不同类别的PE文件,共有31 678个二进制文件。通过计算文件的MD5哈希值去除数据集中的重复项,确保样本的唯一性。然后使用DIE(https://github.com/horsicq/Detect-It-Easy)检查样本是否加壳,避免被改变了静态特征的加壳程序影响检测效果。此外,还有一些特殊的PE文件需要去除,例如某些PE文件没有函数,本身无法执行任何功能,也没有可提取的函数特征供MalMiner检测;与PE文件格式相似的.NET文件通过Windows的公共语言运行环境(Common Language Runtime,CLR)和.NET框架类库运行,虽然与一般的PE文件结构类似但实际差别极大,因此需要去除。最后,为确保良性数据集中没有恶意程序,通过VirusTotal(https://www.virustotal.com)扫描良性软件,只有当少于3个反病毒引擎的扫描检测结果为恶意时,该软件才被认定为良性的。
本文通过ROC的曲线下方的面积(Area under the Curve,AUC)判断分类模型的优劣:当AUC为0.5时,预测结果近似随机猜测,模型没有预测价值;当AUC小于0.5时,预测结果比随机猜测还差;当AUC大于0.5时,表示分类结果优于随机结果,这时对分类模型设置合适的阈值,模型就有预测价值。
ZHANGY, LIUQ Z, LIT, et al. Research and development of Rootkit[J]. Journal of University of Electronic Science and Technology of China, 2015, 44(4):563-578 (Ch). DOI: 10.3969/j.issn.1001-0548.2015.04.016 .
ZHANGB Y, YINJ P, HAOJ B, et al. Malicious codes detection based on ensemble learning[C]//Autonomic and Trusted Computing: 4th International Conference. Berlin: Springer, 2007: 468-477. DOI: 10.1007/978-3-540-73547-2_48 .
[8]
NAGANOY, UDA R. Static analysis with paragraph vector for malware detection[C]//Proceedings of the 11th International Conference on Ubiquitous Information Management and Communication. New York: ACM, 2017: 1-7. DOI: 10.1145/3022227.3022306 .
YÜCELÇ, KOLTUKSUZA. Imaging and evaluating the memory access for malware[J]. Forensic Science International: Digital Investigation, 2020, 32: 200903. DOI: 10.1016/j.fsidi.2019.200903 .
[11]
RABBANIM, WANGY L, KHOSHKANGINIR, et al. A hybrid machine learning approach for malicious behaviour detection and recognition in cloud computing[J]. Journal of Network and Computer Applications, 2020, 151: 102507. DOI: 10.1016/j.jnca.2019.102507 .
[12]
SHIJOP V, SALIMA. Integrated static and dynamic analysis for malware detection[J]. Procedia Computer Science, 2015, 46: 804-811. DOI: 10.1016/j.procs.2015.02.149 .
[13]
PFEFFERA, RUTTENBERGB, KELLOGGL, et al. Artificial intelligence based malware analysis[EB/OL]. 2017: arXiv: 1704.08716.
[14]
HUDAS, ISLAMR, ABAWAJYJ, et al. A hybrid-multi filter-wrapper framework to identify run-time behaviour for fast malware detection[J]. Future Generation Computer Systems, 2018, 83: 193-207. DOI: 10.1016/j.future.2017.12.037 .
[15]
DOWNINGE, MIRSKYY, PARKK, et al. DeepReflect: Discovering malicious functionality through binary reconstruction[DB/OL].[2022-12-20].
[16]
FIREEYE.CAPA[EB/OL].[2022-08-15].
[17]
HENNESSYJ L, PATTERSOND A. Computer Architecture: A Quantitative Approach[M]. 5th ed iton.Amsterdam:Elsevier, 2011.
[18]
ALLENF E. Control flow analysis[J]. ACM Sigplan Notices, 1970, 5(7): 1-19. DOI: 10.1145/390013.808479 .
[19]
RONNEBERGERO, FISCHERP, BROXT. U-net: Convolutional networks for biomedical image segmentation[C]// Medical Image Computing and Computer-Assisted Intervention―MICCAI 2015: 18th International Conference. Cham: Springer International Publishing, 2015: 234-241. DOI: 10.1007/978-3-319-24574-4_28 .
[20]
BRANDESU. A faster algorithm for betweenness centrality[J]. The Journal of Mathematical Sociology, 2001, 25(2): 163-177. DOI: 10.1080/0022250x.2001.9990249 .
[21]
BAYERU, COMPARETTIP M, HLAUSCHEKC, et al. Scalable, behavior-based malware clustering[DB/OL].[2022-12-12].