WO2022107964A1 - 인접 행렬 기반의 악성 코드 탐지 및 분류 장치와 악성 코드 탐지 및 분류 방법 - Google Patents

인접 행렬 기반의 악성 코드 탐지 및 분류 장치와 악성 코드 탐지 및 분류 방법 Download PDF

Info

Publication number
WO2022107964A1
WO2022107964A1 PCT/KR2020/016939 KR2020016939W WO2022107964A1 WO 2022107964 A1 WO2022107964 A1 WO 2022107964A1 KR 2020016939 W KR2020016939 W KR 2020016939W WO 2022107964 A1 WO2022107964 A1 WO 2022107964A1
Authority
WO
WIPO (PCT)
Prior art keywords
malicious code
source data
api
matrix
code detection
Prior art date
Application number
PCT/KR2020/016939
Other languages
English (en)
French (fr)
Inventor
정수환
응웬부렁
심현석
Original Assignee
숭실대학교 산학협력단
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
Priority claimed from KR1020200160107A external-priority patent/KR102427782B1/ko
Application filed by 숭실대학교 산학협력단 filed Critical 숭실대학교 산학협력단
Priority to US18/020,904 priority Critical patent/US20230306112A1/en
Publication of WO2022107964A1 publication Critical patent/WO2022107964A1/ko

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/562Static detection
    • G06F21/563Static detection by source code analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • 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/554Detecting local intrusion or implementing counter-measures involving event detection and direct action
    • 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

Definitions

  • Malicious code is a computing device or associated A collective term for software designed to cause damage to computer networks. If malicious code exists in the computer, it can damage the data stored in the device or steal the user's personal information and cause economic damage to the user. It is important.
  • One-dimensional convolutional neural networks for Android malware detection by Hasegawa, C. and Iyatomi, H. (IEEE 14th International Colloquium on Signal Processing & Its Applications (IEEE 14th International Colloquium on Signal Processing & Its Applications) CSPA), 2018, pp. 99-102) discloses that a specific part of an APK file is converted into a short string and analysis is performed by applying a convolutional neural network (CNN) to it.
  • CNN convolutional neural network
  • Deep Android Malware Classification with API-Based Feature Graph (18th IEEE International Conference On Trust, Security And Privacy In Computing And Communications/13th IEEE International Conference On Big Data Science And Engineering (TrustCom/BigDataSE), IEEE, 2019) discloses training and classification by applying CNN to an API (Application Programming Interface)-based feature graph.
  • API Application Programming Interface
  • the feature graph used in the present method has a limit that is not sufficient to represent the operation of the app itself.
  • Patent Document 1 Patent Publication No. 10-2012-0105759
  • connection relationship between API Application Programming Interface
  • API Application Programming Interface
  • the connection relationship between API (Application Programming Interface) included in the source code of the program is converted into an adjacent matrix, and this is applied to a machine learning-based analysis model. It is possible to provide a malicious code detection and classification device capable of detecting malicious code by using it as an input value for a malicious code, a malicious code detection and classification method, and a computer program for the same.
  • a malicious code detection and classification device includes a plurality of nodes corresponding to an API (Application Programming Interface) included in the source data from source data and one connecting the plurality of nodes.
  • a graph generating unit configured to generate graph information including an abnormal edge;
  • a matrix generator configured to generate an adjacency matrix between APIs included in the source data by using the graph information;
  • a machine learning unit configured to detect a malicious code included in the source data by using the adjacency matrix as an input value for a machine learning-based analysis model.
  • the graph information is text data written in a graph modeling language (GML).
  • GML graph modeling language
  • the adjacency matrix is a two-dimensional matrix including one or more columns corresponding to an API included in the source data and one or more rows corresponding to an API included in the source data.
  • the matrix generator is configured to generate the adjacency matrix by updating the adjacency matrix in response to the API being executed while sequentially executing the API included in the source data is associated with another API.
  • the machine learning unit configured to activate a region corresponding to the API connected to each other in the adjacency matrix; and an analysis unit configured to classify the adjacency matrix by using the activated region as an input value for the machine learning-based analysis model.
  • the analysis unit is further configured to detect the malicious code by a convolutional neural network (CNN) algorithm using the activated region as an input image.
  • CNN convolutional neural network
  • a malicious code detection and classification device connects a plurality of nodes corresponding to an API included in the source data from source data and between the plurality of nodes. generating graph information including more than one edge; generating, by the malicious code detection and classification device, an adjacency matrix between APIs included in the source data using the graph information; and detecting, by the malicious code detection and classification apparatus, the malicious code included in the source data by using the adjacency matrix as an input value for a machine learning-based analysis model.
  • the generating of the adjacency matrix includes, by the malicious code detection and classification device, one or more columns corresponding to the API included in the source data and one or more rows corresponding to the API included in the source data. and generating a two-dimensional matrix including
  • the generating of the adjacency matrix may include, in the malicious code detection and classification device, sequentially executing the APIs included in the source data in response to the API being executed being associated with another API.
  • the method further includes updating the matrix.
  • the detecting of the malicious code included in the source data may include: activating, by the malicious code detection and classification device, a region corresponding to an API connected to each other in the adjacent matrix by a filter; and classifying, by the malicious code detection and classification apparatus, the neighbor matrix by using the activated region as an input value for the machine learning-based analysis model.
  • the step of classifying the adjacency matrix is performed by a CNN algorithm using the activated region as an input image.
  • the computer program according to an embodiment is combined with hardware to execute the malicious code detection and classification method according to the above-described embodiments, and may be stored in a computer-readable medium.
  • a call graph between API is generated from source data, and each row and column is an API.
  • API Application Programming Interface
  • the apparatus and method for detecting and classifying malicious code it is possible to detect malicious code with a very high detection rate, and furthermore, for some malicious code families, it is possible to detect malicious code with high accuracy, such as 100% analysis accuracy. It has the advantage of being detectable.
  • FIG. 1 is a schematic block diagram illustrating a configuration of an apparatus for detecting and classifying a malicious code according to an embodiment.
  • FIG. 2 is a flowchart illustrating each step of a method for detecting and classifying a malicious code according to an exemplary embodiment.
  • FIG. 3 is a call graph illustrating an API call of source data analyzed by a malicious code detection and classification method according to an embodiment.
  • FIG. 4 is an image illustrating an adjacency matrix generated using the graph information shown in FIG. 3 .
  • FIG. 5 is a conceptual diagram illustrating a process of classifying a malicious code by a convolutional neural network (CNN) in a method for detecting and classifying a malicious code according to an embodiment.
  • CNN convolutional neural network
  • FIG. 1 is a schematic block diagram illustrating a configuration of an apparatus for detecting and classifying a malicious code according to an embodiment.
  • the apparatus 3 for detecting and classifying malicious codes includes a graph generating unit 32 , a matrix generating unit 33 , and a machine learning unit 34 . Also, in an embodiment, the malicious code detection and classification device 3 may further include a transceiver 31 .
  • Each unit of the malicious code detection and classification apparatus 3 may be entirely hardware, or may have aspects that are partly hardware and partly software.
  • each unit of the malicious code detection and classification device 3 shown in FIG. 1 may collectively refer to hardware and related software for processing data in a specific format and content and/or sending/receiving data in an electronic communication method.
  • terms such as “unit”, “module”, “device”, “terminal”, “server” or “system” are intended to refer to a combination of hardware and software run by the hardware.
  • software driven by hardware may refer to a running process, an object, an executable file, a thread of execution, a program, and the like.
  • each element constituting the malicious code detection and classification device 3 is not necessarily intended to refer to separate devices physically separated from each other.
  • the transceiver 31 , the graph generator 32 , the matrix generator 33 , and the machine learning unit 34 of FIG. 1 functionally perform operations executed by the hardware of the malicious code detection and classification device 3 . It is only separated by , and each part does not necessarily have to be provided independently of each other.
  • one or more of the transceiver 31 , the graph generator 32 , the matrix generator 33 , and the machine learning unit 34 may be implemented as separate devices physically separated from each other. do.
  • the transceiver 31 may receive analysis target source data by communicating with the user device 1 or an external server 2 , and/or may provide a detection result for a malicious code. To this end, the transceiver 31 is configured to be able to communicate with the user device 1 and/or the external server 2 through a wired or wireless communication network.
  • the malicious code detection and classification apparatus 3 may include a Local Area Network (LAN), a Metropolitan Area Network (MAN), a Global System for Mobile Network (GSM), an Enhanced Data GSM Environment (EDGE), High Speed Downlink Packet Access (HSDPA), Wideband Code Division Multiple Access (W-CDMA), Code Division Multiple Access (CDMA), Time Division Multiple Access (TDMA), Bluetooth, Zigbee, Wi-Fi Wi-Fi), Voice over Internet Protocol (VoIP), LTE Advanced, IEEE802.16m, WirelessMAN-Advanced, HSPA+, 3GPP Long Term Evolution (LTE), Mobile WiMAX (IEEE 802.16e), UMB (formerly EV-DO Rev.
  • LAN Local Area Network
  • MAN Metropolitan Area Network
  • GSM Global System for Mobile Network
  • EDGE Enhanced Data GSM Environment
  • HSDPA High Speed Downlink Packet Access
  • W-CDMA Wideband Code Division Multiple Access
  • CDMA Code Division Multiple Access
  • TDMA Time Division Multiple Access
  • Bluetooth Zigbee
  • C at least one communication selected from the group consisting of Flash-OFDM, iBurst and MBWA (IEEE 802.20) systems, HIPERMAN, Beam-Division Multiple Access (BDMA), Wi-MAX (World Interoperability for Microwave Access) and ultrasound-assisted communication. method, but is not limited thereto.
  • the user device 1 is a smartphone driven by an Android operating system (OS), and the source data to be analyzed is an executable file of an app running on a smartphone using the Android OS.
  • the APK file is described as an example.
  • the external server 2 is a server that provides an online market for downloading an app from the user device 1, such as Google's Play Store, or storing the source code of the app or checking the safety of the source code. It may be a separate server for the purpose.
  • source data may refer to data executable on various operating systems and is not limited to the APK file.
  • the user device 1 may be operated using any computer operating system such as Microsoft Windows, OS X, or Linux, or any mobile operating system such as Apple iOS or Windows Mobile.
  • the form of the user device 1 of the present specification is not limited to a smartphone, and a mobile communication terminal, a personal computer, a notebook computer, a PDA (personal digital assistant), a tablet, Any computing device such as a set-top box for Internet Protocol Television (IPTV) or the like may correspond to the user device 1 .
  • IPTV Internet Protocol Television
  • the malicious code detection and classification device 3 itself may be implemented in a user device such as a smart phone or a personal computer.
  • the user device 1 shown in FIG. 1 may be omitted, and the source data to be analyzed is received from the external server 2 through a wired or wireless communication network to the malicious code detection and classification device 3 or It can be input directly into the code detection and classification device 3 .
  • the graph generating unit 32 may generate graph information based on a relationship between an API (Application Programming Interface) included in the source data from the source data received or input to the transceiver 31 . That is, the graph information may include a plurality of nodes corresponding to each API included in the source data, and one or more edges connecting each node. At this time, the graph generating unit 32 can use only the call graph information in the graph modeling language (GML) in the form of plain text without having to visualize this graph information for the entire source data. have.
  • GML graph modeling language
  • the matrix generator 33 may generate an adjacency matrix between APIs included in the source data by using the graph information generated by the graph generator 32 .
  • the adjacency matrix may be a two-dimensional matrix in which each row and each column of the matrix represents one API.
  • the machine learning unit 34 serves to detect whether the source data is malicious code by using the adjacency matrix generated by the matrix generation unit 33 as an input to the machine learning-based analysis model.
  • the machine learning unit 34 may include a storage unit 343 in which the analysis model and related parameters are stored. Also, in one embodiment, the machine learning unit 34 may include a filter unit 341 for activating a region in which each API is connected to each other in the adjacency matrix. Further, in one embodiment, the machine learning unit 34 analyzes the machine learning unit 34 to detect malicious codes by using the region activated by the filter unit 341 as an input value to the machine learning-based analysis model. part 342 .
  • the analysis by the machine learning unit 34 is described as an example of classifying the source code by applying a convolutional neural network (CNN) algorithm to an input image generated from an adjacency matrix.
  • CNN convolutional neural network
  • the analysis model that can be used by the malicious code detection and classification apparatus 3 according to the embodiments is not limited to CNN.
  • FIGS. 1 and 2 is a flowchart illustrating each step of a method for detecting and classifying a malicious code according to an exemplary embodiment. For convenience of description, a method for detecting and classifying a malicious code according to the present embodiment will be described with reference to FIGS. 1 and 2 .
  • the transceiver 31 of the malicious code detection and classification device 3 may receive target source data for detecting malicious code (S1).
  • the transceiver 31 may receive source data from the user device 1 or the external server 2 through a communication method through a wired and/or wireless network.
  • the source data may be directly input to the malicious code detection and classification device 3 .
  • the graph generating unit 32 of the malicious code detection and classification device 3 may convert the source data into graph information (S2).
  • Graph information means that each API included in the source data is expressed as a node by analyzing the source data, and the relationship between the APIs is expressed as an edge.
  • the graph information may be generated using a commercial reverse engineering tool such as AndroGuard, but is not limited thereto.
  • graph information in order to maintain a constant size of an adjacency matrix to be generated later, graph information may be generated using only an API built into the operating system.
  • the graph generator 32 may use only call graph information, which is plain text written in a graph modeling language, as graph information.
  • Table 1 shows an example of graph information in the form of plain text, and shows graph information including a node having ID 62 and an edge connecting between the node 62 and the node 2772.
  • the matrix generator 33 of the malicious code detection and classification apparatus 3 may generate an adjacency matrix for the API of the source data by using the graph information (S3).
  • the adjacency matrix represents a connection relationship between APIs by each element of the matrix, and in one embodiment, the adjacency matrix means a two-dimensional matrix in which each row and column of the matrix is an API.
  • the matrix generator 33 may generate an adjacency matrix by sequentially examining all API methods included in the source data, and updating the adjacency matrix whenever an API is related to another API.
  • FIG. 3 is a call graph illustrating an API call of source data analyzed by a malicious code detection and classification method according to an embodiment.
  • the onCreateB API is called by the onCreateA API, and the node 102 and the node 102 are connected, and an initialization function 103 by the onCreateB API call. It is configured to run. Meanwhile, the onCreateB API calls the onProcessC and onProcessD APIs, respectively, so that the node 102 is connected to the respective nodes 104 and 105 corresponding to the onProcessC and onProcessD APIs. Also, the onProcessC API calls the onSendE API to connect the node 104 to the node 106 , and the onProcessD API calls the onSendF API to connect the node 105 to the node 107 .
  • FIG. 4 is an image illustrating an adjacency matrix generated using the graph information shown in FIG. 3 .
  • each row of the adjacency matrix sequentially corresponds to each API of onCreateA, onCreateB, onProcessC, onProcessD, onSendE, and onSendF, and likewise, each column of the adjacency matrix also sequentially corresponds to these six APIs. Therefore, in this example, the adjacency matrix has a size of 6 ⁇ 6.
  • each component of the adjacency matrix represents a call relation between the corresponding row and column APIs. If the row and column APIs call the corresponding column API, the component has a value of 1, and if there is no such call relationship, the component The value of was defined as 0.
  • the onCreateA API corresponding to row 1 calls the onCreateB API corresponding to column 2, the value 401 of the components (1,2) of the adjacency matrix is 1.
  • the onCreateB API corresponding to row 2 calls the onCreateC API and onCreateD API corresponding to columns 3 and 4, respectively, so the value 402 of the component (2, 3) and the value 402 of the component (2, 4) of the adjacency matrix ( 403) also becomes 1.
  • the onProcessC API in line 3 calls the onSendE API in column 5, so the value 404 of component (3, 5) becomes 1, and the onProcessD API in line 4 calls the onSendF API in column 6, so component (4, The value 406 of 6) also becomes 1.
  • connection relationship between APIs included in the source data can be converted into an adjacency matrix.
  • the machine learning unit 34 of the malicious code detection and classification apparatus 3 may generate a malicious code detection result for the source data by using the adjacency matrix as an input value to the machine learning-based analysis model.
  • the analysis result by the machine learning unit 34 will be described in more detail.
  • the filter unit 341 of the machine learning unit 34 may activate a region having a connection relation between APIs among the adjacent matrices (S4).
  • the adjacency matrix 301 may be a two-dimensional matrix having m rows and n columns, where m and n may be any natural number and may be the same number.
  • Each row and column of the adjacency matrix 301 corresponds to an API, eg, a first row 302 with components a 11 , a 12 , a 13 ... corresponds to a first API, and a component a 21 ,
  • a first column 303 having a 22 , a 23 ... corresponds to the second API.
  • the component a 11 is defined by the presence or absence of a connection relationship between the first API and the second API and/or the number of connections.
  • the filter unit 341 activates a region having a connection relationship between APIs in the adjacency matrix 301, and the analysis unit 342 inputs the activated region 310 to the machine learning machine learning analysis model as an input image. It can be done (S5).
  • the machine learning unit 34 may detect a malicious code by learning through a CNN algorithm, and in this case, the filter unit 341 may correspond to a convolutional filter of CNN.
  • the machine learning unit 34 can classify the source data by learning it.
  • Table 2 shows the appearance frequency of APIs in each malicious code family of BankBot, Dowgin, DroidKungfu, FakeInst, Fusob, Kuguo, Mecor, and Youmi.
  • An analysis model can be created by performing training using known training data.
  • the filter unit 341 may sequentially activate regions having a connection relationship between APIs in the adjacency matrix 301 to a size corresponding to the CNN input image
  • the analysis unit 342 may A process of extracting a feature from the activated region 310 of the matrix 301 as an input image, and classifying the feature as malicious code or non-malicious code through a neural network can be performed. have.
  • the convolutional layer 320 that extracts a feature map by performing a convolution operation with a filter on the activated region 310 of the adjacency matrix 301 and the output data of the convolutional layer 320 are input.
  • a pooling layer 330 that receives and reduces the size of output data or emphasizes specific data may be used. Although one convolutional layer 320 and one pooling layer 330 are illustrated in the drawing, the convolutional layer 320 and the pooling layer 330 may be alternately used a plurality of times.
  • a fully connected layer 340 may be formed through the neural network, and output information 350 corresponding to the classification result for the malicious code may be generated therefrom.
  • the present inventors trained a machine learning analysis model using a malicious code sample operating in the Android operating system, and tested the malicious code detection performance on unknown source data using this.
  • Table 3 shows the results, and as an analysis feature, an adjacency matrix having 219 rows and columns, respectively, based on Android's built-in API was used. it was
  • Table 4 shows the accuracy and recall of the malicious code detection result according to the embodiment of the present invention.
  • the analysis accuracy reaches 100%, It can be seen that the code detection method has superior performance compared to the prior art.
  • the machine learning unit 34 of the malicious code detection and classification apparatus 3 may generate a malicious code detection result for the source data through the above process ( S7 ).
  • the malicious code detection result may indicate whether a specific app is a malicious app or whether to publish the corresponding app in an online store.
  • the transceiver 31 may transmit the detection result generated by the above-described process to the user device 1 and/or the external server 2 (S7).
  • the detection result may be implemented so that it can be directly checked on the malicious code detection and classification device 3 .
  • the operation by the malicious code detection and classification method according to the embodiments described above may be at least partially implemented as a computer program and recorded in a computer-readable recording medium.
  • the computer-readable recording medium may be distributed in a network-connected computer system, and the computer-readable code may be stored and executed in a distributed manner.
  • functional programs, codes, and code segments for implementing the present embodiment may be easily understood by those skilled in the art to which the present embodiment belongs.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Virology (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Computer And Data Communications (AREA)
  • Debugging And Monitoring (AREA)

Abstract

악성 코드 탐지 및 분류 장치는, 소스(source) 데이터로부터 상기 소스 데이터에 포함된 API(Application Programming Interface)에 상응하는 복수 개의 노드 및 상기 복수 개의 노드 사이를 연결하는 하나 이상의 에지를 포함하는 그래프 정보를 생성하도록 구성된 그래프 생성부; 상기 그래프 정보를 이용하여 상기 소스 데이터에 포함된 API 사이의 인접 행렬(adjacent matrix)을 생성하도록 구성된 행렬 생성부; 및 상기 인접 행렬을 머신러닝 기반의 분석 모델에 대한 입력값으로 이용하여 상기 소스 데이터에 포함된 악성 코드를 탐지하도록 구성된 머신러닝(machine learning)부를 포함할 수 있다. 상기 악성 코드 탐지 및 분류 장치에 의하면, API 사이의 콜 그래프(call graph)를 각 행과 각 열이 API인 인접 행렬로 변환하여 머신러닝 기반의 분석 모델에 대한 입력값으로 사용함으로써, 종래에 비해 높은 탐지율과 정확도로 악성 코드를 탐지할 수 있는 이점이 있다.

Description

인접 행렬 기반의 악성 코드 탐지 및 분류 장치와 악성 코드 탐지 및 분류 방법
실시예들은 악성 코드 탐지 및 분류 장치와, 악성 코드 탐지 및 분류 방법 및 이를 위한 컴퓨터 프로그램에 관한 것이다. 보다 상세하게는, 실시예들은 프로그램의 소스(source) 코드에 포함된 API(Application Programming Interface) 사이의 연결 관계를 인접 행렬(adjacent matrix)에 기반하여 머신러닝(machine learning)을 통해 분석함으로써 악성 코드를 탐지하는 기술에 대한 것이다.
악성 코드는 바이러스(virus), 웜(worm), 트로이 목마(trojan), 랜섬웨어(ransomware), 애드웨어(adware), 스파이웨어(spyware), 멀버타이징(malvertising) 등과 같이 컴퓨팅 장치 또는 이와 관련된 컴퓨터 네트워크에 피해를 발생시킬 목적으로 설계된 소프트웨어를 통칭한다. 컴퓨터 내에 악성 코드가 존재하는 경우 장치에 저장되어 있는 데이터를 훼손하거나 사용자의 개인 정보를 탈취하여 사용자에게 경제적인 피해를 줄 수 있으므로, 악성 코드의 존재를 지속적으로 탐지하여 이를 사전에 제거하는 것이 매우 중요하다.
최근에는 스마트폰의 사용이 급속도로 확산되면서 악성 코드가 안드로이드(Android) 운영체제의 앱(app) 형태로 배포되는 경우가 많아지고 있으며, 이러한 파일에서 특정 소스 코드가 악성 코드인지 여부를 알아 내기 위한 방법에 대한 연구가 이루어지고 있다.
예를 들어, Hasegawa, C. 및 Iyatomi, H. 공저의 "안드로이드 멀웨어 탐지를 위한 일방향 컨볼루션 신경망(One-dimensional convolutional neural networks for Android malware detection)"(IEEE 14th International Colloquium on Signal Processing & Its Applications (CSPA), 2018, pp. 99-102)은 APK 파일의 특정 부분을 짧은 문자열로 변환하고 이에 컨볼루션 신경망(Convolution Neural Network; CNN)을 적용하여 분석을 수행하는 것을 개시한다. 이 방법은 처리 속도가 빠른 장점이 있으나, 적은 양의 문자열이 해당 앱을 대표할 수 없고, 악성 앱이라 하더라도 대부분의 부분은 양성, 즉, 악성이 아닌 문자열로 이루어져 있어 탐지가 어려운 문제가 있다.
다른 예로, Huang, N. 외 4인 공저의 "API 기반 특징 그래프에 의한 딥 안드로이드 멀웨어 분류(Deep Android Malware Classification with API-Based Feature Graph)"(18th IEEE International Conference On Trust, Security And Privacy In Computing And Communications/13th IEEE International Conference On Big Data Science And Engineering (TrustCom/BigDataSE), IEEE, 2019)는 API(Application Programing Interface) 기반 특징 그래프에 CNN을 적용하여 훈련 및 분류를 수행하는 것을 개시한다. 그러나, 본 방법에서 사용되는 특징 그래프는 앱 자체의 동작을 나타내기에 충분하지 못한 한계를 갖는다.
또 다른 예로, Fan, M. 외 6인 공저의 "비지도 학습을 이용한 그래프 임베딩 기반의 안드로이드 멀웨어 퍼밀리얼 분석(Graph embedding based familial analysis of android malware using unsupervised learning)"(2019 IEEE/ACM 41st International Conference on Software Engineering (ICSE), IEEE, 2019)은 API 호출에 대한 그래프 간의 일치 여부를 벡터 계산이 용이한 유사성 계산으로 변환하여 악성 코드를 탐지하는 것을 개시한다. 그러나, 본 연구는 유지 보수가 중단된 데이터베이스를 이용하여 API를 식별하도록 구성되어 사용이 부적절한 문제가 있다.
또 다른 예로, Liu, Xiaojian 외 2인 공저의 "머신러닝 기술에 의한 안드로이드 멀웨어 탐지에 있어 그래프 기반의 특징 생성 접근법(A Graph-Based Feature Generation Approach in Android Malware Detection with Machine Learning Techniques)"(Mathematical Problems in Engineering, 2020)은 보안에 민감한 브로드캐스트(broadcast) 이벤트, 보안에 민감한 권한 및 관련 컨텍스트(context)를 가진 API 호출의 다이어그램을 식별하는 것을 개시한다. 그러나, 본 연구는 권한 및 API를 매핑함에 있어 현재는 사용되지 않는 기술을 기반으로 하고 있고, 또한 제시된 매핑은 API 흐름의 경로 민감성을 고려하지 않는 한계를 갖는다.
결국, 프로그램에 사용되는 API를 기반으로 악성 코드를 높은 탐지율과 정확도로 탐지할 수 있는 기술은 종래에는 존재하지 않았다.
[선행기술문헌]
[특허문헌]
(특허문헌 1) 공개특허공보 제10-2012-0105759호
본 발명의 일 측면에 따르면, 프로그램의 소스(source) 코드에 포함된 API(Application Programming Interface) 사이의 연결 관계를 인접 행렬(adjacent matrix)로 변환하고 이를 머신러닝(machine learning) 기반의 분석 모델에 대한 입력값으로 사용하여 악성 코드를 탐지할 수 있는 악성 코드 탐지 및 분류 장치와, 악성 코드 탐지 및 분류 방법 및 이를 위한 컴퓨터 프로그램을 제공할 수 있다.
본 발명의 일 실시예에 따른 악성 코드 탐지 및 분류 장치는, 소스(source) 데이터로부터 상기 소스 데이터에 포함된 API(Application Programming Interface)에 상응하는 복수 개의 노드 및 상기 복수 개의 노드 사이를 연결하는 하나 이상의 에지를 포함하는 그래프 정보를 생성하도록 구성된 그래프 생성부; 상기 그래프 정보를 이용하여 상기 소스 데이터에 포함된 API 사이의 인접 행렬(adjacent matrix)을 생성하도록 구성된 행렬 생성부; 및 상기 인접 행렬을 머신러닝 기반의 분석 모델에 대한 입력값으로 이용하여 상기 소스 데이터에 포함된 악성 코드를 탐지하도록 구성된 머신러닝(machine learning)부를 포함한다.
일 실시예에서, 상기 그래프 정보는 그래프 모델링 언어(Graph Modeling Language; GML)로 작성된 텍스트 데이터이다.
일 실시예에서, 상기 인접 행렬은 상기 소스 데이터에 포함된 API에 상응하는 하나 이상의 열 및 상기 소스 데이터에 포함된 API에 상응하는 하나 이상의 행을 포함하는 2차원 행렬이다.
일 실시예에서, 상기 행렬 생성부는, 상기 소스 데이터에 포함된 API를 순차적으로 실행하면서 실행되는 API가 다른 API와 연관되는 것에 대한 응답으로 상기 인접 행렬을 갱신함으로써 상기 인접 행렬을 생성하도록 구성된다.
일 실시예에서, 상기 머신러닝부는, 상기 인접 행렬에서 서로 연결된 API에 상응하는 영역을 활성화하도록 구성된 필터부; 및 활성화된 상기 영역을 상기 머신러닝 기반의 분석 모델에 대한 입력값으로 이용하여 상기 인접 행렬을 분류하도록 구성된 분석부를 포함한다.
일 실시예에서, 상기 분석부는 활성화된 상기 영역을 입력 이미지로 하는 컨볼루션 신경망(Convolution Neural Network; CNN) 알고리즘에 의해 상기 악성 코드를 탐지하도록 더 구성된다.
*본 발명의 일 실시예에 따른 악성 코드 탐지 및 분류 방법은, 악성 코드 탐지 및 분류 장치가 소스 데이터로부터 상기 소스 데이터에 포함된 API에 상응하는 복수 개의 노드 및 상기 복수 개의 노드 사이를 연결하는 하나 이상의 에지를 포함하는 그래프 정보를 생성하는 단계; 상기 악성 코드 탐지 및 분류 장치가 상기 그래프 정보를 이용하여 상기 소스 데이터에 포함된 API 사이의 인접 행렬을 생성하는 단계; 및 상기 악성 코드 탐지 및 분류 장치가 상기 인접 행렬을 머신러닝 기반의 분석 모델에 대한 입력값으로 이용하여 상기 소스 데이터에 포함된 악성 코드를 탐지하는 단계를 포함한다.
일 실시예에서, 상기 인접 행렬을 생성하는 단계는, 상기 악성 코드 탐지 및 분류 장치가, 상기 소스 데이터에 포함된 API에 상응하는 하나 이상의 열 및 상기 소스 데이터에 포함된 API에 상응하는 하나 이상의 행을 포함하는 2차원 행렬을 생성하는 단계를 포함한다.
일 실시예에서, 상기 인접 행렬을 생성하는 단계는, 상기 악성 코드 탐지 및 분류 장치가, 상기 소스 데이터에 포함된 API를 순차적으로 실행하면서 실행되는 API가 다른 API와 연관되는 것에 대한 응답으로 상기 인접 행렬을 갱신하는 단계를 더 포함한다.
일 실시예에서, 상기 소스 데이터에 포함된 악성 코드를 탐지하는 단계는, 상기 악성 코드 탐지 및 분류 장치가, 상기 인접 행렬에서 서로 연결된 API에 상응하는 영역을 필터에 의해 활성화하는 단계; 및 상기 악성 코드 탐지 및 분류 장치가, 활성화된 상기 영역을 상기 머신러닝 기반의 분석 모델에 대한 입력값으로 이용하여 상기 인접 행렬을 분류하는 단계를 포함한다.
일 실시예에서, 상기 인접 행렬을 분류하는 단계는 활성화된 상기 영역을 입력 이미지로 하는 CNN 알고리즘에 의해 수행된다.
일 실시예에 따른 컴퓨터 프로그램은 하드웨어와 결합되어 전술한 실시예들에 따른 악성 코드 탐지 및 분류 방법을 실행하기 위한 것으로서 컴퓨터로 판독 가능한 매체에 저장된 것일 수 있다.
본 발명의 일 측면에 따른 악성 코드 탐지 및 분류 장치 및 방법에 의하면, 소스(source) 데이터로부터 API(Application Programming Interface) 사이의 콜 그래프(call graph)를 생성하고, 이를 각 행과 열이 API인 인접 행렬(adjacent matrix)로 변환하여 머신러닝(machine learning) 기반의 분석 모델을 통해 분석함으로써, 악성 코드에서의 API 출현 빈도에 대한 학습 결과를 기반으로 하여 소스 데이터의 악성 코드를 탐지할 수 있다.
본 발명의 일 측면에 따른 악성 코드 탐지 및 분류 장치 및 방법에 의하면 매우 높은 탐지율로 악성 코드를 탐지할 수 있으며, 나아가 일부 악성 코드 패밀리의 경우 분석 정확도가 100%에 달하는 등 높은 정확도로 악성 코드를 탐지할 수 있는 이점이 있다.
도 1은 일 실시예에 따른 악성 코드 탐지 및 분류 장치의 구성을 나타내는 개략적인 블록도이다.
도 2는 일 실시예에 따른 악성 코드 탐지 및 분류 방법의 각 단계를 나타내는 순서도이다.
도 3은 일 실시예에 따른 악성 코드 탐지 및 분류 방법에 의하여 분석되는 소스 데이터의 API 호출을 나타내는 콜 그래프(call graph)이다.
도 4는 도 3에 도시된 그래프 정보를 이용하여 생성된 인접 행렬을 나타내는 이미지이다.
도 5는 일 실시예에 따른 악성 코드 탐지 및 분류 방법에서 컨볼루션 신경망(Convolution Neural Network; CNN)에 의하여 악성 코드를 분류하는 과정을 설명하기 위한 개념도이다.
이하에서, 도면을 참조하여 본 발명의 실시예들에 대하여 상세히 살펴본다.
도 1은 일 실시예에 따른 악성 코드 탐지 및 분류 장치의 구성을 나타내는 개략적인 블록도이다.
도 1을 참조하면, 본 실시예에 따른 악성 코드 탐지 및 분류 장치(3)는 그래프 생성부(32), 행렬 생성부(33) 및 머신러닝(machine learning)부(34)를 포함한다. 또한 일 실시예에서, 악성 코드 탐지 및 분류 장치(3)는 송수신부(31)를 더 포함할 수 있다.
실시예들에 따른 악성 코드 탐지 및 분류 장치(3)의 각 부(unit)는 전적으로 하드웨어이거나, 또는 부분적으로 하드웨어이고 부분적으로 소프트웨어인 측면을 가질 수 있다. 예컨대, 도 1에 도시된 악성 코드 탐지 및 분류 장치(3)의 각 부는 특정 형식 및 내용의 데이터를 처리하거나 또는/또한 전자통신 방식으로 주고받기 위한 하드웨어 및 이에 관련된 소프트웨어를 통칭할 수 있다. 본 명세서에서 "부", "모듈(module)", "장치", "단말기", "서버" 또는 "시스템" 등의 용어는 하드웨어 및 해당 하드웨어에 의해 구동되는 소프트웨어의 조합을 지칭하는 것으로 의도된다. 예를 들어, 하드웨어에 의해 구동되는 소프트웨어는 실행중인 프로세스, 객체(object), 실행파일(executable), 실행 스레드(thread of execution), 프로그램(program) 등을 지칭할 수 있다.
또한, 악성 코드 탐지 및 분류 장치(3)를 구성하는 각각의 요소는 반드시 서로 물리적으로 구분되는 별개의 장치를 지칭하는 것으로 의도되지 않는다. 예컨대, 도 1의 송수신부(31), 그래프 생성부(32), 행렬 생성부(33) 및 머신러닝부(34)는 악성 코드 탐지 및 분류 장치(3)의 하드웨어에 의하여 실행되는 동작들을 기능적으로 구분한 것일 뿐, 반드시 각각의 부가 서로 독립적으로 구비되어야 하는 것이 아니다. 물론, 실시예에 따라서는 송수신부(31), 그래프 생성부(32), 행렬 생성부(33) 및 머신러닝부(34) 중 하나 이상이 서로 물리적으로 구분되는 별개의 장치로 구현되는 것도 가능하다.
송수신부(31)는 사용자 장치(1) 또는 외부 서버(2)와 통신함으로써 분석 대상 소스(source) 데이터를 수신하거나, 또는/또한 악성 코드에 대한 탐지 결과를 제공할 수 있다. 이를 위하여, 송수신부(31)는 유선 또는 무선 통신 네트워크를 통하여 사용자 장치(1) 및/또는 외부 서버(2)와 통신 가능하도록 구성된다.
예를 들어, 실시예들에 따른 악성 코드 탐지 및 분류 장치(3)는 LAN(Local Area Network), MAN(Metropolitan Area Network), GSM(Global System for Mobile Network), EDGE(Enhanced Data GSM Environment), HSDPA(High Speed Downlink Packet Access), W-CDMA(Wideband Code Division Multiple Access), CDMA(Code Division Multiple Access), TDMA(Time Division Multiple Access), 블루투스(Bluetooth), 지그비(Zigbee), 와이-파이(Wi-Fi), VoIP(Voice over Internet Protocol), LTE Advanced, IEEE802.16m, WirelessMAN-Advanced, HSPA+, 3GPP Long Term Evolution (LTE), Mobile WiMAX (IEEE 802.16e), UMB (formerly EV-DO Rev. C), Flash-OFDM, iBurst and MBWA (IEEE 802.20) systems, HIPERMAN, Beam-Division Multiple Access (BDMA), Wi-MAX(World Interoperability for Microwave Access) 및 초음파 활용 통신으로 이루어진 군으로부터 선택되는 하나 이상의 통신 방법으로 통신할 수 있으나, 이에 한정되는 것은 아니다.
본 명세서에서 사용자 장치(1)는 안드로이드(Android) 운영체제 (Operating System; OS)에 의해 구동되는 스마트폰이며, 분석 대상 소스 데이터는 안드로이드 OS를 이용한 스마트폰에서 실행되는 앱(app)의 실행파일인 APK 파일을 예시로 하여 설명된다. 이때, 외부 서버(2)는 구글 사의 플레이 스토어와 같이 사용자 장치(1)에서 앱을 다운로드할 수 있는 온라인 마켓을 제공하는 서버이거나 또는 앱의 소스 코드를 저장하거나 소스 코드에 대한 안전성을 검사하는 것을 목적으로 하는 별도의 서버일 수 있다.
그러나 이는 예시적인 것으로서, 본 명세서에서 소스 데이터는 다양한 운영체제상에서 실행 가능한 데이터를 지칭할 수 있으며 APK 파일에 한정되는 것이 아니다. 또한, 사용자 장치(1)는 Microsoft Windows, OS X, Linux 등 임의의 컴퓨터 운영체제, 또는 Apple iOS, Windows Mobile 등 임의의 모바일 운영체제를 이용하여 동작되는 것일 수 있다.
또한, 본 명세서의 사용자 장치(1)의 형태는 스마트폰에 한정되는 것은 아니며, 이동 통신 단말기, 개인용 컴퓨터(personal computer), 노트북(notebook) 컴퓨터, PDA(personal digital assistant), 태블릿(tablet), IPTV(Internet Protocol Television) 등을 위한 셋톱박스(set-top box) 등 임의의 컴퓨팅 장치가 사용자 장치(1)에 해당될 수 있다.
한편, 다른 실시예에서는 악성 코드 탐지 및 분류 장치(3) 자체가 스마트폰이나 개인용 컴퓨터와 같은 사용자 장치 내에 구현될 수도 있다. 이 경우 도 1에 도시된 사용자 장치(1)는 생략될 수 있으며, 분석 대상 소스 데이터는 외부 서버(2)로부터 유선 또는 무선 통신 네트워크를 통하여 악성 코드 탐지 및 분류 장치(3)에 수신되거나 또는 악성 코드 탐지 및 분류 장치(3)에 직접 입력될 수 있다.
그래프 생성부(32)는 송수신부(31)에 수신 또는 입력된 소스 데이터로부터, 소스 데이터에 포함된 API(Application Programming Interface) 사이의 관계에 기반한 그래프 정보를 생성할 수 있다. 즉, 그래프 정보는 소스 데이터에 포함된 각 API에 상응하는 복수 개의 노드(node)와, 각 노드 사이를 연결하는 하나 이상의 에지(edge)를 포함할 수 있다. 이때, 그래프 생성부(32)는 이러한 그래프 정보를 소스 데이터 전체에 대해 가시화할 필요 없이, 그래프 모델링 언어(Graph Modelling Language; GML)로 된 콜 그래프(call graph) 정보만을 일반 텍스트의 형태로 이용할 수 있다.
행렬 생성부(33)는, 그래프 생성부(32)에 의해 생성된 그래프 정보를 이용하여 소스 데이터에 포함된 API 사이의 인접 행렬(adjacent matrix)을 생성할 수 있다. 이때 인접 행렬은 행렬의 각 행과 각 열이 하나의 API를 나타내는 2차원 행렬일 수 있다.
머신러닝부(34)는 행렬 생성부(33)에 의해 생성된 인접 행렬을 머신러닝 기반의 분석 모델에 대한 입력으로 이용하여 소스 데이터가 악성 코드인지 여부를 탐지하는 역할을 한다.
이를 위하여, 일 실시예에서 머신러닝부(34)는 분석 모델 및 관련 파라미터들이 저장되는 저장부(343)를 포함할 수 있다. 또한 일 실시예에서, 머신러닝부(34)는 인접 행렬에서 각 API들이 서로 연결되는 영역을 활성화하기 위한 필터부(341)를 포함할 수 있다. 나아가 일 실시예에서, 머신러닝부(34)는 머신러닝부(34)는 필터부(341)에 의해 활성화된 영역을 머신러닝 기반의 분석 모델에 대한 입력값으로 하여 악성 코드를 탐지하도록 구성된 분석부(342)를 포함할 수 있다.
이하의 본 명세서에서, 머신러닝부(34)에 의한 분석은 인접 행렬로부터 생성된 입력 이미지에 컨볼루션 신경망(Convolution Neural Network; CNN) 알고리즘을 적용하여 소스 코드를 분류하는 것을 예시로 하여 설명된다. 그러나 실시예들에 따른 악성 코드 탐지 및 분류 장치(3)가 이용할 수 있는 분석 모델은 CNN에 한정되는 것은 아니다.
도 2는 일 실시예에 따른 악성 코드 탐지 및 분류 방법의 각 단계를 나타내는 순서도이다. 설명의 편의를 위하여, 도 1 및 도 2를 참조하여 본 실시예에 따른 악성 코드 탐지 및 분류 방법에 대하여 설명한다.
먼저, 악성 코드 탐지 및 분류 장치(3)의 송수신부(31)는 악성 코드를 탐지할 대상 소스 데이터를 수신할 수 있다(S1). 일 실시예에서, 송수신부(31)는 유선 및/또는 무선 네트워크를 통한 통신 방식으로 사용자 장치(1) 또는 외부 서버(2)로부터 소스 데이터를 수신할 수 있다. 그러나 다른 실시예에서, 악성 코드 탐지 및 분류 장치(3) 자체가 사용자 장치로 구성되는 경우, 소스 데이터는 악성 코드 탐지 및 분류 장치(3)에 직접 입력될 수도 있다.
다음으로, 악성 코드 탐지 및 분류 장치(3)의 그래프 생성부(32)는 소스 데이터를 그래프 정보로 변환할 수 있다(S2). 그래프 정보는 소스 데이터를 분석하여 소스 데이터에 포함된 각 API를 노드(node)로 표현하고 API 사이의 관계를 에지(edge)로 표현한 것을 의미한다. 예를 들어, 그래프 정보는 AndroGuard와 같은 상용 리버스 엔지니어링 도구를 이용하여 생성된 것일 수 있으나, 이에 한정되는 것은 아니다.
일 실시예에서는, 추후 생성될 인접 행렬의 크기를 일정하게 유지하기 위하여, 그래프 정보는 운영체제에 내장된 API만을 이용하여 생성될 수 있다.
그래프 정보를 생성함에 있어서 전체 소스 데이터를 노드와 에지로 시각화할 수도 있으나, 이는 많은 시간과 비용이 소요된다. 따라서, 일 실시예에서 그래프 생성부(32)는 그래프 모델링 언어(Graph Modeling Language)로 작성된 일반 텍스트인 콜 그래프(call graph) 정보만을 그래프 정보로 이용할 수 있다. 하기 표 1은 일반 텍스트 형태의 그래프 정보의 일 예를 나타내는 것으로, ID 62를 갖는 노드 및 노드 62와 노드 2772 사이를 연결하는 에지를 포함하는 그래프 정보를 나타낸다.
[표 1]
Figure PCTKR2020016939-appb-I000001
다음으로, 악성 코드 탐지 및 분류 장치(3)의 행렬 생성부(33)는 그래프 정보를 이용하여 소스 데이터의 API에 대한 인접 행렬을 생성할 수 있다(S3). 인접 행렬은 API 사이의 연결 관계를 행렬의 각 성분에 의하여 나타낸 것으로서, 일 실시예에서, 인접 행렬은 행렬의 각 행과 열이 API인 2차원 행렬을 의미한다. 행렬 생성부(33)는 소스 데이터에 포함된 모든 API 메소드(method)를 순차적으로 검사하면서, API가 다른 API와 관계 있을 때마다 인접 행렬을 갱신하는 방식으로 인접 행렬을 생성할 수 있다.
예를 들어, 도 3은 일 실시예에 따른 악성 코드 탐지 및 분류 방법에 의하여 분석되는 소스 데이터의 API 호출을 나타내는 콜 그래프이다.
도 3을 참조하면, 본 예에서 소스 데이터를 분석한 콜 그래프는 onCreateA API에 의해 onCreateB API가 호출되어 노드(102)와 노드(102) 사이가 연결되며 onCreateB API의 호출에 의해 초기화 기능(103)이 실행되도록 구성되어 있다. 한편, onCreateB API는 onProcessC 및 onProcessD API를 각각 호출하여 노드(102)는 onProcessC 및 onProcessD API에 해당하는 각 노드(104, 105)에 연결된다. 또한, onProcessC API는 onSendE API를 호출하여 노드(104)가 노드(106)에 연결되며, onProcessD API는 onSendF API를 호출하여 노드(105)가 노드(107)에 연결된다.
도 4는 도 3에 도시된 그래프 정보를 이용하여 생성된 인접 행렬을 나타내는 이미지이다.
도 4를 참조하면, 인접 행렬의 각 행은 onCreateA, onCreateB, onProcessC, onProcessD, onSendE 및 onSendF의 각 API에 순차적으로 대응되며, 마찬가지로 인접 행렬의 각 열도 이들 6개의 API에 순차적으로 대응된다. 따라서 본 예에서 인접 행렬은 6×6의 크기를 갖는다. 이때 인접 행렬의 각 성분은 이에 해당하는 행과 열의 API 사이의 호출 관계를 나타내는 것으로서, 행에 해당하는 API가 열에 해당하는 API를 호출하는 경우 성분이 값이 1로, 이러한 호출 관계가 없을 경우 성분의 값이 0으로 정의되었다.
도 3을 참조하여 전술한 예에서 1행에 해당하는 onCreateA API는 2열에 해당하는 onCreateB API를 호출하므로, 인접 행렬의 성분 (1, 2)의 값(401)은 1이다. 마찬가지로, 2행에 해당하는 onCreateB API는 각각 3열과 4열에 해당하는 onCreateC API 및 onCreateD API를 호출하므로, 인접 행렬의 성분 (2, 3)의 값(402)과 성분 (2, 4)의 값(403)도 각각 1이 된다. 동일한 방식으로, 3행의 onProcessC API는 5열의 onSendE API를 호출하므로 성분 (3, 5)의 값(404)이 1이되며, 4행의 onProcessD API는 6열의 onSendF API를 호출하므로 성분 (4, 6)의 값(406)도 1이 된다.
이상과 같은 방식으로, 소스 데이터에 포함된 API 사이의 연결 관계를 인접 행렬로 변환할 수 있다.
다음으로, 악성 코드 탐지 및 분류 장치(3)의 머신러닝부(34)는 인접 행렬을 머신러닝 기반의 분석 모델에 대한 입력값으로 이용하여 소스 데이터에 대한 악성 코드 탐지 결과를 생성할 수 있다. 도 5를 더 참조하여, 머신러닝부(34)에 의한 분석 결과를 보다 구체적으로 설명한다.
먼저, 머신러닝부(34)의 필터부(341)는 인접 행렬 중 API 간의 연결 관계가 있는 영역을 활성화할 수 있다(S4). 도 5를 참조하면, 인접 행렬(301)는 m 개의 행 및 n 개의 열을 갖는 2차원 행렬일 수 있으며, 이때 m과 n은 임의의 자연수일 수 있고 서로 동일한 숫자일 수 있다. 인접 행렬(301)의 각 행과 열은 API에 대응되며, 예컨대, 성분 a11, a12, a13 ...을 갖는 첫 번째 행(302)은 제1 API에 대응되고, 성분 a21, a22, a23 ...을 갖는 첫 번째 열(303)은 제2 API에 대응된다. 이때 성분 a11은 제1 API와 제2 API 사이의 연결 관계의 유무 및/또는 연결 횟수에 의해 정의된다.
이때, 필터부(341)는 인접 행렬(301)에서 API 사이의 연결 관계가 있는 영역을 활성화하고, 분석부(342)는 활성화된 영역(310)을 머신러닝 머신러닝 분석 모델에 입력 이미지로 입력할 수 있다(S5). 예를 들어, 일 실시예에서 머신러닝부(34)는 CNN 알고리즘을 통한 학습에 의하여 악성 코드를 탐지할 수 있으며, 이때 필터부(341)는 CNN의 컨볼루션 필터에 해당하는 것일 수 있다.
악성 코드에 출현하는 API의 빈도에는 소정의 경향성이 있으며, 머신러닝부(34)는 이를 학습함으로써 소스 데이터를 분류할 수 있다. 예를 들어, 하기 표 2는 BankBot, Dowgin, DroidKungfu, FakeInst, Fusob, Kuguo, Mecor 및 Youmi의 각 악성 코드 패밀리에서의 API 출현 빈도를 나타낸 것으로, 머신러닝부(34)는 악성 코드인지 여부가 미리 알려진 학습 데이터를 이용한 학습을 수행함으로써 분석 모델을 생성할 수 있다.
[표 2]
Figure PCTKR2020016939-appb-I000002
도 5를 참조하면, 필터부(341)는 인접 행렬(301)에서 API 사이의 연결 관계가 있는 영역을 CNN의 입력 이미지에 해당하는 크기로 순차적으로 활성화할 수 있으며, 분석부(342)는 인접 행렬(301)의 활성화된 영역(310)을 입력 이미지로 하여 이로부터 특징(feature)을 추출하고, 신경망을 통해 해당 특징을 악성 코드 또는 악성 코드가 아닌 것으로 분류(classification)하는 과정을 수행할 수 있다.
구체적으로, 인접 행렬(301)의 활성화된 영역(310)을 대상으로 필터로 합성곱 연산을 수행함으로써 특징맵을 추출하는 컨볼루션 레이어(320)와 컨볼루션 레이어(320)의 출력 데이터를 입력으로 받아서 출력 데이터의 크기를 줄이거나 특정 데이터를 강조하는 풀링(pooling) 레이어(330)가 사용될 수 있다. 도면에는 각각 하나의 컨볼루션 레이어(320)와 풀링 레이어(330)가 도시되었으나 컨볼루션 레이어(320)와 풀링 레이어(330)가 교대로 복수 회 사용될 수 있다. 특징값이 추출되면, 신경망을 통해 완전 연결 계층(fully connected layer)(340)을 형성하고 이로부터 악성 코드에 대한 분류 결과에 해당하는 출력 정보(350)를 생성할 수 있다.
이상의 과정은 공지된 CNN 알고리즘으로부터 통상의 기술자에게 잘 알려져 있으므로, 발명의 요지를 명확하게 하기 위하여 이에 대한 상세한 설명은 생략한다.
본 발명자들은, 안드로이드 운영체제에서 동작하는 악성 코드 샘플을 이용하여 머신러닝 분석 모델을 훈련시키고, 이를 이용하여 미지의 소스 데이터에 대한 악성 코드 탐지 성능을 시험하였다. 하기 표 3은 그 결과를 나타내는 것으로서, 분석 특징으로는 안드로이드에 내장된 API를 기반으로 각각 219 개의 행과 열을 갖는 인접 행렬이 이용되었으며 한정된 수의 특징에도 불구하고 아래 표와 같이 높은 정확도를 나타내었다.
[표 3]
Figure PCTKR2020016939-appb-I000003
또한 하기 표 4는 본 발명의 실시예에 따른 악성 코드 탐지 결과의 정확도(accuracy)와 재현율(recall)을 나타내는 것으로서, 몇몇 악성코드 패밀리의 경우 100%에 달하는 분석 정확도를 나타내어 본 실시예에 따른 악성 코드 탐지 방법이 종래에 비해 우수한 성능을 갖는 것을 알 수 있다.
[표 4]
Figure PCTKR2020016939-appb-I000004
다시 도 1 및 도 2를 참조하면, 악성 코드 탐지 및 분류 장치(3)의 머신러닝부(34)는 이상의 과정에 의하여 소스 데이터에 대한 악성 코드 탐지 결과를 생성할 수 있다(S7). 예를 들어, 악성 코드 탐지 결과란, 특정 앱이 악성 앱인지 여부를 나타내는 것이나 해당 앱을 온라인 스토어에 게시할 것인지 여부를 나타내는 것 등일 수 있다.
또한, 송수신부(31)는 전술한 과정에 의하여 생성된 탐지 결과를 사용자 장치(1) 및/또는 외부 서버(2)에 전송할 수 있다(S7). 그러나 다른 실시예에서 악성 코드 탐지 및 분류 장치(3) 자체가 사용자 장치의 형태로 구현된 경우, 탐지 결과는 악성 코드 탐지 및 분류 장치(3) 상에서 직접 확인 가능하도록 구현될 수도 있다.
전술한 방법은 도면에 제시된 순서도를 참조로 하여 설명되었다. 간단히 설명하기 위하여 상기 방법은 일련의 블록들로 도시되고 설명되었으나, 본 발명은 상기 블록들의 순서에 한정되지 않고, 몇몇 블록들은 다른 블록들과 본 명세서에서 도시되고 기술된 것과 상이한 순서로 또는 동시에 일어날 수도 있으며, 동일한 또는 유사한 결과를 달성하는 다양한 다른 분기, 흐름 경로, 및 블록의 순서들이 구현될 수 있다. 또한, 본 명세서에서 기술되는 방법의 구현을 위하여 도시된 모든 블록들이 요구되지 않을 수도 있다.
이상에서 설명한 실시예들에 따른 악성 코드 탐지 및 분류 방법에 의한 동작은 적어도 부분적으로 컴퓨터 프로그램으로 구현되고 컴퓨터로 읽을 수 있는 기록매체에 기록될 수 있다. 실시예들에 따른 악성 코드 탐지 및 분류 방법에 의한 동작을 구현하기 위한 프로그램이 기록되고 컴퓨터가 읽을 수 있는 기록매체는 컴퓨터에 의하여 읽혀질 수 있는 데이터가 저장되는 모든 종류의 기록장치를 포함한다. 컴퓨터가 읽을 수 있는 기록매체의 예로는 ROM, RAM, CD-ROM, 자기 테이프, 플로피디스크, 광 데이터 저장장치 등이 있다. 또한 컴퓨터가 읽을 수 있는 기록매체는 네트워크로 연결된 컴퓨터 시스템에 분산되어, 분산 방식으로 컴퓨터가 읽을 수 있는 코드가 저장되고 실행될 수도 있다. 또한, 본 실시예를 구현하기 위한 기능적인 프로그램, 코드 및 코드 세그먼트(segment)들은 본 실시예가 속하는 기술 분야의 통상의 기술자에 의해 용이하게 이해될 수 있을 것이다.
이상에서 살펴본 본 발명은 도면에 도시된 실시예들을 참고로 하여 설명하였으나 이는 예시적인 것에 불과하며 당해 분야에서 통상의 지식을 가진 자라면 이로부터 다양한 변형 및 실시예의 변형이 가능하다는 점을 이해할 것이다. 그러나, 이와 같은 변형은 본 발명의 기술적 보호범위 내에 있다고 보아야 한다. 따라서, 본 발명의 진정한 기술적 보호범위는 첨부된 청구범위의 기술적 사상에 의해서 정해져야 할 것이다.

Claims (13)

  1. 소스 데이터로부터 상기 소스 데이터에 포함된 API에 상응하는 복수 개의 노드 및 상기 복수 개의 노드 사이를 연결하는 하나 이상의 에지를 포함하는 그래프 정보를 생성하도록 구성된 그래프 생성부;
    상기 그래프 정보를 이용하여 상기 소스 데이터에 포함된 API 사이의 인접 행렬을 생성하도록 구성된 행렬 생성부; 및
    상기 인접 행렬을 머신러닝 기반의 분석 모델에 대한 입력값으로 이용하여 상기 소스 데이터에 포함된 악성 코드를 탐지하도록 구성된 머신러닝부를 포함하는 악성 코드 탐지 및 분류 장치.
  2. 제1항에 있어서,
    상기 그래프 정보는 그래프 모델링 언어로 작성된 텍스트 데이터인 악성 코드 탐지 및 분류 장치.
  3. 제1항에 있어서,
    상기 인접 행렬은 상기 소스 데이터에 포함된 API에 상응하는 하나 이상의 열 및 상기 소스 데이터에 포함된 API에 상응하는 하나 이상의 행을 포함하는 2차원 행렬인 악성 코드 탐지 및 분류 장치.
  4. 제3항에 있어서,
    상기 행렬 생성부는, 상기 소스 데이터에 포함된 API를 순차적으로 실행하면서 실행되는 API가 다른 API와 연관되는 것에 대한 응답으로 상기 인접 행렬을 갱신함으로써 상기 인접 행렬을 생성하도록 구성된 악성 코드 탐지 및 분류 장치.
  5. 제3항에 있어서,
    상기 머신러닝부는,
    상기 인접 행렬에서 서로 연결된 API에 상응하는 영역을 활성화하도록 구성된 필터부; 및
    활성화된 상기 영역을 상기 머신러닝 기반의 분석 모델에 대한 입력값으로 이용하여 상기 인접 행렬을 분류하도록 구성된 분석부를 포함하는 악성 코드 탐지 및 분류 장치.
  6. 제5항에 있어서,
    상기 분석부는 활성화된 상기 영역을 입력 이미지로 하는 컨볼루션 신경망 알고리즘에 의해 상기 악성 코드를 탐지하도록 더 구성된 악성 코드 탐지 및 분류 장치.
  7. 악성 코드 탐지 및 분류 장치가 소스 데이터로부터 상기 소스 데이터에 포함된 API에 상응하는 복수 개의 노드 및 상기 복수 개의 노드 사이를 연결하는 하나 이상의 에지를 포함하는 그래프 정보를 생성하는 단계;
    상기 악성 코드 탐지 및 분류 장치가 상기 그래프 정보를 이용하여 상기 소스 데이터에 포함된 API 사이의 인접 행렬을 생성하는 단계; 및
    상기 악성 코드 탐지 및 분류 장치가 상기 인접 행렬을 머신러닝 기반의 분석 모델에 대한 입력값으로 이용하여 상기 소스 데이터에 포함된 악성 코드를 탐지하는 단계를 포함하는 악성 코드 탐지 및 분류 방법.
  8. 제7항에 있어서,
    상기 그래프 정보는 그래프 모델링 언어로 작성된 텍스트 데이터인 악성 코드 탐지 및 분류 방법.
  9. 제7항에 있어서,
    상기 인접 행렬을 생성하는 단계는, 상기 악성 코드 탐지 및 분류 장치가, 상기 소스 데이터에 포함된 API에 상응하는 하나 이상의 열 및 상기 소스 데이터에 포함된 API에 상응하는 하나 이상의 행을 포함하는 2차원 행렬을 생성하는 단계를 포함하는 악성 코드 탐지 및 분류 방법.
  10. 제9항에 있어서,
    상기 인접 행렬을 생성하는 단계는, 상기 악성 코드 탐지 및 분류 장치가, 상기 소스 데이터에 포함된 API를 순차적으로 실행하면서 실행되는 API가 다른 API와 연관되는 것에 대한 응답으로 상기 인접 행렬을 갱신하는 단계를 더 포함하는 악성 코드 탐지 및 분류 방법.
  11. 제9항에 있어서,
    상기 소스 데이터에 포함된 악성 코드를 탐지하는 단계는,
    상기 악성 코드 탐지 및 분류 장치가, 상기 인접 행렬에서 서로 연결된 API에 상응하는 영역을 필터에 의해 활성화하는 단계; 및
    상기 악성 코드 탐지 및 분류 장치가, 활성화된 상기 영역을 상기 머신러닝 기반의 분석 모델에 대한 입력값으로 이용하여 상기 인접 행렬을 분류하는 단계를 포함하는 악성 코드 탐지 및 분류 방법.
  12. 제11항에 있어서,
    상기 인접 행렬을 분류하는 단계는 활성화된 상기 영역을 입력 이미지로 하는 컨볼루션 신경망 알고리즘에 의해 수행되는 악성 코드 탐지 및 분류 방법.
  13. 하드웨어와 결합되어 제7항 내지 제12항 중 어느 한 항에 따른 악성 코드 탐지 및 분류 방법을 실행하도록 컴퓨터로 판독 가능한 기록매체에 저장된 컴퓨터 프로그램.
PCT/KR2020/016939 2020-11-19 2020-11-26 인접 행렬 기반의 악성 코드 탐지 및 분류 장치와 악성 코드 탐지 및 분류 방법 WO2022107964A1 (ko)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US18/020,904 US20230306112A1 (en) 2020-11-19 2020-11-26 Apparatus and method for detection and classification of malicious codes based on adjacency matrix

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
KR20200155901 2020-11-19
KR10-2020-0155901 2020-11-19
KR1020200160107A KR102427782B1 (ko) 2020-11-19 2020-11-25 인접 행렬 기반의 악성 코드 탐지 및 분류 장치와 악성 코드 탐지 및 분류 방법
KR10-2020-0160107 2020-11-25

Publications (1)

Publication Number Publication Date
WO2022107964A1 true WO2022107964A1 (ko) 2022-05-27

Family

ID=81709256

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2020/016939 WO2022107964A1 (ko) 2020-11-19 2020-11-26 인접 행렬 기반의 악성 코드 탐지 및 분류 장치와 악성 코드 탐지 및 분류 방법

Country Status (2)

Country Link
US (1) US20230306112A1 (ko)
WO (1) WO2022107964A1 (ko)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220358214A1 (en) * 2021-05-04 2022-11-10 Battelle Energy Alliance, Llc Systems and methods for binary code analysis
CN117034273A (zh) * 2023-08-28 2023-11-10 山东省计算中心(国家超级计算济南中心) 基于图卷积网络的安卓恶意软件检测方法及系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070156889A1 (en) * 2006-01-05 2007-07-05 International Business Machines Corporation Method and system for determining application availability
KR20150047241A (ko) * 2013-10-24 2015-05-04 한양대학교 산학협력단 콘트롤 플로우 그래프들을 이용하는 프로그램의 표절 판단 방법 및 장치
US20160306971A1 (en) * 2015-04-15 2016-10-20 Los Alamos National Security, Llc Automated identification and reverse engineering of malware
KR101749210B1 (ko) * 2015-12-18 2017-06-20 한양대학교 산학협력단 다중 서열 정렬 기법을 이용한 악성코드 패밀리 시그니쳐 생성 장치 및 방법
KR20180019429A (ko) * 2016-08-16 2018-02-26 단국대학교 산학협력단 소프트웨어 클러스터링 방법 및 장치

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070156889A1 (en) * 2006-01-05 2007-07-05 International Business Machines Corporation Method and system for determining application availability
KR20150047241A (ko) * 2013-10-24 2015-05-04 한양대학교 산학협력단 콘트롤 플로우 그래프들을 이용하는 프로그램의 표절 판단 방법 및 장치
US20160306971A1 (en) * 2015-04-15 2016-10-20 Los Alamos National Security, Llc Automated identification and reverse engineering of malware
KR101749210B1 (ko) * 2015-12-18 2017-06-20 한양대학교 산학협력단 다중 서열 정렬 기법을 이용한 악성코드 패밀리 시그니쳐 생성 장치 및 방법
KR20180019429A (ko) * 2016-08-16 2018-02-26 단국대학교 산학협력단 소프트웨어 클러스터링 방법 및 장치

Also Published As

Publication number Publication date
US20230306112A1 (en) 2023-09-28

Similar Documents

Publication Publication Date Title
US11086987B2 (en) Malware detection in event loops
US9348998B2 (en) System and methods for detecting harmful files of different formats in virtual environments
WO2014035043A1 (ko) 악성 애플리케이션 진단 장치 및 방법
EP3882799B1 (en) Computer security event analysis
US11089038B2 (en) Safe sharing of sensitive data
US20180025153A1 (en) Method and device for detecting malicious code in an intelligent terminal
WO2015056885A1 (ko) 안드로이드 악성 애플리케이션의 탐지장치 및 탐지방법
WO2017213400A1 (en) Malware detection by exploiting malware re-composition variations
WO2022107964A1 (ko) 인접 행렬 기반의 악성 코드 탐지 및 분류 장치와 악성 코드 탐지 및 분류 방법
US20210133322A1 (en) Visual Identification of Malware
JP6864610B2 (ja) 特定システム、特定方法及び特定プログラム
WO2014077615A1 (en) Anti-malware system, method of processing packet in the same, and computing device
WO2019147101A1 (ko) 악성 코드를 분류하는 전자 장치 및 그 동작 방법
US9471713B2 (en) Handling complex regex patterns storage-efficiently using the local result processor
KR102427782B1 (ko) 인접 행렬 기반의 악성 코드 탐지 및 분류 장치와 악성 코드 탐지 및 분류 방법
JP6527111B2 (ja) 解析装置、解析方法および解析プログラム
US20210019407A1 (en) System and method of detecting malicious files based on file fragments
WO2022097898A1 (ko) 악성코드 탐지모델 학습방법 및 악성코드 탐지방법
WO2019216502A1 (ko) 악성코드 데이터를 분류하는 장치 및 방법
US20230171267A1 (en) Selective security scan to reduce signature candidates
CN113010268B (zh) 恶意程序识别方法及装置、存储介质、电子设备
WO2016048070A1 (ko) 실행파일 복원 장치 및 방법
WO2017018701A1 (ko) 블랙박스의 데이터 단편화 방지 방법 및 장치
GARCÍA Malware analysis based on smart agents and image classification
WO2024063171A1 (ko) 자식 프로세스의 악성 행위를 검사하기 위한 방법 및 이를 위한 장치

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20962570

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20962570

Country of ref document: EP

Kind code of ref document: A1