KR101977265B1 - Method and apparatus for detection original entry point of packed executable files - Google Patents

Method and apparatus for detection original entry point of packed executable files Download PDF

Info

Publication number
KR101977265B1
KR101977265B1 KR1020170148135A KR20170148135A KR101977265B1 KR 101977265 B1 KR101977265 B1 KR 101977265B1 KR 1020170148135 A KR1020170148135 A KR 1020170148135A KR 20170148135 A KR20170148135 A KR 20170148135A KR 101977265 B1 KR101977265 B1 KR 101977265B1
Authority
KR
South Korea
Prior art keywords
point candidate
starting point
candidate group
start point
executable file
Prior art date
Application number
KR1020170148135A
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 KR1020170148135A priority Critical patent/KR101977265B1/en
Application granted granted Critical
Publication of KR101977265B1 publication Critical patent/KR101977265B1/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 for detecting an original entry point (OEP) of a packed executable file, capable of easily analyzing the operation of the executable file. According to one embodiment of the present invention, a method executing a file to be analyzed, which is a packed executable file, in a computer to detect an OEP, from which the executable file is started, comprises the steps of: detecting a first candidate OEP group including at least one candidate OEP based on whether character information including at least one information is detected from a path and a filename of the executable file in a memory area included in the computer; detecting a second candidate OEP group including at least one candidate OEP based on whether at least one function is called from an execution preparing function group including a plurality of functions required for executing the executable file; and generating a final candidate OEP group including a predetermined number of candidate OEPs based on the first and second candidate OEP groups.

Description

패킹된 실행파일의 시작지점 탐지 방법 및 장치{METHOD AND APPARATUS FOR DETECTION ORIGINAL ENTRY POINT OF PACKED EXECUTABLE FILES}METHOD AND APPARATUS FOR DETECTION ORIGINAL ENTRY POINT OF PACKED EXECUTABLE FILES [0002]

본 발명은 패킹된 실행파일의 시작지점(OEP)을 탐지하는 방법 및 장치에 관한 것으로, 보다 상세하게는 컴퓨터 상에서 패킹된 실행파일의 패킹이 해제된 이후에, 실행파일이 동작을 시작하는 메모리 상의 시작지점을 탐지하는 방법 및 장치에 관한 것이다.The present invention relates to a method and apparatus for detecting the beginning point (OEP) of a packed executable file, and more particularly to a method and apparatus for detecting the beginning point of a packed executable file To a method and apparatus for detecting a starting point.

악성코드를 포함하는 실행파일은 실행에 필요한 정보들을 압축하고 난독화하는 특성으로 인해, 그 압축하고 난독화하는 패킹(packing)이 적용된 실행파일을 자세히 분석하기 위하여 우선 패킹상태를 해제하는 과정이 수행되어야 한다.Because the executable file containing the malicious code compresses and obfuscates the information necessary for execution, the process of releasing the packing state is first performed in order to analyze the executable file to which the compression and obfuscation packing is applied in detail .

이때, 패킹에는 여러 종류가 있는데, 악성코드가 자신의 악성행위를 분석하기 어렵게 만들기 위해 사용되는 것에는 컴프레셔, 크립터, 프로텍터, 번들러 등이 있다. 컴프레셔는 파일의 크기를 줄이는데 주력한다. 크립터는 파일을 암호화나 난독화하는데 사용된다. 프로텍터는 컴프레셔와 크립터의 기능을 함께 적용하여 핵심 아이디어를 보호하며 실행파일을 압축하고 난독화한다. 또한, 번들러는 여러 파일을 하나의 실행파일로 만들어 작동하도록 만든다. 이와 같이 패킹된 프로그램은 메모리에 적재(load)될 때 실행 가능한 형태로 복구된 후에 실행된다.At this time, there are many types of packing, such as compressors, cryptors, protectors, and bundlers, which are used by malicious codes to make it difficult to analyze their malicious behavior. The compressor focuses on reducing the size of the file. Cryptor is used to encrypt or obfuscate a file. Protectors combine the functions of compressors and cryptors to protect key ideas, compress and obfuscate executables. In addition, Bundler makes multiple files work as a single executable. Such a packed program is executed after being restored to an executable form when loaded into a memory.

한편, 악성코드를 포함하는 실행파일은 실행 이후에 엔트리 포인트(original entry point; OEP)라 칭해지는 위치부터 본격적인 악성행위를 시작하게 된다. 이때, 패킹이 되지 않은 실행파일은 대체로 고정적인 주소(OEP)를 사용하지만, 패킹된 실행파일의 OEP는 코드 섹션(code section) 내에 어디든지 존재할 수 있다. 따라서, 패킹된 실행파일의 OEP를 알아내는 기술이 있어야 패킹이 해제한 이후에 실행파일에 포함된 악성코드를 정밀분석 할 수 있게 된다.On the other hand, the executable file containing the malicious code starts malicious action after the execution, which is called an original entry point (OEP). At this time, an unpacked executable file generally uses a fixed address (OEP), but an OEP of a packed executable file can reside anywhere within a code section. Therefore, it is necessary to know the OEP of the packed executable file so that the malicious code included in the executable file can be precisely analyzed after the packing is released.

따라서, 패킹된 실행파일의 시작지점(OEP)을 탐지하는 방법 및 장치에 대한 필요성이 대두되고 있다.Accordingly, there is a need for a method and apparatus for detecting the beginning point (OEP) of a packed executable file.

관련 선행기술로는 대한민국 공개특허공보 제 10-2017-0087007호(발명의 명칭: 악성 코드 분석을 위한 전자 장치 및 이의 방법, 공개일자: 2017년 7월 27일)가 있다.A related art is Korean Patent Laid-Open Publication No. 10-2017-0087007 entitled " Electronic Device for Analyzing Malicious Code and Its Method, Public Date: July 27, 2017. "

본 발명은 패킹된 실행파일의 시작지점(OEP)을 탐지하는 방법 및 장치를 제공하고자 한다.The present invention seeks to provide a method and apparatus for detecting the beginning point (OEP) of a packed executable file.

본 발명이 해결하고자 하는 과제는 이상에서 언급한 과제(들)로 제한되지 않으며, 언급되지 않은 또 다른 과제(들)은 아래의 기재로부터 당업자에게 명확하게 이해될 수 있을 것이다.The problems to be solved by the present invention are not limited to the above-mentioned problem (s), and another problem (s) not mentioned can be clearly understood by those skilled in the art from the following description.

상기 과제를 해결하기 위한 본 발명의 일 실시예에 따른 패킹된 실행파일의 시작지점 탐지 방법은 컴퓨터 상에서 패킹된 실행파일인 분석대상파일을 실행하여, 상기 실행파일이 동작을 시작하는 지점인 시작지점(original entry point; OEP)을 탐지하는 방법에 있어서, 상기 컴퓨터에 포함된 메모리 영역에서 상기 실행파일의 경로 및 파일명 중 적어도 하나의 정보를 포함하는 문자정보가 검출되는지 여부에 기초하여, 적어도 하나의 시작지점 후보를 포함하는 제1 시작지점후보그룹을 탐지하는 단계; 상기 실행파일을 실행하기 위하여 필요한 복수의 함수를 포함하는 실행준비함수그룹 중 적어도 하나의 함수가 호출되는지 여부에 기초하여, 적어도 하나의 시작지점 후보를 포함하는 제2 시작지점후보그룹을 탐지하는 단계; 및 상기 제1 시작지점후보그룹 및 상기 제2 시작지점후보그룹에 기초하여, 소정 개수의 시작지점 후보를 포함하는 최종시작지점후보그룹을 생성하는 단계를 포함한다.According to an aspect of the present invention, there is provided a method of detecting a starting point of a packed executable file, the method comprising: executing an analysis target file, which is an executable file packed on a computer, based on whether or not character information including at least one of a path and a file name of the executable file is detected in a memory area included in the computer, Detecting a first starting point candidate group including a starting point candidate; Detecting a second starting point candidate group including at least one starting point candidate based on whether at least one function among a group of execution ready functions including a plurality of functions required to execute the executable file is called ; And generating a final starting point candidate group including a predetermined number of starting point candidates based on the first starting point candidate group and the second starting point candidate group.

바람직하게는, 상기 컴퓨터에 포함된 레지스터를 백업하기 위한 명령어와 상기 백업된 레지스터를 복원하기 위한 명령어가 순차적으로 호출되는지 여부에 기초하여, 적어도 하나의 시작지점 후보를 포함하는 제3 시작지점후보그룹을 탐지하는 단계를 더 포함하고, 상기 최종시작지점후보그룹을 생성하는 단계는 상기 제3 시작지점후보그룹에 더 기초할 수 있다.Preferably, based on whether a command for backing up a register included in the computer and an instruction for restoring the backed-up register are sequentially called, a third starting point candidate group including at least one starting point candidate Wherein the step of generating the final starting point candidate group may further be based on the third starting point candidate group.

바람직하게는, 소정의 임계치 이상 상기 분석대상파일의 실행 흐름(flow of execution)을 이동시키는 명령어가 호출되는지 여부에 기초하여, 적어도 하나의 시작지점 후보를 포함하는 제4 시작지점후보그룹을 탐지하는 단계를 더 포함하고, 상기 최종시작지점후보그룹을 생성하는 단계는 상기 제4 시작지점후보그룹에 더 기초할 수 있다.Preferably, a fourth starting point candidate group including at least one starting point candidate is detected based on whether an instruction to move the flow of execution of the analysis target file above a predetermined threshold is called Wherein the step of generating the final starting point candidate group may further be based on the fourth starting point candidate group.

바람직하게는, 상기 컴퓨터에서 상이한 메모리 영역으로 상기 분석대상파일의 실행 흐름이 이동하는지 여부에 기초하여, 적어도 하나의 시작지점 후보를 포함하는 제5 시작지점후보그룹을 탐지하는 단계를 더 포함하고, 상기 최종시작지점후보그룹을 생성하는 단계는 상기 제5 시작지점후보그룹에 더 기초할 수 있다.Preferably, the method further comprises detecting a fifth starting point candidate group including at least one starting point candidate, based on whether the execution flow of the analysis target file moves from the computer to a different memory area, The step of generating the final starting point candidate group may further be based on the fifth starting point candidate group.

바람직하게는, 상기 최종시작지점후보그룹을 생성하는 단계는 상기 제1 시작지점후보그룹 및 상기 제2 시작지점후보그룹에 공통적으로 포함되는 시작지점 후보를 포함하도록 상기 최종시작지점후보그룹을 생성할 수 있다..The generating of the final starting point candidate group may include generating the final starting point candidate group so as to include a starting point candidate commonly included in the first starting point candidate group and the second starting point candidate group Can ...

바람직하게는, 상기 분석대상파일은 상기 실행파일에 대하여 다른 파일과 함께 묶음, 암호화, 난독화 및 압축 중 적어도 하나를 적용한 결과일 수 있다.Preferably, the analysis object file may be a result of applying at least one of bundling, encryption, obfuscation, and compression to the executable file together with another file.

또한, 상기 과제를 해결하기 위한 본 발명의 일 실시예에 따른 패킹된 실행파일의 시작지점 탐지 장치는 컴퓨터 상에서 패킹된 실행파일인 분석대상파일을 실행하여, 상기 실행파일이 동작을 시작하는 지점인 시작지점을 탐지하는 장치에 있어서, 상기 컴퓨터에 포함된 메모리 영역에서 상기 실행파일의 경로 및 파일명 중 적어도 하나의 정보를 포함하는 문자정보가 검출되는지 여부에 기초하여, 적어도 하나의 시작지점 후보를 포함하는 제1 시작지점후보그룹을 탐지하고, 상기 실행파일을 실행하기 위하여 필요한 복수의 함수를 포함하는 실행준비함수그룹 중 적어도 하나의 함수가 호출되는지 여부에 기초하여, 적어도 하나의 시작지점 후보를 포함하는 제2 시작지점후보그룹을 탐지하는 탐지부; 및 상기 제1 시작지점후보그룹 및 상기 제2 시작지점후보그룹에 기초하여, 소정 개수의 시작지점 후보를 포함하는 최종시작지점후보그룹을 생성하는 생성부를 포함한다.According to another aspect of the present invention, there is provided an apparatus for detecting a starting point of a packed executable file, the apparatus comprising: An apparatus for detecting a starting point, the apparatus comprising at least one starting point candidate based on whether or not character information including at least one of a path and a filename of the executable file is detected in a memory area included in the computer Based on whether at least one function among a group of execution-ready functions that includes a plurality of functions required to execute the executable file is called, includes at least one starting-point candidate A detection unit for detecting a second starting point candidate group to be detected; And a generation unit generating a final starting point candidate group including a predetermined number of starting point candidates based on the first starting point candidate group and the second starting point candidate group.

바람직하게는, 상기 탐지부는 상기 컴퓨터에 포함된 레지스터를 백업하기 위한 명령어와 상기 백업된 레지스터를 복원하기 위한 명령어가 순차적으로 호출되는지 여부에 기초하여, 적어도 하나의 시작지점 후보를 포함하는 제3 시작지점후보그룹을 더 탐지하고, 상기 생성부는 상기 제3 시작지점후보그룹에 더 기초할 수 있다.Preferably, the detection unit is configured to detect, based on a command for backing up a register included in the computer, and a command for restoring the backed-up register in order, The point candidate group is further detected, and the generation unit may further be based on the third starting point candidate group.

바람직하게는, 상기 탐지부는 소정의 임계치 이상 상기 분석대상파일의 실행 흐름(flow of execution)을 이동시키는 명령어가 호출되는지 여부에 기초하여, 적어도 하나의 시작지점 후보를 포함하는 제4 시작지점후보그룹을 더 탐지하고, 상기 생성부는 상기 제4 시작지점후보그룹에 더 기초할 수 있다.Preferably, the detection unit determines whether or not a command to move the flow of execution of the analysis target file over a predetermined threshold value is called, the fourth starting point candidate group including at least one starting point candidate , And the generating unit may further be based on the fourth starting point candidate group.

바람직하게는, 상기 탐지부는 상기 컴퓨터에서 상이한 메모리 영역으로 상기 분석대상파일의 실행 흐름이 이동하는지 여부에 기초하여, 적어도 하나의 시작지점 후보를 포함하는 제5 시작지점후보그룹을 더 탐지하고, 상기 생성부는 상기 제5 시작지점후보그룹에 더 기초할 수 있다.Preferably, the detection unit further detects a fifth starting point candidate group including at least one starting point candidate, based on whether an execution flow of the analysis target file moves from the computer to a different memory area, The generating unit may further be based on the fifth starting point candidate group.

바람직하게는, 상기 생성부는 상기 제1 시작지점후보그룹 및 상기 제2 시작지점후보그룹에 공통적으로 포함되는 시작지점 후보를 포함하도록 상기 최종시작지점후보그룹을 생성할 수 있다.Preferably, the generating unit may generate the final starting point candidate group so as to include starting point candidates commonly included in the first starting point candidate group and the second starting point candidate group.

바람직하게는, 상기 분석대상파일은 상기 실행파일에 대하여 다른 파일과 함께 묶음, 암호화, 난독화 및 압축 중 적어도 하나를 적용한 결과일 수 있다.Preferably, the analysis object file may be a result of applying at least one of bundling, encryption, obfuscation, and compression to the executable file together with another file.

본 발명의 일 실시예에 따른 패킹된 실행파일의 시작지점 탐지 방법 및 장치는 압축, 난독화 및 암호화 등으로 패킹된 실행파일의 시작지점을 보다 정확하게 탐지할 수 있는 효과가 있다.The method and apparatus for detecting the starting point of a packed executable file according to an embodiment of the present invention can detect the starting point of an executable file packed with compression, obfuscation, encryption, etc. more accurately.

또한, 본 발명의 일 실시예에 따른 패킹된 실행파일의 시작지점 탐지 방법 및 장치는 그 패킹된 실행파일의 시작지점을 정확하게 탐지함으로써, 그 실행파일의 동작을 보다 용이하게 분석할 수 있도록 하는 효과가 있다.In addition, the method and apparatus for detecting the start point of a packed executable file according to an embodiment of the present invention can accurately detect the start point of the packed executable file, thereby making it possible to more easily analyze the operation of the executable file .

도 1은 본 발명의 일 실시예에 따른 패킹된 실행파일의 시작지점 탐지 방법을 설명하기 위한 흐름도이다.
도 2는 본 발명의 일 실시예에 따른 패킹된 실행파일의 시작지점 탐지 장치를 설명하기 위한 블록도이다.
1 is a flowchart illustrating a method of detecting a start point of a packed executable file according to an embodiment of the present invention.
2 is a block diagram illustrating an apparatus for detecting a starting point of a packed executable file according to an embodiment of the present invention.

본 발명은 다양한 변경을 가할 수 있고 여러 가지 실시예를 가질 수 있는 바, 특정 실시예들을 도면에 예시하고 상세한 설명에 상세하게 설명하고자 한다. 그러나, 이는 본 발명을 특정한 실시 형태에 대해 한정하려는 것이 아니며, 본 발명의 사상 및 기술 범위에 포함되는 모든 변경, 균등물 내지 대체물을 포함하는 것으로 이해되어야 한다. 각 도면을 설명하면서 유사한 참조부호를 유사한 구성요소에 대해 사용하였다.While the invention is susceptible to various modifications and alternative forms, specific embodiments thereof are shown by way of example in the drawings and will herein be described in detail. It should be understood, however, that the invention is not intended to be limited to the particular embodiments, but includes all modifications, equivalents, and alternatives falling within the spirit and scope of the invention. Like reference numerals are used for like elements in describing each drawing.

제1, 제2, A, B 등의 용어는 다양한 구성요소들을 설명하는데 사용될 수 있지만, 상기 구성요소들은 상기 용어들에 의해 한정되어서는 안 된다. 상기 용어들은 하나의 구성요소를 다른 구성요소로부터 구별하는 목적으로만 사용된다. 예를 들어, 본 발명의 권리 범위를 벗어나지 않으면서 제1 구성요소는 제2 구성요소로 명명될 수 있고, 유사하게 제2 구성요소도 제1 구성요소로 명명될 수 있다. 및/또는 이라는 용어는 복수의 관련된 기재된 항목들의 조합 또는 복수의 관련된 기재된 항목들 중의 어느 항목을 포함한다.The terms first, second, A, B, etc. may be used to describe various elements, but the elements should not be limited by the terms. The terms are used only for the purpose of distinguishing one component from another. For example, without departing from the scope of the present invention, the first component may be referred to as a second component, and similarly, the second component may also be referred to as a first component. And / or < / RTI > includes any combination of a plurality of related listed items or any of a plurality of related listed items.

어떤 구성요소가 다른 구성요소에 "연결되어" 있다거나 "접속되어" 있다고 언급된 때에는, 그 다른 구성요소에 직접적으로 연결되어 있거나 또는 접속되어 있을 수도 있지만, 중간에 다른 구성요소가 존재할 수도 있다고 이해되어야 할 것이다. 반면에, 어떤 구성요소가 다른 구성요소에 "직접 연결되어" 있다거나 "직접 접속되어" 있다고 언급된 때에는, 중간에 다른 구성요소가 존재하지 않는 것으로 이해되어야 할 것이다.It is to be understood that when an element is referred to as being "connected" or "connected" to another element, it may be directly connected or connected to the other element, . On the other hand, when an element is referred to as being "directly connected" or "directly connected" to another element, it should be understood that there are no other elements in between.

본 출원에서 사용한 용어는 단지 특정한 실시예를 설명하기 위해 사용된 것으로, 본 발명을 한정하려는 의도가 아니다. 단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함한다. 본 출원에서, "포함하다" 또는 "가지다" 등의 용어는 명세서상에 기재된 특징, 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것이 존재함을 지정하려는 것이지, 하나 또는 그 이상의 다른 특징들이나 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것들의 존재 또는 부가 가능성을 미리 배제하지 않는 것으로 이해되어야 한다.The terminology used in this application is used only to describe a specific embodiment and is not intended to limit 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.

다르게 정의되지 않는 한, 기술적이거나 과학적인 용어를 포함해서 여기서 사용되는 모든 용어들은 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자에 의해 일반적으로 이해되는 것과 동일한 의미를 가지고 있다. 일반적으로 사용되는 사전에 정의되어 있는 것과 같은 용어들은 관련 기술의 문맥 상 가지는 의미와 일치하는 의미를 가지는 것으로 해석되어야 하며, 본 출원에서 명백하게 정의하지 않는 한, 이상적이거나 과도하게 형식적인 의미로 해석되지 않는다.Unless defined otherwise, all terms used herein, including technical or scientific terms, have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. Terms such as those defined in commonly used dictionaries are to be interpreted as having a meaning consistent with the contextual meaning of the related art and are to be interpreted as either ideal or overly formal in the sense of the present application Do not.

이하, 본 발명에 따른 바람직한 실시예를 첨부된 도면을 참조하여 상세하게 설명한다.Hereinafter, preferred embodiments according to the present invention will be described in detail with reference to the accompanying drawings.

본 발명에서 패킹된 실행파일은 실제 컴퓨터 또는 컴퓨터 상에서 동작하는 동적분석도구(dynamic binary instruments; DBI)를 이용하여 실행될 수 있다. 즉, 본 발명에서 언급하는 컴퓨터는 자체적인 CPU와 메모리를 포함하는 실제의 컴퓨터일 수 있을 뿐만 아니라, 실제의 컴퓨터에 기반하는 가상의 컴퓨터 또는 컴퓨터 시뮬레이션 장치(동적분석도구 포함)일 수도 있다. The packed executable files in the present invention may be executed using dynamic binary instruments (DBI) operating on a real computer or computer. That is, the computer referred to in the present invention may be not only an actual computer including its own CPU and memory but also a virtual computer or a computer simulation apparatus (including a dynamic analysis tool) based on an actual computer.

도 1은 본 발명의 일 실시예에 따른 패킹된 실행파일의 시작지점 탐지 방법을 설명하기 위한 흐름도이다.1 is a flowchart illustrating a method of detecting a start point of a packed executable file according to an embodiment of the present invention.

단계 S110에서는, 시작지점 탐지 장치가 컴퓨터에 포함된 메모리 영역에서 실행파일의 경로 및 파일명 중 적어도 하나의 정보를 포함하는 문자정보가 검출되는지 여부에 기초하여, 적어도 하나의 시작지점 후보를 포함하는 제1 시작지점후보그룹을 탐지한다.In step S110, based on whether or not the character information including at least one of the path of the executable file and the file name is detected in the memory area included in the computer, the start point detecting apparatus determines whether the character string including at least one start point candidate 1 Detect the starting point candidate group.

여기서, 압축, 암호화 및 난독화 등의 패킹이 적용된 실행파일인 분석대상파일이 컴퓨터 상에서 실행될 때, 그 실행파일의 패킹이 해제된 이후에 그 실행파일이 동작을 시작하는 주소가 시작지점(OEP)이다. 예컨대, 그 패킹된 실행파일이 컴퓨터에 악영향을 미치는 악성코드인 경우, 그 악성코드가 동작을 시작하는 지점이 바로 시작지점일 수 있다.Here, when an analysis object file, which is an executable file to which packing such as compression, encryption and obfuscation is applied, is executed on a computer, the address at which the execution file starts its operation after the packing of the executable file is released is the start point (OEP) to be. For example, if the packed executable file is a malicious code that adversely affects the computer, the point where the malicious code starts to operate may be the starting point.

한편, 패킹이 해제된 후 실행파일이 실행될 때, 메인함수(int main(int argc, char *argv[], char *envp[]))의 매개변수 중 argv의 0번째에는 시스템 기본값으로 실행파일의 경로 및 실행파일에 해당하는 문자열(예, 경로는 "C:\data"이고, 실행파일은 "program.exe"일 때, "C:\data\\program.exe"이 포함될 수 있다. 따라서, 특정한 시스템함수(예, __getmainargs)가 호출되면서, 컴퓨터의 stack 메모리에서 실행파일의 경로 및 파일명 중 적어도 하나를 포함하는 문자정보가 검출될 수 있다. On the other hand, when the executable is executed after the packing is released, the 0th parameter of the main function (int main (int argc, char * argv [], char * envp [ The path and the string corresponding to the executable file (for example, the path is "C: \ data" and the executable file is "program.exe", it may contain "C: \ data \\ program.exe" As certain system functions (e.g., __getmainargs) are invoked, character information including at least one of the path and file name of the executable file in the stack memory of the computer may be detected.

이때, 시작지점 탐지 장치는 실행파일의 시작지점인 시작지점을 바로 직전에 지나왔다고 판단할 수 있다. 따라서, 가장 최근에 발생한 메모리 쓰기 후에 지나온 메모리 주소를 시작지점 후보로 결정할 수 있다.At this time, the start point detection device can determine that the start point, which is the start point of the executable file, has just passed the start point. Thus, the memory address passed after the most recent memory write can be determined as the starting point candidate.

단계 S120에서는, 시작지점 탐지 장치가 그 실행파일을 실행하기 위하여 필요한 복수의 함수를 포함하는 실행준비함수그룹 중 적어도 하나의 함수가 호출되는지 여부에 기초하여, 적어도 하나의 시작지점 후보를 포함하는 제2 시작지점후보그룹을 탐지한다.In step S120, based on whether or not a function of at least one of a group of execution-ready functions including a plurality of functions required for the start point detecting apparatus to execute the executable file is called, 2 Detect the starting point candidate group.

즉, 시작지점 탐지 장치가 그 실행파일의 int main() 함수를 실행하기 위해 필요한 실행준비함수그룹(예, __getmainargs, __wgetmainargs, GetModuleFileNameA, GetModuleFileNameEx, GetModuleFileNameW, GetStartUpInfoA) 중 일부가 호출된 이후에, 가장 최근에 발생한 메모리 쓰기 후에 지나온 메모리 주소를 시작지점 후보로 결정할 수 있다.That is, after some of the execution-ready function groups (eg, __getmainargs, __wgetmainargs, GetModuleFileNameA, GetModuleFileNameA, GetModuleFileNameEx, GetModuleFileNameW, GetStartUpInfoA) needed to execute the int main () function of the executable file are called, It is possible to determine the address of the memory after the memory write in the memory as the start point candidate.

마지막으로 단계 S130에서는, 시작지점 탐지 장치가 그 제1 시작지점후보그룹 및 제2 시작지점후보그룹에 기초하여, 소정 개수의 시작지점 후보를 포함하는 최종시작지점후보그룹을 생성한다.Finally, in step S130, the start point detecting apparatus generates a final start point candidate group including a predetermined number of start point candidates based on the first start point candidate group and the second start point candidate group.

예컨대, 시작지점 탐지 장치는 그 제1 시작지점후보그룹 및 제2 시작지점후보그룹에 포함되어 있는 복수의 시작지점 후보 중에서 미리 설정된 소정 개수의 시작지점 후보를 포함하는 최종시작지점후보그룹을 생성할 수 있다.For example, the start point detection apparatus generates a final start point candidate group including a predetermined number of start point candidates that are preset from a plurality of start point candidates included in the first start point candidate group and the second start point candidate group .

보다 구체적으로, 제1 시작지점후보그룹이 {A, B, C, D}의 시작지점 후보를 포함하고, 제2 시작지점후보그룹이 {C, D, E, F}의 시작지점 후보를 포함하는 경우, 시작지점 탐지 장치는 제1 시작지점후보그룹과 제2 시작지점후보그룹을 모두 포함하는 {A, B, C, D, E, F}의 시작지점 후보 중에서 최종시작지점후보그룹을 생성할 수 있다.More specifically, the first starting point candidate group includes the starting point candidates of {A, B, C, D} and the second starting point candidate group includes the starting point candidates of {C, D, E, , The start point detection apparatus generates a final start point candidate group among the start point candidates of {A, B, C, D, E, F} including both the first start point candidate group and the second start point candidate group can do.

한편, 생성된 최종시작지점후보그룹은 실행파일을 분석하는데 이용될 수 있다. 예를 들어, 실행파일이 악성코드인 경우, 백신 프로그램의 제조자는 그 생성된 최종시작지점후보그룹을 이용하여 그 악성코드의 동작을 추적할 수 있으며, 그 악성코드의 동작 메커니즘을 밝히거나 치료방법을 개발하는데 도움을 받을 수 있다.On the other hand, the generated final start point candidate group can be used to analyze the executable file. For example, if the executable file is malicious code, the manufacturer of the vaccine program can track the operation of the malicious code by using the generated final start point candidate group, and disclose the operation mechanism of the malicious code, Can be helped to develop.

다른 실시예에서는, 시작지점 탐지 장치가 컴퓨터에 포함된 레지스터를 백업하기 위한 명령어와 그 백업된 레지스터를 복원하기 위한 명령어가 순차적으로 호출되는지 여부에 기초하여, 적어도 하나의 시작지점 후보를 포함하는 제3 시작지점후보그룹을 탐지할 수 있다. 또한, 시작지점 탐지 장치는 그 제1 시작지점후보그룹, 제2 시작지점후보그룹 및 제3 시작지점후보그룹에 기초하여 최종시작지점후보그룹을 생성할 수 있다.In another embodiment, the starting point detection device may be configured to determine whether the instruction to back up the register contained in the computer and the instruction to restore the backed-up register are sequentially called, 3 Start point Candidate group can be detected. Further, the start point detecting apparatus can generate a final start point candidate group based on the first start point candidate group, the second start point candidate group, and the third start point candidate group.

즉, 시작지점 탐지 장치는 압축된 실행파일의 압축을 해제하기 전에 현재 레지스터를 백업하고, 압축 해제가 완료된 이후에 백업된 레지스터를 복구하는 특징을 이용하여, 레지스터 백업 명령어와 레지스터 복원 명령어가 순차적으로 호출되는 경우, 그 이후에 첫번째로 코드섹션에 진입한 주소를 시작지점 후보로 결정할 수 있다. 이때, 레지스터 백업 명령어는 PUSHAD이고, 레지스터 복원 명령어는 POPAD일 수 있다.That is, the start point detection device uses the feature of backing up the current register before uncompressing the compressed executable file and restoring the backed-up register after decompression is completed, so that the register backup command and the register restoration command are sequentially If called, then the first entry in the code section can be determined as the starting point candidate. At this time, the register backup command may be PUSHAD and the register restoration command may be POPAD.

한편, 시작지점 탐지 장치는 그 제1 시작지점후보그룹, 제2 시작지점후보그룹 및 제3 시작지점후보그룹 모두에 기초하여, 최종시작지점후보그룹을 생성할 수 있다.On the other hand, the start point detecting apparatus can generate the final start point candidate group based on both the first start point candidate group, the second start point candidate group, and the third start point candidate group.

또 다른 실시예에서는, 시작지점 탐지 장치가 소정의 임계치 이상 그 분석대상파일의 실행 흐름(flow of execution)을 이동시키는 명령어가 호출되는지 여부에 기초하여, 적어도 하나의 시작지점 후보를 포함하는 제4 시작지점후보그룹을 탐지할 수 있다. 또한, 시작지점 탐지 장치는 그 제1 시작지점후보그룹, 제2 시작지점후보그룹 및 제4 시작지점후보그룹에 기초하여 최종시작지점후보그룹을 생성할 수 있다.In yet another embodiment, based on whether the start point detection device is called an instruction to move the flow of execution of the analysis object file beyond a predetermined threshold, the fourth point, including at least one start point candidate, Start point candidate group can be detected. Further, the start point detecting apparatus can generate a final start point candidate group based on the first start point candidate group, the second start point candidate group, and the fourth start point candidate group.

즉, 시작지점 탐지 장치는 그 분석대상파일이 실행되는 도중에 실행 흐름이 임계치 이상 이동하면, 그 이후에 첫번째로 코드섹션에 진입한 주소를 시작지점 후보로 결정할 수 있다.That is, when the execution flow moves more than the threshold value during the execution of the analysis target file, the start point detection apparatus can determine the address that first enters the code section as the start point candidate.

이는, 압축된 실행파일의 압축해제가 완료되면, 그 코드를 실행하기 위하여 일반적이지 않은 범위로 JUMP 또는 RET 명령어가 호출되기 때문이다. 이때, JUMP 명령어의 목적지 주소가 시작지점일 수 있다.This is because when the decompression of the compressed executable file is completed, the JUMP or RET command is invoked to an unusual extent to execute the code. At this time, the destination address of the JUMP command may be the start point.

또 다른 실시예에서는, 시작지점 탐지 장치가 컴퓨터에서 상이한 메모리 영역으로 그 분석대상파일의 실행 흐름이 이동하는지 여부에 기초하여, 적어도 하나의 시작지점 후보를 포함하는 제5 시작지점후보그룹을 탐지할 수 있다. 또한, 시작지점 탐지 장치는 그 제1 시작지점후보그룹, 제2 시작지점후보그룹 및 제5 시작지점후보그룹에 기초하여 최종시작지점후보그룹을 생성할 수 있다.In yet another embodiment, the start point detection device detects a fifth start point candidate group that includes at least one start point candidate based on whether the flow of execution of the analysis object file moves from the computer to a different memory area . Further, the start point detecting apparatus can generate a final start point candidate group based on the first start point candidate group, the second start point candidate group, and the fifth start point candidate group.

즉, 시작지점 탐지 장치는 그 분석대상파일이 실행되는 도중에 실행 흐름이 A 메모리 영역에서 B 메모리 영역으로 메모리 영역(memory section)의 단위를 넘어서 이동하는 경우, 그 이후에 첫번째로 코드섹션에 진입한 주소를 시작지점 후보로 결정할 수 있다.That is, when the execution flow moves from the A memory area to the B memory area beyond the memory section (memory section) while the analysis target file is being executed, the start point detecting device enters the code section first The address can be determined as the starting point candidate.

한편, 시작지점 탐지 장치는 1) 메모리 쓰기 후 실행 방법, 2) 페이지 추출 방법, 3) 엔트로피 분석 방법 등의 방법을 더 이용하여 시작지점 후보를 결정할 수 있다.On the other hand, the start point detection apparatus can determine the start point candidate by further using methods such as 1) a method of executing after memory writing, 2) a page extraction method, and 3) an entropy analysis method.

첫번째로, 메모리 쓰기 후 실행 방법을 이용할 수 있다. First, you can use the execution method after memory write.

실행압축을 푼다는 것은 나중에 실행시킬 부분을 메모리에 쓰고 있다는 의미다. 즉, 모든 메모리 쓰기가 일어난 주소를 기록하고 있다가 쓰기 명령이 끝나고 기록된 주소를 실행하면 시작지점 후보일 가능성이 있다고 판단하는 방법이다. 그러나, 이는 너무 많은 시작지점 후보를 제공한다. 실제로 시작지점이 맞는지 아닌지를 검증하는 시간이 오래 걸릴 수 있다. 적게는 30개 많게는 990개 이상의 시작지점 후보를 제공할 수 있다.Unpacking the executable means that you are writing to memory in the future. That is, all the memory write addresses are recorded, and when the write command is completed and the written address is executed, it is determined that there is a possibility of being a candidate for the start point. However, this provides too many starting point candidates. In fact, it can take a long time to verify whether the starting point is correct or not. You can offer more than 990 starting point candidates, with as few as 30 as many.

두번째로, 페이지 추출 방법을 이용할 수 있다.Second, a page extraction method can be used.

즉, 메모리 쓰기 후 읽기를 이용하여 시작지점 후보를 찾는 방법의 개선된 방법으로 페이지 추출(page extraction)방법이 있다. 이는 메모리 쓰기가 일어난 영역을 페이지 단위(4kb)로 세분화한다. 그리고 페이지는 generating과 sharing로 구분한다. 또한 write set과 execute set을 가진다. 이때, write set는 write명령어가 일어난 source 페이지와 destination 페이지를 쌍으로 지닌다. 또한, execute set는 실행된 페이지를 지닌다. 이때, generating과 sharing을 구별한 기준은 다음과 같다. (generating: 한 페이지가 written 이후 execute가 일어났을 때, write 명령어를 한 페이지다.(즉, source가 된다.), sharing: write명령어가 일어났을 때 destination에 u마크가 있다면 write set 안의 source는 sharing이 된다.)That is, there is a page extraction method as an improved method of finding a starting point candidate by using read after memory writing. This subdivides the memory write area into page units (4kb). Pages are divided into generating and sharing. It also has write and execute sets. At this time, a write set has a pair of a source page and a destination page in which a write command is issued. The execute set also holds the executed page. The criteria for distinguishing between generating and sharing are as follows. When a page is written, when a page is written, the write command is one page (that is, source). When the sharing: write command occurs, if the destination has a u mark, .

u마크를 하는 방법은, write set안에 source페이지가 generating page라면 source에다가 u마크를 표시한다. u마크를 destination으로 하는 source 페이지(generating 혹은 sharing 상관없이)에 u마크를 표시한다.The way to mark a u is to mark the u mark in the source if the source page in the write set is a generating page. Mark the u mark on the source page (regardless of generating or sharing) with the u mark as the destination.

쓰기명령어 집합(write set)은 실행시간을 기준으로 정렬하며, execute명령어는 실행 명령어 집합(execute set)안에 들어간다.The write set is sorted by execution time, and the execute command enters the execution set.

시작지점 후보는 execute set안의 요소이며, 가장 최적의 시작지점 후보는 마지막에 u마킹 된 페이지와 가장 가까운 것이 된다는 방법이다. 이 방법을 사용하면 990개 이상의 시작지점 후보 중 우선순위가 높은 순서로 정렬을 시킬 수 있다. 하지만 실제로 시작지점이 맞는지 아닌지 검증하려면 대략 32개 정도의 시작지점 후보를 검증해야 99%정도의 정확도가 나온다.The starting point candidate is the element in the execute set, and the most optimal starting point candidate is the one closest to the last u-marked page. Using this method, more than 990 starting point candidates can be sorted in order of priority. However, in order to verify whether the starting point is actually correct, approximately 32 starting point candidates must be verified to achieve accuracy of about 99%.

세번째로, 엔트로피 분석 방법을 이용할 수 있다.Thirdly, an entropy analysis method can be used.

즉, 엔트로피 값의 변화량을 이용하여 시작지점을 찾을 수 있다. 일반적으로 패커를 적용하게 되면 파일 내부에 저장된 데이터의 엔트로피가 증가한다. 따라서, 패킹을 적용한 파일은 실행 시에 압축된 데이터를 해제하면서 데이터의 엔트로피가 감소하며, 압축해제가 완료된 후에 데이터의 엔트로피 변화가 거의 없다. 이 특징을 이용해 데이터의 엔트로피 변화를 관찰해 시작지점을 찾을 수 있다. 하지만 이는 변화량을 몇으로 설정하느냐에 따라서 시작지점을 찾지 못할 가능성이 크다는 문제점이 있다. 또한 패커마다 변화량이 다르다는 점도 문제가 될 수 있다.That is, the starting point can be found by using the change amount of the entropy value. In general, applying a packer increases the entropy of the data stored in the file. Therefore, the entropy of the data is reduced while the file to which the packing is applied releases the compressed data at the time of execution, and the entropy of the data is hardly changed after the decompression is completed. You can use this feature to find the starting point by observing the change in entropy of the data. However, there is a problem that the starting point is not likely to be found depending on how many changes are set. Also, the fact that the amount of change is different for each packer can also be a problem.

또 다른 실시예에서는, 시작지점 탐지 장치가 그 제1 시작지점후보그룹 및 제2 시작지점후보그룹에 공통적으로 포함되는 시작지점 후보를 포함하도록 최종시작지점후보그룹을 생성할 수 있다.In another embodiment, the start point detection device may generate a final start point candidate group so as to include start point candidates commonly included in the first start point candidate group and the second start point candidate group.

