KR101327740B1 - apparatus and method of collecting action pattern of malicious code - Google Patents

apparatus and method of collecting action pattern of malicious code Download PDF

Info

Publication number
KR101327740B1
KR101327740B1 KR1020110142178A KR20110142178A KR101327740B1 KR 101327740 B1 KR101327740 B1 KR 101327740B1 KR 1020110142178 A KR1020110142178 A KR 1020110142178A KR 20110142178 A KR20110142178 A KR 20110142178A KR 101327740 B1 KR101327740 B1 KR 101327740B1
Authority
KR
South Korea
Prior art keywords
file
api
folder
file access
protected
Prior art date
Application number
KR1020110142178A
Other languages
Korean (ko)
Other versions
KR20130074224A (en
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 KR1020110142178A priority Critical patent/KR101327740B1/en
Publication of KR20130074224A publication Critical patent/KR20130074224A/en
Application granted granted Critical
Publication of KR101327740B1 publication Critical patent/KR101327740B1/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
    • G06F21/567Computer malware detection or handling, e.g. anti-virus arrangements using dedicated hardware
    • 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/552Detecting local intrusion or implementing counter-measures involving long-term monitoring or reporting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/604Tools and structures for managing or administering access control systems

Abstract

본 발명은 해킹프로그램, 컴퓨터바이러스, 게임 핵을 포함한 다양한 악성코드로부터 보호 대상 폴더와 보호 대상 파일을 보호하면서 악성코드의 행동 패턴을 수집하는 장치 및 방법에 관한 것이다.
본 발명에 따른 악성코드의 행동 패턴 수집장치는, 임의의 주체 프로세스가 사용하는 파일 접근 API를 후킹하는 파일접근API후킹부와, 상기 파일 접근 API의 객체 파일을 분석하는 API분석부와, 상기 파일 접근 API의 객체 파일이 보호 대상 파일이면 더미 파일을 생성하고 상기 더미 파일을 대상으로 상기 파일 접근 API를 실행하는 API실행부와, 상기 API실행부에서 실행한 상기 파일 접근 API 관련 정보를 로그로 저장하는 로그수집부와, 상기 API실행부의 실행 결과를 상기 주체 프로세스에게 통지하는 API실행결과통지부를 포함한다.
The present invention relates to an apparatus and method for collecting behavior patterns of malicious code while protecting a protected folder and a protected file from various malicious codes including hacking programs, computer viruses, and game hacks.
The apparatus for collecting behavior patterns of malicious code according to the present invention includes a file access API hooking unit hooking a file access API used by an arbitrary subject process, an API analysis unit analyzing an object file of the file access API, and the file. If the object file of the access API is a protected file, an API execution unit generating a dummy file and executing the file access API for the dummy file, and storing the file access API related information executed by the API execution unit as a log And a log collecting unit for executing the API execution result notification unit for notifying the subject process of the execution result of the API executing unit.

Description

악성코드의 행동 패턴 수집장치 및 방법{apparatus and method of collecting action pattern of malicious code}Apparatus and method of collecting action pattern of malicious code}

본 발명은 악성코드의 행동 패턴 수집장치 및 방법에 관한 것으로, 보다 상세하게는 해킹프로그램, 컴퓨터바이러스, 게임 핵을 포함한 다양한 악성코드로부터 보호 대상 폴더와 보호 대상 파일을 보호하는 악성코드의 행동 패턴 수집장치 및 방법에 관한 것이다.The present invention relates to an apparatus and method for collecting behavior patterns of malicious codes, and more particularly, to collecting behavior patterns of malicious codes for protecting folders and files to be protected from various malicious codes including hacking programs, computer viruses, and game hacks. An apparatus and method are provided.

통상적으로 악성코드는 다른 사람에게 심리적, 실질적으로 피해를 주기 위하여 제작된 모든 프로그램 및 실행코드를 의미하는 바, 이러한 악성코드는 정보 보호를 위협하며 문제를 일으키고 있다. 크래커들의 악성코드 제작 기술력이 증가함에 따라 보안 위협도 증가한다. 악성코드를 분석하기 위한 방법에는 지문(signature) 검사법, CRC(Cyclic Redundancy Check) 검사법 및 경험적(heuristic) 검사법이 있다.In general, malware refers to all programs and executable code designed to psychologically and substantially damage other people, and these malicious codes threaten information protection and cause problems. As the cracker's technology for producing malicious code increases, so does its security threats. Methods for analyzing malware include signature tests, cyclic redundancy check (CRC) tests, and heuristic tests.

여기서 지문 검사법은 사람을 구별할 때 지문을 보듯이 악성코드를 진단하는 방법 중의 한 가지로서, 보안모듈은 악성코드의 독특한 문자열을 수집하여 데이터베이스에 저장하고, 임의의 실행 파일과 악성코드 문자열을 매칭하여 해당 실행 파일이 악성코드인지 여부를 진단한다.Here, fingerprint inspection is one of the methods of diagnosing malicious code as if fingerprints are identified when distinguishing people. The security module collects unique strings of malicious codes and stores them in a database, matching arbitrary executable files with malicious code strings. Diagnose whether the executable file is malicious code.

이러한 지문 검사법에는 순차적 문자열 검사법과 특정 문자열 검사법이 있는데, 순차적 문자열 검사법은 속도는 빠르지만 악성코드 탐지율이 떨어지는 단점이 있고, 특정 문자열 검사법은 악성코드 탐지율은 높으나 속도가 느리다는 단점이 있다. 이러한 지문 검사법은 동일한 문자열 비교를 통해 악성코드를 탐지하기 때문에, 악성코드의 문자열 중 일부가 수정될 경우에는 해당 악성코드를 탐지할 수 없는 문제점이 있다.The fingerprint inspection method has a sequential string inspection method and a specific string inspection method. The sequential string inspection method has a disadvantage in that the detection rate of malware is fast, but the detection rate of malware is low, and the specific string inspection method has a disadvantage of high malware detection rate but slowness. Since the fingerprint inspection method detects a malicious code by comparing the same string, there is a problem that the corresponding malicious code cannot be detected when some of the strings of the malicious code are modified.

또, CRC 검사법은 시리얼 전송에서 데이터의 신뢰성을 검증하기 위한 에러검출방법의 일종으로 오진율이 낮다는 장점이 있으나, 데이터가 1 바이트라도 변형되면 악성코드를 진단할 수 없는 단점이 있다.In addition, CRC test method is an error detection method for verifying the reliability of data in the serial transmission has the advantage of low error rate, but there is a disadvantage that can not diagnose the malicious code if the data is modified even one byte.

최근에는 지문 검사법의 기능을 향상시킨 경험적(heuristic) 기법을 이용한 악성코드 진단이 주로 이루어지는데, 이는 악성코드의 행동이나 방식을 분석하여 자체적으로 학습하는 학습기반 분석법 중 하나이다. 즉, 악성 바이러스프로그램의 경우 독특한 조합의 API 명령을 사용하는 경우가 많은데, 경험적 기법은 이와 같이 독특한 API 명령의 조합을 학습하여 API 명령을 기반으로 악성코드 여부를 판단한다. 이러한 경험적 기법은 이미 수집된 악성코드의 행동 패턴을 분석하여, 임의의 실행 파일이 악성코드의 행동 패턴대로 동작하면 이를 악성코드로 진단한다.Recently, malware diagnosis using heuristic techniques that improve the function of fingerprint inspection is mainly performed. This is one of the learning-based analysis methods that learn by analyzing the behavior or method of the malware. In other words, a malicious virus program often uses a unique combination of API commands, and the heuristic technique learns a combination of these unique API commands to determine whether the malicious code is based on the API commands. This empirical technique analyzes the behavior patterns of the already collected malware and diagnoses it as malicious code if any executable file operates according to the behavior pattern of the malware.

통상적으로 보안모듈은 상술한 다양한 분석방법 등을 통해 악성코드가 탐지되면 그 탐지된 악성코드(예컨대, 게임 핵)를 강제 종료시킴으로써, 악성코드가 보호 대상 폴더나 보호 대상 파일을 변경하거나 삭제하지 못하도록 차단한다. 이 때문에 보안회사는 새로운 악성코드에 대한 행동 패턴 정보를 수집하려면 해당 악성코드를 별도 수집하여 따로 분석해야 하기 때문에 추가적인 시간과 인력이 소요되는 문제점이 있다. Typically, when a malicious code is detected through various analysis methods described above, the security module forcibly terminates the detected malicious code (eg, game hack), so that the malicious code cannot change or delete the protected folder or the protected file. Block it. For this reason, security companies have to collect additional patterns and analyze them separately to collect behavior pattern information for new malware, which requires additional time and manpower.

또한, 악성코드가 강제 종료되어 차단되면, 해커는 다른 방법으로의 접근을 시도하기 위한 악성코드의 문자열을 변경하기 때문에, 보안회사는 그 변경된 악성코드를 분석하기 위한 시간과 인력을 더욱 소모해야 하는 문제점이 있다.Also, if the malware is forcibly terminated and blocked, the hacker changes the string of the malware to try to access it in another way, so the security company has to spend more time and manpower analyzing the changed malware. There is a problem.

한편, 특허등록번호 제10-1038048호에서 악성 봇을 제어하는 원격 명령/제어 서버의 명령을 분석하기 위해 가상환경 기반에서 실행된 악성 봇의 API 호출을 후킹(Hooking)하여 분석하고, 가상환경 기반에서 악성 봇에 의해 외부로 송신하는 트래픽을 분석함으로써 악성 봇을 포함한 봇넷의 악성행위를 실시간으로 탐지하기 위한 봇넷 악성행위 실시간 분석 시스템에 관한 기술이 선등록된바 았다.On the other hand, in Patent Registration No. 10-1038048 to analyze the commands of the remote command / control server controlling the malicious bots by hooking the API calls of the malicious bots executed in the virtual environment, and analyzes the virtual environment based The technology for botnet malicious behavior real-time analysis system has been pre-registered to detect malicious behaviors of botnets including malicious bots in real time by analyzing the traffic sent to the outside by malicious bots.

이에 따라 본 발명은 상기한 문제점을 해결하기 위해 착안 된 것으로서, 악성코드로부터 보호 대상 폴더 및 보호 대상 파일을 보호함과 동시에 악성코드의 행동 패턴을 수집하기 위한 악성코드의 행동 패턴 수집장치 및 방법을 제공하는 것에 그 목적이 있다.Accordingly, the present invention was conceived to solve the above problems, and provides a method and apparatus for collecting behavior patterns of malicious code to protect the protected folder and the protected files from the malware and at the same time collect behavior patterns of the malicious code. The purpose is to provide.

이러한 목적을 달성하기 위해 본 발명의 특징은, 임의의 주체 프로세스가 사용하는 파일 접근 API를 후킹하는 파일접근API후킹부와, 상기 파일 접근 API의 객체 파일을 분석하는 API분석부와, 상기 파일 접근 API의 객체 파일이 보호 대상 파일이면 더미 파일을 생성하고 상기 더미 파일을 대상으로 상기 파일 접근 API를 실행하는 API실행부와, 상기 API실행부에서 실행한 상기 파일 접근 API 관련 정보를 로그로 저장하는 로그수집부와, 상기 API실행부의 실행 결과를 상기 주체 프로세스에게 통지하는 API실행결과통지부를 포함한 것을 특징으로 한다.In order to achieve this object, a feature of the present invention is a file access API hooking unit for hooking a file access API used by any subject process, an API analysis unit for analyzing an object file of the file access API, and the file access unit. If the object file of the API is a file to be protected, an API execution unit for generating a dummy file and executing the file access API for the dummy file, and storing the file access API related information executed by the API execution unit as a log And a log collection unit and an API execution result notification unit for notifying the subject process of the execution result of the API execution unit.

이때, 상기 API분석부는 상기 파일 접근 API의 객체 폴더를 더 분석하고, 상기 API실행부는 상기 객체 폴더가 보호 대상 폴더이면 더미 폴더를 대상으로 상기 파일 접근 API를 실행하는 것을 특징으로 한다.In this case, the API analyzer further analyzes the object folder of the file access API, and the API executing unit executes the file access API to the dummy folder if the object folder is a protected folder.

또한, 상기 로그수집부에 저장된 로그 기록을 분석하여 보호 대상 폴더 또는 보호 대상 파일에 접근하는 해킹 프로세스가 실행한 파일 접근 API와 객체 폴더 및 객체 파일 정보를 순차적으로 정렬하여 상기 해킹 프로세스의 행동 패턴을 추출하는 로그분석부를 더 포함한 것을 특징으로 한다.In addition, by analyzing the log records stored in the log collector to sequentially arrange the file access API executed by the hacking process to access the protected folder or the protected file and the object folder and object file information to determine the behavior pattern of the hacking process Characterized in that it further comprises a log analysis to extract.

본 발명에 따른 악성코드의 행동 패턴 수집방법은, 행동 패턴 수집장치가 임의의 주체 프로세스가 사용하는 파일 접근 API를 후킹하는 파일접근API후킹단계(S21); 상기 파일 접근 API의 객체 파일을 분석하는 API분석단계(S22); 상기 파일 접근 API의 객체 파일인지 판단(S23)하여, 보호 대상 파일이면 더미 파일을 생성(S24)하고, 더미 파일을 대상으로 상기 파일 접근 API를 실행하는 API실행단계(S25); 상기 API실행단계(S25)에서 실행한 상기 파일 접근 API 관련 정보를 로그로 저장하는 로그수집단계(S26); 및 상기 API실행단계(S25)의 실행 결과를 상기 주체 프로세스에게 통지하는 API실행결과통지단계(S27);를 포함하여 이루어지는 것을 특징으로 한다.Behavior pattern collection method of malicious code according to the present invention, the behavior pattern collection device hooks a file access API hooking a file access API used by any subject process (S21); An API analysis step (S22) of analyzing the object file of the file access API; Determining whether it is an object file of the file access API (S23), generating a dummy file (S24) if it is a file to be protected, and executing the file access API on the dummy file (S25); A log collection step (S26) of storing the file access API related information executed in the API execution step (S25) as a log; And an API execution result notification step (S27) of notifying the subject process of the execution result of the API execution step (S25).

이때, 상기 로그수집단계(S26)에 기록된 로그들을 분석하여 보호대상 폴더와 보호 대상 파일에 접근하는 악성 프로세스가 실행한 파일 접근 API 및 폴더 및 파일 정보를 접근시간을 기준으로 순차적으로 정렬하여 악성 프로세스의 행동 패턴을 정렬하여 패턴리스트를 작성하는 로그분석단계(S28)를 더 포함한 것을 특징으로 한다.At this time, by analyzing the logs recorded in the log collection step (S26), the file access API and folder and file information executed by the malicious process accessing the protected folder and the protected file are sequentially sorted based on the access time. Characterized in that it further comprises a log analysis step (S28) for creating a pattern list by arranging the behavior patterns of the process.

이상의 구성 및 작용에 의하면, 본 발명은 악성코드가 보호 대상 폴더 또는 보호 대상 파일을 대상으로 수행하고자 하는 행위들이 보호 대상 폴더 또는 보호 대상 파일을 대상으로 수행되지 않고 더미 폴더의 더미 파일을 대상으로 수행되도록 함으로써 악성코드로부터 보호 대상 폴더 및 보호 대상 파일을 보호할 수 있고, 실환경에서 보호대상은 악성코드의 피해를 받지 않는 상태에서 악성코드의 행동패턴을 수집할 수 있는 효과가 있다.According to the above configuration and operation, the present invention does not perform actions that a malicious code intends to perform on a protected folder or a protected file to a dummy file of a dummy folder without performing the protected folder or a protected file. By doing so, the protected folder and the protected file can be protected from the malicious code. In the real environment, the protected object can collect the behavior patterns of the malicious code without being damaged by the malicious code.

또한, 상기 악성코드가 보호 대상 폴더 또는 보호 대상 파일을 대상으로 수행하고자 하는 순차적인 행위들을 로그로 기록함으로써 알려지지 않은 악성코드의 행동 패턴에 대한 정보 수집이 용이한 효과가 있다.In addition, since the malicious code records sequential actions to be performed on the protected folder or the protected file as a log, it is easy to collect information on the behavior pattern of the unknown malware.

도 1은 본 발명에 따른 악성코드의 행동 패턴 수집장치를 계략적으로 나타내는 구성도.
도 2는 본 발명에 따른 악성코드의 행동 패턴 수집방법을 계략적으로 나타내는 구성도.
1 is a configuration diagram schematically showing a device for collecting behavior patterns of malicious code according to the present invention.
Figure 2 is a schematic diagram showing a method of collecting behavior patterns of malicious code according to the present invention.

이하, 첨부된 도면을 참조하며 본 발명의 한 실시예에 따른 악성코드의 행동 패턴 수집장치 및 방법을 보다 상세하게 설명하면 다음과 같다.Hereinafter, an apparatus and method for collecting behavior patterns of malicious code according to an embodiment of the present invention will be described in detail with reference to the accompanying drawings.

도 1은 본 발명에 따른 악성코드의 행동 패턴 수집장치를 계략적으로 나타내는 구성도이다.1 is a block diagram schematically showing an apparatus for collecting behavior patterns of malicious code according to the present invention.

