CN114692148A - 一种基于机器学习的恶意代码检测方法 - Google Patents
一种基于机器学习的恶意代码检测方法 Download PDFInfo
- Publication number
- CN114692148A CN114692148A CN202210343446.9A CN202210343446A CN114692148A CN 114692148 A CN114692148 A CN 114692148A CN 202210343446 A CN202210343446 A CN 202210343446A CN 114692148 A CN114692148 A CN 114692148A
- Authority
- CN
- China
- Prior art keywords
- tzhd
- mat
- sample
- malicious code
- code detection
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 19
- 238000010801 machine learning Methods 0.000 title claims abstract description 13
- 238000012549 training Methods 0.000 claims abstract description 19
- 238000004422 calculation algorithm Methods 0.000 claims abstract description 16
- 239000013598 vector Substances 0.000 claims abstract description 16
- 238000000034 method Methods 0.000 claims abstract description 10
- 230000003068 static effect Effects 0.000 claims abstract description 9
- 238000003066 decision tree Methods 0.000 claims abstract description 7
- 238000013135 deep learning Methods 0.000 claims abstract description 7
- 238000007637 random forest analysis Methods 0.000 claims abstract description 7
- 238000000605 extraction Methods 0.000 claims abstract description 6
- 238000012545 processing Methods 0.000 claims abstract description 6
- 238000013528 artificial neural network Methods 0.000 claims abstract description 4
- 239000011159 matrix material Substances 0.000 claims description 21
- 238000013527 convolutional neural network Methods 0.000 claims description 9
- 230000008569 process Effects 0.000 claims description 6
- 230000009467 reduction Effects 0.000 claims description 4
- 238000005516 engineering process Methods 0.000 description 4
- 241000700605 Viruses Species 0.000 description 3
- 230000000694 effects Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 241000272201 Columbiformes Species 0.000 description 1
- 208000025174 PANDAS Diseases 0.000 description 1
- 208000021155 Paediatric autoimmune neuropsychiatric disorders associated with streptococcal infection Diseases 0.000 description 1
- 240000000220 Panda oleosa Species 0.000 description 1
- 235000016496 Panda oleosa Nutrition 0.000 description 1
- 230000002411 adverse Effects 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 235000012054 meals Nutrition 0.000 description 1
- 230000035772 mutation Effects 0.000 description 1
- 230000002085 persistent effect Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/50—Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
- G06F21/55—Detecting local intrusion or implementing counter-measures
- G06F21/56—Computer malware detection or handling, e.g. anti-virus arrangements
- G06F21/566—Dynamic detection, i.e. detection performed at run-time, e.g. emulation, suspicious activities
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/214—Generating training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/53—Decompilation; Disassembly
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Software Systems (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Computer Security & Cryptography (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Life Sciences & Earth Sciences (AREA)
- Artificial Intelligence (AREA)
- Molecular Biology (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Biomedical Technology (AREA)
- Computer Hardware Design (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Virology (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Biology (AREA)
- Image Analysis (AREA)
Abstract
本发明公开了一种基于机器学习的恶意代码检测方法,包括以下步骤:1)采用基于静态分析的特征提取手段,根据Android系统APP的APK样本提取特征;2)特征数据处理,将特征向量构成TZHD‑Mat样本库;3)模型训练;以Matlab环境为平台,将APK样本TZHD‑Mat灰度值图片作为训练集输入,训练和调试深度学习神经网络参数以及随机森林算法决策树,获得最终的恶意代码检测模型。本发明方法和传统的经典机器学习算法相比,显著地提高了检测效率和模型可靠性。
Description
技术领域
本发明涉及信息安全技术,尤其涉及一种基于机器学习的恶意代码检测方法。
背景技术
大数据信息时代我们有了足不出户便可购物的手机网上商城;彰显个性与分享生活的多元化社交网络APP;便捷生活每一处的打车、点餐、导航、租借应用等APP软件。但是这些便捷的软件系统后台也提取了用户海量的个人信息,才能做到对我们的人性化服务,与此同时,用户的个人信息安全也受到严峻挑战。并且随着人类智能工业技术水平稳步提升,智能终端设备的外观、材料、功能等日益多元化,以及众多硬件技术指标都达到了较高水准,因而智能终端设备的普及率迅速增加。著名的数据预测公司Graner预测到2019年年底,全球将有40亿部电脑、平板电脑以及智能手机使用Android系统,这将使其成为了一个占主导地位的智能终端平台,抢占整个智能终端市场约三分之二的份额。但是由于Android系统的开放性,它也成为了众多恶意代码开发者的活跃地盘。由于恶意代码的数量和种类越来越多,加上代码混淆、代码变异、加密等技术的兴起,使得恶意代码检测变得越来越困难。一种名为WannaCry的“蠕虫”勒索病毒肆虐全球,使全球很多高等院校、科研机构、银行以及证券机构均受到严重攻击,带来了全球性的互联网灾难。WannaCry勒索病毒是继“灰鸽子”和“熊猫烧香”以来,影响力最大的病毒之一。更有些威胁性较大的恶意代码,甚至是利用了系统的漏洞,来实施恶意攻击。例如前段时间席卷全球的“永恒之蓝”勒索病毒,就是利用了计算机网络通信端口的漏洞。
所以,人工智能大数据时代,人们的生活因为有了互联网技术、有了数据分享、有了云计算而变得更加的智能便捷,但是个人的信息安全将面临严峻的挑战。因此研究一种检测未知恶意代码的技术显得尤为重要。
发明内容
本发明要解决的技术问题在于针对现有技术中的缺陷,提供一种基于机器学习的恶意代码检测方法。
本发明解决其技术问题所采用的技术方案是:一种基于机器学习的恶意代码检测方法,包括以下步骤:
1)采用基于静态分析的特征提取手段,根据Android系统APP的APK样本提取特征;
具体过程如下:(静态分析特征提取技术OPNG)
1.1)由APKTool APK编译工具对APK样本文件进行反编译;
1.2)采用基于N-Gram的算法对反编译获取的Smali文件特征数据提取特征向量;
2)特征数据处理;将特征向量构成TZHD-Mat样本库;
2.1)特征动作列向量转换为矩阵形式,即将样本特征数据列向量X=(x1,x2,x3,...xN)T转化为M×N格式的矩阵;
2.2)采用SVD奇异值矩阵降维算法,将原始M×N维TZHD-Mat矩阵压缩为6×6维TZHD-Mat矩阵;
2.3)将6×6维TZHD-Mat特征矩阵转化为TZHD-Mat灰度值图片,即样本特征灰度值图片;
2.4)将样本特征灰度值图片作为APK样本的TZHD-Mat图像,构成TZHD-Mat样本库;
3)模型训练;
以Matlab环境为平台,训练和调试深度学习神经网络参数以及随机森林算法决策树;
具体过程为:
将APK样本TZHD-Mat灰度值图片作为训练集,对卷积神经网络进行迭代训练、调优网络参数,当最终正确分类识别率达到了0.99或迭代次数超过设定次数时停止迭代。
按上述方案,所述步骤1.2)中提取特征向量为结合Dalvikcodes的指令特征进行N-Gram处理,获得静态分析特征。
按上述方案,所述步骤3)中卷积神经网络为Caffe深度学习框架下的卷积神经网络。
按上述方案,所述步骤3)中网络参数包括学习率。
本发明产生的有益效果是:
本发明方法和传统的经典机器学习算法相比,显著地提高了检测效率和模型可靠性。
附图说明
下面将结合附图及实施例对本发明作进一步说明,附图中:
图1是本发明实施例的方法流程图。
具体实施方式
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本发明,并不用于限定本发明。
如图1所示,一种基于机器学习的恶意代码检测方法,包括以下步骤:
1)采用基于静态分析的特征提取手段,根据Android系统APP的APK样本提取特征;
具体过程如下:
1.1)由APKTool APK编译工具对APK样本文件进行反编译;
1.2)采用基于N-Gram的算法对反编译获取的Smali文件特征数据提取特征向量;
在采用静态分析特征集提取特征向量时,为提高特征集的细粒度,根据N-Gram在恶意代码检测的应用,并结合Dalvikcodes的指令特征,采用静态分析特征提取技术OPNG(opcode-N-gram);
2)特征数据处理,将特征向量构成TZHD-Mat样本库;
2.1)特征动作列向量转换为矩阵形式,即将样本特征数据列向量X=(x1,x2,x3,...xN)T转化为M×N格式的矩阵;
2.2)采用SVD奇异值矩阵降维算法,将原始M×N维TZHD-Mat矩阵压缩为6×6维TZHD-Mat矩阵;
步骤2.1)-2.2),针对原始TZHD-Mat图像检测效果不佳的特点,采用SVD奇异值矩阵降维算法,将原始60×35维TZHD-Mat矩阵压缩为6×6维TZHD-Mat矩阵,消除了冗余信息造成的不良影响,更好体现了数据的核心特征,不仅提高了样本的训练速度,还提高了最终模型的检测精度;
2.3)将6×6维TZHD-Mat特征矩阵转化为TZHD-Mat灰度值图片,即样本特征灰度值图片;
2.4)将样本特征灰度值图片作为APK样本的TZHD-Mat图像,构成TZHD-Mat样本库;
3)模型训练;
以Matlab环境为平台,将APK样本TZHD-Mat灰度值图片作为训练集输入,训练和调试深度学习神经网络参数以及随机森林算法决策树;
具体过程为:
将APK样本TZHD-Mat灰度值图片作为训练集,对卷积神经网络进行迭代训练、调优网络参数,采用随机森林算法决策树进行分类,当最终正确分类识别率达到了0.99或迭代次数超过设定次数时停止迭代,网络参数包括学习率和动量。
利用Caffe深度学习框架下的卷积神经网络在图像分类识别领域高效率的特点,将大量的APK样本TZHD-Mat图片对卷积神经网络进行迭代训练、调优网络参数、最后采用随机森林算法决策树进行识别,最终正确识别率达到了0.99。
应当理解的是,对本领域普通技术人员来说,可以根据上述说明加以改进或变换,而所有这些改进和变换都应属于本发明所附权利要求的保护范围。
Claims (4)
1.一种基于机器学习的恶意代码检测方法,其特征在于,包括以下步骤:
1)采用基于静态分析的特征提取手段,根据Android系统APP的APK样本提取特征;
具体过程如下:
1.1)由APKTool APK编译工具对APK样本文件进行反编译;
1.2)采用基于N-Gram的算法对反编译获取的Smali文件特征数据提取特征向量;
2)特征数据处理,将特征向量构成TZHD-Mat样本库;
2.1)特征动作列向量转换为矩阵形式,即将样本特征数据列向量X=(x1,x2,x3,...xN)T转化为M×N格式的矩阵;
2.2)采用SVD奇异值矩阵降维算法,将原始M×N维TZHD-Mat矩阵压缩为6×6维TZHD-Mat矩阵;
2.3)将6×6维TZHD-Mat特征矩阵转化为TZHD-Mat灰度值图片,即样本特征灰度值图片;
2.4)将样本特征灰度值图片作为APK样本的TZHD-Mat图像,构成TZHD-Mat样本库;
3)模型训练;
以Matlab环境为平台,将APK样本TZHD-Mat灰度值图片作为训练集输入,训练和调试深度学习神经网络参数以及随机森林算法决策树,获得最终的恶意代码检测模型;
具体过程为:
将APK样本TZHD-Mat灰度值图片作为训练集,对卷积神经网络进行迭代训练、调优网络参数,采用随机森林算法决策树进行分类,当最终正确分类识别率达到了0.99或迭代次数超过设定次数时停止迭代。
2.根据权利要求1所述的基于机器学习的恶意代码检测方法,其特征在于,所述步骤1.2)中提取特征向量为结合Dalvikcodes的指令特征进行N-Gram处理,获得静态分析特征。
3.根据权利要求1所述的基于机器学习的恶意代码检测方法,其特征在于,所述步骤3)中卷积神经网络为Caffe深度学习框架下的卷积神经网络。
4.根据权利要求1所述的基于机器学习的恶意代码检测方法,其特征在于,所述步骤3)中网络参数包括学习率。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210343446.9A CN114692148B (zh) | 2022-03-31 | 2022-03-31 | 一种基于机器学习的恶意代码检测方法 |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210343446.9A CN114692148B (zh) | 2022-03-31 | 2022-03-31 | 一种基于机器学习的恶意代码检测方法 |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114692148A true CN114692148A (zh) | 2022-07-01 |
CN114692148B CN114692148B (zh) | 2024-04-26 |
Family
ID=82140800
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210343446.9A Active CN114692148B (zh) | 2022-03-31 | 2022-03-31 | 一种基于机器学习的恶意代码检测方法 |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114692148B (zh) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105205396A (zh) * | 2015-10-15 | 2015-12-30 | 上海交通大学 | 一种基于深度学习的安卓恶意代码检测系统及其方法 |
CN106096405A (zh) * | 2016-04-26 | 2016-11-09 | 浙江工业大学 | 一种基于Dalvik指令抽象的Android恶意代码检测方法 |
US20190065746A1 (en) * | 2017-08-25 | 2019-02-28 | Drexel University | Light-Weight Behavioral Malware Detection for Windows Platforms |
US20200106788A1 (en) * | 2018-01-23 | 2020-04-02 | Hangzhou Dianzi University | Method for detecting malicious attacks based on deep learning in traffic cyber physical system |
CN111832019A (zh) * | 2020-06-10 | 2020-10-27 | 国家计算机网络与信息安全管理中心 | 基于生成对抗网络的恶意代码检测方法 |
CN111931179A (zh) * | 2020-08-13 | 2020-11-13 | 北京理工大学 | 基于深度学习的云端恶意程序检测系统及方法 |
-
2022
- 2022-03-31 CN CN202210343446.9A patent/CN114692148B/zh active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105205396A (zh) * | 2015-10-15 | 2015-12-30 | 上海交通大学 | 一种基于深度学习的安卓恶意代码检测系统及其方法 |
CN106096405A (zh) * | 2016-04-26 | 2016-11-09 | 浙江工业大学 | 一种基于Dalvik指令抽象的Android恶意代码检测方法 |
US20190065746A1 (en) * | 2017-08-25 | 2019-02-28 | Drexel University | Light-Weight Behavioral Malware Detection for Windows Platforms |
US20200106788A1 (en) * | 2018-01-23 | 2020-04-02 | Hangzhou Dianzi University | Method for detecting malicious attacks based on deep learning in traffic cyber physical system |
CN111832019A (zh) * | 2020-06-10 | 2020-10-27 | 国家计算机网络与信息安全管理中心 | 基于生成对抗网络的恶意代码检测方法 |
CN111931179A (zh) * | 2020-08-13 | 2020-11-13 | 北京理工大学 | 基于深度学习的云端恶意程序检测系统及方法 |
Non-Patent Citations (1)
Title |
---|
陈铁明;杨益敏;陈波;: "Maldetect:基于Dalvik指令抽象的Android恶意代码检测系统", 计算机研究与发展, no. 10, 15 October 2016 (2016-10-15) * |
Also Published As
Publication number | Publication date |
---|---|
CN114692148B (zh) | 2024-04-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Li et al. | Deeppayload: Black-box backdoor attack on deep learning models through neural payload injection | |
Xu et al. | Hierarchical bidirectional RNN for safety-enhanced B5G heterogeneous networks | |
Jian et al. | A novel framework for image-based malware detection with a deep neural network | |
Yuan et al. | Stealthy porn: Understanding real-world adversarial images for illicit online promotion | |
Kong et al. | A survey on adversarial attack in the age of artificial intelligence | |
Yin et al. | Deep learning-aided OCR techniques for Chinese uppercase characters in the application of Internet of Things | |
US11444978B1 (en) | Machine learning-based system for detecting phishing websites using the URLS, word encodings and images of content pages | |
US11438377B1 (en) | Machine learning-based systems and methods of using URLs and HTML encodings for detecting phishing websites | |
CN112688928A (zh) | 结合自编码器和wgan的网络攻击流量数据增强方法及系统 | |
CN113420294A (zh) | 基于多尺度卷积神经网络的恶意代码检测方法 | |
Ling-Zi et al. | A case study of text-based CAPTCHA attacks | |
CN116010947A (zh) | 一种基于异质网络的Android恶意软件检测方法 | |
Priyadarshini et al. | Internet memes: a novel approach to distinguish humans and bots for authentication | |
CN112383518A (zh) | 一种僵尸网络检测方法及装置 | |
Ding et al. | Image steganography based on artificial immune in mobile edge computing with internet of things | |
ALfouzan et al. | A systematic approach for malware URL recognition | |
Wei et al. | Calibrating Network Traffic with One‐Dimensional Convolutional Neural Network with Autoencoder and Independent Recurrent Neural Network for Mobile Malware Detection | |
Naim et al. | Malicious website identification using design attribute learning | |
Thaler et al. | Deep learning in information security | |
Atri et al. | De-CAPTCHA: A novel DFS based approach to solve CAPTCHA schemes | |
CN114282258A (zh) | 截屏数据脱敏方法、装置、计算机设备及存储介质 | |
CN114692148B (zh) | 一种基于机器学习的恶意代码检测方法 | |
Liu et al. | Malware detection method based on image analysis and generative adversarial networks | |
Liu et al. | Malicious URL Detection via Pretrained Language Model Guided Multi-Level Feature Attention Network | |
Peng et al. | A Survey of Security Protection Methods for Deep Learning Model |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |