KR101922956B1 - Method of detecting malware based on entropy count map of low dimensional number - Google Patents

Method of detecting malware based on entropy count map of low dimensional number Download PDF

Info

Publication number
KR101922956B1
KR101922956B1 KR1020180091636A KR20180091636A KR101922956B1 KR 101922956 B1 KR101922956 B1 KR 101922956B1 KR 1020180091636 A KR1020180091636 A KR 1020180091636A KR 20180091636 A KR20180091636 A KR 20180091636A KR 101922956 B1 KR101922956 B1 KR 101922956B1
Authority
KR
South Korea
Prior art keywords
byte
entropy
data
count map
malicious code
Prior art date
Application number
KR1020180091636A
Other languages
Korean (ko)
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
Application filed by (주)케이사인 filed Critical (주)케이사인
Priority to KR1020180091636A priority Critical patent/KR101922956B1/en
Application granted granted Critical
Publication of KR101922956B1 publication Critical patent/KR101922956B1/en

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Virology (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Disclosed is a method of detecting a malicious code based on an entropy count map in a lower dimensional number. Byte-based entropy feature data extracted from learning files of a plurality of normal programs and malicious codes provided as input data are mapped to a presence frequency for each range of entropy values and converted into a plurality of byte entropy count map feature data in a lower dimensional number. Machine learning is performed using the byte entropy count map feature data to generate a detection model capable of classifying the normal programs and the malicious codes. Based on the generated detection model, detection is made regarding whether or not any analysis target file corresponds to the malicious codes. Since the feature of the entropy count map is formed with a distribution of entropy values in a lower dimensional number, it is possible to minimize the redundancy and the noise problems of malicious code data, to improve detection accuracy, to speed up learning and detection, and to improve flexibility, thus a sufficient learning effect can be obtained in the smaller amount of learning data.

Description

저 차원 수의 엔트로피 카운트 맵 기반 악성코드 탐지 방법 {Method of detecting malware based on entropy count map of low dimensional number}TECHNICAL FIELD [0001] The present invention relates to an entropy count map detecting method,

본 발명은 정보 보안 기술 분야에 관한 것으로서, 보다 상세하게는 엔트로피 카운트 맵을 이용한 악성코드(Malware) 탐지 기술에 관한 것이다.BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to the field of information security technology, and more particularly, to a technology for detecting malware using an entropy count map.

다양한 악성코드들이 끊임없이 생성되고 있다. 예컨대, 랜섬웨어 및 지능형 신종 악성코드와 무수한 변종들이 최근에 급격하게 증가하고 있다. 악성코드를 탐지하는 방법 중의 하나로 시그니처(signiture) 기반의 탐지방법이 있다. 이 탐지방법은 악성코드에 대한 시그니처와 악성유무 판별의 대상이 되는 임의의 바이너리 파일에 대한 시그니처를 추출하고, 그 두 시그니처를 비교하여 계산된 유사 정도를 악성코드 탐지 및 분류에 이용하는 방법이다. 그런데 시그니처 기반 탐지방법은 기존에 알려진 악성코드에 대해서만 대응할 수 있고, 신종이나 변종 악성코드를 탐지하는 데 큰 한계를 갖는다. Various malicious codes are constantly being generated. For example, Ransomware and intelligent new malware and myriad variants have been increasing rapidly in recent years. One of the ways to detect malicious code is sign-based detection. This detection method is a method of extracting signatures for malicious codes and arbitrary binary files that are subject to malicious existence, and comparing the calculated similarities to malicious code detection and classification. However, signature-based detection methods can only respond to known malicious codes, and have great limitations in detecting new or variant malicious codes.

시그니처 기반 탐지방법의 한계를 극복하고 악성 코드의 다양화에 대처하기 위해 기계학습(machine learning) 기반의 탐지방법이 제안되었다. 기존에 알려진 일반적인 기계학습 기반 악성코드 탐지방법은 정상 파일과 악성코드가 포함된 파일(이하, 간략히 '악성코드'라 함)로 학습된 탐지 모델을 만들고, 그 학습된 탐지 모델을 이용하여 임의의 파일이 악성코드인지 여부를 탐지하는 것이다. 이 탐지방법은 신종이나 변종 악성코드까지 탐지할 수 있는 장점이 있다. A machine learning based detection method has been proposed to overcome the limitations of signature-based detection methods and cope with the diversification of malicious codes. A known machine learning-based malicious code detection method known in the art is to create a detection model learned from a file containing normal files and malicious codes (hereinafter, simply referred to as "malicious code"), It is to detect whether the file is malicious code. This detection method has the advantage of detecting new or variant malicious codes.

기계학습 기반의 탐지방법을 사용하기 위해서는 신규의 악성 코드 데이터를 학습하여 악성 코드 탐지모델을 꾸준히 갱신해야 해야 한다. 기존에 알려진 기계학습 기반 악성코드 탐지기술은 기존의 데이터와 새로 생겨난 악성코드에 관한 신규 데이터 간의 데이터 중복 문제, 노이즈 데이터 문제, 모델의 확장성 제약 등의 단점이 있다. 데이터 중복에 따라 처리해야 할 데이터 량이 불필요하게 많아지고, 탐지모델 갱신 작업이 까다로워진다. 또한, 데이터의 중복은 탐지모델의 성능을 저하시키는 요인이 될 수 있다. 노이즈 데이터로 인한 탐지 성공률이 낮아지는 문제도 생긴다. In order to use machine learning based detection method, new malicious code data should be learned and malicious code detection model should be updated constantly. Previously known machine learning based malware detection techniques have disadvantages such as data duplication problem between existing data and new data about newly created malicious code, noise data problem, and model extensibility restriction. The amount of data to be processed due to data duplication becomes unnecessarily large, and the updating of the detection model becomes difficult. In addition, redundancy of data can be a factor that deteriorates the performance of the detection model. There is a problem that the detection success rate due to noise data is lowered.

해커들도 나날이 지능화 되면서 악성코드를 이용한 공격 방법 및 공격 루트가 복잡하고 예측 불가능하게 진화하고 있다. 새롭게 생성되는 신규 악성코드도 많고 그것들의 변종도 많이 생겨난다. 신규 악성코드와 변종 악성코드의 데이터를 확보하여 기 생성한 기존의 악성코드 탐지모델에 업데이트함으로써 악성코드 탐지능력을 꾸준히 같이 진화시킬 필요가 있다. As hackers become more intelligent day by day, attack methods and attack routes using malicious code are evolving to complex and unpredictable. There are many new malicious codes that are newly created, and many variants of them are generated. It is necessary to constantly evolve malicious code detection capability by updating existing malicious code detection models by acquiring new malicious code and malicious malicious code data.

최근에 출현하는 대부분의 지능화된 악성코드들은 기존의 백신 프로그램을 우회하여 공격하는 경향이 늘고 있다. 악성코드 탐지기술을 우회하기 위해 대부분의 악성코드들은 난독화 되어 있거나 압축되어 있다. 난독화되고 압축된 악성코드에 대해 더 정확한 정보들을 얻기 위해서는 악성코드의 난독화를 제거하고, 압축을 풀어야 한다. 하지만 이러한 작업들은 전문가의 지식과 많은 시간을 필요로 한다. 알려져 있지 않은 난독화가 적용되어 있는 악성코드의 경우, 그러한 작업을 수행하는 데 한계가 있다. 따라서 일반적인 악성코드를 탐지할 수 있을 뿐만 아니라, 난독화 되어있거나 또는 압축되어 있는 악성코드들도 탐지할 수 있는 악성코드의 특징 추출이 필요하다.Most recent intelligent malicious codes are increasingly being attacked by bypassing existing vaccine programs. Most malicious codes are obfuscated or compressed to circumvent malware detection technology. To get more accurate information about obfuscated and compressed malware, you need to remove the obfuscation of the malware and uncompress it. However, these tasks require expert knowledge and time. In the case of malicious code that is obfuscated, which is not known, there are limitations in performing such an operation. Therefore, it is necessary not only to detect common malicious codes but also to extract malicious codes that can detect malicious codes that are obfuscated or compressed.

바이트 기반의 악성코드를 탐지하기 위한 특징으로는 엔-그램(N-gram), 메타데이터(Metadata), 엔트로피(Entropy), 이미지 묘사(Image representation), 문자열 길이(String length) 등이 있다. 기계 학습을 통한 악성코드 탐지에서는 어떠한 특징을 선택하느냐에 따라 탐지 정확성과 학습 시간에 차이가 존재할 수 있다. 특히, 특징의 차원이 높아지면 학습에 필요한 데이터가 기하급수적으로 많아지고, 학습 시간도 많이 걸린다는 단점이 있다. Features for detecting byte-based malware include N-gram, Metadata, Entropy, Image representation, and String length. In detection of malicious codes through machine learning, there may be a difference in detection accuracy and learning time depending on which feature is selected. Especially, as the dimension of the feature increases, the data required for learning increases exponentially, and it takes a long learning time.

본 발명은 학습용 정상파일과 악성코드의 바이트 데이터로부터 추출한 저 차원수의 엔트로피 카운트 맵(entropy count map) 특징 데이터를 이용하여 제한된 학습 데이터로도 정확한 탐지성능을 발휘할 수 있으며 유연성이 좋은 악성코드 탐지모델을 만들어 악성코드를 탐지하는 악성코드 탐지방법을 제공하기 위한 것이다.According to the present invention, accurate detection performance can be exhibited even with limited learning data by using low-dimensional entropy count map feature data extracted from normal learning files and byte data of malicious codes, and a flexible malicious code detection model To detect a malicious code to provide a malicious code detection method.

본 발명은 또한 저 차원수의 엔트로피 카운트 맵 특징 데이터 중에서 선택된 프로토타입 데이터를 이용하여 생성한 악성코드 탐지모델에 기초하여 악성코드를 탐지함으로써, 탐지모델 생성 및 갱신에서의 데이터 중복 문제 해소가 가능하고, 데이터 잡음에 강하고 탐지 정확도를 높일 수 있으며, 학습시간도 최소화 시킬 수 있는 악성코드 탐지방법을 제공하기 위한 것이다.The present invention also enables detection of malicious code based on a malicious code detection model generated using prototype data selected from entropy count map feature data of a low dimensional number to solve the problem of data duplication in detection model generation and update To provide a malicious code detection method that can be strong against data noise, increase detection accuracy, and minimize learning time.

본 발명이 해결하고자 하는 과제는 상술한 과제들에 한정되는 것이 아니며, 본 발명의 사상 및 영역으로부터 벗어나지 않는 범위에서 다양하게 확장될 수 있을 것이다.The present invention is not limited to the above-described embodiments, and various modifications may be made without departing from the spirit and scope of the invention.

상기 본 발명의 일 목적을 실현하기 위한 실시예들에 따른 저 차원 수의 엔트로피 카운트 맵 기반 악성코드 탐지방법은 컴퓨팅 장치에서 실행되는 컴퓨터 프로그램을 이용하여 악성코드를 탐지하기 위한 방법이다. 상기 악성코드 탐지방법은 입력 데이터로 제공되는 다수의 정상 프로그램과 악성 코드의 학습용 파일들로부터 다수의 바이트 기반 엔트로피 특징 데이터를 추출하는 단계; 추출된 상기 다수의 바이트 기반 엔트로피 특징 데이터들을 '엔트로피 값의 범위'별 존재 빈도로 매핑시켜 더 낮은 차원수의 다수의 바이트 엔트로피 카운트 맵 특징데이터로 변환하는 단계; 상기 다수의 바이트 엔트로피 카운트 맵 특징 데이터를 이용하여 기계학습을 수행하는 것에 의해 정상 프로그램과 악성 코드를 분류할 수 있는 탐지모델을 생성하는 단계; 및 생성된 탐지모델에 기초하여, 임의의 분석대상 파일이 악성 코드에 해당하는지 여부를 분석하는 탐지 단계를 포함한다. A low-dimensional entropy count map-based malicious code detection method according to embodiments for realizing the object of the present invention is a method for detecting a malicious code using a computer program executed in a computing device. The method includes: extracting a plurality of byte-based entropy feature data from a plurality of normal programs and malicious code learning files provided as input data; Converting the extracted plurality of byte-based entropy feature data into a plurality of byte entropy count map feature data of a lower dimensional number by mapping the extracted plurality of byte-based entropy feature data to a presence frequency of each 'range of entropy values'; Generating a detection model capable of classifying normal programs and malicious codes by performing machine learning using the plurality of byte entropy count map feature data; And a detection step of analyzing whether or not any analysis target file corresponds to a malicious code based on the generated detection model.

예시적인 실시예들에 있어서, 상기 '다수의 바이트 기반 엔트로피 특징 데이터를 추출하는 단계'는, 상기 학습용 파일들의 바이트 어레이 분석용 윈도우의 사이즈와 윈도우 이동 스텝 사이즈를 설정하는 단계; 각 학습용 파일의 바이트 어레이 전체에 대하여 맨 처음부터 끝까지 윈도우를 상기 윈도우 이동 스텝 사이즈만큼씩 이동해가면서 N개의 윈도우(단, N은 2보다 큰 자연수)를 생성하고, 상기 N개의 윈도우 각각을 통해 각 윈도우에 대응되는 N개의 바이트 히스토그램을 산출하는 단계; 산출된 N개의 바이트 히스토그램 전체를 통합하여 하나의 바이트 히스토그램 어레이를 생성하는 단계; 및 상기 바이트 히스토그램 어레이를 바이트 엔트로피 계산을 통해 바이트 엔트로피 어레이로 변환하는 단계를 포함할 수 있다.In the exemplary embodiments, the step of extracting a plurality of byte-based entropy characteristic data includes: setting a size of a window for analyzing a byte array of the learning files and a window movement step size; N windows (where N is a natural number greater than 2) are generated while moving the window by the window moving step size from the beginning to the end with respect to the entire byte array of each learning file, and each window Calculating N byte histograms corresponding to the N bytes; Integrating all of the N byte histograms to generate a byte histogram array; And converting the byte histogram array into a byte entropy array through byte entropy computation.

예시적인 실시예들에 있어서, 상기 원도우의 사이즈는 상기 윈도우 이동 스텝 사이즈보다 크게 설정되어, 이동 전후의 인접하는 앞뒤 윈도우들 간에 중첩될 수 있다. In the exemplary embodiments, the size of the window is set to be larger than the window moving step size, and can be overlapped between adjacent front and rear windows before and after the movement.

예시적인 실시예들에 있어서, 상기 'N개의 바이트 히스토그램을 산출하는 단계'는, 상기 N개의 윈도우 각각에 대하여, 각 윈도우에 포함되는 바이트 어레이의 전체 바이트들의 10진수 값들의 빈도를 카운트 하는 단계; 및 각 윈도우별로 카운트된 10진수 값들의 빈도를 해당 윈도우에 대응하는 바이트 어레이 히스토그램으로 생성하여 N개의 윈도우에 대응되는 N개의 바이트 히스토그램을 산출하는 단계를 포함할 수 있다.In the exemplary embodiments, the step of 'calculating N byte histograms' may include counting the frequency of decimal values of all the bytes of the byte array included in each window for each of the N windows; And generating the N byte histograms corresponding to the N windows by generating the frequency of the decimal values counted for each window with the byte array histogram corresponding to the corresponding window.

예시적인 실시예들에 있어서, 상기 '바이트 엔트로피 어레이로 변환하는 단계'는, 상기 바이트 히스토그램 어레이를 구성하는 제1 내지 제N 바이트 히스토그램 각각에서 바이트 주파수 비(=임의의 바이트 히스토그램 영역 내의 전체 원소의 값의 총합에 대한 각 원소의 값의 비)를 계산하여 제1 내지 제N 바이트 주파수 비 어레이를 생성하는 단계; 생성된 상기 제1 내지 제N 바이트 주파수 비 어레이를 이용하여, 각 윈도우별로 바이트 주파수 비에 대한 바이트 엔트로피를 계산하여 제1 내지 제N 바이트 엔트로피 어레이를 계산하는 단계; 및 계산된 제1 내지 제N 바이트 엔트로피 어레이 전체를 통합하여 상기 학습용 파일의 상기 바이트 엔트로피 어레이를 생성하는 단계를 포함할 수 있다.In the exemplary embodiments, the step of 'converting into a byte entropy array' may include a step of converting a byte frequency ratio (= all of the elements in the arbitrary byte histogram area) in each of the first through Nth byte histograms constituting the byte histogram array Calculating a ratio of a value of each element to a sum of values of the first to Nth byte frequency non-arrays; Calculating first through Nth byte entropy arrays by calculating a byte entropy with respect to a byte frequency ratio for each window using the first through Nth byte frequency array arrays; And generating the byte entropy arrays of the training file by integrating the calculated first through Nth byte entropy arrays as a whole.

예시적인 실시예들에 있어서, 상기 바이트 주파수 비에 대한 상기 바이트 엔트로피는 식

Figure 112018077801635-pat00001
을 이용하여 계산될 수 있다. 여기서,
Figure 112018077801635-pat00002
는 윈도우내 원소 i번째 엔트로피 값을 나타내고,
Figure 112018077801635-pat00003
는 윈도우의 원소 i번째 바이트 주파수 비를 나타낸다.In the exemplary embodiments, the byte entropy for the byte frequency ratio is given by Equation
Figure 112018077801635-pat00001
. ≪ / RTI > here,
Figure 112018077801635-pat00002
Represents the i-th entropy value of the element in the window,
Figure 112018077801635-pat00003
Represents the i-th byte frequency ratio of the window element.

예시적인 실시예들에 있어서, 상기 '다수의 바이트 엔트로피 카운트 맵 특징데이터로 변환하는 단계'는, 상기 바이트 엔트로피 어레이를 구성하는 제1 내지 제N 바이트 엔트로피 어레이를 Nx1 크기의 2차원 바이트 엔트로피 행렬로 변환하는 단계; 및 상기 2차원 바이트 엔트로피 행렬의 원소들을 R개(여기서, 상기 R은 2보다 큰 자연수임)의 범위로 구분된 바이트 엔트로피 값의 범위들로 매핑시켜 상기 원소들을 상기 바이트 엔트로피 값의 범위별 존재 빈도로 나타낸 상기 바이트 엔트로피 카운트 맵을 생성하는 단계를 포함할 수 있다.In the exemplary embodiments, the step of converting into 'a plurality of byte entropy count map feature data' may be a step of converting the first through Nth byte entropy arrays constituting the byte entropy array into a Nx1 size two-dimensional byte entropy matrix Converting; And mapping the elements of the two-dimensional byte entropy matrix into ranges of byte entropy values separated by R (where R is a natural number greater than 2), so as to convert the elements into an existence frequency of the byte entropy value And generating the byte entropy count map represented by the byte entropy count map.

예시적인 실시예들에 있어서, 상기 바이트 엔트로피 값의 범위는, 상기 바이트 엔트로피 값 0 이상 0.6 미만을 R-1개의 범위로 구분하고, 상기 바이트 엔트로피 값 0.6 이상을 1가지 범위로 구분하여, 총 R개의 범위로 구분될 수 있다.In the exemplary embodiments, the range of the byte entropy value may be defined by dividing the byte entropy value of 0 to less than 0.6 into R-1 ranges, dividing the byte entropy value of 0.6 or more into one range, ≪ / RTI >

예시적인 실시예들에 있어서, 상기 R은 7일 수 있다.In exemplary embodiments, R may be 7.

예시적인 실시예들에 있어서, '상기 바이트 엔트로피 카운트 맵을 생성하는 단계'는, 상기 2차원 바이트 엔트로피 행렬의 각 열마다 해당 열에 속하는 N개의 바이트 엔트로피 값들이 상기 R개의 범위 중 어느 범위에 속하는지를 비교하여 상기 R개의 범위 각각에 속하는 바이트 엔트로피 값들의 개수를 카운트하는 단계; 및 카운트 결과를 R x Q 크기의 2차원 행렬로 표현하는 단계를 포함할 수 있다. 여기서, R은 바이트 엔트로피 값의 범위의 개수이고, Q는 1 바이트가 나타내는 10진수의 개수이며, N>>R이다.In the exemplary embodiments, the step of generating the byte entropy count map may include determining whether the N byte entropy values belonging to the column of each of the two-dimensional byte entropy matrix belongs to which of the R ranges Counting the number of byte entropy values belonging to each of the R ranges; And representing the count result as a R x Q size two-dimensional matrix. Here, R is the number of ranges of byte entropy values, Q is the number of decimal digits represented by 1 byte, and N >> R.

예시적인 실시예들에 있어서, 상기 악성코드 탐지방법은 상기 다수의 바이트 기반 엔트로피 특징 데이터의 전체를 이용하거나 또는 상기 전체의 일부로서 상기 전체를 대표하는 적은 수의 프로토타입 데이터를 상기 탐지모델의 생성을 위해 이용할 수 있다.In exemplary embodiments, the malicious code detection method may use the entirety of the plurality of byte-based entropy feature data, or a small number of prototype data representative of the entirety as part of the overall, For example.

예시적인 실시예들에 있어서, 상기 '탐지모델을 생성하는 단계'는, 상기 학습용 파일의 데이터들 간의 비유사도와 클래스 정보를 이용하여 각 학습용 파일의 클래스에 속하는 바이트 엔트로피 카운트 맵 특징 데이터를 대표하는 프로토타입 데이터를 선정하는 단계; 및 선정된 프로토타입 데이터의 집합을 새로운 학습 데이터 집합으로 삼아 기계학습을 수행하여 상기 탐지모델을 생성하는 단계를 포함할 수 있다.In the exemplary embodiments, the 'generating the detection model' may be a step of representing the byte entropy count map feature data belonging to the class of each learning file using the non-guide diagram and the class information between the data of the learning file Selecting prototype data; And generating the detection model by performing the machine learning using a set of the selected prototype data as a new learning data set.

예시적인 실시예들에 있어서, 상기 학습용 파일들의 클래스 영역들은 프로토타입 데이터와 상기 프로토타입 데이터를 중심으로 하는 반지름에 의해 규정되는 구로 구분되며, 상기 반지름은 가장 인접한 다른 클래스 데이터와 가장 먼 동일 클래스 데이터의 중간 거리 값으로 결정될 수 있다.In exemplary embodiments, the class regions of the learning files are divided into proto-type data and phrases defined by a radius centered on the proto-type data, and the radius is the same class data as the closest other class data As shown in FIG.

예시적인 실시예들에 있어서, 상기 탐지 단계는, 상기 분석대상파일의 바이트 엔트로피 특징 데이터를 추출하는 단계; 추출된 상기 분석대상파일의 바이트 엔트로피 특징 데이터를 저 차원수의 바이트 엔트로피 카운트 맵 특징 데이터로 변환하는 단계; 및 변환된 상기 분석대상파일의 바이트 엔트로피 카운트 맵 특징 데이터를 상기 탐지모델에 기초하여 분석하여 상기 분석대상파일이 정상 프로그램에 해당하는지 아니면 악성코드에 해당하는지를 판단하는 단계를 포함할 수 있다.In exemplary embodiments, the detecting includes extracting a byte entropy characteristic data of the analysis target file; Converting the extracted byte entropy characteristic data of the analysis target file into low dimensional number of byte entropy count map characteristic data; And analyzing the converted byte entropy count map feature data of the analysis target file based on the detection model to determine whether the analysis target file corresponds to a normal program or a malicious code.

예시적인 실시예들에 있어서, 위에서 언급된 악성코드 탐지방법들을 수행하기 위하여 컴퓨터 판독 가능한 기록 매체에 저장된 컴퓨터 실행가능 프로그램이 제공될 수 있다.In exemplary embodiments, a computer executable program stored on a computer-readable recording medium may be provided to perform the above-described malicious code detection methods.

예시적인 실시예들에 있어서, 위에서 언급된 악성코드 탐지방법을 수행하기 위한 컴퓨터 실행가능 프로그램이 기록된 컴퓨터 판독 가능한 기록 매체가 제공될 수 있다.In exemplary embodiments, a computer-readable recording medium on which a computer-executable program for performing the above-mentioned malicious code detection method is recorded may be provided.

기존의 일반적인 기계학습 기반의 악성 코드 탐지방법은 차원이 높은 데이터를 사용하여 학습시키므로 모델 학습을 위한 데이터도 기하급수적으로 많이 필요하게 된다. 또한, 학습 시간도 많이 걸리는 단점이 있다. 데이터의 중복 및 노이즈 문제가 존재하여 탐지의 정확도가 낮을 수도 있다. 이에 비해, 본 발명에 따른 악성코드 탐지방법은 학습용 데이터의 바이트 기반 엔트로피 특징을 차원 수가 낮은 엔트로피 카운트 맵 특징 데이터로 변환하여 탐지모델을 생성한다. 분석대상 파일에 대해서도 동일하게 저 차원 수의 엔트로피 카운트 맵 특징 데이터를 추출하여 상기 탐지모델을 이용하여 악성코드 탐지여부를 판별한다. Since the existing malware detection method based on general machine learning learns by using high-dimensional data, data for model learning is also needed exponentially. In addition, it takes a lot of learning time. Data redundancy and noise issues may exist and the accuracy of the detection may be low. In contrast, the malicious code detection method according to the present invention generates a detection model by converting a byte-based entropy feature of learning data into entropy count map feature data having a low number of dimensions. Likewise, the low-dimensional-number entropy count map feature data is extracted for the analysis target file, and malicious code detection is determined using the detection model.

엔트로피 카운트 맵 특징 데이터의 가장 큰 장점은 차원수가 낮다는 것이다. '차원의 저주' 이론에 의하면, 차원이 늘어날수록 정확한 모델을 생성하기 위한 학습용 데이터가 기하급수적으로 늘어나게 된다. 하지만 현실적으로는 기하급수적으로 늘어나는 학습용 데이터를 충당하기가 불가능하다. 학습용 데이터 수가 소정 범위 이내로 제한되는 이런 현실적인 상황을 전제하면, 차원의 수를 줄여서 더 정확한 모델을 만들 수 있다. 즉, 탐지모델 생성에 이용된 엔트로피 카운트 맵의 차원수가 낮아 더 적은 데이터로 충분한 학습 효과를 제공할 수 있다. 탐지모델에 신규의 악성코드 데이터를 빠르게 학습시킬 수 있다. The main advantage of entropy count map feature data is that the number of dimensions is low. According to the 'curse of dimension' theory, as the dimension increases, the learning data for generating the accurate model increases exponentially. In reality, however, it is impossible to cover the exponential growth of learning data. Assuming this realistic situation that the number of learning data is limited within a predetermined range, a more accurate model can be made by reducing the number of dimensions. That is, the number of dimensions of the entropy count map used for generation of the detection model is low, and a sufficient learning effect can be provided with less data. It is possible to quickly learn new malicious code data in the detection model.

엔트로피 카운트 맵 특징 데이터는 바이트 엔트로피 값들을 크기 범위별 빈도로 변환하여 나타낸 것이므로, 엔트로피 카운트 맵 특징 데이터를 이용하여 만든 탐지모델은 데이터의 잡음에 강한 장점을 갖는다.  Since the entropy count map feature data is obtained by converting the byte entropy values into the frequencies of each size range, the detection model created using the entropy count map feature data has a strong advantage on the noise of the data.

이렇게 데이터 잡음에 강하고 정확한 탐지모델은 우수한 악성코드 탐지 성능을 제공할 수 있다. 저 차원수의 엔트로피 카운트 맵 특징 데이터는 이를 가능하게 해준다. This data noise-robust and accurate detection model can provide good malware detection performance. The entropy count map feature data of the low dimensional number makes this possible.

탐지모델이 엔트로피 카운트 맵 특징을 이용하여 만들어지므로, 일반적인 악성코드를 탐지 할 수 있을 뿐만 아니라 난독화 되어있거나 또는 압축되어 있는 악성코드도 탐지할 수 있다. Because the detection model is created using the entropy count map feature, it can detect common malicious code as well as malicious code that is obfuscated or compressed.

악성 코드가 주로 수행하는 악성 행위는 사용자에게 기기관리자 권한을 요구하는 것이며, 사용자의 개인 정보 및 기기 정보, 통화 녹취 및 위치 정보 등을 탈취하는 행위를 포함할 수 있다. 이러한 악성 행위들 각각은 서로 다른 클래스로 묶어 구분할 수 있다. 본 발명에 따르면, 학습용 데이터로부터 추출된 엔트로피 카운트 맵 특징 데이터 전체를 이용하는 대신에 그 전체 특징 데이터에서 각 클래스를 대표하는 프로토타입 데이터를 선정하여 탐지모델을 만들 수 있다. 이 방법에 의하면, 엔트로피 카운트 맵 특징 데이터 전체를 저장하는 대신 그것을 대표하는 여러 개의 프로토타입 데이터만을 저장하면 되므로, 컴퓨터의 저장 공간을 크게 줄일 수 있는 장점이 있다. The malicious activity that the malicious code mainly performs is to require the user to have the device administrator authority, and may include taking the user's personal information, device information, call recording, and location information. Each of these malicious behaviors can be grouped into different classes. According to the present invention, instead of using the entire entropy count map feature data extracted from the training data, a detection model can be created by selecting prototype data representative of each class from the whole feature data. According to this method, instead of storing the entire entropy count map feature data, only a plurality of prototype data representative of the entropy count map feature data can be stored, thereby saving the storage space of the computer considerably.

또한, 프로토타입 데이터만을 이용하여 탐지모델을 구축하는 방법은 데이터의 중복 및 잡음 문제를 더욱 줄여주어 탐지모델의 성능을 더 높일 수가 있다. 나아가, 엔트로피 카운트 맵 특징 데이터 전체에서 그것을 대표하는 몇 개의 프로토타입 데이터만을 가지고 탐지모델을 생성하기 때문에 악성코드 학습 과정이 상대적으로 짧아지게 되는 이점도 있다. In addition, the method of constructing the detection model using only the prototype data can further reduce the redundancy and noise problem of the data, thereby further enhancing the performance of the detection model. Furthermore, since the detection model is generated with only a few prototype data representative of all the entropy count map feature data, there is an advantage that the malicious code learning process is relatively short.

악성코드는 나날이 진화함에 따라 신규 악성코드는 구 탐지모델에서는 탐지 할 수 없게 된다. 따라서 주기적으로 구 탐지모델을 신 탐지모델로 갱신해줄 필요가 있다. 즉, 신규 악성코드를 탐지할 수 있는 성능을 구 탐지모델의 탐지 성능에 추가할 필요가 있다. 이를 위해 본 발명에 의하면, 구 탐지모델에서는 프로토타입 데이터들의 정보만을 고려하여 신규 악성코드 데이터를 추가한다. 각 클래스를 대표하는 프로토타입 데이터는 신규 악성코드 데이터에 의해 바뀔 수도 있고, 바뀌지 않을 수도 있다.As malicious code evolves day by day, new malware can not be detected by the sphere detection model. Therefore, it is necessary to periodically update the old detection model with the new detection model. In other words, the ability to detect new malicious code needs to be added to the detection performance of the old detection model. According to the present invention, in the sphere detection model, new malicious code data is added considering only information of prototype data. Prototype data representing each class may or may not be changed by new malicious code data.

프로토타입 데이터 선정기술을 적용하지 않으면 엔트로피 카운트 맵 특징 데이터 전체를 고려해야 하지만, 프로토타입 데이터 선정기술을 적용하면 신규 악성코드 데이터는 프로토타입 데이터들의 정보만을 비교하면 되므로 탐지모델의 유연성을 높일 수 있는 장점도 갖는다. If the prototype data selection technology is not applied, the whole entropy count map characteristic data must be considered. However, if the prototype data selection technology is applied, new malicious code data can be compared with the prototype data only, .

또한, 탐지모델이 엔트로피 카운트 맵 특징에 기초한 프로토타입을 이용하여 만들어지므로, 일반적인 악성코드를 탐지 할 수 있을 뿐만 아니라 난독화 되어있거나 또는 압축되어 있는 악성코드도 탐지할 수 있다. In addition, since the detection model is created using a prototype based on the entropy count map feature, not only can it detect common malicious codes, but also malicious codes that are obfuscated or compressed can be detected.

도 1은 본 발명의 실시예에 따른 악성코드 탐지모델의 전반적인 생성 과정을 나타내는 흐름도이다.
도 2는 본 발명의 실시예에 따른 악성코드 탐지모델을 이용한 악성코드 탐지 과정을 개략적으로 나타내는 흐름도이다.
도 3은 본 발명의 예시적인 실시예에 따른 바이트 기반 엔트로피 카운트 맵을 생성하는 과정을 나타내는 흐름도이다.
도 4 내지 도 8은 대상 파일의 바이트 히스토그램 어레이 산출단계를 설명하기 위한 도면들로서, 도 4는 바이트 히스토그램 산출을 위한 윈도우 사이즈 설정을 예시하고, 도 5는 설정된 윈도우 영역 내의 바이트 어레이에 대하여 바이트 히스토그램을 계산하는 것을 예시하며, 도 6은 이동 스텝 사이즈만큼 윈도우를 이동하여 새로운 윈도우를 설정하는 것을 예시하며, 도 7은 새로 설정된 윈도우에 대하여 같은 방법으로 그 윈도우 내의 바이트 어레이에 대하여 바이트 히스토그램을 생성하는 것을 예시하며, 도 8은 전체 윈도우 영역의 바이트 히스토그램을 모아 바이트 히스토그램 어레이를 생성하는 것을 예시한다.
도 9는 바이트 히스토그램 어레이를 바이트 엔트로피 계산을 통해 바이트 엔트로피 어레이로 변환하는 것을 예시한다.
도 10은 바이트 엔트로피 특징 데이터를 계산하는 방법을 도식적으로 예시한다.
도 11은 바이트 엔트로피 어레이를 2차원의 바이트 엔트로피 행렬로 형태변환을 하는 것을 예시한다.
도 12는 2차원 바이트 엔트로피 행렬을 엔트로피 카운트 맵 특징 데이터로 변환하는 것을 예시한다.
도 13은 차원이 높아지면 학습에 필요한 데이터의 량이 기하급수적으로 증가하는 것을 나타내는 도면이다.
도 14는 탐지모델 생성을 위해 사용되는 기계 학습용 정상 프로그램과 악성 코드의 엔트로피 카운트 맵 특징 데이터의 분포도이다.
도 15는 도 14의 엔트로피 카운트 맵 특징 데이터를 이용한 기계학습을 통해 얻은 탐지모델을 신규의 엔트로피 카운트 맵 데이터로 갱신하는 것을 설명하기 위한 도면이다.
도 16은 도 14에 도시된 각 클래스별 엔트로피 카운트 맵 특징 데이터의 전체를 대표하는 프로토타입 데이터를 도시한다.
도 17은 도 16의 프로토타입 데이터를 이용한 기계학습을 통해 얻은 탐지모델을 신규의 엔트로피 카운트 맵 데이터로 갱신하는 것을 설명하기 위한 도면이다.
도 18과 도 19는 정상 프로그램 파일로부터 추출된 바이트 엔트로피 카운트 맵 특징 데이터(도면에서 파란색 원으로 표시됨)와 악성코드로부터 추출된 바이트 엔트로피 카운트 맵 특징 데이터(도면에서 붉은색 x로 표시됨)를 이용하여 기계학습을 하는 과정을 나타낸다.
1 is a flowchart illustrating an overall generation process of a malicious code detection model according to an embodiment of the present invention.
2 is a flowchart schematically illustrating a malicious code detection process using a malicious code detection model according to an embodiment of the present invention.
3 is a flow diagram illustrating a process for generating a byte-based entropy count map in accordance with an exemplary embodiment of the present invention.
FIGS. 4 to 8 are diagrams for explaining a byte histogram array calculation step of a target file. FIG. 4 illustrates a window size setting for calculating a byte histogram. FIG. 5 illustrates a byte histogram FIG. 6 illustrates moving a window by a moving step size to set a new window, and FIG. 7 illustrates creating a byte histogram for a byte array in the window in the same way for a newly set window FIG. 8 illustrates the generation of a byte histogram array by gathering byte histograms of the entire window region.
Figure 9 illustrates the translation of a byte histogram array into a byte entropy array through byte entropy computation.
FIG. 10 schematically illustrates a method of calculating byte entropy characteristic data.
FIG. 11 illustrates the transformation of a byte entropy array into a two-dimensional byte entropy matrix.
12 illustrates the transformation of a two-dimensional byte entropy matrix into entropy count map feature data.
13 is a diagram showing that the amount of data necessary for learning increases exponentially as the dimension increases.
14 is a distribution diagram of entropy count map feature data of a normal program for machine learning and malicious code used for generation of a detection model.
FIG. 15 is a diagram for explaining updating of a detection model obtained through machine learning using the entropy count map characteristic data of FIG. 14 with new entropy count map data.
FIG. 16 shows prototype data representing the entirety of entropy count map feature data for each class shown in FIG.
FIG. 17 is a diagram for explaining updating of a detection model obtained through machine learning using the prototype data of FIG. 16 with new entropy count map data. FIG.
18 and 19 are diagrams for explaining an example of a case where a byte entropy count map feature data (indicated by a blue circle in the drawing) extracted from a normal program file and a byte entropy count map feature data (represented by a red color x in the drawing) extracted from a malicious code It represents the process of machine learning.

본문에 개시되어 있는 본 발명의 실시예들에 대해서, 특정한 구조적 내지 기능적 설명들은 단지 본 발명의 실시예를 설명하기 위한 목적으로 예시된 것으로, 본 발명의 실시예들은 다양한 형태로 실시될 수 있으며 본문에 설명된 실시예들에 한정되는 것으로 해석되어서는 아니 된다.For the embodiments of the invention disclosed herein, specific structural and functional descriptions are set forth for the purpose of describing an embodiment of the invention only, and it is to be understood that the embodiments of the invention may be practiced in various forms, The present invention should not be construed as limited to the embodiments described in Figs.

본 발명에서 사용한 용어는 단지 특정한 실시예를 설명하기 위해 사용된 것으로, 본 발명을 한정하려는 의도가 아니다. 단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함한다. 본 출원에서, "포함하다" 또는 "가지다" 등의 용어는 명세서 상에 기재된 특징, 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것이 존재함을 지정하려는 것이지, 하나 또는 그 이상의 다른 특징들이나 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것들의 존재 또는 부가 가능성을 미리 배제하지 않는 것으로 이해되어야 한다.The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The singular expressions include plural expressions unless the context clearly dictates otherwise. In the present application, the terms "comprises" or "having" and the like are used to specify that there is a feature, a number, a step, an operation, an element, a component or a combination thereof described in the specification, But do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, or combinations thereof.

이하, 첨부한 도면들을 참조하여, 본 발명의 바람직한 실시예를 보다 상세하게 설명하고자 한다. 도면상의 동일한 구성요소에 대해서는 동일한 참조부호를 사용하고 동일한 구성요소에 대해서 중복된 설명은 생략한다.Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings. The same reference numerals are used for the same constituent elements in the drawings and redundant explanations for the same constituent elements are omitted.

일반적으로, 악성코드의 바이트 영역 내에는 다양한 정보들이 존재할 수 있다. 이러한 정보들 각각은 악성코드를 판별할 수 있는 중요한 요소들이다. 한 개의 전역적인 특징점(global features)은 악성코드에 포함된 각각의 정보들을 표현하기에 부적절하다. 그렇기 때문에, '윈도우(Window)'를 사용함으로써 다수 개의 지역적인 특징점(local features)을 추출하여 악성코드의 바이트 영역 내 각각의 정보들을 표현할 수 있다. 알려진 바에 따르면, 지역적인 특징점들이 전역적인 특징점보다 더 좋은 성능을 보인다. 지역적인 특징점과 전역적인 특징점을 모두 사용하면, 더 좋은 성능을 보일 수 있다. 하지만 악성코드 탐지에서는 증가하는 차원에 따라 필요로 하는 데이터의 수에 제약이 존재하기 때문에 적절하지 않다.In general, various information may exist in the byte area of the malicious code. Each of these pieces of information is an important factor in identifying malicious code. One global feature is inadequate to represent each piece of information contained in the malicious code. Therefore, by using 'Window', it is possible to extract local features and express each information in byte area of malicious code. It is known that local feature points perform better than global feature points. Using both local and global feature points can lead to better performance. However, malicious code detection is not appropriate because there is a limitation on the number of data required depending on the increasing level.

정보에 관한 엔트로피는 '정보를 최적으로 인코딩하기 위해 필요한 비트의 수'를 나타낸다. 엔트로피가 크면 정보가 많고 작으면 정보가 적다. 고발생 빈도 요소들은 적은 비트수(저비용)로 나타내고, 저발생 빈도 요소들은 많은 비트수(고비용)로 나타내면, 경제적(최적 인코딩이 가능)일 수 있다. Entropy on information represents the number of bits needed to encode information optimally. The larger the entropy, the less the information. The high occurrence frequency elements may be represented by a small number of bits (low cost), and the low occurrence frequency elements may be economical (optimal encoding is possible) if they are represented by a large number of bits (high cost).

본 발명의 실시예에 있어서, 엔트로피는 바이트의 불규칙성을 나타낼 수 있는 평가 요소로서 사용될 수 있다. 바이트 기반의 엔트로피 특징 추출방법은 일반적인 악성코드뿐만 아니라, 난독화가 적용된 악성코드까지 분석하기 위해 사용될 수 있다. In an embodiment of the present invention, the entropy can be used as an evaluation factor that can indicate the irregularity of bytes. The byte - based entropy feature extraction method can be used not only for general malicious code but also for malicious code with obfuscation.

엔트로피 값은 아래 식을 이용하여 구할 수 있다. The entropy value can be obtained using the following equation.

Figure 112018077801635-pat00004
......(1)
Figure 112018077801635-pat00004
......(One)

여기서,

Figure 112018077801635-pat00005
는 윈도우내 원소 i번째 엔트로피 값을 나타내고,
Figure 112018077801635-pat00006
는 윈도우의 원소 i번째 주파수 값을 나타낸다.here,
Figure 112018077801635-pat00005
Represents the i-th entropy value of the element in the window,
Figure 112018077801635-pat00006
Represents the ith frequency value of the window.

본 발명은 이러한 개념에 기초하여, 학습용 파일들로부터 바이트 기반 엔트로피 카운트 맵 특징 데이터 추출하여 악성코드 탐지모델을 생성하고, 그 탐지모델을 이용하여 분석대상 파일이 악성코드에 해당하는지 여부를 탐지하는 방법을 제안한다.According to the present invention, a method for extracting a byte-based entropy count map feature data from learning files to generate a malicious code detection model and detecting whether the analysis target file corresponds to a malicious code using the detection model .

도 1은 본 발명의 예시적인 실시예에 따라 엔트로피 카운트 맵 특징 데이터를 이용하여 악성코드 탐지모델을 생성하는 과정을 나타내는 흐름도이다. 1 is a flow diagram illustrating a process for generating a malicious code detection model using entropy count map feature data in accordance with an exemplary embodiment of the present invention.

예시적인 실시예에 따른 악성코드 탐지모델은 이하에서 설명되는 악성코드 탐지모델 생성방법의 실시를 통해 생성될 수 있다. 그 악성코드 탐지모델의 생성방법은 컴퓨터 프로그램(이하, '악성코드 탐지 프로그램'이라 함)으로 구현될 수 있다. 그 악성코드 탐지 프로그램은 컴퓨터 장치에 의해 실행될 수 있다. The malicious code detection model according to the exemplary embodiment can be generated through execution of the malicious code detection model generation method described below. The method of generating the malicious code detection model can be implemented as a computer program (hereinafter referred to as a malicious code detection program). The malicious code detection program can be executed by a computer device.

도 1을 참조하면, 악성 코드 탐지 모델은 학습용 데이터를 이용하여 기계학습을 수행하는 것을 통해 생성할 수 있다. 기계 학습을 위해 우선 학습용 데이터를 준비한다. 학습용 데이터로 정상 프로그램의 데이터와 악성코드의 데이터를 모두 준비한다. 특정 악성코드에 감염된 악성코드 파일과 그것에 감염되지 않은 정상 프로그램 파일 쌍을 학습용 데이터로 사용할 수 있다. 악성코드 파일 - 정상프로그램 파일 쌍의 개수는 충분히 많이 확보한다. 준비된 다수의 학습용 파일 쌍을 컴퓨터 장치에 설치된 탐지모델 생성 프로그램의 입력 데이터로 제공될 수 있다(S10). Referring to FIG. 1, a malicious code detection model can be generated by performing machine learning using learning data. Prepare training data for machine learning first. Prepare both normal program data and malicious code data with learning data. A malicious code file infected with a specific malicious code and a normal program file pair not infected with the malicious code file can be used as learning data. Malicious Code File - Ensure that there are enough normal program file pairs. A plurality of prepared pairs of learning files may be provided as input data of a detection model generation program installed in the computer device (S10).

악성코드를 수집하고 분석하는 과정에서 중요한 것 중의 하나는 분석에 사용하기 위해 기존의 알려진 악성코드 그룹에서 특징을 추출하는 과정이다. 악성코드 특징의 추출 과정이 정확하게 이루어져야 향후 악성코드 후보 프로그램이 등장하였을 때 정확히 분석하여 분류할 수 있게 된다. 따라서 악성코드 분석 및 탐지 기술에서는 기존 악성코드 클래스의 특징을 충분히 반영하여야 한다. One of the important things in collecting and analyzing malicious code is the process of extracting features from existing known malware groups for analysis. The malicious code feature extraction process must be accurately performed so that the malicious code candidate program can be accurately analyzed and classified when the program appears in the future. Therefore, malicious code analysis and detection technology should sufficiently reflect characteristics of existing malicious code classes.

컴퓨터 장치에서 실행된 탐지모델 생성 프로그램은 입력 데이터로 제공된 정상 프로그램과 악성 코드의 학습 데이터들로부터 바이트 기반 엔트로피 특징 데이터를 추출할 수 있다(S20).The detection model generation program executed in the computer device can extract the byte-based entropy feature data from the learning data of the normal program and the malicious code provided as input data (S20).

예시적인 실시예에 따르면, 상기 탐지모델 생성 프로그램은 그 추출된 바이트 기반 엔트로피 특징 데이터들을 '엔트로피 값의 범위'별 존재빈도로 매핑시켜 더 낮은 차원수의 바이트 엔트로피 카운트 맵 특징 데이터로 변환할 수 있다(S30). According to an exemplary embodiment, the detection model generation program can convert the extracted byte-based entropy feature data into a presence frequency of each 'range of entropy values' to convert it into a lower-dimensional number of byte entropy count map feature data (S30).

그리고 상기 탐지모델 생성 프로그램은 추출된 바이트 엔트로피 카운트 맵 데이터를 이용하여 기계학습을 수행할 수 있다. 기계학습을 통해 정상 프로그램과 악성 코드를 분류할 수 있는 탐지모델(분류기)을 생성할 수 있다(S40). 예시적인 실시예에 따르면, 탐지모델 생성을 위한 기계학습에 사용되는 학습 데이터는 단계 S30에서 얻은 다수의 바이트 엔트로피 카운트 맵 데이터 전체일 수 있다. The detection model generation program can perform machine learning using the extracted byte entropy count map data. Through the machine learning, a detection model (classifier) capable of classifying normal programs and malicious codes can be generated (S40). According to an exemplary embodiment, the learning data used for machine learning for generation of the detection model may be the entirety of the plurality of byte entropy count map data obtained in step S30.

어떤 파일이 악성코드에 감염된 상태의 파일과 그렇지 않은 정상 상태의 파일은 서로 다른 엔트로피 특징을 갖는다. 이 두 파일의 엔트로피 특징의 차이 즉, 악성 코드에 엔트로피 카운트 맵 특징 데이터의 값들과 정상 프로그램에 해당하는 엔트로피 카운트 맵 특징 데이터의 값들과 그 값들 간의 차이에 관해 기계학습을 수행할 수 있다. 다수의 학습 파일 쌍에 관하여 이러한 기계 학습을 반복적으로 수행한다. 이를 통해 어떤 파일의 바이트 데이터로부터 얻어진 엔트로피 카운트 맵 특징 데이터를 입력받아 그것이 악성코드인지 아니면 정상 프로그램인지 여부를 구분할 수 있는 분류기 즉, 탐지모델을 생성할 수 있다.A file in which a file is infected with malicious code and a file in a normal state that is not infected have different entropy characteristics. The difference between the entropy characteristics of the two files, that is, the difference between the values of the entropy count map feature data and the values of the entropy count map feature data and the values of the entropy count map feature data corresponding to the normal program, in the malicious code. This machine learning is repeatedly performed with respect to a plurality of learning file pairs. In this way, the entropy count map feature data obtained from the byte data of a certain file can be input to generate a classifier, i.e., a detection model, which can discriminate whether it is a malicious code or a normal program.

예시적인 실시예에 따르면, 단계 S30에서 얻은 다수의 엔트로피 카운트 맵 특징 데이터 전부를 이용하는 대신 그 전체 데이터의 일부로서 상기 전체 데이터를 대표하는 프로토타입 데이터를 선정하고 (S50), 선정된 프로토타입 데이터를 이용하여 기계학습을 수행하여 악성코드 탐지모델을 만들 수도 있다(S60). 프로토타입 데이터는 정상 코드(클래스 A)와 악성 코드(클래스 B) 각각의 프로토타입 데이터를 포함할 수 있다. 여기서, 어떤 클래스의 프로토타입 데이터는 해당 클래스의 엔트로피 카운트 맵 특징 데이터 전체를 대표하는 엔트로피 카운트 맵 특징 데이터를 의미한다. 프로토타입 데이터가 선정되면, 정상 프로그램(클래스 A)과 악성 코드(클래스 B) 각각에서 선택된 프로토타입 데이터를 입력받아 기계학습을 수행함으로써 원하는 탐지모델을 생성할 수 있다(S60). According to the exemplary embodiment, instead of using all of the plurality of entropy count map feature data obtained in step S30, prototype data representing the entire data is selected as a part of the whole data (S50), and the selected prototype data A malicious code detection model may be created by performing machine learning using the detected malicious code (S60). Prototype data may include prototype data for each of the normal code (class A) and malicious code (class B). Here, the prototype data of a class means entropy count map feature data representing the entire entropy count map feature data of the class. When the prototype data is selected, a desired detection model can be generated by receiving the prototype data selected from the normal program (class A) and the malicious code (class B), respectively, and performing machine learning (S60).

이처럼 특정 클래스의 엔트로피 카운트 맵 특징 데이터 전체 대신에 그 전체 데이터를 대표하는 소수의 프로토타입 데이터를 이용하여 탐지모델을 만들면, 저장해야 할 데이터 량이 크게 줄고, 그에 따라 그 데이터를 처리하고 저장하기 위한 컴퓨터 자원 특히, 데이터의 저장 공간을 크게 줄일 수 있다. 계속해서 생겨나는 악성코드 학습 데이터를 기존의 탐지모델에 적용함에 있어서도, 데이터 량이 적으므로 악성코드 학습을 신속하게 수행할 수 있다. 또한, 프로토타입 특징 데이터 기반 탐지기술은 전체 특징 데이터에서 프로토타입을 선택함으로써 데이터의 중복 및 잡음 문제를 줄여줄 수 있고, 탐지모델의 성능을 높일 수 있다. 이와 같은 장점들 때문에, 일반적인 기계학습 기반의 탐지기술의 단점들을 보완하기 위한 방안으로, 프로토타입(prototype) 특징 데이터를 이용할 수 있다. If a detection model is created by using a small number of prototype data representing the entire data instead of the whole entropy count map characteristic data of a specific class, the amount of data to be stored is greatly reduced, and accordingly, In particular, the storage space of data can be greatly reduced. Even when the malicious code learning data that is generated continuously is applied to the existing detection model, since the data amount is small, malicious code learning can be performed quickly. In addition, the prototype feature data-based detection technique can reduce the redundancy and noise problem of data by selecting the prototype from the whole feature data, and can enhance the performance of the detection model. Because of these advantages, prototype feature data can be used as a way to overcome the disadvantages of conventional machine learning based detection techniques.

도 2는 본 발명의 실시예에 따른 악성코드 탐지모델을 이용한 악성코드 탐지 과정을 개략적으로 나타내는 흐름도이다.2 is a flowchart schematically illustrating a malicious code detection process using a malicious code detection model according to an embodiment of the present invention.

도 2를 참조하면, 컴퓨터 장치에는 이하에서 설명하는 알고리즘이 구현된 악성코드 탐지프로그램이 설치되어 실행될 수 있다. 미리 생성한 탐지모델은 상기 악성코드 탐지프로그램의 일부로서 입력되어 반영될 수 있다(S60). Referring to FIG. 2, a malicious code detection program implementing an algorithm described below may be installed and executed in a computer device. The pre-generated detection model can be input and reflected as a part of the malicious code detection program (S60).

입력된 탐지모델에 기반한 악성코드 탐지프로그램이 실행되고 있는 컴퓨터 장치에 악성코드 탐지 대상인 임의의 파일(이하에서는 '분석대상 파일'이라 함)이 입력될 수 있다(S70). An arbitrary file (hereinafter, referred to as 'analysis object file') to be a malicious code detection object may be input to the computer apparatus in which the malicious code detection program based on the input detection model is executed (S70).

악성코드 탐지프로그램은 그 분석대상 파일의 바이트 데이터에 기반한 엔트로피 특징 데이터를 추출할 수 있다(S80).The malicious code detection program can extract entropy feature data based on the byte data of the analysis object file (S80).

악성코드 탐지프로그램은 추출된 엔트로피 특징 데이터를 엔트로피 카운트 맵 특징 데이터로 변환할 수 있다(S90). The malicious code detection program can convert the extracted entropy feature data into entropy count map feature data (S90).

악성코드 탐지프로그램은 탐지모델을 이용하여 그 엔트로피 카운트 맵 특징 데이터가 악성코드에 해당하는지 여부를 판별할 수 있다(S95). The malicious code detection program can use the detection model to determine whether the entropy count map feature data corresponds to a malicious code (S95).

본 발명의 실시예에 따른 악성코드 탐지모델을 만들기 위해서는, 그리고 그 탐지모델을 이용하여 분석대상파일이 악성코드인지를 탐지하기 위해서는, 해당 파일의 바이트 기반 엔트로피 특징 데이터를 추출하고(S20 및 S80 단계), 그 추출된 바이트 엔트로피 특징 데이터를 바이트 엔트로피 카운트 맵 특징 데이터로 변환하는(S30 및 S90 단계) 작업이 수행될 수 있다. 이와 관련하여, 도 3에는 본 발명의 예시적인 실시예에 따라 분석대상파일의 바이트 기반 엔트로피 카운트 맵 특징 데이터를 추출하는 과정을 나타내는 흐름도가 도시되어 있다. In order to create a malicious code detection model according to an embodiment of the present invention and to detect whether the analysis target file is a malicious code using the detection model, byte-based entropy feature data of the file is extracted (S20 and S80 ), And converting the extracted byte entropy characteristic data into byte entropy count map characteristic data (steps S30 and S90). In this regard, FIG. 3 is a flowchart illustrating a process for extracting byte-based entropy count map feature data of an analysis object file according to an exemplary embodiment of the present invention.

도 3을 참조하여 학습용 악성코드 및 정상 프로그램, 그리고 분석대상 파일(이하, 이들을 '대상 파일'로 통칭함) 각각으로부터 엔트로피 카운트 맵 특징 데이터를 추출하는 과정을 구체적으로 설명한다.3, the process of extracting the entropy count map feature data from the malicious code for learning, the normal program, and the analysis object file (hereinafter collectively referred to as 'object file') will be described in detail.

예시적인 실시예에 따르면, 엔트로피 카운트 맵 특징 데이터를 추출하는 과정은 대상 파일(110)의 바이트 히스토그램 어레이(130)를 산출하는 단계(S100), 바이트 히스토그램 어레이(130)를 바이트 엔트로피 어레이(140)로 변환하는 단계(S200), 바이트 엔트로피 어레이(140)를 2차원 형태의 바이트 엔트로피 행렬(145)로 변환하는 단계(S300), 그리고 그 2차원 바이트 엔트로피 행렬(145)을 엔트로피 카운트 맵 특징 데이터(150)로 변환하는 단계(S400)를 포함할 수 있다. According to an exemplary embodiment, the process of extracting the entropy count map feature data includes calculating a byte histogram array 130 of a target file 110, a byte histogram array 130 into a byte entropy array 140, (Step S300) of transforming the byte entropy array 140 into a two-dimensional byte entropy matrix 145, and converting the two-dimensional byte entropy matrix 145 into entropy count map feature data (step S200) 150) (S400).

먼저, 임의의 대상 파일(110)의 바이트 히스토그램 어레이를 산출하는 단계(S100)를 설명한다. 도 4 내지 도 8에는 대상 파일(110)의 바이트 히스토그램 어레이를 산출하는 단계(S100)가 도식적으로 예시되어 있다. 이 단계(S100)에서는 임의의 대상 파일(110)의 바이트 어레이(115)에 대하여 윈도우를 소정 단위씩 이동해가면서 각 윈도우를 통해 바이트 히스토그램을 산출하고, 그 산출된 바이트 히스토그램 전체를 통합하여 하나의 바이트 히스토그램 어레이를 생성한다.First, a step S100 of calculating a byte histogram array of an arbitrary object file 110 will be described. Figures 4-8 illustrate step S100 of calculating a byte histogram array of the object file 110. In this step S100, a byte histogram is calculated through each window while the window is shifted by a predetermined unit with respect to the byte array 115 of an arbitrary object file 110, and the calculated byte histogram is integrated into one byte Create a histogram array.

도 4는 바이트 히스토그램 산출을 위한 윈도우 사이즈 설정을 예시한다. 도 4를 참조하면, 대상 파일(110)은 탐지모델 생성을 위한 학습용 데이터 파일(정상 프로그램과 악성코드를 포함)이거나 또는 기 생성된 탐지모델을 이용하여 악성코드인지 여부를 탐지하는 분석대상 파일일 수 있다. 대상 파일(110)의 바이트 어레이(115)에 관한 바이트 히스토그램을 계산하기 위해, 우선 도 4에 도시된 것처럼 바이트 히스토그램 생성용 윈도우(120)의 사이즈와 그 윈도우(120)를 이동시키는 단위 즉, 윈도우의 이동 스텝 사이즈를 설정할 수 있다. 윈도우의 사이즈와 이동 스텝 사이즈는 예컨대 바이트 단위로 설정할 수 있다. 4 illustrates a window size setting for calculating a byte histogram. Referring to FIG. 4, the target file 110 includes a learning data file (including a normal program and a malicious code) for generating a detection model, or a file to be analyzed, which detects whether or not the malicious code is generated using a pre- . In order to calculate the byte histogram of the byte array 115 of the target file 110, the size of the byte histogram generation window 120 and the unit for moving the window 120, Can be set. The size of the window and the moving step size can be set, for example, in units of bytes.

예시적인 실시예에 있어서, 이동 전후의 인접하는 앞뒤 윈도우들 간에 중첩되도록 하기 위해, 원도우의 사이즈는 이동 스텝 사이즈보다 크게 설정할 수 있다. 이렇게 하는 것이 악성코드 탐지의 정확도를 높이는 데 유리하다. 악성코드 탐지에서는 생성된 윈도우 데이터 간 연계성이 필요하다. 예를 들어 분석 대상 파일(110)에 ConnectNetwork, DownloadFromURL, ShellExecute 라는 세 개의 정보가 있다고 가정하면, 이 3가지 정보가 각각 서로 다른 윈도우에 포함되면, 3개의 윈도우 데이터 [ConnectNetwork], [DownloadFromURL], [ShellExecute]는 데이터 간 연계성이 떨어질 수 있다. 반면에 상기 3가지 정보가 복수 개의 윈도우에 포함되면, 예컨대 [ConnectNetwork, DownloadFromURL], [DownloadFromURL, ShellExecute]와 같은 윈도우 데이터를 생성하게 되면 데이터 간 연계성이 증가하게 된다. 즉, [ConnectNetwork]의 데이터를 통해서는 "네트워크에 연결했다."라는 정보만 알 수 있는데, 이 정보로는 악성코드인지 판단하기 어려운 점이 있다. 그러나 [ConnectNetwork, DownloadFromURL]의 데이터를 통해서는 "네트워크에 연결했고, 무엇인가를 다운로드 받았다."라는 정보를 알 수 있어서, 앞의 경우에 비해 악성코드인지 판별하기가 훨씬 쉬워지고 정확한 판별이 가능해진다. 이처럼 악성코드인지 여부를 판별함에 있어서, 독립적인 한 개의 정보보다는 연계성 있는 다수 개의 정보가 더 의미 있는 데이터일 수 있다. 따라서 연계성 있는 다수 개의 정보를 얻기 위해서, 윈도우 사이즈는 윈도우 이동 스텝 사이즈보다 크게 설정하는 것이 좋다. 위의 예는 이해를 돕기 위해 예를 들어 설명한 것이고, 실제로 대상 파일(110)의 데이터는 알아볼 수 없는 바이트 데이터이다.In an exemplary embodiment, the size of the window may be set to be larger than the moving step size in order to overlap between adjacent front and rear windows before and after the movement. This is advantageous for increasing the accuracy of malware detection. Detection of malicious code requires connection between generated window data. For example, supposing that there are three pieces of information, that is, ConnectNetwork, DownloadFromURL, and ShellExecute, in the analysis object file 110, when these three pieces of information are included in different windows, three pieces of window data [ConnectNetwork], [DownloadFromURL] ShellExecute] may have poor connectivity between data. On the other hand, if the above three pieces of information are included in a plurality of windows, for example, if window data such as [ConnectNetwork, DownloadFromURL], [DownloadFromURL, ShellExecute] are generated, the inter-data linkage is increased. In other words, through the data of [ConnectNetwork], only the information "I connected to the network" is known, and it is difficult to judge whether this information is malicious code. However, the data of [ConnectNetwork, DownloadFromURL] can be used to know the information "I connected to the network and downloaded something", so it is much easier to determine whether it is malicious code or not, . In determining whether the malicious code is malicious code, a plurality of related information may be more meaningful data than a single independent information. Therefore, in order to obtain a plurality of pieces of information that are related to each other, it is preferable to set the window size to be larger than the window movement step size. The above example has been described by way of example for the sake of understanding, and in fact, the data of the target file 110 is invisible byte data.

윈도우 이동 스텝 사이즈를 윈도우 사이즈에 비해 지나치게 작게 설정하면, 인접하는 윈도우 간의 중첩 구간이 커져 탐지의 정확도는 올라가지만 계산량은 크게 늘어날 수 있다. 실행 환경을 고려하여 인접 윈도우들 간의 중첩 구간의 크기를 적절하게 설정하면 될 것이다. 도 4는 윈도우 사이즈를 예컨대 1024 바이트로 설정하고, 윈도우의 이동 스텝 사이즈는 예컨대 256 바이트로 설정한 경우를 도시한다. 이는 예시적인 것에 불과하고 윈도우 사이즈와 이동 스텝 사이즈는 이와 다른 크기로 설정할 수도 있다. 1 바이트는 00 ~ FF 까지 표시되고, 10진수로 표시했을 경우 0 ~ 255까지 표현될 수 있다. If the window movement step size is set too small as compared with the window size, the overlapping interval between adjacent windows becomes large, and the accuracy of detection increases, but the calculation amount can be greatly increased. The size of the overlapping section between adjacent windows should be appropriately set in consideration of the execution environment. 4 shows a case where the window size is set to, for example, 1024 bytes, and the moving step size of the window is set to 256 bytes, for example. This is merely an example, and the window size and the moving step size may be set to different sizes. 1 byte is displayed from 00 to FF, and when it is expressed in decimal number, it can be expressed from 0 to 255.

윈도우(120)의 사이즈와 이동 스텝 사이즈가 정해지면, 분석대상 파일(110)의 바이트 어레이 전체에 대하여 맨 처음부터 끝까지 윈도우(120)를 이동 스텝 사이즈 단위씩 이동시켜가면서 복수의 윈도우를 생성하고, 그 복수의 윈도우 각각을 통해 각 윈도우에 대응되는 바이트 히스토그램을 계산할 수 있다. When the size and the moving step size of the window 120 are determined, a plurality of windows are generated while moving the window 120 by moving step size units from the beginning to the end of the entire byte array of the analysis object file 110, A byte histogram corresponding to each window can be calculated through each of the plurality of windows.

이와 관련하여, 도 5는 설정된 윈도우 영역 내의 바이트 어레이에 대하여 바이트 히스토그램을 계산하는 것을 예시한다. In this regard, Figure 5 illustrates calculating a byte histogram for a byte array in a set window area.

도 5를 참조하면, 먼저 제1 윈도우(120-1)가 설정될 수 있다. 제1 윈도우(120-1) 안에는 분석대상 파일(110)의 첫 번째 바이트부터 윈도우 사이즈인 1024번째 바이트까지의 바이트 어레이가 된다. 제1 윈도우(120-1)에 포함되는 바이트 어레이의 전체 바이트들의 10진수 값의 빈도를 카운트한다. 카운트된 10진수 값들의 빈도는 어레이 형태로 저장하여, 제1 윈도우(120-1)에 대응하는 제1 바이트 히스토그램(130-1)이 생성될 수 있다. 도 5는 제1 윈도우(120-1)에 포함된 바이트 어레이는 10진수 값으로 0을 24회, 1을 9회, 2를 12회, 그리고 255를 9회 포함하는 것으로 카운트된 경우를 예시한다.Referring to FIG. 5, the first window 120-1 may be set first. In the first window 120-1, a byte array is formed from the first byte of the analysis object file 110 to the window size 1024th byte. The frequency of the decimal value of the total bytes of the byte array included in the first window 120-1 is counted. The frequency of the counted decimal values may be stored in an array form so that the first byte histogram 130-1 corresponding to the first window 120-1 may be generated. FIG. 5 illustrates a case where the byte array included in the first window 120-1 is counted by including 0 as 24, 1 as 9, 2 as 12, and 255 as 9 decimal values .

도 6은 이동 스텝 사이즈만큼 윈도우를 이동하여 새로운 윈도우를 설정하는 것을 예시한다.FIG. 6 illustrates setting a new window by moving the window by the moving step size.

도 6을 참조하면, 제1 윈도우(120-1)에 대한 10진수 값 빈도 카운트가 끝난 후, 도시된 것처럼, 제1 윈도우(120-1) 위치에서 윈도우 이동 스텝 사이즈(예: 256바이트)만큼 이동한 새로운 윈도우 즉, 제2 윈도우(120-2)를 설정할 수 있다. 제2 윈도우(120-2)는 분석대상 파일(110)의 257번째 바이트부터 257+1024번째 바이트까지를 포함한다. Referring to FIG. 6, after the decimal value frequency count for the first window 120-1 is completed, as shown in FIG. 6, the window moving step size (for example, 256 bytes) at the position of the first window 120-1 A new window 120-2 can be set. The second window 120-2 includes the 257th byte to the 257th + 1024th byte of the analysis target file 110. [

도 7은 새로 설정된 윈도우에 대하여 같은 방법으로 그 윈도우 내의 바이트 어레이에 대하여 바이트 히스토그램을 생성하는 것을 예시한다.Figure 7 illustrates the generation of a byte histogram for a byte array in the window in the same way for a newly set window.

윈도우 이동을 통해 제2 윈도우(120-2)가 설정되면, 도 7에 예시된 것처럼, 제2 윈도우(120-2)에 포함되는 1024 바이트 어레이에 대해서도 제1 윈도우(120-1)에서와 동일한 방법으로 10진수 값의 빈도를 카운트하여 제2 바이트 히스토그램(130-2)을 생성할 수 있다. 즉, 제2 윈도우(120-2)에 포함되는 1024개의 바이트 각각이 표현하는 10진수 값들의 빈도를 카운트하여 어레이 형태로 저장하여 제2 바이트 히스토그램(130-2)을 생성할 수 있다.When the second window 120-2 is set through the window movement, as shown in FIG. 7, the 1024 byte array included in the second window 120-2 is also the same as that in the first window 120-1 The second byte histogram 130-2 can be generated by counting the frequency of the decimal value. That is, the second byte histogram 130-2 can be generated by counting the frequency of the decimal values represented by each of the 1024 bytes included in the second window 120-2 and storing the frequency in an array form.

이런 방식으로 분석 대상 파일(110)의 전체 바이트 어레이에 대하여 윈도우(120)를 이동 스텝 사이즈만큼 이동시켜 N개(N은 2보다 큰 자연수)의 윈도우(120-1, 120-2, ...)를 생성하고, 그 N개의 윈도우(120-1, 120-2, ..., 120-N) 각각을 통해 그에 대응하는 N개의 바이트 히스토그램(130-1, 130-2, ..., 130-N)을 생성할 수 있다.In this manner, the number of windows (120-1, 120-2, ..., N-1) in which N (N is a natural number greater than 2) 120-1, 120-2, ... are moved by the movement step size with respect to the entire byte array of the analysis object file 110 ..., and N-byte histograms 130-1, 130-2, ..., and 130-N corresponding to the N windows 120-1, 120-2, ..., -N) < / RTI >

도 8은 전체 윈도우 영역의 N개의 바이트 히스토그램(130-1, 130-2, ..., 130-N) 전부를 모아 바이트 히스토그램 어레이(130)를 생성하는 것을 예시한다. 도 8에 도시된 것처럼, N개의 윈도우(120-1, 120-2, ..., 120-N)를 통해 생성된 전체 N개의 바이트 히스토그램들(130-1, 130-2, ..., 130-N)을 한 줄로 연결되게 통합하여 하나의 바이트 히스토그램 어레이(130)를 생성할 수 있다.FIG. 8 illustrates generation of the byte histogram array 130 by collecting all of the N byte histograms 130-1, 130-2, ..., 130-N of the entire window region. 8, all of the N byte histograms 130-1, 130-2, ..., 120-N generated through the N windows 120-1, 120-2, ..., 120- 130-N may be concatenated in a single line to generate a single byte histogram array 130.

바이트 히스토그램을 계산함에 있어서, 분석 대상 파일(100)의 크기가 클수록 생성되는 윈도우 개수(N)가 증가할 것이다. 생성되는 윈도우 개수에 따라 통합된 바이트 히스토그램 어레이(130)의 크기 또한 달라질 것이다. In calculating the byte histogram, the larger the size of the analysis target file 100, the more the number of windows N to be generated will increase. The size of the integrated byte histogram array 130 will also vary according to the number of windows generated.

다음으로, 도 9는 대상 파일(110)의 바이트 히스토그램 어레이(130)를 바이트 엔트로피 계산을 통해 바이트 엔트로피 어레이(140)로 변환하는 단계(S200)를 도식적으로 예시한다. 도 10은 바이트 히스토그램으로부터 바이트 엔트로피를 계산하는 방법을 도식적으로 예시한다. Next, FIG. 9 schematically illustrates a step S200 of converting the byte histogram array 130 of the object file 110 into the byte entropy array 140 through the byte entropy calculation. 10 schematically illustrates a method of calculating a byte entropy from a byte histogram.

도 9와 도 10을 참조하면서, 바이트 엔트로피 어레이(140)를 생성하는 방법을 구체적으로 설명한다. 단계(S200)에서는, S100 단계에서 얻어진 바이트 히스토그램 어레이(130)를 바이트 주파수 비를 산출한 후, 그 산출된 바이트 주파수 비를 이용하여 바이트 엔트로피를 산출하여 바이트 엔트로피 어레이(140)를 생성할 수 있다. A method of generating the byte entropy array 140 will be described in detail with reference to FIGS. 9 and 10. FIG. In step S200, after calculating the byte frequency ratio of the byte histogram array 130 obtained in step S100, the byte entropy array is calculated using the calculated byte frequency ratio to generate the byte entropy array 140 .

구체적으로, 대상 파일(110)의 바이트 엔트로피를 산출하기 위해, 먼저 바이트 히스토그램 어레이(130)를 구성하는 N개의 바이트 히스토그램(130-1, 130-2, ..,, 130-N) 각각에서 바이트 주파수 비를 산출한다. 여기서, 바이트 주파수 비는 임의의 바이트 히스토그램 영역 내의 전체 원소의 값의 총합에 대한 각 원소의 값의 비를 의미한다. Specifically, in order to calculate the byte entropy of the object file 110, first, the byte histograms 130-1, 130-2, ..., 130-N of the byte histogram array 130 constituting the byte histogram 130-1, Frequency ratio. Here, the byte frequency ratio means the ratio of the values of the respective elements to the total of the values of all the elements in the arbitrary byte histogram region.

도 10을 참조하면, 바이트 히스토그램 어레이(130)의 제1 바이트 히스토그램(130-1) 내에 존재하는 바이트 데이터들의 빈도 즉, 주파수 비를 카운트하여 제1 바이트 주파수 비 어레이(135-1)를 생성할 수 있다. 예컨대, 제1 바이트 히스토그램(130-1)의 전체 원소들이 (24, 9, 12, ..., 9)이고 이 원소들의 값의 총합이 400이라하면, 각 원소의 주파수 비는 (24/400, 9/400, 12/400, ..., 9/400)이 될 것이다. 제1 바이트 히스토그램(130-1)의 각 원소의 값(24, 9, 12, ..., 9)을 그에 대응하는 바이트 주파수 비의 값(24/400, 9/400, 12/400, ..., 9/400)으로 대체함으로써, 제1 윈도우(120-1) 영역의 제1 바이트 히스토그램(130-1)을 제1 바이트 주파수 비 어레이(135-1)로 변환할 수 있다(도 10의 (b) 참조). 10, the frequency of the byte data existing in the first byte histogram 130-1 of the byte histogram array 130 is counted to generate the first byte frequency array 135-1 . For example, if all elements of the first byte histogram 130-1 are (24, 9, 12, ..., 9) and the sum of the values of these elements is 400, the frequency ratio of each element is (24/400 , 9/400, 12/400, ..., 9/400). 9, 12, ..., 9) of each element of the first byte histogram 130-1 as the value of the byte frequency ratio (24/400, 9/400, 12/400,. The first byte histogram 130-1 of the first window 120-1 region can be converted into the first byte frequency ratio array 135-1 (see FIG. 10 (B)).

나머지 제2 내지 제N 바이트 히스토그램(130-2, 130-3, ..., 130-N) 각각에 대해서도 위와 동일한 과정을 수행하여 제2 내지 제N 바이트 주파수 비 어레이(135-2, 135-3, ..., 135-N)를 구할 수 있다. 제1 내지 제N 윈도우(120-1 내지 120-N) 영역에 대응하는 제1 내지 제N 바이트 주파수 비 어레이(135-1 내지 135-N)를 모두 통합하면 대상 파일(110)의 바이트 주파수 비 어레이(135)가 생성될 수 있다.The second through Nth byte frequency arrays 135-2 and 135-N perform the same process for the remaining second through Nth byte histograms 130-2 through 130- 3, ..., 135-N. If the first to Nth byte frequency arrays 135-1 to 135-N corresponding to the first to Nth windows 120-1 to 120-N are all combined, the byte frequency ratio of the object file 110 An array 135 can be created.

이렇게 생성된 바이트 주파수 비 어레이(135)를 이용하여 각 윈도우별로 제1 내지 제N 바이트 엔트로피 어레이(140-1, 140-2, ..., 140-N)를 계산하고, 그 계산된 제1 내지 제N 바이트 엔트로피 어레이(140-1, 140-2, ..., 140-N) 전체를 한 줄로 통합하여 대상 파일(110)의 바이트 엔트로피 어레이(140)를 생성할 수 있다. The first to Nth-byte entropy arrays 140-1, 140-2, ..., 140-N are calculated for each window using the byte frequency non-arrays 135 thus generated, N-byte entropy arrays 140-1, 140-2, ..., and 140-N into a single line to generate the byte entropy array 140 of the object file 110. [

구체적으로, 도 10의 (b)와 (c)를 참조하면, 제1 바이트 주파수 비 어레이 (135-1)에서, 전체 바이트 주파수 비 원소들 (24/400, 9/400, 12/400, ..., 9/400) 각각에 대하여 바이트 엔트로피를 계산할 수 있다. 각 바이트 주파수 비에 대한 바이트 엔트로피는 식 (1)을 이용하여 계산할 수 있다. 예컨대, 제1 바이트 주파수 비 어레이(135-1)의 제1, 제2, 제3, ..., 제N 바이트 주파수 비 (x1, x2, x3, ..., xN) 값이 각각 0.06(=24/400), 0.02(=9/400), 0.03(=12/400), ..., 0.02(=9/400)이므로, 이를 식 (1)에 대입하여 제1, 2, 3, ..., 제N 바이트 엔트로피 값을 계산하면 다음과 같다: Specifically, referring to FIGS. 10B and 10C, in the first byte frequency non-array 135-1, the total byte frequency non-elements 24/400, 9/400, 12/400,. .., 9/400), respectively. The byte entropy for each byte frequency ratio can be calculated using Equation (1). For example, the first, second, of the single-frequency non-array 135-1 3, ..., the N bytes of the frequency ratio (x 1, x 2, x 3, ..., x N) values Is substituted into equation (1) to obtain the first, second, and third values, respectively, since they are 0.06 (= 24/400), 0.02 (= 9/400), 0.03 2, 3, ..., N-byte Entropy values are calculated as follows:

Figure 112018077801635-pat00007
Figure 112018077801635-pat00007

이에 의해, 제1 바이트 엔트로피 어레이(140-1)가 (0.24, 0.11, 0.15, ..., 0.11)로 얻어진다. Thereby, the first byte entropy array 140-1 is obtained as (0.24, 0.11, 0.15, ..., 0.11).

이런 방식으로, 나머지 제2 내지 제N 바이트 주파수 비 어레이(135-1, 135-2, ..., 135-N) 각각에 대해서도, 각 바이트 주파수 비 어레이의 전체 원소에 대하여 바이트 엔트로피 값을 계산할 수 있다. 이를 통해, 제2 내지 제N 바이트 엔트로피 어레이(140-2 내지 140-N)가 얻어질 수 있다.In this manner, also for each of the remaining second to Nth byte non-frequency arrays 135-1, 135-2, ..., 135-N, the byte entropy value is calculated for all the elements of each byte non- . Through this, the second through Nth byte entropy arrays 140-2 through 140-N can be obtained.

이런 과정을 통해, 대상 파일(110)에 대하여 N개의 윈도우 전체를 통해 제1 내지 제N 바이트 엔트로피 어레이(140-1, 140-2, ..., 140-N)가 얻어지면, 이를 한 줄로 통합하여 바이트 엔트로피 어레이(140)를 생성할 수 있다. 바이트 엔트로피 어레이(140)의 전체 원소는 바이트 주파수 비 어레이(135)의 전체 원소(바이트 주파수 비)를 바이트 엔트로피 값으로 환산한 것이다(도 9의 (b)와 (c) 참조). Through this process, if the first to N-th byte entropy arrays 140-1, 140-2, ..., 140-N are obtained through the entire N windows for the object file 110, The byte entropy array 140 can be generated. All the elements of the byte entropy array 140 are obtained by converting all the elements (byte frequency ratio) of the byte frequency ratio array 135 into byte entropy values (see FIGS. 9 (b) and 9 (c)).

도 11은 바이트 엔트로피 어레이를 2차원의 바이트 엔트로피 행렬로 형태변환을 하는 것을 예시한다.FIG. 11 illustrates the transformation of a byte entropy array into a two-dimensional byte entropy matrix.

바이트 엔트로피 어레이(140)가 확보되면, 그 바이트 엔트로피 어레이(140)를 2차원 형태의 바이트 엔트로피 행렬(145)로 변환하는 단계(S300)를 수행할 수 있다. 도 11을 참조하면, 이 변환 단계(S300)에서는, 바이트 엔트로피 어레이(140)를 구성하는 N개의 바이트 엔트로피 어레이(140-1, 140-2, ..., 140-N) 를 수직방향으로 순차 적층하여 1열로 재배치할 수 있다. 이런 재배치를 통해, 바이트 엔트로피 어레이(140)는 Nx1 크기의 2차원의 바이트 엔트로피 행렬(145)로 변환될 수 있다. 따라서 2차원 바이트 엔트로피 행렬(145)에서, 각 바이트 엔트로피 어레이(140-1, 140-2, ..., 140-N)의 동일 인덱스의 N개의 원소(바이트 엔트로피 값)들은 동일 열에 배치된다.When the byte entropy array 140 is secured, the step 14000 of converting the byte entropy array 140 into a two-dimensional byte entropy matrix 145 may be performed. Referring to FIG. 11, in this conversion step S300, the N byte entropy arrays 140-1, 140-2, ..., 140-N constituting the byte entropy array 140 are sequentially They can be stacked and relocated in one row. Through such relocation, the byte entropy array 140 can be transformed into a two-dimensional byte entropy matrix 145 of Nx1 size. Therefore, in the two-dimensional byte entropy matrix 145, N elements (byte entropy values) at the same index of each of the byte entropy arrays 140-1, 140-2, ..., 140-N are arranged in the same column.

2차원 바이트 엔트로피 행렬(145)이 구해지면, 그것을 엔트로피 카운트 맵 특징 데이터(150)로 변환하는 단계(S400)를 수행할 수 있다. 도 12는 2차원 바이트 엔트로피 행렬(145)을 엔트로피 값의 범위를 빈도로 매핑시켜 엔트로피 카운트 맵 특징 데이터(150)로 변환하는 단계(S400)를 예시한다.Once the two-dimensional byte entropy matrix 145 is obtained, it may perform step S400 of converting it into entropy count map feature data 150. FIG. 12 illustrates a step (S400) of converting a two-dimensional byte entropy matrix 145 into entropy count map feature data 150 by mapping a range of entropy values to frequency.

기계학습 분야에서는 '차원의 저주(curse of dimensionality)'라는 개념이 있다. 차원의 저주는 차원이 높아지면 단위 영역의 희소성(sparsity)이 높아져서, 도 13에 도시된 것처럼, 학습을 위해 필요로 하는 데이터의 수가 기하급수적으로 증가하게 되고, 이로 인해 예측 정확도가 낮아진다는 개념이다. 윈도우의 개수는 파일의 크기가 커질수록 많아지게 된다. 바이트 엔트로피 특징을 추출하는 경우 차원이 증가하게 된다. 학습을 위한 데이터는 매우 한정적이다. 그렇기 때문에, 차원이 증가하면, 학습을 위해 요구되는 데이터의 양을 충족시키지 못해 탐지모델의 정확도가 급격히 낮아질 수 있다. In the field of machine learning, there is the concept of 'curse of dimensionality'. As shown in FIG. 13, the number of data required for learning increases exponentially and the prediction accuracy is lowered because the degree of the sparsity of the unit area increases as the dimension of the dimension becomes higher . The number of windows increases as the file size increases. When the byte entropy feature is extracted, the dimension is increased. Data for learning is very limited. Therefore, as the dimension increases, the amount of data required for learning can not be met, and the accuracy of the detection model can be drastically lowered.

악성코드 탐지모델을 생성함에 있어서, 대상 파일(110) 즉, 학습용 데이터로부터 추출된 바이트 엔트로피 특징 데이터를 전부 그대로 사용하여 기계학습을 하면, 너무 많은 차원 때문에 '차원의 저주'에 빠지는 문제가 생긴다. 이런 문제를 해결하기 위해, 본 발명의 예시적인 실시예에 따르면, 학습 데이터의 차원수를 감소시키기 위해 '바이트 엔트로피 카운트 맵(byte entropy count map)' 개념을 도입한다.In generating the malicious code detection model, when the machine learning is performed using the object file 110, that is, the byte entropy characteristic data extracted from the learning data, as it is, there arises a problem of falling into the 'curse of dimension' due to too many dimensions. To solve this problem, according to an exemplary embodiment of the present invention, the concept of a " byte entropy count map " is introduced to reduce the number of dimensions of learning data.

차원이 높은 바이트 엔트로피 데이터를 그대로 사용하는 대신에, 바이트 엔트로피 특징 데이터를 차원이 낮은 바이트 엔트로피 카운트 맵의 특징 데이터로 변환한다. 바이트 엔트로피 카운트 맵을 사용하면, 바이트 엔트로피의 값을 '값의 분포'로 변환시켜 차원을 낮추는 효과를 얻을 수 있으며, 동시에 잡음의 영향을 완화시킬 수 있다.Instead of using the high byte entropy data as it is, the byte entropy feature data is converted into the feature data of the low-order byte entropy count map. By using the byte entropy count map, the effect of lowering the dimension by converting the value of the byte entropy to the value distribution can be obtained, and at the same time, the influence of the noise can be alleviated.

바이트 엔트로피 카운트 맵은 바이트 엔트로피 값의 범위를 소정 개수의 단계로 지정할 수 있다. 본 발명자들은 유의미한 바이트 엔트로피 특징 데이터들의 값들이 대부분 0 이상 6 미만의 범위 안에 존재하고, 6보다 큰 값은 거의 없는 점을 발견하였다. 이 점을 고려하여, 엔트로피 특징 데이터의 엔트로피 값들을 0에서 6 사이에서 복수 개의 범위 즉, R 개의 범위(단, R은 2이상의 자연수)로 구분할 수 있다. 그리고 2차원 바이트 엔트로피 행렬(145)의 원소들을 그 '엔트로피 값의 범위'로 매핑시킬 수 있다. 이러한 매핑을 통해 바이트 엔트로피 카운트 맵이 얻어질 수 있다.The byte entropy count map may specify a range of byte entropy values in a predetermined number of steps. The present inventors have found that the values of significant byte entropy characteristic data are mostly in the range of 0 to less than 6, and there is little value larger than 6. In consideration of this point, the entropy values of the entropy characteristic data can be divided into a plurality of ranges, that is, R ranges (where R is a natural number of 2 or more) between 0 and 6. Then, the elements of the two-dimensional byte entropy matrix 145 can be mapped to the 'range of entropy values'. Through this mapping, a byte entropy count map can be obtained.

예시적인 실시예에 있어서, 도 12에 예시된 것과 같이 바이트 엔트로피 특징 데이터의 값들을 바이트 엔트로피 카운트 맵으로 변환하는 '값의 범위'를 다음과 같이 설정할 수 있다. 물론 아래 표 1에서 제시한 엔트로피 값의 범위는 예시적인 것이다. 엔트로피 값의 범위를 7 구간보다 더 적거나 많은 구간으로 구분할 수 있으며, 각 구간마다의 범위도 다르게 설정할 수도 있을 것이다. In the exemplary embodiment, a 'value range' for converting the values of the byte entropy characteristic data into the byte entropy count map as illustrated in FIG. 12 can be set as follows. Of course, the ranges of the entropy values shown in Table 1 below are exemplary. The range of the entropy value may be divided into seven or less intervals, and the range of each interval may be set differently.

구간 인덱스Interval index 바이트 엔트로피 값의 범위Range of byte entropy values 1One 0 이상 0.1 미만0 to less than 0.1 22 0.1 이상 0.2 미만0.1 or more and less than 0.2 33 0.2 이상 0.3 미만0.2 to less than 0.3 44 0.3 이상 0.4 미만0.3 or more and less than 0.4 55 0.4 이상 0.5 미만0.4 to less than 0.5 66 0.5 이상 0.6 미만0.5 or more and less than 0.6 77 0.6 이상 0.6 or more

표 1의 엔트로피 값의 범위를 이용하여 2차원 바이트 엔트로피 행렬(145)을 엔트로피 카운트 맵으로 변환한다. 이 변환은 2차원 바이트 엔트로피 행렬(145)의 각 열마다 해당 열에 속하는 N개의 바이트 엔트로피 값들이 상기 R개의 범위 중 어느 범위에 속하는지를 비교하여 상기 R개의 범위 각각에 속하는 바이트 엔트로피 값들의 개수를 카운트하는 것을 통해 이루어질 수 있다. The two-dimensional byte entropy matrix 145 is converted into an entropy count map using the range of entropy values in Table 1. [ This conversion compares the N byte entropy values belonging to the column in each column of the two-dimensional byte entropy matrix 145 with which range of the R number of ranges belongs, and counts the number of byte entropy values belonging to each of the R number of ranges And the like.

도 12를 참조하면, 2차원 바이트 엔트로피 행렬(145)의 제1열에 속하는 N개의 바이트 엔트로피 값들(0.24, 0.28, 0.12, 0.22, ..., 0.09, 0.14, 0.42, 0.22)이 상기 표 1의 7가지 구간의 엔트로피 값의 범위 중 어디에 속하는지를 각각 카운트한다. 도 12에 예시된 것에 따르면, 2차원 바이트 엔트로피 행렬(145)의 제1열에 대한 카운트 결과, 제1 구간 (0.0 ~ 0.1), 제2구간(0.1 ~ 0.2), ..., 제7구간(0.6 이상)에 속하는 엔트로피 값의 개수는 각각 a1, a2, ..., a7이다. 카운트된 개수의 총합은 N개(= a1 + a2 + a3 + a4 + a5 + a6 + a7)이다. 12, N byte entropy values (0.24, 0.28, 0.12, 0.22, ..., 0.09, 0.14, 0.42, and 0.22) belonging to the first column of the two-dimensional byte entropy matrix 145 are shown in Table 1 And the entropy value range of the seven intervals. 12, the count result of the first column of the two-dimensional byte entropy matrix 145 is divided into a first interval (0.0 to 0.1), a second interval (0.1 to 0.2), ..., a seventh interval 0.6 or more) are a1, a2, ..., a7, respectively. The sum of the counted numbers is N (= a1 + a2 + a3 + a4 + a5 + a6 + a7).

2차원 바이트 엔트로피 행렬(145)의 제2열의 N개의 엔트로피 값에 대해서도 위와 같은 방식으로 카운트한다. 도 12에 예시된 것에 따르면, 제2열에 대한 카운트 결과, 제1 구간 (0.0 ~ 0.1), 제2구간(0.1 ~ 0.2), ..., 제7구간(0.6 이상)에 속하는 엔트로피 값의 개수는 각각 b1, b2, ..., b7이고, 이들 개수의 총합도 N개(= b1 + b2 + b3 + b4 + b5 + b6 + b7)이다. 나머지 제3 내지 제256열 각각에 대해서도, 각 열에 속하는 N개의 엔트로피 값을 위와 같은 방식으로 카운트할 수 있다. The N entropy values in the second column of the two-dimensional byte entropy matrix 145 are also counted in the same manner as described above. 12, the count result of the second column indicates the number of entropy values belonging to the first section (0.0 to 0.1), the second section (0.1 to 0.2), ..., the seventh section (0.6 or more) B1 + b2 + b3 + b4 + b5 + b6 + b7), where b1, b2, ..., For each of the remaining third to 256th columns, N entropy values belonging to each column can be counted in the same manner as described above.

이와 같은 변환에 의해 얻어지는 엔트로피 카운트 맵(150)은 R x Q 크기의 2차원 행렬로 표현될 수 있다. 여기서, R은 바이트 엔트로피 값의 범위의 개수이고, Q는 1 바이트가 나타내는 10진수의 개수 즉, 256을 나타낸다. 도 12에 예시된 7구간의 엔트로피 값 범위를 적용한 경우, 엔트로피 카운트 맵(150)은 7x256 크기의 2차원 행렬이다. 변환전의 2차원 바이트 엔트로피 행렬(145)이 Nx256 크기의 2차원 행렬이고, 여기서 N은 윈도우(120)의 개수를 나타낸다. 대개의 경우, 윈도우(120)의 개수 N은 R보다는 훨씬 큰 값을 갖는다(즉, N>>R임). 따라서, 2차원 바이트 엔트로피 행렬(145)을 엔트로피 카운트 맵(150)으로 변환하는 것에 의해 차원 수의 현저한 감소를 얻을 수 있다. 이를 통해 차원의 저주로부터 자유로워질 수 있다. 탐지 모델을 생성할 때 낮은 차원 수의 학습 데이터를 사용할 수 있다.The entropy count map 150 obtained by such a transformation can be expressed by a two-dimensional matrix of R x Q size. Where R is the number of ranges of byte entropy values, and Q is the number of decimal digits represented by one byte, that is, 256. 12, the entropy count map 150 is a 2-dimensional matrix of 7x256 size. The two-dimensional byte entropy matrix 145 before conversion is a two-dimensional matrix of Nx256 size, where N represents the number of windows 120. [ In most cases, the number N of windows 120 is much larger than R (i.e., N >> R). Thus, a significant reduction in the number of dimensions can be obtained by converting the two-dimensional byte entropy matrix 145 into the entropy count map 150. This can free you from the curse of the dimension. A low number of training data can be used when generating the detection model.

다시, 도 1을 참조하면, 다수의 학습용 파일 쌍(악성코드 파일 - 정상프로그램 파일 쌍) 각각에 대하여 단계 S10, S20, S30을 수행하여 각 학습용 파일 쌍에 대응하는 바이트 엔트로피 카운트 맵(150)을 구할 수 있다. Referring again to FIG. 1, steps S10, S20, and S30 are performed for each of a number of learning file pairs (malicious code file-normal program file pair), and a byte entropy count map 150 corresponding to each pair of learning files Can be obtained.

도 14는 이렇게 구한 다수의 바이트 엔트로피 카운트 맵(150) 특징 데이터들의 분포도를 예시적으로 보여준다. 도 15는 도 14의 엔트로피 카운트 맵 특징 데이터를 이용한 기계학습을 통해 얻은 탐지모델을 신규의 엔트로피 카운트 맵 데이터로 갱신하는 것을 설명하기 위한 도면이다.FIG. 14 exemplarily shows a distribution diagram of the plurality of byte entropy count map 150 feature data thus obtained. FIG. 15 is a diagram for explaining updating of a detection model obtained through machine learning using the entropy count map characteristic data of FIG. 14 with new entropy count map data.

도 14와 15를 참조하면, 탐지모델 학습용으로 구한 전체 바이트 엔트로피 카운트 맵(150) 특징 데이터는 예컨대 클래스 A와 클래스 B로 구분할 수 있다. 도면에서, Class A는 정상 프로그램 파일로부터 추출된 전체 바이트 엔트로피 카운트 맵(150) 특징 데이터의 분포도이고, Class B는 악성 코드 파일로부터 추출된 전체 바이트 엔트로피 카운트 맵(150) 특징 데이터의 분포도이다. 원형 점선으로 표시된 Class A와 Class B(예: 트로이목마라는 악성코드에 의한 악성 행위) 내에 표시된 각 점들은 정상 프로그램과 악성 프로그램 각각의 전체 바이트 엔트로피 카운트 맵(150) 특징 데이터를 나타낸다. 14 and 15, the characteristic data of the full-byte entropy count map 150 obtained for the detection model learning can be classified into Class A and Class B. For example, In the figure, Class A is a distribution diagram of the total byte entropy count map 150 feature data extracted from the normal program file, and Class B is a distribution diagram of the total byte entropy count map 150 feature data extracted from the malicious code file. Each dot shown in the circular dashed lines in Class A and Class B (eg malicious behavior by malicious code called Trojan Horse) represents full byte entropy count map (150) feature data of normal and malicious programs, respectively.

정상 프로그램의 엔트로피 카운트 맵 특징 데이터들과 악성 코드의 엔트로피 카운트 맵 특징 데이터들은 각각 소정 영역에 군집적으로 분포될 수 있다. 이러한 분포를 갖는 정상 프로그램의 엔트로피 카운트 맵 특징 데이터들의 집합인 클래스 A와 악성 코드의 엔트로피 카운트 맵 특징 데이터들의 집합인 클래스 B를 입력데이터로 삼아 기계학습을 수행할 수 있다. 그 기계학습을 통해 정상 프로그램(클래스 A)과 악성 코드(클래스 B)를 구분할 수 있는 악성코드 분류자(200) 즉, 탐지모델을 구할 수 있다. The entropy count map feature data of the normal program and the entropy count map feature data of the malicious code may be distributed collectively in a predetermined area. Machine learning can be performed by using class A, which is a set of entropy count map feature data of a normal program having such a distribution, and class B, which is an aggregate of entropy count map feature data of malicious codes, as input data. The malicious code classifier 200 that can distinguish the normal program (class A) from the malicious code (class B) through the machine learning, that is, the detection model can be obtained.

기계학습을 통해 탐지모델을 생성하는 과정은, 위와 같이 확보된 학습 데이터를 전처리(data preprocessing) 한 후, 탐색적 데이터 분석(Exploratory data analysis)을 수행하여 최상의 모델을 선택하고, 그 선택된 모델에 대한 평가를 거쳐 최종 모델을 확정하는 절차로 이루어질 수 있다. The process of generating a detection model through machine learning consists of preprocessing the acquired learning data and then performing exploratory data analysis to select the best model, And the final model is finalized after the evaluation.

도 18과 도 19는 정상 프로그램 파일로부터 추출된 바이트 엔트로피 카운트 맵 특징 데이터(도면에서 파란색 원으로 표시됨)와 악성코드로부터 추출된 바이트 엔트로피 카운트 맵 특징 데이터(도면에서 붉은색 x로 표시됨)를 이용하여 기계학습을 하는 과정을 나타낸다.18 and 19 are diagrams for explaining an example of a case where a byte entropy count map feature data (indicated by a blue circle in the drawing) extracted from a normal program file and a byte entropy count map feature data (represented by a red color x in the drawing) extracted from a malicious code It represents the process of machine learning.

도 18과 19를 참조하면, 구하고자 하는 탐지모델을 예컨대 다음과 같은 함수식으로 표시할 수 있다. 여기서 x1과 x2 는 입력 변수이고, w0 w1, w2 는 계수이다.Referring to FIGS. 18 and 19, a detection model to be obtained can be expressed by, for example, the following function formula. Where x 1 and x 2 are input variables, and w 0 w 1 and w 2 are coefficients.

Figure 112018077801635-pat00008
......(2)
Figure 112018077801635-pat00008
......(2)

탐지모델을 생성한다는 것은 주어진 입력데이터 x에 대하여 계수 w의 값을 지속적으로 갱신하여 최상의 탐지성능을 발휘할 수 있는 값을 찾는 작업이다. 식 (2)의 우변을 0으로 놓으면 이를 만족하는 (x1, x2)는 평면상에서 직선이 된다. 예컨대 계수 w에 대하여 초기 값, W0 = 80, W1 = -3, W2 = 1을 부여하면 도 18의 (A)에 도시된 분류자(450a)를 얻을 수 있다. 이 분류자(450a)는 정상코드 특징데이터와 악성코드 특징데이터를 잘못 분류하는 비율이 높다. 계수 w의 값을 조정하여 W0 = 40, W1 = -3, W2 = 2로 수정하면, 도 18의 (B)에 도시된 것처럼, 잘못 분류된 특징 데이터의 수는 이전에 비해 감소하였으나, 여전히 정상코드 특징데이터와 악성코드 특징데이터가 잘못 분류되는 경우가 있다. 다시 계수 w의 값을 조정하여 W0 = -50, W1 = -1, W2 = 2로 수정하면, 도 19에 도시된 것처럼, 이제는 정상코드 특징데이터와 악성코드 특징데이터가 모두 정확하게 분류된다. 이 때의 계수를 적용하여 탐지모델(즉, 정상코드와 악성코드를 분류하는 분류자(classifier))을 선택하면 다음과 같다. 선택된 탐지모델의 성능에 대한 평가를 거쳐 최종적으로 탐지모델을 확정할 수 있다.Generating a detection model is a task of finding a value capable of exhibiting the best detection performance by continuously updating the value of the coefficient w for a given input data x. When the right side of Equation (2) is set to 0, (x 1 , x 2 ) satisfying this condition is a straight line on the plane. For example, if the initial values W 0 = 80, W 1 = -3 and W 2 = 1 are given to the coefficient w, the classifier 450a shown in FIG. 18A can be obtained. This classifier 450a has a high ratio of misclassifying the normal code characteristic data and the malicious code characteristic data. If the value of the coefficient w is adjusted to be W 0 = 40, W 1 = -3, and W 2 = 2, the number of erroneously classified feature data decreases as shown in FIG. 18 (B) , The normal code characteristic data and the malicious code characteristic data may still be classified incorrectly. When the values of the coefficients w are adjusted again to W 0 = -50, W 1 = -1 and W 2 = 2, as shown in FIG. 19, both the normal code characteristic data and the malicious code characteristic data are correctly classified . The detection model (that is, the classifier that classifies the normal code and the malicious code) is selected by applying the coefficient at this time is as follows. After the evaluation of the performance of the selected detection model, the detection model can finally be confirmed.

Figure 112018077801635-pat00009
......(3)
Figure 112018077801635-pat00009
(3)

구해진 탐지모델을 사용하여 분석대상파일의 특징데이터를 분류할 수 있다. 예컨대, 입력변수 (x1, x2)의 값이 예컨대 (40, 40)인 경우, f(40, 40)의 값은 0보다 작기 때문에 악성코드 클래스로 분류될 수 있다.The feature data of the analysis target file can be classified using the obtained detection model. For example, when the value of the input variable x 1 , x 2 is, for example, (40, 40), the value of f (40, 40) is smaller than 0 and can be classified as a malicious code class.

f(40, 40) = -50 -40 + 2x40 < 0f (40, 40) = -50 -40 + 2x40 <0

위에서 설명한 탐지모델 생성을 위한 기계학습 방법은 예시적인 것이다. 이미 알려진 많은 기계학습 방법들 중에서 적절한 것을 본 발명에 적용할 수 있음은 물론이다.The machine learning method for generating the detection model described above is exemplary. Of course, many of the known machine learning methods are applicable to the present invention.

도시된 것처럼, 특징 데이터의 차원수가 굉장히 많다. 일반적인 기계학습 방법은 각 클래스에 포함된 '모든' 학습데이터를 도 14에 도시된 것처럼 Class A와 Class B로 구별한다. 따라서 특징 데이터들 간에 중복이 심하고 잡음 데이터가 많이 포함될 수 있어서, 탐지 모델의 정확도가 떨어지는 문제가 있다. 또한 탐지 모델 생성을 위한 학습을 위해 많은 데이터가 필요하다는 점도 비효율적일 수 있디. As shown, the number of dimensions of feature data is very large. In the general machine learning method, 'all' learning data included in each class is classified into Class A and Class B as shown in FIG. Therefore, there is a problem that the accuracy of the detection model deteriorates because the feature data may be redundant and contain a lot of noise data. It may also be inefficient that a lot of data is needed for learning to generate a detection model.

도 15에 도시된 두 클래스의 엔트로피 카운트 맵 특징 데이터들은 소정 크기의 원 (또는 구)내에 분포하고, 이들을 구분하는 기준인 악성코드 분류자(200)는 직선으로 표시되어 있지만, 이는 이해를 쉽게 하기 위한 예시적인 것에 불과하다. 두 클래스의 엔트로피 카운트 맵 특징 데이터들은 예컨대 3차원 공간에 분포된 것일 수도 있으며, 이 두 클래스를 구분하는 악성코드 분류자(200)는 임의의 형태의 곡선일 수 있다.The entropy count map feature data of the two classes shown in FIG. 15 are distributed in a circle (or a circle) of a predetermined size, and the malicious code classifier 200, which is a criterion for distinguishing the two, is shown as a straight line. Is an example only. The entropy count map feature data of the two classes may be distributed, for example, in a three-dimensional space, and the malicious code classifier 200 that distinguishes the two classes may be any type of curve.

악성 코드의 신종, 변종이 꾸준히 나타나므로 탐지모델도 그에 상응하여 신종 또는 변종 악성 코드를 학습하여 탐지모델을 갱신할 필요가 있다. 새로운 악성코드 파일과 그에 대응하는 정상 프로그램 파일을 모아서 탐지모델 갱신용 학습데이터로 사용할 수 있다. 위에서 설명한 방법과 동일하게 갱신용 학습데이터로부터 신규의 바이트 엔트로피 맵 특징 데이터(300)를 추출하고, 그 추출된 신규 바이트 엔트로피 맵 특징 데이터(300)를 기존 탐지모델에 학습시켜 탐지모델을 갱신할 수 있다. Since new and variant malicious codes are steadily appearing, the detection model needs to update the detection model by learning new or variant malicious codes accordingly. The new malicious code file and the corresponding normal program file can be collected and used as learning data for updating the detection model. The new byte entropy map characteristic data 300 is extracted from the learning data for updating in the same manner as described above and the detected newest entropy map characteristic data 300 is learned to the existing detection model to update the detection model have.

다만, 신규 바이트 엔트로피 맵 특징 데이터(300)를 기존의 탐지모델에 학습시키기 위해서는 기존의 탐지모델 생성에 이용된 데이터 전부가 고려되어야 한다. 탐지모델 갱신을 위해서는 전체 데이터가 고려되어야 되기 때문에 신규 데이터의 학습 시간이 오래 걸리게 되고, 탐지모델의 유연성이 낮을 수 있다. However, in order to allow the new byte entropy map feature data 300 to be learned by the existing detection model, all of the data used for generating the existing detection model must be considered. In order to update the detection model, the whole data must be considered, so that the learning time of the new data becomes long and the flexibility of the detection model may be low.

예시적인 실시예에 있어서, 탐지모델은 프로토타입 기반의 기계학습을 통해서 생성될 수도 있다. 도 16은 도 14에 도시된 각 클래스별 엔트로피 카운트 맵 특징 데이터의 전체를 대표하는 프로토타입 데이터를 도시한다. 도 17은 도 16의 프로토타입 데이터를 이용한 기계학습을 통해 얻은 탐지모델을 신규의 엔트로피 카운트 맵 데이터로 갱신하는 것을 설명하기 위한 도면이다.In an exemplary embodiment, the detection model may be generated through prototype-based machine learning. FIG. 16 shows prototype data representing the entirety of entropy count map feature data for each class shown in FIG. FIG. 17 is a diagram for explaining updating of a detection model obtained through machine learning using the prototype data of FIG. 16 with new entropy count map data. FIG.

프로토타입 기반의 기계 학습은 위와 같은 단점들을 극복할 수 있는 방안이다. 프로토타입(prototype)은 기계학습에서 학습 데이터의 클래스 내 데이터를 대표할 수 있는 적은 수의 데이터로 정의될 수 있다. 프로토타입 기반의 기계 학습에 따르면, 도 16에 도시된 것처럼, 정상 프로그램을 나타내는 Class A에 속하는 전체 바이트 엔트로피 카운트 맵 특징 데이터에 기초하여 소정의 방법으로 프로토타입 데이터(350a)를 선정한다. 마찬가지로 악성 코드를 나타내는 Class B에 속하는 전체 바이트 엔트로피 카운트 맵 특징 데이터에 기초하여 소정의 방법으로 프로토타입 데이터(350b)를 선정한다. 선정된 프로토타입 데이터(350a, 350b)는 해당 클래스를 대표한다. Prototype-based machine learning is a way to overcome these shortcomings. A prototype can be defined as a small number of data that can represent data in a class of learning data in machine learning. According to prototype-based machine learning, as shown in FIG. 16, prototype data 350a is selected in a predetermined method based on full-byte entropy count map feature data belonging to Class A representing a normal program. Likewise, the prototype data 350b is selected in a predetermined method based on the full-byte entropy count map feature data belonging to Class B representing the malicious code. The selected prototype data 350a, 350b represent the corresponding class.

프로토타입 기반 분류 학습은 대표 데이터의 선택과 분류 학습의 두 단계로 구성될 수 있다. 첫 번째 단계에서 학습 데이터간의 비유사도와 클래스 정보를 이용하여 대표 프로토타입을 선택할 수 있다. 선택된 프로토타입들은 준비된 학습 데이터의 수보다 적은 수로 구성되고 각 클래스 데이터를 대표하며 학습 분류 알고리즘에 적용가능하다고 가정한다. 두 번째로 선택된 대표 프로토타입 데이터들로 구성된 학습 데이터 집합들로 학습하고 테스트 데이터에 대해 분류 예측을 할 수 있다. Prototype - based classification learning can be composed of two steps: selection of representative data and classification learning. In the first step, representative prototypes can be selected by using the information between the learning data and the class information. It is assumed that the selected prototypes consist of fewer than the number of prepared learning data, represent each class data, and are applicable to the learning classification algorithm. Secondly, we can learn with learning data sets composed of representative prototype data selected and perform classification prediction on test data.

예시적인 실시예에 따르면, 각 학습용 특징 데이터가 대표하는 클래스 영역은 예컨대 구(sphere)로 구분할 수 있다. 예컨대, 분석대상 데이터를 가장 근접한 학습 데이터의 클래스로 분류하는 알고리즘인 최근접 이웃 규칙(nearest-neighbor rule)을 적용하며, 구의 내부는 동일 클래스의 특징 데이터들만 포함하도록 할 수 있다. 즉, 클래스 A와 클래스 B는 각 클래스의 프로토타입 데이터(350a, 350b)와 그것을 중심으로 하는 반지름(r)을 통해 구분될 수 있다. 예시적인 실시예에 따르면, 프로토타입 데이터(350a, 350b)는 구의 중심점일 수 있고, 프로토타입의 반지름(r)은 가장 인접한 다른 클래스 데이터와 가장 먼 동일 클래스 데이터의 중간 거리 값으로 결정할 수 있다.According to the exemplary embodiment, the class region represented by each learning feature data can be divided into a sphere, for example. For example, the nearest neighbor rule, which is an algorithm for classifying the analysis target data into the class of the learning data closest to the target, may be applied, and the inside of the phrase may include only the characteristic data of the same class. That is, the class A and the class B can be distinguished through the prototype data 350a and 350b of each class and the radius r centering on the prototype data 350a and 350b. According to the exemplary embodiment, the prototype data 350a and 350b may be the center point of the sphere, and the radius r of the prototype may be determined as the intermediate distance value of the same class data farthest from the closest other class data.

이렇게 정해진 프로토타입 데이터(350a, 350b) 집합을 새로운 학습 데이터 집합으로 삼아 기계학습을 수행하여 악성코드와 정상프로그램을 구분할 수 있는 분류자(250) 즉, 프로토타입 데이터 기반 탐지모델을 생성할 수 있다. 프로토타입 데이터 집합을 사용하여 기계학습 시 최근접 이웃 규칙을 적용하여 학습 데이터의 클래스를 예측할 수 있다.A set of prototype data (350a, 350b) defined above is used as a new learning data set, and machine learning is performed to generate a classifier 250, that is, a prototype data-based detection model capable of distinguishing malicious code from normal programs . The prototype data set can be used to predict the class of learning data by applying nearest neighborhood rules in machine learning.

프로토타입 데이터를 기반으로 하여 탐지모델을 생성하는 방법에 의하면, 각 클래스에 포함된 많은 특징 데이터들이 하나의 프로토타입 데이터에 의해 대표되므로 관련된 데이터 량이 크게 줄어들 수 있다. 따라서 데이터의 중복 및 잡음 문제가 거의 존재하지 않아 탐지모델의 정확도가 높다. 또한 적은 데이터로 모델을 학습할 수 있는 장점이 있다.According to the method of generating a detection model based on prototype data, since many feature data included in each class are represented by one prototype data, the amount of related data can be greatly reduced. Therefore, there is little data duplication and noisy problem, so the accuracy of the detection model is high. Also, there is an advantage that the model can be learned with a small amount of data.

도 17을 참조하면, 프로토타입 데이터(350a, 350b)에 기반하여 생성된 기존의 탐지모델에 신규의 특징데이터(300)를 학습시키기 위해서는 그 신규 특징데이터(300)를 해당 클래스의 프로토타입 데이터(350a, 350b)와만 비교하여 학습시키면 된다. 이처럼 프로토타입 모델 기반 신규 데이터 학습 방법은 각 클래스를 대표하는 프로토타입 데이터(350a, 350b)만 고려하여 기존의 탐지모델을 갱신하면 되므로, 학습 시간이 적게 걸리고 탐지모델의 유연성이 높다. 프로토타입 데이터를 기반으로 하는 탐지모델은 위와 같은 장점 때문에 갱신을 빠르고 유연하게 할 수 있다. 17, in order to learn new feature data 300 to an existing detection model generated based on prototype data 350a and 350b, the new feature data 300 is divided into prototype data of the class 350a, and 350b. As described above, the new data learning method based on the prototype model requires only a short learning time and high flexibility of the detection model since only the existing detection model needs to be updated considering only the prototype data 350a and 350b representative of each class. Detection models based on prototype data can make updates faster and more flexible because of these advantages.

위에서 설명한 방법들을 통해 생성된 탐지모델은 도 2의 설명에서 언급한 것처럼 악성코드 탐지프로그램에 반영될 수 있다. 그 악성코드 탐지프로그램은 컴퓨터 장치에서 실행될 수 있고, 그에 따라 임의의 분석대상파일이 악성코드인지 여부를 실시간 또는 비실시간으로 판별할 수 있다. 즉, 이러한 판별을 위해, 분석대상파일의 바이트 데이터를 이용하여 바이트 엔트로피 특징 데이터를 추출하고(S80), 그것을 다시 차원 수가 낮은 바이트 엔트로피 카운트 맵 특징 데이터로 변환한다(S90). 변환된 분석대상파일의 바이트 엔트로피 카운트 맵 특징 데이터(400)를 탐지모델을 이용하여 분석함으로써 그 분석대상파일이 악성코드인지 아니면 정상 프로그램인지 여부를 판별할 수 있다(S95). The detection model generated through the methods described above can be reflected in the malicious code detection program as mentioned in the description of FIG. The malicious code detection program can be executed in a computer device, and thereby it is possible to determine whether an arbitrary analysis target file is malicious code in real time or in non-real time. That is, for this discrimination, the byte entropy characteristic data is extracted by using the byte data of the analysis object file (S80), and it is converted into low byte entropy count map characteristic data again (S90). The byte entropy count map feature data 400 of the converted analysis target file is analyzed using a detection model to determine whether the analysis target file is a malicious code or a normal program (S95).

이상에서 설명한 본 발명의 실시예들에 따르면, 악성코드 탐지모델은 차원 수가 아주 낮은 바이트 엔트로피 카운트 맵의 특징 데이터를 이용하여 생성된다. 악성코드 탐지모델은 저 차원수의 엔트로피 카운트 맵 특징을 통해 각 악성코드 클래스를 대표하는 프로토타입을 선정하고, 그 프로토타입에 기반하여 생성될 수도 있다. 이에 의하면, 엔트로피 카운트 맵의 특징이 차원 수가 낮은 엔트로피 값의 범위별 분포로 이루어져 있어서 데이터의 잡음에 강하다. 이런 장점은 엔트로피 카운트 맵 특징에 기초한 프로토타입을 이용하여 만들어지는 탐지모델에도 그대로 반영된다. 즉, 본 발명에 따른 탐지모델은 악성코드 데이터의 중복 및 잡음 문제를 최소화할 수 있고, 탐지 정확도를 향상시킬 수 있다. 탐지모델 생성에 이용된 엔트로피 카운트 맵은 차원수가 낮아 더 적은 데이터로 충분한 학습 효과를 제공할 수 있다. 그러므로 탐지 모델에 신규 악성코드 데이터를 빠르게 학습시킬 수 있어 학습 및 탐지의 신속성과 유연성을 높일 수 있다. 또한, 본 발명의 실시예들은 바이트 기반의 엔트로피 특징을 이용하여 악성코드를 탐지하므로, 일반적인 악성 코드 및 난독화 된 악성 코드 또는 압축된 악성 코드도 탐지할 수 있다. According to the embodiments of the present invention described above, the malicious code detection model is generated using the feature data of the byte entropy count map with a low number of dimensions. The malicious code detection model can be generated based on the prototype that represents each malicious code class by selecting a low dimensional number of entropy count map features. According to this, the feature of the entropy count map is strong in noise of data because it consists of a range-dependent distribution of entropy values having a low number of dimensions. This advantage is reflected in the detection model created using the prototype based on the entropy count map feature. That is, the detection model according to the present invention can minimize the problem of duplication and noise of malicious code data and improve the detection accuracy. The entropy count map used to generate the detection model is low in dimension and can provide sufficient learning effect with less data. Therefore, it is possible to quickly learn new malicious code data in the detection model, thus improving the speed and flexibility of learning and detection. Also, embodiments of the present invention detect malicious code using a byte-based entropy feature, so that it can detect general malicious code, obfuscated malicious code, or compressed malicious code.

실시예에 따른 방법은 다양한 컴퓨팅 장치에 의해 실행될 수 있는 컴퓨터 프로그램(computer program), 코드(code), 명령(instruction), 또는 이들 중 하나 이상의 조합을 포함한 형태(이하 '소프트웨어'로 통칭함)로 구현될 수 있다. 상기 소프트웨어는 원하는 대로 동작하도록 처리 장치를 구성하거나 독립적으로 또는 결합적으로(collectively) 처리 장치를 명령할 수 있다. 소프트웨어 및/또는 데이터는, 처리 장치에 의하여 해석되거나 처리 장치에 명령 또는 데이터를 제공하기 위하여, 어떤 유형의 기계, 구성요소(component), 물리적 장치, 가상 장치(virtual equipment), 또는 컴퓨터 판독 저장 매체 또는 장치에 영구적으로, 또는 일시적으로 구체화(embody)될 수 있다. 컴퓨터 프로그램은 네트워크로 연결된 컴퓨터 시스템 상에 분산되어서, 분산된 방법으로 저장되거나 실행될 수도 있다. The method according to an embodiment may be implemented in a form that includes a computer program, code, instructions, or a combination of any one or more thereof (collectively referred to as "software") that may be executed by various computing devices Can be implemented. The software may configure the processing device to operate as desired or may independently or collectively command the processing device. Software and / or data may be stored on any type of machine, component, physical device, virtual equipment, or computer readable storage medium, such as a computer readable medium, Or may be permanently or temporarily embodyed on the device. The computer programs may be distributed on a networked computer system and stored or executed in a distributed manner.

소프트웨어 및 데이터는 하나 이상의 컴퓨터 판독 가능 기록 매체에 저장될 수 있다. 상기 컴퓨터 판독 가능 매체는 프로그램 명령, 데이터 파일, 데이터 구조 등을 단독으로 또는 조합하여 포함할 수 있다. 상기 매체에 기록되는 프로그램 명령은 실시예를 위하여 특별히 설계되고 구성된 것들이거나 컴퓨터 소프트웨어 당업자에게 공지되어 사용 가능한 것일 수도 있다. 컴퓨터 판독 가능 기록 매체의 예에는 하드 디스크, 플로피 디스크 및 자기 테이프와 같은 자기 매체(magnetic media), CD-ROM, DVD와 같은 광기록 매체(optical media), 플롭티컬 디스크(floptical disk)와 같은 자기-광 매체(magneto-optical media), 및 롬(ROM), 램(RAM), 플래시 메모리 등과 같은 프로그램 명령을 저장하고 수행하도록 특별히 구성된 하드웨어 장치가 포함된다. 프로그램 명령의 예에는 컴파일러에 의해 만들어지는 것과 같은 기계어 코드뿐만 아니라 인터프리터 등을 사용해서 컴퓨터에 의해서 실행될 수 있는 고급 언어 코드를 포함한다. 상기된 하드웨어 장치는 실시예의 동작을 수행하기 위해 하나 이상의 소프트웨어 모듈로서 작동하도록 구성될 수 있으며, 그 역도 마찬가지이다.The software and data may be stored on one or more computer readable recording media. The computer-readable medium may include program instructions, data files, data structures, and the like, alone or in combination. The program instructions to be recorded on the medium may be those specially designed and configured for the embodiments or may be available to those skilled in the art of computer software. Examples of computer-readable media include magnetic media such as hard disks, floppy disks and magnetic tape; optical media such as CD-ROMs and DVDs; magnetic media such as floppy disks; Magneto-optical media, and hardware devices specifically configured to store and execute program instructions such as ROM, RAM, flash memory, and the like. Examples of program instructions include machine language code such as those produced by a compiler, as well as high-level language code that can be executed by a computer using an interpreter or the like. The hardware devices described above may be configured to operate as one or more software modules to perform the operations of the embodiments, and vice versa.

본 발명의 실시예들에 의한 소프트웨어를 실행할 수 있는 장치 및 구성요소는, 예를 들어, 프로세서, 콘트롤러, ALU(arithmetic logic unit), 디지털 신호 프로세서(digital signal processor), 마이크로컴퓨터, FPA(field programmable array), PLU(programmable logic unit), 마이크로프로세서, 또는 명령(instruction)을 실행하고 응답할 수 있는 다른 어떠한 장치와 같이, 하나 이상의 범용 컴퓨터 또는 특수 목적 컴퓨터일 수 있다. 처리 장치는 운영 체제(OS) 및 상기 운영 체제 상에서 수행되는 하나 이상의 소프트웨어 애플리케이션을 수행할 수 있다. 또한, 처리 장치는 소프트웨어의 실행에 응답하여, 데이터를 접근, 저장, 조작, 처리 및 생성할 수도 있다. Devices and components capable of executing software in accordance with embodiments of the present invention include, for example, a processor, a controller, an arithmetic logic unit (ALU), a digital signal processor, a microcomputer, a field programmable array, a programmable logic unit (PLU), a microprocessor, or any other device capable of executing and responding to instructions. The processing device may execute an operating system (OS) and one or more software applications running on the operating system. The processing device may also access, store, manipulate, process, and generate data in response to execution of the software.

상기에서는 본 발명의 바람직한 실시예를 참조하여 설명하였지만, 해당 기술 분야의 숙련된 당업자는 하기의 특허 청구 범위에 기재된 본 발명의 사상 및 영역으로부터 벗어나지 않는 범위 내에서 본 발명을 다양하게 수정 및 변경시킬 수 있음을 이해할 수 있을 것이다.It will be apparent to those skilled in the art that various modifications and variations can be made in the present invention without departing from the spirit or scope of the present invention as defined by the following claims. It can be understood that it is possible.

본 발명은 다양한 컴퓨팅 장치에서 악성코드를 탐지하기 위한 용도로 이용될 수 있다.The present invention can be used for detecting malicious codes in various computing devices.

110: 분석대상파일 115: 바이트 어레이
120: 윈도우 130: 바이트 히스토그램 어레이
135: 바이트 주파수 비 어레이 140: 바이트 엔트로피 어레이
145: 2차원 바이트 엔트로피 행렬 150: 바이트 엔트로피 카운트 맵
200: 악성코드 분류자
300: 신규의 바이트 엔트로피 맵 특징 데이터
400: 분석대상파일의 바이트 엔트로피 카운트 맵 특징 데이터
110: File to be analyzed 115: Byte array
120: Window 130: Byte Histogram Array
135: Byte frequency non-array 140: Byte entropy array
145: two-dimensional byte entropy matrix 150: byte entropy count map
200: Malware classifier
300: New byte entropy map feature data
400: byte entropy count of the file to be analyzed map feature data

Claims (16)

컴퓨팅 장치에서 실행되는 컴퓨터 프로그램을 이용하여 악성코드를 탐지하기 위한 방법으로서,
입력 데이터로 제공되는 다수의 정상 프로그램과 악성 코드의 학습용 파일들로부터 다수의 바이트 기반 엔트로피 특징 데이터를 추출하는 단계;
추출된 상기 다수의 바이트 기반 엔트로피 특징 데이터들을 '엔트로피 값의 범위'별 존재 빈도로 매핑시켜 더 낮은 차원수의 다수의 바이트 엔트로피 카운트 맵 특징데이터로 변환하는 단계;
상기 다수의 바이트 엔트로피 카운트 맵 특징 데이터를 이용하여 기계학습을 수행하는 것에 의해 정상 프로그램과 악성 코드를 분류할 수 있는 탐지모델을 생성하는 단계; 및
생성된 탐지모델에 기초하여, 임의의 분석대상 파일이 악성 코드에 해당하는지 여부를 분석하는 탐지 단계를 포함하고,
상기 '다수의 바이트 엔트로피 카운트 맵 특징데이터로 변환하는 단계'는, 바이트 엔트로피 어레이를 구성하는 제1 내지 제N 바이트 엔트로피 어레이를 Nx1 크기의 2차원 바이트 엔트로피 행렬로 변환하는 단계; 및 상기 2차원 바이트 엔트로피 행렬의 원소들을 R개(여기서, 상기 R은 2보다 큰 자연수임)의 범위로 구분된 바이트 엔트로피 값의 범위들로 매핑시켜 상기 원소들을 상기 바이트 엔트로피 값의 범위별 존재 빈도로 나타낸 상기 바이트 엔트로피 카운트 맵을 생성하는 단계를 포함하는 것을 특징으로 하는 저 차원 수의 엔트로피 카운트 맵 기반 악성코드 탐지방법.
CLAIMS 1. A method for detecting malicious code using a computer program running on a computing device,
Extracting a plurality of byte-based entropy feature data from learning files of a plurality of normal programs and malicious codes provided as input data;
Converting the extracted plurality of byte-based entropy feature data into a plurality of byte entropy count map feature data of a lower dimensional number by mapping the extracted plurality of byte-based entropy feature data to a presence frequency of each 'range of entropy values';
Generating a detection model capable of classifying normal programs and malicious codes by performing machine learning using the plurality of byte entropy count map feature data; And
And a detection step of analyzing whether or not any analysis target file corresponds to a malicious code based on the generated detection model,
Converting the first to Nth-byte entropy arrays constituting the byte entropy array into an Nx1-sized two-dimensional byte entropy matrix; And mapping the elements of the two-dimensional byte entropy matrix into ranges of byte entropy values separated by R (where R is a natural number greater than 2), so as to convert the elements into an existence frequency of the byte entropy value And generating the byte entropy count map represented by the entropy count map based on the low-dimensional number.
제1항에 있어서, 상기 '다수의 바이트 기반 엔트로피 특징 데이터를 추출하는 단계'는, 상기 학습용 파일들의 바이트 어레이 분석용 윈도우의 사이즈와 윈도우 이동 스텝 사이즈를 설정하는 단계; 각 학습용 파일의 바이트 어레이 전체에 대하여 맨 처음부터 끝까지 윈도우를 상기 윈도우 이동 스텝 사이즈만큼씩 이동해가면서 N개의 윈도우(단, N은 2보다 큰 자연수)를 생성하고, 상기 N개의 윈도우 각각을 통해 각 윈도우에 대응되는 N개의 바이트 히스토그램을 산출하는 단계; 산출된 N개의 바이트 히스토그램 전체를 통합하여 하나의 바이트 히스토그램 어레이를 생성하는 단계; 및 상기 바이트 히스토그램 어레이를 바이트 엔트로피 계산을 통해 바이트 엔트로피 어레이로 변환하는 단계를 포함하는 것을 특징으로 하는 저 차원 수의 엔트로피 카운트 맵 기반 악성코드 탐지방법.The method of claim 1, wherein the step of extracting the plurality of byte-based entropy characteristic data comprises: setting a size of a window for analyzing a byte array of the learning files and a window movement step size; N windows (where N is a natural number greater than 2) are generated while moving the window by the window moving step size from the beginning to the end with respect to the entire byte array of each learning file, and each window Calculating N byte histograms corresponding to the N bytes; Integrating all of the N byte histograms to generate a byte histogram array; And converting the byte histogram array to a byte entropy array through byte entropy computation. &Lt; Desc / Clms Page number 21 &gt; 제2항에 있어서, 상기 윈도우의 사이즈는 상기 윈도우 이동 스텝 사이즈보다 크게 설정되어, 이동 전후의 인접하는 앞뒤 윈도우들 간에 중첩되는 것을 특징으로 하는 저 차원 수의 엔트로피 카운트 맵 기반 악성코드 탐지방법.3. The method of claim 2, wherein the size of the window is set to be larger than the size of the window movement step, and overlapped between adjacent front and rear windows before and after the movement. 제2항에 있어서, 상기 'N개의 바이트 히스토그램을 산출하는 단계'는, 상기 N개의 윈도우 각각에 대하여, 각 윈도우에 포함되는 바이트 어레이의 전체 바이트들의 10진수 값들의 빈도를 카운트 하는 단계; 및 각 윈도우별로 카운트된 10진수 값들의 빈도를 해당 윈도우에 대응하는 바이트 어레이 히스토그램으로 생성하여 N개의 윈도우에 대응되는 N개의 바이트 히스토그램을 산출하는 단계를 포함하는 것을 특징으로 하는 저 차원 수의 엔트로피 카운트 맵 기반 악성코드 탐지방법.3. The method of claim 2, wherein the calculating the N byte histogram comprises: counting the frequency of decimal values of all the bytes of the byte array included in each window for each of the N windows; And generating the N bytes of histograms corresponding to the N windows by generating a frequency of the decimal values counted for each window with a byte array histogram corresponding to the corresponding window, Map based malware detection method. 제2항에 있어서, 상기 '바이트 엔트로피 어레이로 변환하는 단계'는, 상기 바이트 히스토그램 어레이를 구성하는 제1 내지 제N 바이트 히스토그램 각각에서 바이트 주파수 비(=임의의 바이트 히스토그램 영역 내의 전체 원소의 값의 총합에 대한 각 원소의 값의 비)를 계산하여 제1 내지 제N 바이트 주파수 비 어레이를 생성하는 단계; 생성된 상기 제1 내지 제N 바이트 주파수 비 어레이를 이용하여, 각 윈도우별로 바이트 주파수 비에 대한 바이트 엔트로피를 계산하여 제1 내지 제N 바이트 엔트로피 어레이를 계산하는 단계; 및 계산된 제1 내지 제N 바이트 엔트로피 어레이 전체를 통합하여 상기 학습용 파일의 상기 바이트 엔트로피 어레이를 생성하는 단계를 포함하는 것을 특징으로 하는 저 차원 수의 엔트로피 카운트 맵 기반 악성코드 탐지방법.3. The method according to claim 2, wherein the step of converting into the byte entropy array is a step of converting the byte frequency ratio (= the value of all the elements in the arbitrary byte histogram area) of each of the first through Nth byte histograms constituting the byte histogram array Calculating a ratio of a value of each element to a sum of the first to Nth byte frequency non-arrays; Calculating first through Nth byte entropy arrays by calculating a byte entropy with respect to a byte frequency ratio for each window using the first through Nth byte frequency array arrays; And summing the calculated first through Nth byte entropy arrays to generate the byte entropy array of the learning file. &Lt; Desc / Clms Page number 19 &gt; 제5항에 있어서, 상기 바이트 주파수 비에 대한 상기 바이트 엔트로피는 아래 식,
Figure 112018077801635-pat00010

을 이용하여 계산되고, 여기서,
Figure 112018077801635-pat00011
는 윈도우내 원소 i번째 엔트로피 값을 나타내고,
Figure 112018077801635-pat00012
는 윈도우의 원소 i번째 바이트 주파수 비를 나타내는 것을 특징으로 하는 저 차원 수의 엔트로피 카운트 맵 기반 악성코드 탐지방법.
6. The method of claim 5, wherein the byte entropy for the byte frequency ratio is expressed by the following equation:
Figure 112018077801635-pat00010

, Where &lt; RTI ID = 0.0 &gt;
Figure 112018077801635-pat00011
Represents the i-th entropy value of the element in the window,
Figure 112018077801635-pat00012
Represents a frequency ratio of an i-th byte of an element of the window, and a low-dimensional-number entropy count map-based malicious code detection method.
삭제delete 제1항에 있어서, 상기 바이트 엔트로피 값의 범위는, 상기 바이트 엔트로피 값 0 이상 0.6 미만을 R-1개의 범위로 구분하고, 상기 바이트 엔트로피 값 0.6 이상을 1가지 범위로 구분하여, 총 R개의 범위로 구분되는 것을 특징으로 하는 저 차원 수의 엔트로피 카운트 맵 기반 악성코드 탐지방법.2. The method of claim 1, wherein the byte entropy value ranges from 0 to less than 0.6, and the byte entropy value is divided into a range of R-1, Wherein the entropy count map is divided into a low-dimensional number of entropy count map and a low-dimensional number of entropy count map. 제8항에 있어서, 상기 R은 7인 것을 특징으로 하는 저 차원 수의 엔트로피 카운트 맵 기반 악성코드 탐지방법.9. The method of claim 8, wherein the R is 7. 제1항에 있어서, '상기 바이트 엔트로피 카운트 맵을 생성하는 단계'는, 상기 2차원 바이트 엔트로피 행렬의 각 열마다 해당 열에 속하는 N개의 바이트 엔트로피 값들이 상기 R개의 범위 중 어느 범위에 속하는지를 비교하여 상기 R개의 범위 각각에 속하는 바이트 엔트로피 값들의 개수를 카운트하는 단계; 및 카운트 결과를 R x Q 크기의 2차원 행렬로 표현하는 단계를 포함하고, 여기서, R은 바이트 엔트로피 값의 범위의 개수이고, Q는 1 바이트가 나타내는 10진수의 개수이며, N>>R인 것을 특징으로 하는 저 차원 수의 엔트로피 카운트 맵 기반 악성코드 탐지방법.2. The method of claim 1, wherein the step of generating the byte entropy count map compares a range of N number of byte entropy values belonging to the column with respect to each row of the two-dimensional byte entropy matrix, Counting the number of byte entropy values belonging to each of the R ranges; And expressing the count result as a two-dimensional matrix of R x Q size, where R is the number of ranges of byte entropy values, Q is the number of decimal numbers represented by one byte, and N >> R A low dimensional number of entropy count map based malicious code detection method. 제1항에 있어서, 상기 다수의 바이트 기반 엔트로피 특징 데이터의 전체를 이용하거나 또는 상기 전체의 일부로서 상기 전체를 대표하는 적은 수의 프로토타입 데이터를 상기 탐지모델의 생성을 위해 이용하는 것을 특징으로 하는 저 차원 수의 엔트로피 카운트 맵 기반 악성코드 탐지방법.2. The method of claim 1, wherein a small number of prototype data representing the entirety of the plurality of byte-based entropy feature data is used for generation of the detection model. Entropy count map based malware detection method of dimension number. 제1항에 있어서, 상기 '탐지모델을 생성하는 단계'는, 상기 학습용 파일의 데이터들 간의 비유사도와 클래스 정보를 이용하여 각 학습용 파일의 클래스에 속하는 바이트 엔트로피 카운트 맵 특징 데이터를 대표하는 프로토타입 데이터를 선정하는 단계; 및 선정된 프로토타입 데이터의 집합을 새로운 학습 데이터 집합으로 삼아 기계학습을 수행하여 상기 탐지모델을 생성하는 단계를 포함하는 것을 특징으로 하는 저 차원 수의 엔트로피 카운트 맵 기반 악성코드 탐지방법. The method according to claim 1, wherein the step of generating the detection model comprises: a step of generating a detection model representing a prototype representing the byte entropy count map characteristic data belonging to the class of each learning file by using the non- Selecting data; And generating the detection model by performing machine learning by using a set of the selected prototype data as a new learning data set, thereby generating a detection model based on the entropy count map. 제12항에 있어서, 상기 학습용 파일들의 클래스 영역들은 프로토타입 데이터와 상기 프로토타입 데이터를 중심으로 하는 반지름에 의해 규정되는 구로 구분되며, 상기 반지름은 가장 인접한 다른 클래스 데이터와 가장 먼 동일 클래스 데이터의 중간 거리 값으로 결정되는 것을 특징으로 하는 저 차원 수의 엔트로피 카운트 맵 기반 악성코드 탐지방법.13. The method of claim 12, wherein the class regions of the learning files are divided into proto-type data and phrases defined by a radius centering on the proto-type data, and the radius is a half of the class data that is farthest from the closest other class data And the distance value is determined as a value of the entropy count map. 제1항에 있어서, 상기 탐지 단계는, 상기 분석대상파일의 바이트 엔트로피 특징 데이터를 추출하는 단계; 추출된 상기 분석대상파일의 바이트 엔트로피 특징 데이터를 저 차원수의 바이트 엔트로피 카운트 맵 특징 데이터로 변환하는 단계; 및 변환된 상기 분석대상파일의 바이트 엔트로피 카운트 맵 특징 데이터를 상기 탐지모델에 기초하여 분석하여 상기 분석대상파일이 정상 프로그램에 해당하는지 아니면 악성코드에 해당하는지를 판단하는 단계를 포함하는 것을 특징으로 하는 저 차원 수의 엔트로피 카운트 맵 기반 악성코드 탐지방법.The method of claim 1, wherein the detecting step comprises: extracting byte entropy characteristic data of the analysis target file; Converting the extracted byte entropy characteristic data of the analysis target file into low dimensional number of byte entropy count map characteristic data; And analyzing the converted byte entropy count map feature data of the analysis target file based on the detection model to determine whether the analysis target file corresponds to a normal program or a malicious code Entropy count map based malware detection method of dimension number. 제1항 내지 제6항 및 제8항 내지 제14항 중 어느 한 항에 기재된 악성코드 탐지방법을 수행하기 위하여 컴퓨터 판독 가능한 기록 매체에 저장된 컴퓨터 실행가능 프로그램.A computer-executable program stored in a computer-readable recording medium for performing the malicious code detection method according to any one of claims 1 to 6 and 8 to 14. 제1항 내지 제6항 및 제8항 내지 제14항 중 어느 한 항에 기재된 악성코드 탐지방법을 수행하기 위한 컴퓨터 실행가능 프로그램이 기록된 컴퓨터 판독 가능한 기록 매체.A computer-readable recording medium on which a computer-executable program for performing the malicious code detection method according to any one of claims 1 to 6 and 8 to 14 is recorded.
KR1020180091636A 2018-08-07 2018-08-07 Method of detecting malware based on entropy count map of low dimensional number KR101922956B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020180091636A KR101922956B1 (en) 2018-08-07 2018-08-07 Method of detecting malware based on entropy count map of low dimensional number

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020180091636A KR101922956B1 (en) 2018-08-07 2018-08-07 Method of detecting malware based on entropy count map of low dimensional number

Publications (1)

Publication Number Publication Date
KR101922956B1 true KR101922956B1 (en) 2019-02-27

Family

ID=65561065

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020180091636A KR101922956B1 (en) 2018-08-07 2018-08-07 Method of detecting malware based on entropy count map of low dimensional number

Country Status (1)

Country Link
KR (1) KR101922956B1 (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111400715A (en) * 2020-06-04 2020-07-10 鹏城实验室 Classification engine diagnosis method, classification engine diagnosis device and computer-readable storage medium
CN112183622A (en) * 2020-09-27 2021-01-05 广州汇量信息科技有限公司 Method, device, equipment and medium for detecting cheating in mobile application bots installation
KR102231336B1 (en) * 2019-12-30 2021-03-24 주식회사 쓰리빌리언 System for fast searching similar string and method thereof
CN112926054A (en) * 2021-02-22 2021-06-08 亚信科技(成都)有限公司 Malicious file detection method, device, equipment and storage medium
KR102425729B1 (en) * 2021-08-18 2022-07-29 주식회사 케이사인 Malicious code feature extraction method and system for internet of things device
KR20220121349A (en) 2021-02-25 2022-09-01 순천향대학교 산학협력단 Language model learning device using bytes data
GB2617136A (en) * 2022-03-30 2023-10-04 Egress Software Tech Ip Limited Method and system for processing data packages
CN116996278A (en) * 2023-07-21 2023-11-03 广东技术师范大学 Webpage detection method and device based on mining behavior of WASM module
CN117235728A (en) * 2023-11-16 2023-12-15 中国电子科技集团公司第十五研究所 Malicious code gene detection method and device based on fine granularity labeling model

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101754720B1 (en) * 2016-01-14 2017-07-19 주식회사 블랙포트시큐리티 Device for detecting malicious code in non executable file and method thereof
US20170262633A1 (en) * 2012-09-26 2017-09-14 Bluvector, Inc. System and method for automated machine-learning, zero-day malware detection
KR101858620B1 (en) * 2017-01-10 2018-05-17 고려대학교 산학협력단 Device and method for analyzing javascript using machine learning
KR101863615B1 (en) * 2017-05-24 2018-06-01 (주)이스트소프트 Apparatus for detecting variants of a malicious code based on neural network learning, method thereof and computer recordable medium storing program to perform the method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170262633A1 (en) * 2012-09-26 2017-09-14 Bluvector, Inc. System and method for automated machine-learning, zero-day malware detection
KR101754720B1 (en) * 2016-01-14 2017-07-19 주식회사 블랙포트시큐리티 Device for detecting malicious code in non executable file and method thereof
KR101858620B1 (en) * 2017-01-10 2018-05-17 고려대학교 산학협력단 Device and method for analyzing javascript using machine learning
KR101863615B1 (en) * 2017-05-24 2018-06-01 (주)이스트소프트 Apparatus for detecting variants of a malicious code based on neural network learning, method thereof and computer recordable medium storing program to perform the method

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102231336B1 (en) * 2019-12-30 2021-03-24 주식회사 쓰리빌리언 System for fast searching similar string and method thereof
CN111400715A (en) * 2020-06-04 2020-07-10 鹏城实验室 Classification engine diagnosis method, classification engine diagnosis device and computer-readable storage medium
CN112183622A (en) * 2020-09-27 2021-01-05 广州汇量信息科技有限公司 Method, device, equipment and medium for detecting cheating in mobile application bots installation
CN112183622B (en) * 2020-09-27 2024-03-12 广州汇量信息科技有限公司 Mobile application bots installation cheating detection method, device, equipment and medium
CN112926054B (en) * 2021-02-22 2023-10-03 亚信科技(成都)有限公司 Malicious file detection method, device, equipment and storage medium
CN112926054A (en) * 2021-02-22 2021-06-08 亚信科技(成都)有限公司 Malicious file detection method, device, equipment and storage medium
KR20220121349A (en) 2021-02-25 2022-09-01 순천향대학교 산학협력단 Language model learning device using bytes data
KR102425729B1 (en) * 2021-08-18 2022-07-29 주식회사 케이사인 Malicious code feature extraction method and system for internet of things device
GB2617136A (en) * 2022-03-30 2023-10-04 Egress Software Tech Ip Limited Method and system for processing data packages
CN116996278A (en) * 2023-07-21 2023-11-03 广东技术师范大学 Webpage detection method and device based on mining behavior of WASM module
CN116996278B (en) * 2023-07-21 2024-01-19 广东技术师范大学 Webpage detection method and device based on mining behavior of WASM module
CN117235728A (en) * 2023-11-16 2023-12-15 中国电子科技集团公司第十五研究所 Malicious code gene detection method and device based on fine granularity labeling model
CN117235728B (en) * 2023-11-16 2024-02-06 中国电子科技集团公司第十五研究所 Malicious code gene detection method and device based on fine granularity labeling model

Similar Documents

Publication Publication Date Title
KR101922956B1 (en) Method of detecting malware based on entropy count map of low dimensional number
CN111723786B (en) Method and device for detecting wearing of safety helmet based on single model prediction
CN110189334A (en) The medical image cutting method of the full convolutional neural networks of residual error type based on attention mechanism
CN113159147B (en) Image recognition method and device based on neural network and electronic equipment
US11120297B2 (en) Segmentation of target areas in images
JP7043742B2 (en) Learning model creation device
CN111444807A (en) Target detection method, device, electronic equipment and computer readable medium
CN113822207A (en) Hyperspectral remote sensing image identification method and device, electronic equipment and storage medium
Wu et al. Natural scene text detection by multi-scale adaptive color clustering and non-text filtering
CN113869496A (en) Acquisition method of neural network, data processing method and related equipment
WO2019092867A1 (en) Information processing device, information processing method, and computer-readable recording medium
WO2019092868A1 (en) Information processing device, information processing method, and computer-readable recording medium
Zhang et al. Clustering algorithm based on spatial shadowed fuzzy c-means and i-ching operators
CN111492407B (en) System and method for map beautification
CN113764034B (en) Method, device, equipment and medium for predicting potential BGC in genome sequence
WO2021005898A1 (en) Object detection device, object detection method, and program
Zhang et al. Multicontext 3D residual CNN for false positive reduction of pulmonary nodule detection
CN110059180B (en) Article author identity recognition and evaluation model training method and device and storage medium
CN114095268A (en) Method, terminal and storage medium for network intrusion detection
CN114373098A (en) Image classification method and device, computer equipment and storage medium
CN113627522A (en) Image classification method, device and equipment based on relational network and storage medium
CN117474070B (en) Model pruning method, face recognition model training method and face recognition method
CN116010370B (en) Digital business information processing method and server combined with edge calculation
CN113011580B (en) Processing method for embedding representation and related equipment
KR102073020B1 (en) System and method for selecting optimized medical features using neural network