예컨대, 시작지점 탐지 장치는 제1 시작지점후보그룹이 {A, B, C, D}의 시작지점 후보를 포함하고, 제2 시작지점후보그룹이 {C, D, E, F}의 시작지점 후보를 포함하는 경우, 그 2개의 집합의 교집합인 {C, D}로 최종시작지점후보그룹을 생성할 수 있다For example, the start point detection apparatus may be configured such that the first start point candidate group includes the start point candidates of {A, B, C, D}, the second start point candidate group includes the start point of {C, D, E, F} If a candidate is included, the final starting point candidate group can be created with the intersection of the two sets {C, D}

한편, 시작지점 탐지 장치는 다양한 기준에 의하여 시작지점 후보 생성 방법의 순서를 변경하여, 시작지점 후보 생성의 효율을 향상시킬 수 있다. 예컨대, 가장 적인 수의 시작지점 후보를 탐지하는 방법을 가장 먼저 수행함으로써, 그 뒤에 수행되는 방법들이 수행되는데 걸리는 시간을 최소화할 수 있는 것이다. 보다 구체적으로, S110의 방법이 가장 적은 수의 시작지점 후보를 탐지한다면, S110의 방법을 먼저 수행하고, 그 뒤에 S120 및 또 다른 방법을 수행함으로써, 수행 시간을 최소화할 수 있다.On the other hand, the start point detection apparatus can improve the efficiency of the start point candidate generation by changing the order of the start point candidate generation method according to various criteria. For example, by first performing the method of detecting an optimal number of starting point candidates, it is possible to minimize the time taken to perform the methods performed thereafter. More specifically, if the method of S110 detects the smallest number of starting point candidates, the execution time can be minimized by performing the method of S110 first, followed by S120 and another method.

또 다른 실시예에서는, 분석대상파일은 실행파일에 대하여 다른 파일과 함께 묶음, 암호화, 난독화 및 압축 중 적어도 하나를 적용한 결과일 수 있다.In yet another embodiment, the analysis target file may be the result of applying at least one of bundling, encryption, obfuscation, and compression with other files to the executable file.

예컨대, 분석대상파일은 악성코드인 실행파일 배포하려는 크래커(cracker)에 의해 생성될 수 있으며, 크래커는 악성코드인 실행파일을 압축하거나, 암호화하거나, 난독화하거나, 다른 파일과 함께 묶어서 배포할 수 있다. 그 결과로서, 다른 사람들이 그 악성코드의 존재 여부 또는 세부적인 동작 메커니즘을 파악하기 어렵게 만들 수 있다.For example, the file to be analyzed can be created by a cracker that wants to distribute executable files, which are malicious codes. Crackers can compress, encrypt, obfuscate, or bundle executable files, which are malicious code, with other files. have. As a result, it can make it difficult for others to identify the existence of the malicious code or the detailed operating mechanism.

이와 같이, 본 발명의 일 실시예에 따른 패킹된 실행파일의 시작지점 탐지 방법 및 장치는 패킹된 실행파일을 실행할 때 발생하는 다양한 특징들을 이용하여 시작지점을 보다 정확하게 탐지할 수 있는 효과가 있다.As described above, the method and apparatus for detecting a starting point of a packed executable file according to an embodiment of the present invention can detect the starting point more accurately by using various characteristics that occur when executing a packed executable file.

도 2는 본 발명의 일 실시예에 따른 패킹된 실행파일의 시작지점 탐지 장치를 설명하기 위한 블록도이다.2 is a block diagram illustrating an apparatus for detecting a starting point of a packed executable file according to an embodiment of the present invention.

도 2를 참조하면, 본 발명의 일 실시예에 따른 패킹된 실행파일의 시작지점 탐지 장치(200)는 탐지부(210) 및 생성부(220)를 포함한다.Referring to FIG. 2, an apparatus 200 for detecting a starting point of a packed executable file according to an exemplary embodiment of the present invention includes a detection unit 210 and a generation unit 220.

한편, 시작지점 탐지 장치(200)는 패킹된 실행파일(즉, 분석대상파일)이 실행되는 컴퓨터, 스마트폰, 태블릿PC 및 웨어러블기기 등에 탑재될 수 있다.On the other hand, the start point detection apparatus 200 can be installed in a computer, a smart phone, a tablet PC, a wearable device, or the like, on which a packed executable file (i.e., analysis target file) is executed.

탐지부(210)는 컴퓨터에 포함된 메모리 영역에서 실행파일의 경로 및 파일명 중 적어도 하나의 정보를 포함하는 문자정보가 검출되는지 여부에 기초하여, 적어도 하나의 시작지점 후보를 포함하는 제1 시작지점후보그룹을 탐지하고, 그 실행파일을 실행하기 위하여 필요한 복수의 함수를 포함하는 실행준비함수그룹 중 적어도 하나의 함수가 호출되는지 여부에 기초하여, 적어도 하나의 시작지점 후보를 포함하는 제2 시작지점후보그룹을 탐지한다.Based on whether or not character information including at least one of the path and file name of the executable file is detected in the memory area included in the computer, the detection unit 210 detects a first start point including at least one start point candidate Based on whether at least one function of the group of execution-ready functions including a plurality of functions necessary for detecting the candidate group and executing the executable file is called, a second starting point including at least one starting point candidate Detect candidate groups.

생성부(220)는 그 제1 시작지점후보그룹 및 제2 시작지점후보그룹에 기초하여, 소정 개수의 시작지점 후보를 포함하는 최종시작지점후보그룹을 생성한다.The generating unit 220 generates a final starting point candidate group including a predetermined number of starting point candidates based on the first starting point candidate group and the second starting point candidate group.

다른 실시예에서는, 탐지부(210)는 컴퓨터에 포함된 레지스터를 백업하기 위한 명령어와 그 백업된 레지스터를 복원하기 위한 명령어가 순차적으로 호출되는지 여부에 기초하여, 적어도 하나의 시작지점 후보를 포함하는 제3 시작지점후보그룹을 더 탐지하고, 생성부(220)는 그 제3 시작지점후보그룹에 더 기초할 수 있다.In an alternative embodiment, the detection unit 210 may include at least one starting point candidate based on whether the instructions for backing up the registers contained in the computer and the instructions for restoring the backed-up registers are called sequentially The third starting point candidate group is further detected, and the generating unit 220 may further base on the third starting point candidate group.

또 다른 실시예에서는, 탐지부(210)는 소정의 임계치 이상 분석대상파일의 실행 흐름(flow of execution)을 이동시키는 명령어가 호출되는지 여부에 기초하여, 적어도 하나의 시작지점 후보를 포함하는 제4 시작지점후보그룹을 더 탐지하고, 생성부(220)는 그 제4 시작지점후보그룹에 더 기초할 수 있다.In yet another embodiment, the detection unit 210 determines whether or not a command to move the flow of execution of the analysis target file beyond a predetermined threshold is called, The starting point candidate group is further detected, and the generating unit 220 may further base on the fourth starting point candidate group.

또 다른 실시예에서는, 탐지부(210)는 컴퓨터에서 상이한 메모리 영역으로 그 분석대상파일의 실행 흐름이 이동하는지 여부에 기초하여, 적어도 하나의 시작지점 후보를 포함하는 제5 시작지점후보그룹을 더 탐지하고, 생성부(220)는 그 제5 시작지점후보그룹에 더 기초할 수 있다.In yet another embodiment, the detection unit 210 may further include a fifth starting point candidate group including at least one starting point candidate based on whether the execution flow of the analysis target file is shifted from the computer to a different memory area And the generating unit 220 may further base on the fifth starting point candidate group.

또 다른 실시예에서는, 생성부(220)는 그 제1 시작지점후보그룹 및 제2 시작지점후보그룹에 공통적으로 포함되는 시작지점 후보를 포함하도록 최종시작지점후보그룹을 생성할 수 있다.In another embodiment, the generating unit 220 may generate a final starting point candidate group so as to include starting point candidates commonly included in the first starting point candidate group and the second starting point candidate group.

또 다른 실시예에서는, 분석대상파일은 실행파일에 대하여 다른 파일과 함께 묶음, 암호화, 난독화 및 압축 중 적어도 하나를 적용한 결과일 수 있다.In yet another embodiment, the analysis target file may be the result of applying at least one of bundling, encryption, obfuscation, and compression with other files to the executable file.

한편, 상술한 본 발명의 실시예들은 컴퓨터에서 실행될 수 있는 프로그램으로 작성가능하고, 컴퓨터로 읽을 수 있는 기록매체를 이용하여 상기 프로그램을 동작시키는 범용 디지털 컴퓨터에서 구현될 수 있다.The above-described embodiments of the present invention can be embodied in a general-purpose digital computer that can be embodied as a program that can be executed by a computer and operates the program using a computer-readable recording medium.

상기 컴퓨터로 읽을 수 있는 기록매체는 마그네틱 저장매체(예를 들면, 롬, 플로피 디스크, 하드디스크 등), 광학적 판독 매체(예를 들면, 시디롬, 디브이디 등) 를 포함한다.The computer readable recording medium includes a magnetic storage medium (e.g., ROM, floppy disk, hard disk, etc.), optical reading medium (e.g., CD ROM, DVD, etc.).

이제까지 본 발명에 대하여 그 바람직한 실시예들을 중심으로 살펴보았다. 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자는 본 발명이 본 발명의 본질적인 특성에서 벗어나지 않는 범위에서 변형된 형태로 구현될 수 있음을 이해할 수 있을 것이다. 그러므로 개시된 실시예들은 한정적인 관점이 아니라 설명적인 관점에서 고려되어야 한다. 본 발명의 범위는 전술한 설명이 아니라 특허청구범위에 나타나 있으며, 그와 동등한 범위 내에 있는 모든 차이점은 본 발명에 포함된 것으로 해석되어야 할 것이다.
The present invention has been described with reference to the preferred embodiments. It will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims. Therefore, the disclosed embodiments should be considered in an illustrative rather than a restrictive sense. The scope of the present invention is defined by the appended claims rather than by the foregoing description, and all differences within the scope of equivalents thereof should be construed as being included in the present invention.

Claims (12)

컴퓨터 상에서 패킹된 실행파일인 분석대상파일을 실행하여, 상기 컴퓨터에 포함된 메모리 영역에서, 상기 실행파일이 동작을 시작하는 지점인 시작지점(original entry point; OEP)을 탐지하는 방법에 있어서,
상기 컴퓨터에 포함된 메모리 영역에서 상기 실행파일의 경로 및 파일명 중 적어도 하나의 정보를 포함하는 문자정보가 검출된 메모리 주소에 기초하여, 적어도 하나의 시작지점 후보를 포함하는 제1 시작지점후보그룹을 탐지하는 단계;
상기 실행파일을 실행하기 위하여 필요한 복수의 함수를 포함하는 실행준비함수그룹 중 적어도 하나의 함수가 호출된 메모리 주소에 기초하여, 적어도 하나의 시작지점 후보를 포함하는 제2 시작지점후보그룹을 탐지하는 단계; 및
상기 제1 시작지점후보그룹 및 상기 제2 시작지점후보그룹 중, 중복되는 시작지점 후보를 제외하고 기설정된 개수만큼의 임의의 시작지점 후보를 포함하는 최종시작지점후보그룹을 생성하는 단계;
를 포함하는 것을 특징으로 하는 패킹된 실행파일의 시작지점 탐지 방법.
CLAIMS 1. A method for detecting an original entry point (OEP) in a memory area included in a computer by executing an analysis object file which is an executable file packed on a computer,
A first start point candidate group including at least one start point candidate is determined based on a memory address in which character information including at least one of a path and a file name of the executable file is detected in a memory region included in the computer Detecting;
Detecting a second starting point candidate group including at least one starting point candidate based on a memory address on which at least one function of the group of execution ready functions including a plurality of functions required to execute the executable file is called step; And
Generating a final starting point candidate group including a predetermined number of starting point candidates excluding the overlapping starting point candidates out of the first starting point candidate group and the second starting point candidate group;
And determining a start point of the packed executable file.
제1항에 있어서,
상기 컴퓨터에 포함된 레지스터를 백업하기 위한 명령어와 상기 백업된 레지스터를 복원하기 위한 명령어가 순차적으로 호출된 코드섹션 진입주소에 기초하여, 적어도 하나의 시작지점 후보를 포함하는 제3 시작지점후보그룹을 탐지하는 단계
를 더 포함하고,
상기 최종시작지점후보그룹을 생성하는 단계는
상기 제3 시작지점후보그룹에 더 기초하는 것을 특징으로 하는 패킹된 실행파일의 시작지점 탐지 방법.
The method according to claim 1,
A third start point candidate group including at least one start point candidate based on a code section entry address in which instructions for backing up the register included in the computer and instructions for restoring the backed up register are sequentially called Steps to detect
Further comprising:
The step of generating the final starting point candidate group
Wherein the third starting point candidate group is further based on the third starting point candidate group.
제1항에 있어서,
소정의 임계치 이상 상기 분석대상파일의 실행 흐름(flow of execution)을 이동시키는 명령어가 호출된 코드섹션 진입주소에 기초하여, 적어도 하나의 시작지점 후보를 포함하는 제4 시작지점후보그룹을 탐지하는 단계
를 더 포함하고,
상기 최종시작지점후보그룹을 생성하는 단계는
상기 제4 시작지점후보그룹에 더 기초하는 것을 특징으로 하는 패킹된 실행파일의 시작지점 탐지 방법.
The method according to claim 1,
Detecting a fourth starting point candidate group including at least one starting point candidate based on a code section entry address at which an instruction to move a flow of execution of the analysis target file over a predetermined threshold is called
Further comprising:
The step of generating the final starting point candidate group
Wherein the fourth starting point candidate group is further based on the fourth starting point candidate group.
제1항에 있어서,
상기 컴퓨터에서 상이한 메모리 영역으로 상기 분석대상파일의 실행 흐름이 이동한 코드섹션 진입주소에 기초하여, 적어도 하나의 시작지점 후보를 포함하는 제5 시작지점후보그룹을 탐지하는 단계
를 더 포함하고,
상기 최종시작지점후보그룹을 생성하는 단계는
상기 제5 시작지점후보그룹에 더 기초하는 것을 특징으로 하는 패킹된 실행파일의 시작지점 탐지 방법.
The method according to claim 1,
Detecting a fifth starting point candidate group including at least one starting point candidate based on a code section entry address in which the execution flow of the analysis target file has moved from the computer to a different memory area
Further comprising:
The step of generating the final starting point candidate group
Wherein the fifth starting point candidate group is further based on the fifth starting point candidate group.
제1항에 있어서,
상기 최종시작지점후보그룹을 생성하는 단계는
상기 제1 시작지점후보그룹 및 상기 제2 시작지점후보그룹에 공통적으로 포함되는 시작지점 후보를 포함하도록 상기 최종시작지점후보그룹을 생성하는 것을 특징으로 하는 패킹된 실행파일의 시작지점 탐지 방법.
The method according to claim 1,
The step of generating the final starting point candidate group
Wherein the final start point candidate group is generated to include a start point candidate that is commonly included in the first start point candidate group and the second start point candidate group.
제1항에 있어서,
상기 분석대상파일은
상기 실행파일에 대하여 다른 파일과 함께 묶음, 암호화, 난독화 및 압축 중 적어도 하나를 적용한 결과인 것을 특징으로 하는 패킹된 실행파일의 시작지점 탐지 방법.
The method according to claim 1,
The analysis object file
Wherein the result of applying at least one of bundling, encryption, obfuscation, and compression together with another file to the executable file.
컴퓨터 상에서 패킹된 실행파일인 분석대상파일을 실행하여, 상기 컴퓨터에 포함된 메모리 영역에서 상기 실행파일이 동작을 시작하는 지점인 시작지점을 탐지하는 장치에 있어서,
상기 컴퓨터에 포함된 메모리 영역에서 상기 실행파일의 경로 및 파일명 중 적어도 하나의 정보를 포함하는 문자정보가 검출된 메모리 주소에 기초하여, 적어도 하나의 시작지점 후보를 포함하는 제1 시작지점후보그룹을 탐지하고, 상기 실행파일을 실행하기 위하여 필요한 복수의 함수를 포함하는 실행준비함수그룹 중 적어도 하나의 함수가 호출된 메모리 주소에 기초하여, 적어도 하나의 시작지점 후보를 포함하는 제2 시작지점후보그룹을 탐지하는 탐지부; 및
상기 제1 시작지점후보그룹 및 상기 제2 시작지점후보그룹 중, 중복되는 시작지점 후보를 제외하고 기설정된 개수만큼의 임의의 시작지점 후보를 포함하는 최종시작지점후보그룹을 생성하는 생성부;
를 포함하는 것을 특징으로 하는 패킹된 실행파일의 시작지점 탐지 장치.
An apparatus for executing a file to be analyzed which is an executable file packed on a computer and detecting a starting point at which the executable file starts to operate in a memory area included in the computer,
A first start point candidate group including at least one start point candidate is determined based on a memory address in which character information including at least one of a path and a file name of the executable file is detected in a memory region included in the computer Based on a memory address on which at least one function among a group of execution preparation function groups including a plurality of functions required for executing the executable file is detected, a second start point candidate group including at least one start point candidate A detection unit for detecting the detection signal; And
A generating unit generating a final starting point candidate group including a predetermined number of starting point candidates excluding the overlapping starting point candidates out of the first starting point candidate group and the second starting point candidate group;
Wherein the start point of the packed executable file is located at the start point of the packed executable file.
제7항에 있어서,
상기 탐지부는 상기 컴퓨터에 포함된 레지스터를 백업하기 위한 명령어와 상기 백업된 레지스터를 복원하기 위한 명령어가 순차적으로 호출된 코드섹션 진입주소에 기초하여, 적어도 하나의 시작지점 후보를 포함하는 제3 시작지점후보그룹을 더 탐지하고,
상기 생성부는
상기 제3 시작지점후보그룹에 더 기초하는 것을 특징으로 하는 패킹된 실행파일의 시작지점 탐지 장치.
8. The method of claim 7,
The detecting unit may include a command for backing up the register included in the computer and a command for restoring the backed-up register, based on a code section entry address sequentially called, a third starting point including at least one starting point candidate More candidate groups are detected,
The generating unit
Wherein the third starting point candidate group is further based on the third starting point candidate group.
제7항에 있어서,
상기 탐지부는 소정의 임계치 이상 상기 분석대상파일의 실행 흐름(flow of execution)을 이동시키는 명령어가 호출된 코드섹션 진입주소에 기초하여, 적어도 하나의 시작지점 후보를 포함하는 제4 시작지점후보그룹을 더 탐지하고,
상기 생성부는
상기 제4 시작지점후보그룹에 더 기초하는 것을 특징으로 하는 패킹된 실행파일의 시작지점 탐지 장치.
8. The method of claim 7,
The detecting unit may detect a fourth starting point candidate group including at least one starting point candidate based on a code section entry address at which a command for moving a flow of execution of the analysis target file over a predetermined threshold value is called Further detection,
The generating unit
Wherein the fourth starting point candidate group is further based on the fourth starting point candidate group.
제7항에 있어서,
상기 탐지부는 상기 컴퓨터에서 상이한 메모리 영역으로 상기 분석대상파일의 실행 흐름이 이동한 코드섹션 진입주소에 기초하여, 적어도 하나의 시작지점 후보를 포함하는 제5 시작지점후보그룹을 더 탐지하고,
상기 생성부는
상기 제5 시작지점후보그룹에 더 기초하는 것을 특징으로 하는 패킹된 실행파일의 시작지점 탐지 장치.
8. The method of claim 7,
The detection unit further detects a fifth starting point candidate group including at least one starting point candidate based on a code section entry address in which the execution flow of the analysis target file has been moved from the computer to a different memory area,
The generating unit
Wherein the fifth starting point candidate group is further based on the fifth starting point candidate group.
제7항에 있어서,
상기 생성부는
상기 제1 시작지점후보그룹 및 상기 제2 시작지점후보그룹에 공통적으로 포함되는 시작지점 후보를 포함하도록 상기 최종시작지점후보그룹을 생성하는 것을 특징으로 하는 패킹된 실행파일의 시작지점 탐지 장치.
8. The method of claim 7,
The generating unit
Wherein the final start point candidate group is generated so as to include start point candidates commonly included in the first start point candidate group and the second start point candidate group.
제7항에 있어서,
상기 분석대상파일은
상기 실행파일에 대하여 다른 파일과 함께 묶음, 암호화, 난독화 및 압축 중 적어도 하나를 적용한 결과인 것을 특징으로 하는 패킹된 실행파일의 시작지점 탐지 장치.
8. The method of claim 7,
The analysis object file
Wherein the result of applying at least one of bundling, encryption, obfuscation, and compression with other files to the executable file.
KR1020170148135A 2017-11-08 2017-11-08 Method and apparatus for detection original entry point of packed executable files KR101977265B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020170148135A KR101977265B1 (en) 2017-11-08 2017-11-08 Method and apparatus for detection original entry point of packed executable files

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020170148135A KR101977265B1 (en) 2017-11-08 2017-11-08 Method and apparatus for detection original entry point of packed executable files

Publications (1)

Publication Number Publication Date
KR101977265B1 true KR101977265B1 (en) 2019-05-13

Family

ID=66581799

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020170148135A KR101977265B1 (en) 2017-11-08 2017-11-08 Method and apparatus for detection original entry point of packed executable files

Country Status (1)

Country Link
KR (1) KR101977265B1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20000039973A (en) * 1998-12-16 2000-07-05 김영환 Method for recognizing starting position of application program by operation structure in mobile communication system
KR20070108646A (en) * 2006-05-08 2007-11-13 삼성전자주식회사 Method and terminal for managing of compression binary file
JP2014206948A (en) * 2013-04-16 2014-10-30 株式会社東芝 Entry point extraction device
KR101670916B1 (en) * 2009-03-03 2016-10-31 삼성전자 주식회사 Method for storing function and system device using the same

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20000039973A (en) * 1998-12-16 2000-07-05 김영환 Method for recognizing starting position of application program by operation structure in mobile communication system
KR20070108646A (en) * 2006-05-08 2007-11-13 삼성전자주식회사 Method and terminal for managing of compression binary file
KR101670916B1 (en) * 2009-03-03 2016-10-31 삼성전자 주식회사 Method for storing function and system device using the same
JP2014206948A (en) * 2013-04-16 2014-10-30 株式会社東芝 Entry point extraction device

Similar Documents

Publication Publication Date Title
US10586026B2 (en) Simple obfuscation of text data in binary files
US20080289042A1 (en) Method for Identifying Unknown Virus and Deleting It
JP5644777B2 (en) File group consistency verification system, file group consistency verification method, and file group consistency verification program
CN107291485B (en) Dynamic link library reinforcing method, operation method, reinforcing device and safety system
EP1967954A1 (en) A method for deleting virus program and a method to get back the data destroyed by the virus.
CN107077540B (en) Method and system for providing cloud-based application security services
JP2016062583A (en) Method and apparatus for processing file
KR101990028B1 (en) Hybrid unpacking method and system for binary file recovery
CN115017505A (en) PE virus detection method and device, electronic equipment and storage medium
CN112632536B (en) Memory loading method based on PE file transformation
KR101977265B1 (en) Method and apparatus for detection original entry point of packed executable files
CN108664796B (en) So file protection method and device
JP2013196390A (en) Test data creation method, test data creation program, and test data creation device
JP5952218B2 (en) Information processing apparatus and information processing method
KR102203200B1 (en) Apparatus for deobfuscation and method for the same
KR101052735B1 (en) Method for detecting presence of memory operation and device using same
CN113139190A (en) Program file detection method and device, electronic equipment and storage medium
KR101583306B1 (en) Analysis method and analysis apparatus of executable file applied virtualization obfuscation
US9965621B2 (en) Program protection device
Isawa et al. Generic Unpacking Method Based on Detecting Original Entry Point
CN115659342B (en) Harmless PE file executing method and device, electronic equipment and storage medium
CN115827323B (en) Method, apparatus and computer readable medium for restoring files
JP5687593B2 (en) Analysis device, analysis method, and analysis program
JP5389734B2 (en) Extraction apparatus and extraction method
KR102421394B1 (en) Apparatus and method for detecting malicious code using tracing based on hardware and software

Legal Events

Date Code Title Description
E701 Decision to grant or registration of patent right
GRNT Written decision to grant