본 발명에 따른 악성코드의 행동 패턴 수집장치는 임의의 주체 프로세스가 사용하는 파일 접근 API를 후킹하는 파일접근API후킹부(11)와, 상기 파일 접근 API의 객체 파일을 분석하는 API분석부(12)와, 상기 후킹한 파일 접근 API의 객체 파일이 보호 대상 파일이면 더미 파일을 생성하고 상기 더미 파일을 대상으로 상기 파일 접근 API를 실행하는 API실행부(13)와, 상기 API실행부(13)에서 실행한 상기 파일 접근 API 관련 정보를 저장하는 로그수집부(14)와, 상기 API실행부(13)의 실행 결과를 상기 주체 프로세스에게 통지하는 API실행결과통지부(15)를 포함한다.The apparatus for collecting behavior patterns of malicious code according to the present invention includes a file access API hooking unit 11 hooking a file access API used by an arbitrary subject process, and an API analysis unit 12 analyzing an object file of the file access API. And an API execution unit 13 for generating a dummy file and executing the file access API with respect to the dummy file if the object file of the hooked file access API is a file to be protected, and the API execution unit 13. And a log collection unit 14 for storing the file access API related information executed in the above, and an API execution result notification unit 15 for notifying the subject process of the execution result of the API execution unit 13.

상기 API분석부(12)는 상기 파일 접근 API의 객체 폴더를 더 분석하고, 상기 API실행부(13)는 상기 객체 폴더가 보호 대상 폴더이면 더미 폴더를 대상으로 상기 파일 접근 API를 실행한다.The API analyzing unit 12 further analyzes the object folder of the file access API, and the API executing unit 13 executes the file access API to the dummy folder if the object folder is a protected target folder.

구체적으로, 후킹한 파일 접근 API가 WriteFile API 또는 DeleteFile API이고 후킹한 파일 접근 API의 객체 파일이 보호 대상 파일이면, API실행부(13)는 더미 파일을 생성하고 그 생성한 더미 파일을 대상으로 상기 파일 접근 API를 실행한다. 한편, 후킹한 파일 접근 API가 CreatFile API이고 후킹한 파일 접근 API의 객체 폴더가 보호 대상 폴더이면, API실행부(13)는 더미 폴더를 대상으로 상기 후킹한 파일 접근 API를 실행하여 더미 폴더에 더미 파일을 생성한다.Specifically, if the hooked file access API is the WriteFile API or the DeleteFile API and the object file of the hooked file access API is a protected file, the API execution unit 13 generates a dummy file and targets the generated dummy file. Run the file access API. On the other hand, if the hooked file access API is the CreatFile API and the object folder of the hooked file access API is a protected folder, the API execution unit 13 executes the hooked file access API to the dummy folder and piles the dummy file in the dummy folder. Create a file.

로그수집부(14)에는 파일 접근 API 관련 정보들 즉, 주체 프로세스 정보, 객체 파일 정보, 실행된 파일 접근 API 종류 등이 저장된다.The log collector 14 stores file access API related information, that is, subject process information, object file information, and executed file access API type.

또, 로그수집부(14)의 로그 기록을 분석하여 보호 대상 폴더와 보호 대상 파일에 접근하는 임의의 주체 프로세스 즉, 해킹 프로세스가 실행한 파일 접근 API 종류들 및 그 객체 폴더 및 객체 파일 정보를 순차적으로 정렬하여 상기 해킹 프로세스의 행동 패턴을 추출하는 로그분석부(16)를 더 포함한다.Also, the log collection unit 14 analyzes the log records and sequentially processes any subject process that accesses the protected folder and the protected file, that is, the file access API types executed by the hacking process and the object folder and object file information. It further comprises a log analysis unit 16 to sort by extracting the behavior pattern of the hacking process.

한편, 상기 임의의 응용 프로세스(이를 '주체 프로세스'라 함)는 CreatFile API, WriteFile API, DeleteFile API 등과 같은 파일 접근 API 함수를 이용하여, 임의의 폴더(이를 '객체 폴더'라 함)에 위치한 임의의 파일(이를 '객체 파일'이라 함)을 생성하거나, 임의의 객체 파일의 코드를 변경하여 쓰거나, 임의의 객체 파일을 삭제한다.Meanwhile, the arbitrary application process (called 'subject process') may use file access API functions such as CreatFile API, WriteFile API, DeleteFile API, etc., to locate any arbitrary folder (this is called 'object folder'). Create a file of (called an object file), change the code of an arbitrary object file, or delete an arbitrary object file.

그리고, 상기 CreatFile API는 임의의 폴더 내에 임의의 객체 파일을 생성하는 함수로서, 이 CreatFile API는 주체 프로세스 정보와, 객체 파일을 생성하고자 하는 객체 폴더의 디렉토리 정보와, 생성하고자 하는 객체 파일의 파일명 및 생성 코드 정보를 포함하고, WriteFile API는 임의의 폴더 내에 있는 임의의 객체 파일의 일부 내용을 변경하는 함수로서, 이 WriteFile API는 주체 프로세스 정보와, 변경하고자 하는 객체 파일이 위치하는 폴더의 디렉토리 정보와, 변경하고자 하는 객체 파일의 파일명과, 변경하고자 하는 주소 정보 및 변경 코드 정보를 포함하며, DeleteFile API는 임의의 폴더 내에 있는 임의의 객체 파일을 삭제하는 함수로서, 이 DeleteFile API는 주체 프로세스 정보와, 삭제하고자 하는 객체 파일이 위치하는 폴더의 디렉토리 정보와, 삭제하고자 하는 객체 파일의 파일명 정보를 포함한다.The CreatFile API is a function for generating an arbitrary object file in an arbitrary folder. The CreatFile API is used to generate subject process information, directory information of an object folder in which an object file is to be created, a file name of an object file to be created, and Contains write code information, and the WriteFile API is a function that changes the contents of a part of an object file in an arbitrary folder. The WriteFile API provides information about the subject process and the directory of the folder where the object file to be changed is located. , The file name of the object file to be changed, the address information and the change code information to be changed, and the DeleteFile API is a function to delete an arbitrary object file in an arbitrary folder. Directory information of the folder where the object file to be deleted is located and the customer to be deleted. Information includes the file name of the file.

도 2는 본 발명에 따른 악성코드의 행동 패턴 수집방법을 계략적으로 나타내는 구성도이다.2 is a schematic diagram illustrating a method of collecting behavior patterns of malicious code according to the present invention.

1. 파일접근API후킹단계(S21)1. File access API hooking step (S21)

본 발명에 따른 파일접근API후킹단계(S21)는 행동 패턴 수집장치가 임의의 주체 프로세스가 사용하는 파일 접근 API를 후킹한다.In the file access API hooking step (S21) according to the present invention, the behavior pattern collecting device hooks the file access API used by any subject process.

운영 체제나 응용 소프트웨어 등의 각종 컴퓨터 프로그램에서 소프트웨어 구성 요소 간에 발생하는 함수 호출, 메시지, 이벤트 등을 중간에서 수집한다.
Various computer programs, such as operating systems and application software, collect function calls, messages, and events that occur between software components in the middle.

2. API분석단계(S22)2. API analysis step (S22)

본 발명에 따른 API분석단계(S22)는 상기 파일 접근 API의 객체 파일을 분석한다.API analysis step (S22) according to the present invention analyzes the object file of the file access API.

상기 파일접근API후킹단계(S21)에서 후킹된 파일 접근 API를 분석하고, 이 파일 접근 API에는 앞서 언급한 바와 같이 주체 프로세스 정보와, 객체 폴더 및 객체 파일에 관한 정보가 포함된다.In the file access API hooking step (S21), the hooked file access API is analyzed, and the file access API includes the subject process information, the object folder and the object file as mentioned above.

즉, API함수가 접근하려고 하는 파일의 경로와 파일 읽기, 쓰기, 삭제 등을 수집하여 실행기간 기준으로 순차적인 행동 패턴을 상기 행동 패턴 수집장치를 통해 분석하되, 수집한 함수 호출, 메시지, 이벤트 중 파일 접근 API함수가 접근하려고 하는 폴더/파일의 경로를 추출하여 보호대상 폴더/파일인지 분석한다. 쓰기 및 삭제 접근 API는 파일의 일부분접근인지를 분석하여 API실행단계에 차별을 둔다. 일부분 접근일 경우 파일에 접근하는 주소번지를 1번지부터 시작하도록 변경하는바, 상세한 설명은 후술하는 API실행결과통지단계(s27)를 참조한다.
In other words, while analyzing the sequential behavior patterns through the behavior pattern collecting device based on the execution period by collecting the path and file read, write, delete, etc. of the API function to access the API function, among the collected function calls, messages, events The file access API function extracts the path of the folder / file to be accessed and analyzes whether it is a protected folder / file. Write and delete access APIs discriminate between API execution stages by analyzing whether a file is partly accessed. In case of partial access, the address to access the file is changed to start from address 1. For details, refer to the API execution result notification step (s27) described later.

3. API실행단계(S25)3. API execution step (S25)

본 발명에 따른 API실행단계(S25)는 상기 파일 접근 API의 객체 파일인지 판단(S23)하여, 보호 대상 파일이면 더미 파일을 생성(S24)하고, 더미 파일을 대상으로 상기 파일 접근 API를 실행한다.The API execution step (S25) according to the present invention determines whether or not the object file of the file access API (S23), if the file to be protected generates a dummy file (S24), and executes the file access API for the dummy file .

객체 폴더가 보호 대상 폴더(예컨대, 보호 대상 파일 유/무를 판단하는 기준은 절대 경로이며, 동일한 경로에 같은 파일명이 존재할 수 없음)이면 더미 폴더를 대상으로 상기 파일 접근 API를 실행한 후 그 실행 결과를 상기 주체 프로세스에게 리턴한다.If the object folder is a protected folder (for example, the criterion for determining whether a protected file is present or not is an absolute path and the same file name cannot exist in the same path), the file access API is executed after executing the file access API for the dummy folder. Returns to the subject process.

구체적으로, 후킹한 파일 접근 API가 WriteFile API 또는 DeleteFile API이고 후킹한 파일 접근 API의 객체 파일이 보호 대상 파일이면, API실행부(13)는 더미 파일을 생성하고 그 생성한 더미 파일을 대상으로 상기 파일 접근 API를 실행한다. 후킹한 파일 접근 API가 CreatFile API이고 후킹한 파일 접근 API의 객체 폴더가 보호 대상 폴더이면, API실행부(13)는 더미 폴더를 대상으로 상기 후킹한 파일 접근 API를 실행하여 더미 폴더에 더미 파일을 생성한다.Specifically, if the hooked file access API is the WriteFile API or the DeleteFile API and the object file of the hooked file access API is a protected file, the API execution unit 13 generates a dummy file and targets the generated dummy file. Run the file access API. If the hooked file access API is the CreatFile API and the object folder of the hooked file access API is a protected folder, the API execution unit 13 executes the hooked file access API on the dummy folder to write the dummy file to the dummy folder. Create

그리고, 객체 파일이 보호 대상 파일이 아니면, 후킹한 파일 접근 API를 반환하여(S29), 상기 주체 프로세스가 실행하는 파일 접근 API가 정상적으로 실행되도록 한다.
If the object file is not a file to be protected, the hooked file access API is returned (S29), so that the file access API executed by the subject process is normally executed.

4. 로그수집단계(S26)4. Log collection step (S26)

