CN114692148A - 一种基于机器学习的恶意代码检测方法 - Google Patents

一种基于机器学习的恶意代码检测方法 Download PDF

Info

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
Application number
CN202210343446.9A
Other languages
English (en)
Other versions
CN114692148B (zh
Inventor
冯浩
齐翔
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Ship Development and Design Centre
Original Assignee
China Ship Development and Design Centre
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by China Ship Development and Design Centre filed Critical China Ship Development and Design Centre
Priority to CN202210343446.9A priority Critical patent/CN114692148B/zh
Publication of CN114692148A publication Critical patent/CN114692148A/zh
Application granted granted Critical
Publication of CN114692148B publication Critical patent/CN114692148B/zh
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/55Detecting local intrusion or implementing counter-measures
    • G06F21/56Computer malware detection or handling, e.g. anti-virus arrangements
    • G06F21/566Dynamic detection, i.e. detection performed at run-time, e.g. emulation, suspicious activities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/53Decompilation; Disassembly
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning 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)
  • Life Sciences & Earth Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computer Security & Cryptography (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Molecular Biology (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Biophysics (AREA)
  • Computer Hardware Design (AREA)
  • Biomedical Technology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Virology (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)中网络参数包括学习率。
CN202210343446.9A 2022-03-31 2022-03-31 一种基于机器学习的恶意代码检测方法 Active CN114692148B (zh)

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)

* Cited by examiner, † Cited by third party
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 北京理工大学 基于深度学习的云端恶意程序检测系统及方法

Patent Citations (6)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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
Yuan et al. Stealthy porn: Understanding real-world adversarial images for illicit online promotion
Jian et al. A novel framework for image-based malware detection with a deep neural network
Kong et al. A survey on adversarial attack in the age of artificial intelligence
Dash et al. Are ChatGPT and deepfake algorithms endangering the cybersecurity industry? A review
Yin et al. Deep learning-aided OCR techniques for Chinese uppercase characters in the application of Internet of Things
US11336689B1 (en) Detecting phishing websites via a machine learning-based system using URL feature hashes, HTML encodings and embedded images of content pages
Mohan et al. Spoof net: syntactic patterns for identification of ominous online factors
US20210281606A1 (en) Phishing detection methods and systems
US11438377B1 (en) Machine learning-based systems and methods of using URLs and HTML encodings for detecting phishing websites
US11444978B1 (en) Machine learning-based system for detecting phishing websites using the URLS, word encodings and images of content pages
CN112688928A (zh) 结合自编码器和wgan的网络攻击流量数据增强方法及系统
Yuan et al. A novel approach for malicious URL detection based on the joint model
CN113420294A (zh) 基于多尺度卷积神经网络的恶意代码检测方法
IL303460A (en) Method and system for safe deployment of an artificial intelligence model
Priyadarshini et al. Internet memes: a novel approach to distinguish humans and bots for authentication
Xue et al. PTB: Robust physical backdoor attacks against deep neural networks in real world
CN113901465A (zh) 一种基于异质网络的Android恶意软件检测方法
CN112383518A (zh) 一种僵尸网络检测方法及装置
Ding et al. Image steganography based on artificial immune in mobile edge computing with internet of things
Thaler et al. Deep learning in information security
Naim et al. Malicious website identification using design attribute learning
Atri et al. De-CAPTCHA: A novel DFS based approach to solve CAPTCHA schemes
ALfouzan et al. A systematic approach for malware URL recognition

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