본 발명에 따른 로그수집단계(S26)는 상기 API실행단계(S25)에서 실행한 상기 파일 접근 API 관련 정보를 로그로 저장한다.Log collection step (S26) according to the present invention stores the file access API related information executed in the API execution step (S25) as a log.

보안 모듈은 보호 대상 폴더 및 보호 대상 파일 또는 더미 폴더 및 더미 파일을 대상으로 시도된 파일 접근 API들의 로그를 수집함으로써, 동일한 주체 프로세스(해킹 프로세스)가 보호 대상 폴더 또는 보호 대상 파일에 어떠한 해킹 행위들을 수행하는지 그 행위 패턴 정보를 수집할 수 있다.
The security module collects logs of file access APIs attempted against the protected folder and the protected file or the dummy folder and the dummy file so that the same subject process (hacking process) performs any hacking actions on the protected folder or protected file. It can collect information about its behavior patterns.

5. API실행결과통지단계(S27)5. API execution result notification step (S27)

본 발명에 따른 API실행결과통지단계(S27)는 상기 API실행단계(S25)의 실행 결과를 상기 주체 프로세스에게 통지한다.The API execution result notification step (S27) according to the present invention notifies the subject process of the execution result of the API execution step (S25).

상기에서 파일 접근 API의 분석 결과, 객체 폴더가 보호 대상 폴더이거나 객체 파일이 보호 대상 파일이면, 본 발명의 보안모듈은 더미 폴더에 더미 파일을 생성하여 상기 더미 파일을 대상으로 상기 후킹한 파일 접근 API의 동작을 실행한 후 그 실행 결과를 상기 주체 프로세스에게 리턴한다.As a result of the analysis of the file access API, if the object folder is a protected folder or the object file is a protected file, the security module of the present invention creates a dummy file in a dummy folder and hooks the file access API to the dummy file. After executing the operation, the execution result is returned to the subject process.

예를 들어 설명하면, 주체 프로세스(해킹 프로세스)가 보호 대상 폴더(A 폴더)에 해킹 파일(A' 파일)을 생성하고자 할 경우, 주체 프로세스는 CreatFile API를 실행시킨다. 본 발명의 보안모듈은 이 CreatFile API를 후킹하여 분석하는데, 그 객체 폴더가 보호 대상 폴더(A 폴더)이기 때문에, 더미 폴더(B 폴더)에 더미 파일(B' 파일)을 생성한 후, 주체 프로세스에게 CreatFile API가 성공적으로 수행되었다고 응답한다.For example, if the subject process (hacking process) wants to create a hacking file (A 'file) in the protected folder (A folder), the subject process executes the CreatFile API. The security module of the present invention hooks and analyzes this CreatFile API. Since the object folder is a protected folder (A folder), the security module generates a dummy file (B 'file) in the dummy folder (B folder), and then processes the subject. Responds that the CreatFile API was successful.

한편, 주체 프로세스(해킹 프로세스)가 보호 대상 폴더에 위치한 보호 대상 파일(C 파일)의 일부 구간(예컨대, 101번지 ~ 200번지)의 코드를 변경 코드로 바꾸어 쓰고자 할 경우, 주체 프로세스는 WriteFile API를 실행시킨다. 본 발명의 보안모듈은 이 WriteFile API를 후킹하여 분석하는데, 그 객체 파일이 보호 대상 파일(C 파일)이기 때문에, 더미 폴더(B 폴더)에 더미 파일(D 파일)을 생성하고 그 생성된 더미 파일(D 파일)의 일부 또는 전체 구간(예컨대, 1번지 ~ 100번지)을 변경 코드로 바꾸어 쓴 후, 주체 프로세스에게 WriteFile API가 성공적으로 수행되었다고 응답한다.On the other hand, if the subject process (hacking process) wants to replace the code of some section (eg, addresses 101 to 200) of the protected file (C file) located in the protected folder with the changed code, the subject process writes the API. Run The security module of the present invention hooks and analyzes this WriteFile API. Since the object file is a protected file (C file), a dummy file (D file) is created in the dummy folder (B folder) and the generated dummy file. After rewriting some or all sections (eg, addresses 1 to 100) of the (D file) with the change code, the host process responds that the WriteFile API was successfully executed.

다른 예로서, 주체 프로세스(예컨대, 해킹 프로세스)가 보호 대상 폴더에 위치한 보호 대상 파일(E 파일)을 삭제하고자 할 경우, 주체 프로세스는 DeleteFile API를 실행시킨다. 본 발명의 보안모듈은 DeleteFile API를 후킹하여 분석하는데, 그 객체 파일이 보호 대상 파일이기 때문에, 더미 폴더(B 폴더)에 더미 파일(F 파일)을 생성하고 그 생성된 더미 파일(F 파일)을 삭제한 후 주체 프로세스에게 DeleteFile API가 성공적으로 수행되었다고 응답한다.

그리고, 상기 API분석단계(S22)는 상기 파일 접근 API의 객체 폴더를 더 분석하고, 상기 API실행단계(S25)는 상기 객체 폴더가 보호 대상 폴더이면 더미 폴더를 대상으로 상기 파일 접근 API를 실행한다.
As another example, when a subject process (eg, a hacking process) wants to delete a protected file (E file) located in a protected folder, the subject process executes the DeleteFile API. The security module of the present invention hooks and analyzes the DeleteFile API, and since the object file is a protected file, a dummy file (F file) is generated in a dummy folder (B folder) and the generated dummy file (F file) is analyzed. After deleting, the subject process is responded that the DeleteFile API was successful.

The API analyzing step S22 further analyzes an object folder of the file access API, and the API executing step S25 executes the file access API with respect to a dummy folder if the object folder is a protected target folder. .

7. 로그분석단계(S28)7. Log analysis step (S28)

본 발명에 따른 로그분석단계(S28)는 상기 로그수집단계(S26)에 기록된 로그들을 분석하여 보호대상 폴더와 보호 대상 파일에 접근하는 악성 프로세스가 실행한 파일 접근 API 및 폴더 및 파일 정보를 접근시간을 기준으로 순차적으로 정렬하여 악성 프로세스의 행동 패턴을 정렬하여 패턴리스트를 작성한다.
Log analysis step (S28) according to the present invention analyzes the logs recorded in the log collection step (S26) to access the file access API and folder and file information executed by the malicious process to access the protected folder and the protected file The pattern list is created by sorting the behavior patterns of malicious processes by sequentially sorting by time.

한편, 임의의 주체 프로세스가 보호 대상 폴더에 임의의 파일을 생성하거나, 보호 대상 파일의 코드를 바꾸어 쓰거나, 보호 대상 파일을 삭제하면, 그 주체 프로세스는 해킹 프로세스로 간주하여도 무관하다. 그리고 통상의 보안모듈은 임의의 주체 프로세스가 보호 대상 폴더나 보호 대상 파일에 접근하면 해당 주체 프로세스의 실행을 강제 종료시킴으로써 해킹 프로세스로부터 보호 대상 폴더와 보호 대상 파일을 보호하였으나, 본 발명의 보안모듈은 더미 파일을 생성하고, 그 더미 파일을 대상으로 파일 접근 API 명령을 실행함으로써 보호 대상 폴더와 보호 대상 파일을 보호함과 동시에 해킹 프로세스가 계속적으로 행동하도록 하여 그 해킹 프로세스의 행동 패턴을 수집하게 된다.
On the other hand, if any subject process creates an arbitrary file in the protected folder, changes the code of the protected file, or deletes the protected file, the subject process may be regarded as a hacking process. In addition, the conventional security module protects the protected folder and the protected file from the hacking process by forcibly terminating execution of the subject process when any subject process approaches the protected folder or the protected file, but the security module of the present invention By creating a dummy file and executing a file access API command on the dummy file, the hacking process is continuously performed while protecting the protected folder and the protected file, and the behavior pattern of the hacking process is collected.

11 : 파일접근API후킹부 12 : API분석부
13 : API실행부 14 : 로그수집부
15 : API실행결과통지부 16 : 로그분석부
11: file access API hooking unit 12: API analysis unit
13: API execution unit 14: Log collection unit
15: API execution result notification unit 16: Log analysis unit

Claims (5)

임의의 주체 프로세스가 사용하는 파일 접근 API를 후킹하는 파일접근API후킹부(11);
상기 파일 접근 API의 객체 파일을 분석하는 API분석부(12);
상기 후킹한 파일 접근 API의 객체 파일이 보호 대상 파일이면 더미 파일을 생성하고 상기 더미 파일을 대상으로 상기 파일 접근 API를 실행하는 API실행부(13);
상기 API실행부(13)에서 실행한 상기 파일 접근 API 관련 정보를 저장하는 로그수집부(14);
상기 API실행부(13)의 실행 결과를 상기 주체 프로세스에게 통지하는 API실행결과통지부(15);를 포함하여 이루어지고,
상기 API분석부(12)는 상기 파일 접근 API의 객체 폴더를 더 분석하고, 상기 API실행부(13)는 상기 객체 폴더가 보호 대상 폴더이면 더미 폴더를 대상으로 상기 파일 접근 API를 실행하는 것을 특징으로 하는 악성코드의 행동 패턴 수집장치.
A file access API hooking unit 11 for hooking a file access API used by any subject process;
An API analyzer 12 analyzing the object file of the file access API;
An API execution unit (13) for generating a dummy file and executing the file access API on the dummy file if the object file of the hooked file access API is a protected file;
A log collecting unit 14 for storing the file access API related information executed by the API executing unit 13;
An API execution result notification unit 15 notifying the subject process of the execution result of the API execution unit 13;
The API analyzing unit 12 further analyzes the object folder of the file access API, and the API executing unit 13 executes the file access API to the dummy folder if the object folder is a protected target folder. Device for collecting behavior patterns of malicious code.
삭제delete 제 1항에 있어서,
상기 로그수집부(14)에 저장된 로그 기록을 분석하여 보호 대상 폴더 또는 보호 대상 파일에 접근하는 해킹 프로세스가 실행한 파일 접근 API와 객체 폴더 및 객체 파일 정보를 순차적으로 정렬하여 상기 해킹 프로세스의 행동 패턴을 추출하는 로그분석부(16)를 더 포함한 것을 특징으로 하는 악성코드의 행동 패턴 수집장치.
The method of claim 1,
Analyze the log records stored in the log collector 14 to sequentially arrange the file access API executed by the hacking process for accessing the protected folder or the protected file, the object folder and the object file information, and the behavior pattern of the hacking process. Device for collecting behavior patterns of malicious code, characterized in that it further comprises a log analysis unit 16 for extracting.
행동 패턴 수집장치가 임의의 주체 프로세스가 사용하는 파일 접근 API를 후킹하는 파일접근API후킹단계(S21);
상기 파일 접근 API의 객체 파일을 분석하는 API분석단계(S22);
상기 파일 접근 API의 객체 파일인지 판단(S23)하여, 보호 대상 파일이면 더미 파일을 생성(S24)하고, 더미 파일을 대상으로 상기 파일 접근 API를 실행하는 API실행단계(S25);
상기 API실행단계(S25)에서 실행한 상기 파일 접근 API 관련 정보를 로그로 저장하는 로그수집단계(S26); 및
상기 API실행단계(S25)의 실행 결과를 상기 주체 프로세스에게 통지하는 API실행결과통지단계(S27);를 포함하여 이루어지고,
상기 API분석단계(S22)는 상기 파일 접근 API의 객체 폴더를 더 분석하고, 상기 API실행단계(S25)는 상기 객체 폴더가 보호 대상 폴더이면 더미 폴더를 대상으로 상기 파일 접근 API를 실행하는 것을 특징으로 하는 것을 특징으로 하는 악성코드의 행동 패턴 수집방법.
A file access API hooking step of the behavior pattern collecting device hooking a file access API used by an arbitrary subject process (S21);
An API analysis step (S22) of analyzing the object file of the file access API;
Determining whether it is an object file of the file access API (S23), generating a dummy file (S24) if it is a file to be protected, and executing the file access API on the dummy file (S25);
A log collection step (S26) of storing the file access API related information executed in the API execution step (S25) as a log; And
An API execution result notification step (S27) of notifying the subject process of the execution result of the API execution step (S25);
The API analysis step (S22) further analyzes the object folder of the file access API, and the API execution step (S25) is characterized in that the file access API is executed for the dummy folder if the object folder is a protected folder. Method of collecting behavior patterns of malicious code, characterized in that.
제 4 항에 있어서,
상기 로그수집단계(S26)에 기록된 로그들을 분석하여 보호대상 폴더와 보호 대상 파일에 접근하는 악성 프로세스가 실행한 파일 접근 API 및 폴더 및 파일 정보를 접근시간을 기준으로 순차적으로 정렬하여 악성 프로세스의 행동 패턴을 정렬하여 패턴리스트를 작성하는 로그분석단계(S28)를 더 포함한 것을 특징으로 하는 악성코드의 행동 패턴 수집방법.
5. The method of claim 4,
By analyzing the logs recorded in the log collection step (S26), the file access API and folder and file information executed by the malicious process accessing the protected folder and the protected file are sequentially sorted based on the access time of the malicious process. Behavior pattern collection method of the malware characterized in that it further comprises a log analysis step (S28) for arranging the behavior pattern to create a pattern list.
KR1020110142178A 2011-12-26 2011-12-26 apparatus and method of collecting action pattern of malicious code KR101327740B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020110142178A KR101327740B1 (en) 2011-12-26 2011-12-26 apparatus and method of collecting action pattern of malicious code

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020110142178A KR101327740B1 (en) 2011-12-26 2011-12-26 apparatus and method of collecting action pattern of malicious code

Publications (2)

Publication Number Publication Date
KR20130074224A KR20130074224A (en) 2013-07-04
KR101327740B1 true KR101327740B1 (en) 2013-11-11

Family

ID=48988375

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020110142178A KR101327740B1 (en) 2011-12-26 2011-12-26 apparatus and method of collecting action pattern of malicious code

Country Status (1)

Country Link
KR (1) KR101327740B1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20180054389A (en) 2016-11-14 2018-05-24 숭실대학교산학협력단 Client device and back-up method based on cloud, recording medium for performing the method

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101710928B1 (en) * 2015-09-04 2017-03-13 숭실대학교산학협력단 Method for protecting malignant code in mobile platform, recording medium and device for performing the system
KR101710918B1 (en) * 2015-11-30 2017-02-28 (주)이스트소프트 Method for monitoring malwares which encrypt user files
KR101828600B1 (en) * 2017-03-08 2018-03-22 주식회사 체크멀 Context-aware ransomware detection
WO2021137354A1 (en) * 2019-12-31 2021-07-08 주식회사 디에스알브이랩스 System and method for preventing suspicious transactions in distributed ledger

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101038048B1 (en) * 2009-12-21 2011-06-01 한국인터넷진흥원 Botnet malicious behavior real-time analyzing system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101038048B1 (en) * 2009-12-21 2011-06-01 한국인터넷진흥원 Botnet malicious behavior real-time analyzing system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20180054389A (en) 2016-11-14 2018-05-24 숭실대학교산학협력단 Client device and back-up method based on cloud, recording medium for performing the method

Also Published As

Publication number Publication date
KR20130074224A (en) 2013-07-04

Similar Documents

Publication Publication Date Title
Carmony et al. Extract Me If You Can: Abusing PDF Parsers in Malware Detectors.
Azmandian et al. Virtual machine monitor-based lightweight intrusion detection
US9715588B2 (en) Method of detecting a malware based on a white list
US8762948B1 (en) System and method for establishing rules for filtering insignificant events for analysis of software program
CN103927484B (en) Rogue program behavior catching method based on Qemu simulator
Killourhy et al. A defense-centric taxonomy based on attack manifestations
Zolkipli et al. A framework for malware detection using combination technique and signature generation
EP2975873A1 (en) A computer implemented method for classifying mobile applications and computer programs thereof
US20130174257A1 (en) Active Defense Method on The Basis of Cloud Security
CN107004088B (en) Determining device, determining method and recording medium
KR101327740B1 (en) apparatus and method of collecting action pattern of malicious code
WO2007056933A1 (en) A method for identifying unknown virus and deleting it
KR101132197B1 (en) Apparatus and Method for Automatically Discriminating Malicious Code
JP2010182019A (en) Abnormality detector and program
Čeponis et al. Towards a robust method of dataset generation of malicious activity for anomaly-based HIDS training and presentation of AWSCTD dataset
Eskandari et al. To incorporate sequential dynamic features in malware detection engines
US9860261B2 (en) System for analyzing and maintaining data security in backup data and method thereof
JP5326063B1 (en) Malicious shellcode detection apparatus and method using debug events
KR101228902B1 (en) Cloud Computing-Based System for Supporting Analysis of Malicious Code
KR101161008B1 (en) system and method for detecting malicious code
EP3800570B1 (en) Methods and systems for genetic malware analysis and classification using code reuse patterns
Yin et al. Automatic malware analysis: an emulator based approach
Roney et al. Identifying valuable pointers in heap data
CN113569240B (en) Method, device and equipment for detecting malicious software
JP2010182020A (en) Illegality detector and program

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20161101

Year of fee payment: 4

FPAY Annual fee payment

Payment date: 20171018

Year of fee payment: 5

FPAY Annual fee payment

Payment date: 20191024

Year of fee payment: 7