KR101792631B1 - Api-based software similarity measuring method and system using fuzzy hashing - Google Patents

Api-based software similarity measuring method and system using fuzzy hashing Download PDF

Info

Publication number
KR101792631B1
KR101792631B1 KR1020160091284A KR20160091284A KR101792631B1 KR 101792631 B1 KR101792631 B1 KR 101792631B1 KR 1020160091284 A KR1020160091284 A KR 1020160091284A KR 20160091284 A KR20160091284 A KR 20160091284A KR 101792631 B1 KR101792631 B1 KR 101792631B1
Authority
KR
South Korea
Prior art keywords
similarity
procedure
program
api
function
Prior art date
Application number
KR1020160091284A
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 KR1020160091284A priority Critical patent/KR101792631B1/en
Application granted granted Critical
Publication of KR101792631B1 publication Critical patent/KR101792631B1/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/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/12Protecting executable software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Pure & Applied Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Optimization (AREA)
  • Algebra (AREA)
  • Multimedia (AREA)
  • Technology Law (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The present invention relates to a method for measuring similarity of API-based software of a function using fuzzy hashing and a system thereof. The present invention provides a method and system for comparing multiple processing programs at the same time and measuring the similarity of software by comparing in a procedure unit, not the entire program unit. Further, the present invention provides a method and system for automatically comparing many programs by evaluating the similarity though a busmark in a procedure unit of all programs. According to the present invention, the method includes the steps of: (a) extracting a code area from an input program; (b) disassembling the extracted code area; (c) dividing an instruction sequence of the disassembled program to procedures; (d) generating a hash value with respect to an API call sequence of the divided procedures by using a fuzzy hash function and storing the generated hash value in a busmark database; and (e) measuring similarity of the input program by using the stored hash value.

Description

퍼지 해싱을 사용한 함수의 API 기반 소프트웨어의 유사성 측정방법 및 그 시스템{API-BASED SOFTWARE SIMILARITY MEASURING METHOD AND SYSTEM USING FUZZY HASHING}TECHNICAL FIELD [0001] The present invention relates to a method for measuring similarity of an API-based software of a function using fuzzy hashing,

본 발명은 소프트웨어 유사성 측정방법 및 측정 시스템에 관한 것으로, 보다 상세하게는 프로그램의 특성을 추출하기 위하여 하나의 프로그램을 프로시저 단위(procedure unit)으로 분류하고, 프로시저 단위로 분류된 프로그램을 이용하여 API 호출 명령어 시퀀스를 생성하고, 생성된 API 호출 명령어 시퀀스에 퍼지 해시 함수(Fuzzy hash function)을 적용하여 유사도 측정 데이터(birthmark)를 획득하는 퍼지 해싱을 사용한 함수의 API 기반 소프트웨어의 유사성 측정 시스템 및 방법에 관한 것이다.The present invention relates to a software similarity measurement method and a measurement system, and more particularly, to a software similarity measurement method and a measurement system, in which a program is classified into a procedure unit for extracting characteristics of a program, API based software similarity measurement system and method using fuzzy hashing to generate API call instruction sequence and acquire similarity measurement data (birthmark) by applying fuzzy hash function to the generated API call instruction sequence .

최근에 정보통신 기술이 발전함에 따라 software copyright infringement 에 해당하는 프라이버시(piracy), 크랙(cracked), 코드 도용(code theft)의 악의적인 행위가 진화하고 불법 소프트웨어의 배포속도가 빨라지고 있다.Recent developments in information and communication technologies have evolved piracy, cracked code theft, malicious behavior corresponding to software copyright infringement, and speeding up the distribution of illegal software.

소프트웨어 워터마킹 기술(software watermarking technique)은 소프트웨어 소유자를 식별하기 위하여 원본 소스 코드 안에 저작권 표시를 내장하는 것으로 과거에 제안되어 왔다. 하지만, 이들 워터마크 기술들은 컴파일러(compiler)의 최적화(optimization)나 시멘틱 보존 혼란(semantics-preserving obfuscation)에 의해 쉽게 훼손된다.The software watermarking technique has been proposed in the past to embed copyright notation in the original source code to identify the software owner. However, these watermark techniques are easily compromised by compiler optimizations or semantics-preserving obfuscation.

소프트웨어 버스마크 기술(software birthmark technique)은 버스마크(birthmark)의 사전적 의미가 탄생할 때부터 가지고 있는 모반, 또는 점을 의미하듯이, 모든 소프트웨어 프로그램 그 자체들 마다 가지고 있는 고유한 특징을 반영하는 기술을 말한다. 그렇기 때문에 최근에는 소프트웨어의 저작권 침해, 코드 도용을 넘어 디지털 포렌직 및 악성코드 탐지 등의 분야에 널리 사용되고 있는 기술이다.The software birthmark technique reflects the unique characteristics of every software program itself, such as the birthmark, or the point that it has since the birth of the dictionary meaning of the birthmark Technology. Therefore, it is a technology widely used in digital forensics and malicious code detection beyond the copyright infringement and code theft of software.

전통적으로 소프트웨어 버스마크(software birthmark)는 어플리케이션 프로그램(application program)의 코드를 대상으로 생성하였다. 그것들은 원본 소스 코드와 컴파일이 완료된 코드들로 구분될 수 있다. 컴파일된 프로그램 코드들은 프로그래밍 언어(programming language)와 컴파일러(compiler)에 따라서 네이티브 코드(native code or unmanaged code, machine code)와 관리 코드(managed code)로 나뉠 수 있다.Traditionally, a software birthmark has generated code for an application program. They can be distinguished from the original source code and the compiled code. Compiled program codes can be divided into native code or unmanaged code, and managed code according to a programming language and a compiler.

예를 들어 실행 환경이 Intel Microproccessor x86 과 Windows OS 라면, 네이티브 코드는 Intel instruction set 과 PE(Portable executation) 포맷(format)을 가진다. 그렇기 때문에 소프트웨어 버스마크(software birthmark)의 접근법은 관리 코드(managed code)와 네이티브 코드(native code)에 따라서 달라질 수 있다. 이하의 본 발명의 실시예에서 제안하는 소프트웨어 버스마크 접근법은 네이티브 코드(native code)를 대상으로 한다.For example, if the execution environment is Intel Microproccessor x86 and Windows OS, the native code has Intel instruction set and Portable Execution (PE) format. That's why the software birthmark approach can vary depending on managed code and native code. The software bus mark approach proposed in the following embodiments of the present invention targets native codes.

인스트럭션Instruction 기반 버스마크(Instruction-Based Birthmark) Instruction-Based Birthmark

프로그램은 기본적으로 데이터와 인스트럭션들(instructions) 로 구성된다. 인스트럭션 시퀀스(instructionn sequences)는 프로그램의 동작 행위에 대해 어느 정도 반영되기 때문에 이전 연구에서 버스마크로 자주 사용되어 졌다. The program basically consists of data and instructions. The instruction sequences are often used as bus marks in previous studies because they reflect some degree of program behavior.

구조 기반 버스마크(Structure-Based Birthmark)Structure-Based Birthmark

소프트웨어 버스마크(Software birthmark)는 프로그램(program)의 그래프 구조(graph structure)를 가지고도 제안되어졌다. 프로그램의 각 함수(function) 들 (네이티브 코드 상에서는 프로시저(Procedures))은 함수(function) 내의 스테이트먼트(statements) 사이의 의존성, acyclic graphs 처럼 클래스(class) 들 사이의 상속관계, 제어 흐름(control flow) 등으로 표현될 수 있다. 따라서 프로그램의 그래프 표현으로서 버스마크(birthmark)를 생성할 수 있다.The software birthmark has also been proposed with a graph structure of the program. Each function in the program (procedures in native code) is defined by the dependencies between statements in a function, inheritance relationships between classes, like acyclic graphs, ), And the like. Thus, a bus mark can be generated as a graphical representation of the program.

최근 API 기반 소프트웨어 버스마크(API-based software birthmark)는 Yongman Han et al., 에 의하여 제안되었다. 그들의 연구에서 버스마크(birthmark)는 프로그램의 API call sequence를 기반으로 생성하였다. 또한, 버스마크 DB(birthmark DB)를 구축하여 OSP (Online Service Provider) 나 P2P 환경에서 효율적으로 소프트웨어 저작권 침해(software copyright Infringement)를 탐지할 수 있도록 구성 되어 졌다.Recently, an API-based software birthmark was proposed by Yongman Han et al. In their study, a birthmark was generated based on the API call sequence of the program. In addition, a bus mark DB (birthmark DB) was constructed to efficiently detect software copyright infringement in OSP (Online Service Provider) or P2P environment.

그들이 제안한 버스마크(birthmark)는 한 프로그램 전체의 API 콜 시퀀스 (call sequence)를 추출하고 그것을 암호학적인 해시 함수(hash function (MD5))를 사용하여 버스마크 데이터베이스에 저장하고 비교한다. 이들은 프리 필터링(pre-filtering) 과정을 통하여 다양한 종류의 어플리케이션들을 카테고리(multimedia player, FTP client, Text Editor 등) 별로 분류할 수 있다고 하였다. 프리 필터링(pre-filtering) 처리에서는 프로그램상에 DLLs의 name 과 갯수, APIs name 과 갯수를 기반으로 처리한다.Their proposed birthmark extracts a program-wide API call sequence and stores it in the busmark database using a cryptographic hash function (MD5). They suggested that various types of applications can be classified by category (multimedia player, FTP client, text editor, etc.) through pre-filtering process. In the pre-filtering process, the name and number of DLLs, APIs name and number are processed in the program.

하지만, 그들의 연구에서 MD5의 사용은 버스마크(birthmark)의 유사성을 측정할 수 없고, 프로그램의 전체 영역에서 추출한 API call sequence 는 컴파일(compile) 시에 변경될 수 있어서 소프트웨어 버스마크(software birthmark)의 기본적인 성질인 복구성(resiliency)과 신뢰성(credibility)을 만족하지 못한다. 또한 DLLs 과 APIs 의 이름(name), 개수만을 통해 여러 프로그램의 기능적 특징을 파악하여 카테고리(category)로 분류하는 것은 현실적으로 어려운 접근법이다. However, the use of MD5 in their research can not measure the similarity of the birthmark, and the API call sequence extracted from the entire area of the program can be changed at compile time, It does not satisfy the basic properties resiliency and credibility. It is also difficult to classify the functional characteristics of various programs into categories by only using the names and numbers of DLLs and APIs.

대한민국 공개특허공보 제10-2014-0063322호(공개일자: 2014년05월27일)Korean Patent Publication No. 10-2014-0063322 (Published on May 27, 2014) 대한민국 공개특허공보 제10-2015-0051833호(공개일자: 2015년05월13일)Korean Patent Publication No. 10-2015-0051833 (published on May 13, 2015)

본 발명에 따른 퍼지 해싱을 사용한 함수의 API 기반 소프트웨어의 유사성 측정방법 및 그 시스템은 다음과 같은 해결과제를 가진다.The method and system for measuring the similarity of an API-based software of a function using the fuzzy hashing according to the present invention have the following problems.

첫째, 본 발명은 복수의 처리 프로그램을 동시에 비교할 수 있으며, 프로그램 전체가 아닌 프로시저 단위(procedure unit)의 비교를 통해 소프트웨어 유사도를 측정할 수 있는 방법 및 시스템을 제공하고자 함이다.First, the present invention aims to provide a method and a system that can compare a plurality of processing programs at the same time, and can measure software similarity through comparison of procedure units rather than the whole program.

둘째, 본 발명은 모든 프로그램의 프로시저(procedure) 단위 버스마크(birthmark)로 유사성을 평가하기 때문에, 많은 프로그램과 비교를 자동화시킬 수 있는 방법 및 시스템을 제공하고자 함이다.Second, the present invention is intended to provide a method and system that can automate many programs and comparisons because it evaluates the similarity with the procedure unit bus mark of all programs.

본 발명의 해결과제는 이상에서 언급한 것들에 한정되지 않으며, 언급되지 아니한 다른 해결과제들은 아래의 기재로부터 당업자에게 명확하게 이해될 수 있을 것이다.The present invention has been made in view of the above problems, and it is an object of the present invention to provide an apparatus and method for controlling the same.

상술한 과제를 해결하기 위한 본 발명의 제1 특징은, 퍼지 해싱을 사용한 함수의 API 기반 소프트웨어의 유사성 측정방법으로, (a) 입력받은 프로그램으로부터 코드 영역을 추출하는 단계; (b) 추출된 코드 영역을 디스어셈블링(disassembling) 하는 단계; (c) 디스어셈블링(disassembling) 된 프로그램의 인스트럭션 시퀀스(instruction sequence)를 프로시저(procedure)로 분리하는 단계; (d) 분리된 프로시저들의 API 콜 시퀀스에 대하여 퍼지 해시 함수(fuzzy hash function)를 통해 해시값을 생성하여 버스마크 DB에 저장하는 단계; 및 (e) 저장된 해시값을 이용하여 입력받은 프로그램의 유사성을 측정하는 단계를 포함한다.According to a first aspect of the present invention, there is provided a method for measuring similarity of an API-based software of a function using fuzzy hashing, comprising the steps of: (a) extracting a code area from an input program; (b) disassembling the extracted code region; (c) separating an instruction sequence of a disassembled program into a procedure; (d) generating a hash value through a fuzzy hash function on the API call sequence of the separated procedures and storing the hash value in the bus mark DB; And (e) measuring the similarity of the input program using the stored hash value.

여기서, 상기 코드 영역은, 마이크로프로세서에 의해 해석되어 실행되는 코드(code) 들의 집합인 것이 바람직하고, 상기 (b) 단계는, 추출된 코드 영역을 리커시브 디슨트 디스어셈블리(recursive decent disassembly) 방식을 이용하여 콜 인스트럭션(call instruction)에 대한 참조 프로시저(procedure) 들을 인식하는 단계를 포함하는 것이 바람직하다.Preferably, the code region is a set of codes interpreted and executed by a microprocessor. In the step (b), the extracted code region is subjected to a recursive decent disassembly And recognizing reference procedures for a call instruction using the instruction.

또한, 상기 (c) 단계는, 분리된 각각의 프로시저에서 API 콜이 발생하지 않는 프로시저를 제거하는 단계를 포함하는 것이 바람직하고, 상기 (c) 단계는, 분리된 프로시저들을 선택적으로 프로시저 DB에 저장하는 단계를 포함하는 것이 바람직하다.Preferably, the step (c) includes a step of removing a procedure in which API calls do not occur in each of the separated procedures, and the step (c) And storing it in the schedule DB.

더하여, 상기 (d) 단계는, 생성된 해시값을 실행파일에 대한 정보를 가지는 실행파일 테이블과, 실행파일 테이블과 연결된 프로시저 리스트가 구비된 리스트 테이블로 구성하여 데이터베이스에 저장하는 단계를 포함하는 것이 바람직하고, 상기 (e) 단계는, 저장된 해시값을 이용하여 입력받은 프로그램의 상기 (a) 단계 내지 (e) 단계에서 생성된 해시값을 유사도 측정함수를 통해 프로그램 유사성을 판단하는 단계인 것이 바람직하다.In addition, the step (d) may include the step of constructing the generated hash value into an executable file table having information on the executable file and a list table having a procedure list linked to the executable file table, And the step (e) is a step of judging program similarity through the similarity measurement function to the hash value generated in the steps (a) to (e) of the input program using the stored hash value desirable.

또한, 상기 유사도 측정함수는,Also, the similarity measurement function may include:

Figure 112016069854407-pat00001
Figure 112016069854407-pat00001

(여기서, ε는 문턱값을 나타내고, 각 α 및 β 두 프로그램 P 및 Q로부터 추출된 각 프로시저들에 대한 Bf를 통해 생성된 버스마크 값을 나타낸다.)와 같은 식을 만족하는 것이 바람직하다.(Where e represents a threshold value and represents a bus mark value generated through B f for each procedure extracted from the programs P and Q for each of alpha and beta) .

그리고, 본 발명의 제2 특징은, 퍼지 해싱을 사용한 함수의 API 기반 소프트웨어의 유사성 측정 시스템으로, 프로그램을 입력받아 코드 영역을 추출하는 코드 영역 추출부; 추출된 코드 영역을 디스어셈블링(disassembling) 하는 디스어셈블링부; 디스어셈블링(disassembling) 된 프로그램의 인스트럭션 시퀀스(instruction sequence)를 프로시저(procedure)로 분리하는 프로시저 분리부; 분리된 프로시저들의 API 콜 시퀀스에 대하여 퍼지 해시 함수(fuzzy hash function)를 통해 해시값을 생성하여 버스마크 DB에 저장하는 버스마크 생성부; 및 저장된 해시값을 이용하여 입력받은 프로그램의 유사성을 측정하는 유사성 측정부를 포함한다.According to a second aspect of the present invention, there is provided an API-based software similarity measuring system for a function using fuzzy hashing, comprising: a code region extracting unit for receiving a program and extracting a code region; A disassembly unit for disassembling the extracted code region; A procedure separator for separating an instruction sequence of a disassembled program into a procedure; A bus mark generating unit for generating a hash value through a fuzzy hash function on the API call sequence of the separated procedures and storing the hash value in the bus mark DB; And a similarity measuring unit for measuring the similarity of the input program using the stored hash value.

여기서, 상기 디스어셈블링부는, 추출된 코드 영역을 리커시브 디슨트 디스어셈블리(recursive decent disassembly) 방식을 이용하여 콜 인스트럭션(call instruction)에 대한 참조 프로시저(procedure) 들을 인식하는 것이 바람직하고, 상기 프로시저 분리부는, 분리된 각각의 프로시저에서 API 콜이 발생하지 않는 프로시저를 제거하는 것이 바람직하다.Here, it is preferable that the disassembling unit recognizes reference procedures for a call instruction by using a recursive decent disassembly method on the extracted code area, The procedure separator preferably removes procedures that do not cause API calls in each of the separate procedures.

또한, 상기 프로시저 분리부는, 분리된 프로시저들을 선택적으로 프로시저 DB에 저장하는 것이 바람직하고, 상기 버스마크(birthmark) 생성부는, 생성된 해시값을 실행파일에 대한 정보를 가지는 실행파일 테이블과, 실행파일 테이블과 연결된 프로시저 리스트가 구비된 리스트 테이블로 구성하여 버스마크 DB에 저장하는 것이 바람직하다.Preferably, the procedure separator selectively stores the procedures in the procedure DB, and the bus mark generator generates the generated hash value using an executable file table having information on the executable file, , And a list table having a list of procedures linked to the executable file table, and stores them in the bus mark DB.

더하여, 상기 유사성 측정부는, 저장된 해시값을 이용하여 생성된 입력받은 프로그램의 해시값을 유사도 측정함수를 통해 프로그램 유사성을 판단하는 것이 바람직하고, 상기 유사도 측정함수는,In addition, the similarity measuring unit may preferably determine the similarity of the program through the similarity measure function to the hash value of the input program generated using the stored hash value,

Figure 112016069854407-pat00002
Figure 112016069854407-pat00002

(여기서, ε는 문턱값을 나타내고, 각 α 및 β 두 프로그램 P 및 Q로부터 추출된 각 프로시저들에 대한 Bf를 통해 생성된 버스마크 값을 나타낸다.)와 같은 식을 만족하는 것이 바람직하다.(Where e represents a threshold value and represents a bus mark value generated through B f for each procedure extracted from the programs P and Q for each of alpha and beta) .

그리고, 본 발명의 제3 특징은 하드웨어와 결합되어, 상술한 퍼지 해싱을 사용한 함수의 API 기반 소프트웨어의 유사성 측정방법을 실행시키기 위하여 컴퓨터가 판독 가능한 매체에 저장된 컴퓨터프로그램을 그 특징으로 한다.And a third aspect of the present invention features a computer program stored in a computer-readable medium for executing a method of measuring the similarity of an API-based software of a function using the above-described fuzzy hashing in combination with hardware.

본 발명에 따른 퍼지 해싱을 사용한 함수의 API 기반 소프트웨어의 유사성 측정방법 및 그 시스템은 다음과 같은 효과를 가진다.The method and system for measuring similarity of API based software of a function using fuzzy hashing according to the present invention have the following effects.

첫째, 본 발명은 프로시저 단위(procedure unit) 분류된 프로그램을 이용하여 획득한 유사도 측정 데이터를 이용하여 유사도를 평가함으로써, 복수의 처리 프로그램을 동시에 비교할 수 있으며, 기존의 방법보다 효율적인 소프트웨어 유사성 측정방법 및 시스템을 제공한다.First, the present invention can compare a plurality of processing programs at the same time by evaluating the degree of similarity using the similarity measurement data obtained by using a procedure unit classified program, And a system.

둘째, 본 발명은 데이터베이스(database)에 저장되어 있는 모든 프로그램의 프로시저(procedure) 단위 버스마크(birthmark)로 유사성을 평가하기 때문에, 많은 프로그램과 비교를 자동화시킬 수 있는 소프트웨어 유사성 측정방법 및 시스템을 제공한다.Second, since the present invention evaluates the similarity by a procedure unit bus mark of all programs stored in a database, a software similarity measuring method and system that can automate many programs and comparisons, to provide.

셋째, 전체 프로그램을 대상으로 비교하였던 종래의 기술에 비해 프로시저 상에서 복제된 코드에 대해서도 탐지가 가능하고, 퍼지 해시(fuzzy hash)를 통해 축소된 버스마크 정보는 기존의 시퀀스(sequence)에 대한 비교 처리에 비해 훨씬 효율적인 소프트웨어 유사성 측정방법 및 시스템을 제공한다.Third, it is possible to detect code duplicated in the procedure as compared to the conventional technology, which is compared with the entire program, and the bus mark information reduced through the fuzzy hash can be compared with the existing sequence And provides a method and system for software similarity measurement that is much more efficient than processing.

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

도 1은 프로그램 소프트웨어의 유사성 문제를 도식화하여 나타낸 도면이다.
도 2는 프로그램의 표준 프로시저(procedure) 연결을 나타낸 모식도이다.
도 3은 종래의 PE 포맷에 있어 버스마크 추출 프로세스를 나타낸 모식도이다.
도 4는 본 발명의 실시예에 따른 퍼지 해싱을 사용한 함수의 API 기반 소프트웨어의 유사성 측정방법의 흐름을 나타낸 도면이다.
도 5는 본 발명의 실시예에 따른 퍼지 해싱을 사용한 함수의 API 기반 소프트웨어의 유사성 측정 시스템의 블록 구성을 나타낸 도면이다.
도 6은 본 발명의 실시예에 따른 퍼지 해싱을 사용한 함수의 API 기반 소프트웨어의 유사성 측정 시스템의 작동흐름(workflow)을 나타낸 도면이다.
도 7은 프로시저 기반 API 시퀀스 및 전체 API 시퀀스 사이의 비교 결과를 나타낸 그래프이다.
도 8은 동일한 카테고리 프로그램들 사이의 탑 50 API 콜 프리퀀시의 상관성 분석 결과를 나타낸 그래프이다.
BRIEF DESCRIPTION OF THE DRAWINGS Figure 1 is a schematic representation of the problem of similarity of program software.
2 is a schematic diagram illustrating a standard procedure connection of a program.
3 is a schematic diagram showing a bus mark extraction process in the conventional PE format.
4 is a flowchart illustrating a method for measuring similarity of an API-based software of a function using fuzzy hashing according to an embodiment of the present invention.
FIG. 5 is a block diagram illustrating a similarity measurement system for API-based software of a function using fuzzy hashing according to an embodiment of the present invention.
6 is a diagram showing a workflow of an API-based software similarity measurement system of a function using fuzzy hashing according to an embodiment of the present invention.
7 is a graph showing a comparison result between the procedure-based API sequence and the entire API sequence.
8 is a graph showing the results of correlation analysis of Top 50 API call frequencies between the same category programs.

본 발명의 추가적인 목적들, 특징들 및 장점들은 다음의 상세한 설명 및 첨부도면으로부터 보다 명료하게 이해될 수 있다. Further objects, features and advantages of the present invention will become more apparent from the following detailed description and the accompanying drawings.

본 발명의 상세한 설명에 앞서, 본 발명은 다양한 변경을 도모할 수 있고, 여러 가지 실시 예를 가질 수 있는바, 아래에서 설명되고 도면에 도시된 예시들은 본 발명을 특정한 실시 형태에 대해 한정하려는 것이 아니며, 본 발명의 사상 및 기술 범위에 포함되는 모든 변경, 균등물 내지 대체물을 포함하는 것으로 이해되어야 한다.Before describing the present invention in detail, it is to be understood that the present invention is capable of various modifications and various embodiments, and the examples described below and illustrated in the drawings are intended to limit the invention to specific embodiments It is to be understood that the invention includes all modifications, equivalents, and alternatives falling within the spirit and scope of the invention.

어떤 구성요소가 다른 구성요소에 "연결되어" 있다거나 "접속되어" 있다고 언급된 때에는, 그 다른 구성요소에 직접적으로 연결되어 있거나 또는 접속되어 있을 수도 있지만, 중간에 다른 구성요소가 존재할 수도 있다고 이해되어야 할 것이다. 반면에, 어떤 구성요소가 다른 구성요소에 "직접 연결되어" 있다거나 "직접 접속되어" 있다고 언급된 때에는, 중간에 다른 구성요소가 존재하지 않는 것으로 이해되어야 할 것이다.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 herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The singular expressions include plural expressions unless the context clearly dictates otherwise. In this specification, the terms "comprises" or "having" and the like refer to the presence of stated features, integers, steps, operations, elements, components, or combinations thereof, But do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, or combinations thereof.

또한, 명세서에 기재된 "...부", "...유닛", "...모듈" 등의 용어는 적어도 하나의 기능이나 동작을 처리하는 단위를 의미할 수 있다.Further, terms such as " part, "" unit," " module, "and the like described in the specification may mean a unit for processing at least one function or operation.

또한, 첨부 도면을 참조하여 설명함에 있어, 도면 부호에 관계없이 동일한 구성 요소는 동일한 참조부호를 부여하고 이에 대한 중복되는 설명은 생략하기로 한다. 본 발명을 설명함에 있어서 관련된 공지 기술에 대한 구체적인 설명이 본 발명의 요지를 불필요하게 흐릴 수 있다고 판단되는 경우 그 상세한 설명을 생략한다.In the following description of the present invention with reference to the accompanying drawings, the same components are denoted by the same reference numerals regardless of the reference numerals, and redundant explanations thereof will be omitted. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings. In the following description, well-known functions or constructions are not described in detail since they would obscure the invention in unnecessary detail.

전통적으로, 프로그램 소프트웨어 유사성 문제는 코드 도용의 검출 또는 탐색에 초점이 맞추어져 있다. 또한, 소프트웨어 유사성 문제는 프로그램 p가 복제되었거나 프로그램 q의 파생 프로그램인지를 결정하는 것이다.Traditionally, the problem of program software similarity has focused on detecting or exploring code theft. In addition, the software similarity problem is to determine whether program p is cloned or a derivative program q.

도 1은 프로그램 소프트웨어의 유사성 문제를 도식화하여 나타낸 도면이다. 소프트웨어의 유사성 문제는 도 1에 나타낸 흐름과 같이 진행되고, 이하와 같이 정의될 수 있다.BRIEF DESCRIPTION OF THE DRAWINGS Figure 1 is a schematic representation of the problem of similarity of program software. The similarity problem of the software proceeds as shown in the flow of FIG. 1 and can be defined as follows.

정의 1. (소프트웨어 버스마크(Birthmark)) 프로그램의 모든 집합을 P라고 하고, p ∈ P인 프로그램 p 가 주어진다고 하자. 그리고 В는 프로그램의 특징들의 집합을 추출할 수 있는 함수라고 하자. 다음과 같은 조건을 만족할 경우에 프로그램 p의 버스마크 В(p)를 정의 할 수 있다.Definitions 1. (software birthmarks (Birthmark)) that any set of programs and P, p ∈ P program Let p be given . And В is a function that can extract a set of program features . The bus mark В (p) of the program p can be defined if the following condition is satisfied.

- В(p)는 오직 p 자체로부터만 얻어진다.- В (p) is obtained only from p itself.

- 프로그램 q는 p의 복제이면, → В(p) = В(q)If program q is a clone of p, then В (p) = В (q)

정의 1에서와같이 소프트웨어 버스마크는 프로그램 p 그 자체에서 추출된 고유한 특징을 반영한다. 그러한 소프트웨어 버스마크(software birthmark)는 두 프로그램들의 유사성을 측정하기 위한 기술이다. 만약 두 프로그램들에서 추출한 버스마크(birthmark)의 유사성이 서로 일치한다면, 두 프로그램들은 같거나 복제(copy) 되었다고 할 수 있다.As in definition 1, the software bus mark reflects the unique characteristics extracted from the program p itself. Such a software birthmark is a technique for measuring the similarity of two programs. If the similarities of the birthmarks extracted from the two programs match each other, the two programs may be said to be the same or copied.

일반적으로 이와 같은 소프트웨어 버스마크의 유효성을 평가하기 위해서, 신뢰성 및 복구성의 두가지 특징으로 고려한다.Generally, two features of reliability and recoverability are considered in order to evaluate the effectiveness of such a software bus mark.

정의 2 (복구성(Resiliency)) 두 프로그램 또는 프로그램 구성요소 p, q ∈ P 가 있다고 하자. 그리고 B(p) → a 와 B(q) → b 는 프로그램 p 와 q 에서 추출된 버스마크 값이라고 하자. Definition 2 (Resiliency) Both programs or program components Suppose that p, q ∈ P. And B (p) → a and B (q) → b are the program Let be the bus mark value extracted from p and q .

Simp(a, b) → [0, 1] 를 프로그램에 대한 유사도를 측정하는 함수(function )라고 하고, 주어진 임계값 0 < ε < 1 값이 있다고 하자. 만약 p 와 q 가 서로 유사하고, 1 - Simp,q(a, b) < ε이라면 버스마킹 시스템(birthmarking system)은 복구적(resilient)이라고 한다.Said Sim p (a, b) → [0, 1] a similarity function (function) for measuring for the program, and is assumed that the given threshold value, 0 <ε <1 value. If p and q are similar to one another, 1 - if the Sim p, q (a, b ) <ε bus marking system (birthmarking system) is referred to as a recovery enemy (resilient).

정의 3. (신뢰성(Credibility)) p 와 q 는 서로 독립적으로 작성된 프로그램들이라고 하자. 버스마킹 시스템(birthmarking system)은 이 두 프로그램들 사이를 구별할 수 있다면, 신뢰할 수 있다고 하고, 다음의 [수학식 1]과 같이 정의할 수 있다.Definition 3. (Credibility) Let p and q be programs written independently of each other. The bus marking system can be defined as follows (Equation 1) if it can be distinguished between the two programs, and it can be trusted.

Figure 112016069854407-pat00003
Figure 112016069854407-pat00003

신뢰성(Credibility)은 독립적으로 개발된 두 프로그램들이 버스마킹 시스템(birthmarking system)을 통하여 비교할 때 그 값이 명확히 구분될 수 있는 특징(property)을 정의하였고, 복구성(Resiliency)은 일반적으로, 소프트웨어 버스마크는 원 소스 코드(original source code(managed code를 포함한))와 컴파일된 네이티브 코드(compiled native code) 두 가지 접근법으로 추출될 수 있다.Credibility defines a property that can be clearly distinguished when two independently developed programs are compared through a birthmarking system and resiliency is generally defined as a software bus Marks can be extracted in two approaches: original source code (including managed code) and compiled native code.

원 소스 코드에서 추출하는 접근법은 개발자에 의하여 작성된 코드의 플로우(flow)를 직관적으로 탐색하여 특징을 쉽게 추출할 수 있다는 장점을 가진다. 하지만, 소프트웨어 저작권 침해나 코드 도용을 탐지할 때, 일반적으로 원 소스 코드(original source code)를 가지지 않은 상황에서 수행하는 것이 더 빈번하기 때문에 현실 세계에 적용하기에는 적합하지 않다. The approach extracted from the original source code has an advantage that the feature can be easily extracted by intuitively searching the flow of the code written by the developer. However, when detecting software piracy or code theft, it is generally not suitable for real-world applications because it is more often performed in a situation that does not have original source code.

게다가, 개발자의 코딩 스타일 등이 반영되어 있기 때문에 같은 흐름의 코드 여도 다르게 분석될 수 있는 단점을 가진다. 반면, 네이티브 코드(native code) 에서 추출한 버스마크(birthmark)는 기계 코드(machine code) 만을 가지고 추출할 수 있기 때문에 원 소스 코드(original source code)를 요구하지 않는다.Moreover, since the coding style of the developer is reflected, the code of the same flow can be analyzed differently. On the other hand, the birthmark extracted from the native code does not require the original source code since it can extract only the machine code.

하지만 네이티브 코드(native code)는 플랫폼(platform: micro proccess, operating system 등)에 의존적이기 때문에 추출하기 위해서는 숙련된 전문적인 지식과 코드 흐름 분석을 위한 디스어셈블링(disassembling) 과정을 거쳐야만 한다.However, because native code is dependent on platform (micro proccess, operating system, etc.), it has to go through a disassembling process for expert knowledge and code flow analysis in order to extract it.

이에 본 발명의 과제는 네이티브 코드(native code)에서 소프트웨어 버스마크(software birthmark)를 추출하고 이를 통해 두 프로그램 또는 하나의 프로그램과 여러 프로그램에 대한 유사성을 측정할 수 있는 시스템 및 방법을 제공하고자 함이다.SUMMARY OF THE INVENTION Accordingly, it is an object of the present invention to provide a system and method for extracting a software birthmark from a native code and measuring the similarity between two programs or one program and various programs .

CTPHCTPH : Context-Triggered Piecewise Hashing: Context-Triggered Piecewise Hashing

암호적 해시 알고리즘(cryptographic hash algorithm)은 입력되는 파일을 대상으로 고정된 결과를 출력하며 출력된 결과는 고유한 값으로 두 개의 파일의 해시값(hash value)이 같으면 동일한 파일이라고 판단한다. 일반적으로 전통적인 암호적 해시 함수(cryptographic hash function)는 정보보안 분야에서 데이터의 무결성을 검증하는데 활용된다.The cryptographic hash algorithm outputs a fixed result to the input file. If the hash value of the two files is the same as the output value, it is determined that the file is the same file. In general, traditional cryptographic hash functions are used to verify the integrity of data in the field of information security.

퍼지 해시(Fuzzy hash)는 입력 값을 여러 조각으로 분리한 후 각각의 조각에 해시를 사용하여 하나의 결과를 만들 수 있기 때문에 두 입력 값 사이에 유사성을 평가할 수 있다. 초기 퍼지 해시(fuzzy hash)는 블록 기반 해시(block-based hash) 로 입력 값을 고정된 크기(size)의 블록으로 나누어 해시값(hash value)를 비교하는 방식을 사용하였다. 하지만 입력 값이 조작(삽입, 삭제, 수정)되어 오프셋이 달라지면 블록(block)의 내용이 달라지고 전체 결과에 영향을 주는 문제점이 있었다.A fuzzy hash can evaluate the similarity between two input values by separating the input values into several fragments and then using a hash in each fragments to produce a single result. The initial fuzzy hash is a block-based hash that divides input values into blocks of fixed size and compares the hash values. However, if the input value is manipulated (inserted, deleted, modified) and the offset is changed, the content of the block is changed and the whole result is affected.

이러한 문제를 해결하기 위해 Kormblumn et al., 에 의하여 CTPH(Context-To solve this problem, Kormblum et al.

Triggered Piecewise Hash) 방식이 제안되었다. CTPH는 입력 값의 문맥을 구분할 수 있는 구분자를 식별하고 구분자로 조각난 블록에 대하여 해시를 사용하는 것이다.Triggered Piecewise Hash) method has been proposed. CTPH identifies the delimiter that can distinguish the context of the input value and uses the hash for the delimited block.

예를 들어, 두 개의 문서를 비교하는 과정에서 기존의 방법은 한 페이지가 수정되어 글자가 밀리면 모든 페이지의 글자가 수정되어 두 문서의 유사성을 확인하기 어렵다는 문제점이 있었다. 하지만 CTPH는 페이지가 아니라 문단별로 구분하는 방법이어서 수정이 일어난 문단만 내용이 달라지고 나머지 문단은 변화가 없어 유사도를 확인하게 되는 것이다.For example, in the process of comparing two documents, the existing method has a problem that it is difficult to confirm the similarity of the two documents because the characters of all the pages are modified when one page is modified and the letters are pushed. However, since CTPH is a method of dividing by paragraphs, not pages, only the paragraphs in which the modifications are made are changed, and the remaining paragraphs are unchanged, thereby confirming the similarity.

또한, 2010년 카네기 멜론 대학 CERT가 지적한 것처럼 파일 전체를 대상으로 유사도를 비교하는 것은 효율성이 낮다는 문제점이 있었다. 기본적으로 프로그램 안에 내장되어 있는 코드들은 다양한 상수 값을 포함한다. 또한 이것은 같은 소스 코드에서 파생되었다고 하더라도 리컴파일(recompile) 시에 달라질 수 있다. 그러므로 전체 파일을 대상으로 추출한 해시값(hash value)으로 유사성을 판단하기에는 적절하지 않다. Also, as pointed out by the 2010 Carnegie Mellon University CERT, there was a problem in that it was not efficient to compare similarities across files. By default, the code embedded in the program contains various constant values. Also, even if it is derived from the same source code, it may change at recompile time. Therefore, the hash value extracted from the entire file is not suitable for judging the similarity.

이에 본 발명의 실시예에 따른 버스마크(birthmark)는 한 프로그램상의 프로시저들(procedures)로 분리하여 해시값 함수(fuzzy hash function)을 적용한다.Accordingly, the birth mark according to the embodiment of the present invention is divided into procedures on one program and a fuzzy hash function is applied.

정의 4. (퍼지 해시(Fuzzy Hash)) 입력값 K가 주어지고, K = {k1, k2 , ..., kn -1, kn} 는 n개의 블록을 가지고 있다고 하자. 그리고 h를 퍼지 해시(fuzzy hash)를 생성할 수 있는 함수(function)라고 하자. Suppose that define 4. (purge hash (Fuzzy Hash)) input value K is given and, K = {k 1, k 2, ..., k n -1, n k} have the n blocks. And let's say the function (function) that can generate a fuzzy hash h (fuzzy hash).

h(K) → A를 입력값 K에 대한 퍼지 해시값(fuzzy hash value)라고 했을 때 A는 다음의 조건을 만족한다고 정의한다.When that h (K) → purge hash value for an input value of K A (fuzzy hash value) A defines that satisfy the following conditions.

- A = {a1, a2, ..., an -1, an} 라고 할 때 각 ai 는 ki와 일대일 대응 관계이고, ki 를 대표한다. - A = to as {a 1, a 2, ... , a n -1, a n} for each i and a i k is a one-to-one relationship, and represents the k i.

- h(K) → A를 얻은 후, 블록 ki ∈ K 가 특정 조작이나 수정에 의해서 값이 바뀌어서 h(K') → A' 를 얻었을 때도 A ∼ A' 이어야 한다. - h (K) - &gt; A , When k i ∈ K is changed by a specific operation or modification, h (K ') → A' is obtained, it should be A ~ A ' .

본 발명에서 정의 4.와 같이 특정 조건들을 만족하는 경우에 퍼지 해시 함수(fuzzy hash function) h로서 정의한다. 퍼지 해시 함수(fuzzy hash function)를 프로그램의 특징에 적용하면 그 성질로 인해 프로그램 사이에 유사성을 측정할 수 있다.In the present invention, fuzzy hash function h is defined as a case where certain conditions are satisfied. Applying a fuzzy hash function to a program feature allows you to measure the similarity between programs due to its nature.

이하의 본 발명의 실시예에서는 함수(function)와 프로시저(procedure)를 의미상 구분하여 표기한다. 함수(function)는 관리 코드(managed code)나 원본 소스 코드(original source code) 상에서 사람에 의해 의미상으로 구분될 수 있는 것으로 정의한다. 그리고 프로시저(procedure)는 네이티브 코드(native code) 상에서 기계(machine)에 의해 구분될 수 있는 것으로 정의한다.In the following embodiments of the present invention, a function and a procedure are denoted by meaning. A function is defined as a managed code or an original source code that can be semantically separated by a person. And procedures are defined as being distinguishable by machine on native code.

각 프로시저는 프롤로그 시퀀스와 에필로그 시퀀스를 갖는데, 프로시저 프롤로그는 프로시저 내부에서 사용할 스택과 레지스터들을 준비하는 프로시저 시작부분에 코드의 한 작은 라인이다. 유사하게 프로시저 에필로그는 프로시저의 끝에 나타나며, 스택과 레지스터들을 프로시저를 호출하기 전 상태로 복원하는 역할을 한다. 도 2는 표준 프로시저 연결을 나타낸 모식도이다. Each procedure has a prologue sequence and an epilogue sequence. The procedure prologue is a small line of code at the beginning of the procedure that prepares the stack and registers for use within the procedure. Similarly, the procedure epilogue appears at the end of the procedure and restores the stack and registers to their state before calling the procedure. Figure 2 is a schematic diagram illustrating a standard procedure connection.

정의 5. (프로시저(Procedure)) 주어진 프로그램 P에 속한 프로시저 들의 전체 집합을 Pf 라고 하고, |Pf | = n 를 Pf 의 크기(size) 라고 하자. 그러면, Pf = {f1, f2, ..., fn -1, fn}로 정의할 수 있다. 우리는 다음의 속성을 만족했을 때 fi 를 프로그램 P 의 프로시저라고 한다. Definition 5. (Procedure) A given program Procedures belonging to P And that the entire set of P f, | Pf | Let = n be the size of P f (size) . Then , P f = {f 1 , f 2 , ..., f n -1 , f n } can be defined . We have f i program P is called a procedure .

- fi 는 프로그램 P가 실행되었을 때 최소한 한번 이상은 호출되는 인스트럭션(instruction) 들의 집합이다.- f i is a set of instructions that are called at least once when program P is executed.

- fi 가 fj 로부터 호출되었다면, fi 는 반드시 fj 로 돌아갈 수 있는 인스트럭션(instruction) (즉, 에필로그)들을 포함해야만 한다.- If f i is called from f j , f i must contain instructions (ie epilogues) that can be returned to f j .

- fi 가 다른 fj로 제어권을 넘길 때는 콜 인스트럭션(call instruction)을 통해서만 가능하고, 그것이 fj 의 프롤로그(prologue)이다.- When f i passes control to another f j , it is only possible through a call instruction, which is a prologue of f j .

- 콜 인스트럭션(call instruction)에 의해서 호출되는 fi 는 프로그램 P에 내장된 인스트럭션(instruction)의 집합이나 특정 참조 값이어야만 한다.(API도 포함하는 성질)- f i called by a call instruction must be a set of instructions embedded in the program P or a specific reference value (property including the API).

본 발명의 실시예에서는 정의 5.에 의하여 프로그램의 디스어셈블링(disassembling) 된 인스트럭션(instruction) 들의 시퀀스(sequence)에서 프로시저(procedure) 들을 분리하여 버스마크(birthmark)를 추출한다. 하지만 API call 을 포함하지 않은 프로시저와 프로시저 범위에 속하지 않은 인스트럭션(instruction) 들은 제외한다. 그 이유는 본 발명의 실시예에서 제안하는 소프트웨어 버스마크로 유사성을 측정하기 위해서는 프로그램의 정확한 특징이 반영되어야 하고, 그러기 위해서는 데이터 노이즈(data noise)를 최소한으로 줄여야 하기 때문이다.In an embodiment of the present invention, a procedure is extracted from a sequence of instructions disassembled according to the definition 5 to extract a birthmark. However, it excludes procedures that do not contain API calls and instructions that are not procedural. The reason for this is that in order to measure the similarity to the software bus mark proposed in the embodiment of the present invention, accurate characteristics of the program must be reflected and data noise should be minimized.

그리고, 종래기술(Yongman Han et al.)에 의해 제안된 최신 소프트웨어 버스마크 기술로서, 온라인 서비스 프로바이더(OSP)나 P2P 네트워크 상에서 악의적인 프로그래머나 비인가된 사용자에 의해 발생하는 불법적인 소프트웨어 복사나 배포를 탐지하고, 차단, 제거하는 소프트웨어 버스마크 시스템을 제안하였다.The latest software bus mark technology proposed by the prior art (Yongman Han et al.) Is an illegal copying or distribution of illegal software caused by a malicious programmer or an unauthorized user on an online service provider (OSP) or P2P network A software bus mark system that detects, blocks,

그러나, 종래기술에 의해 제안한 버스마크 시스템은 세 가지 문제점을 가진다. 첫번째로, DLLs 이름과 API 갯수를 통해 정확한 카테고리를 분류할 수 없다. API는 운영 시스템(Operating System)에서 어플리케이션을 개발하는 개발자들에게 제공하는 함수들의 리스트로 정의될 수 있다. 특히, 윈도우 시스템(Windows System)은 API 들을 DLL로 캡슐화된 모듈을 공유 메모리에 적재하여 다양한 어플리케이션이 사용할 수 있도록 제공한다. However, the bus mark system proposed by the prior art has three problems. First, you can not categorize the correct categories through the DLLs name and number of APIs. An API can be defined as a list of functions provided to developers who develop applications in an operating system. In particular, the Windows system loads the APIs encapsulated in a DLL into a shared memory so that it can be used by various applications.

DLLs 를 기능상으로 구분한다면 수많은 DLLs 로 분리되어 메모리에 항상 상주하여야 하기 때문에 윈도우 시스템은 특정한 계층으로 구분하여 그 개수로 줄여서 메모리에 상주시킨다. 그렇기 때문에 기능상으로 명확히 구분되지 않은 USER32.dll, KERNEL32.dll, ADVAPI32.dll 등의 이름만을 가지고 어플리케이션의 성격을 구분할 수 없다. 또한, 최근에는 시용자의 요구에 따라 복합적인 기능을 하는 어플리케이션들이 등장하면서 단순히 API 호출 횟수만으로 어플리케이션의 특징을 판단하기가 어렵다. 예를 들어, 최근 등장하는 텍스트 편집(text editor) 프로그램은 이미지를 편집할 수 있는 기능을 가지고 있고, 클라우드 서버와 동기화하여 파일을 저장한다. 이러한 경우 텍스트 편집(text editor) 프로그램의 APIs 은 기본적으로 텍스트 편집 기능과 네트워크, 이미지 관련 APIs을 내장하기 때문에 실제 그러한 기능을 하는 어플리케이션들과 유사할 가능성이 있다.If the DLLs are functionally separated, they must be separated into many DLLs and always reside in memory. Therefore, the window system is divided into specific hierarchies, and the number of DLLs is reduced to the number of the DLLs. For this reason, it is not possible to distinguish the nature of the application by only names such as USER32.dll, KERNEL32.dll, and ADVAPI32.dll that are not clearly distinguished by function. In addition, in recent years, it has been difficult to judge the characteristics of an application merely by the number of API calls with the appearance of applications having a complex function according to a request of a user. For example, a recent text editor program has the ability to edit images and stores files in sync with the cloud server. In this case, the APIs of the text editor program are basically similar to the applications having the text editing function and the network and image-related APIs.

두번째로, API 콜 시퀀스(call sequence) 가 프로그램 전체 영역에 대해 추출 됐다. 일반적으로 프로그램 소스 코드가 컴파일될 때, 컴파일러는 원본 소스 코드의 함수들을 최대한 그대로 반영한다. 특히, API call 명령어의 경우, 원본 소스코드의 특정 함수에서 호출하였다면, 컴파일된 프로그램의 명령어 시퀀스에서도 해당 함수 영역 내에 존재한다. Second, an API call sequence was extracted for the entire program area. Generally, when the program source code is compiled, the compiler reflects the functions of the original source code as much as possible. In particular, in the case of an API call instruction, if it is called from a specific function of the original source code, the instruction sequence of the compiled program also exists in the corresponding function area.

따라서, 같은 소스코드라 하여도, 컴파일 시에 위치상으로 함수의 영역이 변경되었다면, 다른 API 콜 시퀀스(call sequence)가 발생할 수 있으며, 이것은 우회의 가능성을 포함한다.Thus, even with the same source code, if the area of the function is changed in position at compile time, another API call sequence can occur, including the possibility of bypassing.

이에 본 발명의 실시예에서 제안한 소프트웨어 버스마크 시스템은 하나의 프로그램에서 프로시저들(procedures)로 분리된 API 콜 시퀀스(call sequence)로 구성하기 때문에 컴파일 시에 변경될 수 있는 함수의 위치에 영향을 받지 않는다는 장점이 있다.Accordingly, since the software bus mark system proposed in the embodiment of the present invention is composed of an API call sequence separated into procedures in one program, it affects the position of a function that can be changed at compile time It has the advantage of not receiving.

마지막으로, 프로그램의 특징에 대한 유사성을 판단하는데 암호학적인 해쉬함수 사용은 적절하지 않다. 전통적으로 소프트웨어 버스마크는 프로그램 사이에 유사성을 측정하기 위하여 연구되어 왔다. 그렇기 때문에 Software Birthmark System 는 프로그램 사이에 유사성을 측정할 수 있도록 설계되어야만 한다. Finally, it is not appropriate to use cryptographic hash functions to determine similarities to program features. Traditionally, software bus marks have been studied to measure similarities between programs. Therefore, the Software Birthmark System must be designed to measure similarities between programs.

상술한 Yongman Han et al.에 의해 제안한 버스마크 시스템은 API 콜 시퀀스(call Sequence)에 암호학적인 해시 함수를 사용한다. 암호학적인 해시 함수는 일방향 함수로서 원본 데이터가 조금만 변경 되어도 전혀 다른 값을 출력하는 특성 때문에 데이터의 무결성 검증에 주로 사용된다 The bus mark system proposed by Yongman Han et al. Described above uses a cryptographic hash function for the API call sequence. A cryptographic hash function is a one-way function that is mainly used to verify the integrity of data because of its ability to output a completely different value even if the original data is slightly changed

예를 들어, 도 3과 같이 서로 유사한 API 콜 시퀀스(Call Sequence) 한 쌍이 주어졌을 때, MD5 와 같은 암호학적인 해시 함수는 전혀 다른 값을 출력한다. 하지만 앞서 설명한 CTPH와 같은 퍼지 해시 함수는 원본 데이터의 유사성을 유지시켜준다. 따라서 두 데이터의 유사성을 평가하기에는 암호학적인 해시 함수 보다는 퍼지 해시 함수(fuzzy hash function)을 사용하는 것이 더 적절하다.For example, when a pair of similar API call sequences are given as shown in FIG. 3, a cryptographic hash function such as MD5 outputs a completely different value. However, a fuzzy hash function such as the CTPH described above maintains the similarity of the original data. Therefore, it is more appropriate to use the fuzzy hash function rather than the cryptographic hash function to evaluate the similarity of the two data.

이에 본 발명의 실시예에서는 상술한 문제점을 개선하고자 퍼지 해싱을 사용한 함수의 API 기반 소프트웨어의 유사성 측정 시스템 및 방법을 제안한다.In order to solve the above-mentioned problems, the embodiment of the present invention proposes a similarity measurement system and method for API based software of a function using fuzzy hashing.

이하에서 본 발명의 바람직한 실시예를 도면을 참조하여 상세히 설명하기로 한다.Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the drawings.

도 4는 본 발명의 실시예에 따른 퍼지 해싱을 사용한 함수의 API 기반 소프트웨어의 유사성 측정방법의 흐름을 나타낸 도면이고, 도 5는 본 발명의 실시예에 따른 퍼지 해싱을 사용한 함수의 API 기반 소프트웨어의 유사성 측정 시스템(10)의 블록 구성을 나타낸 도면이다.FIG. 4 is a flowchart illustrating a method for measuring similarity of API-based software of a function using fuzzy hashing according to an embodiment of the present invention. And a block diagram of the similarity measurement system 10.

도 4에 나타낸 바와 같이, 본 발명의 실시예에 따른 퍼지 해싱을 사용한 함수의 API 기반 소프트웨어의 유사성 측정방법은, (a) 입력받은 프로그램으로부터 코드 영역을 추출하는 단계; (b) 추출된 코드 영역을 디스어셈블링(disassembling) 하는 단계; (c) 디스어셈블링(disassembling) 된 프로그램의 인스트럭션 시퀀스(instruction sequence)를 프로시저(procedure)로 분리하는 단계; (d) 분리된 프로시저들의 API 콜 시퀀스에 대하여 퍼지 해싱 함수를 통해 해시값을 생성하여 버스마크 DB에 저장하는 단계; 및 (e) 저장된 해시값을 이용하여 입력받은 프로그램의 유사성을 측정하는 단계를 포함하여 구성된다.As shown in FIG. 4, an API-based software similarity measurement method of a function using fuzzy hashing according to an embodiment of the present invention includes: (a) extracting a code region from an input program; (b) disassembling the extracted code region; (c) separating an instruction sequence of a disassembled program into a procedure; (d) generating a hash value through a fuzzy hashing function for the API call sequence of the separated procedures and storing the hash value in the bus mark DB; And (e) measuring the similarity of the input program using the stored hash value.

그리고, 도 5에 나타낸 바와 같이, 본 발명의 실시예에 따른 퍼지 해싱을 사용한 함수의 API 기반 소프트웨어의 유사성 측정 시스템(10)은, 프로그램을 입력받아 코드 영역을 추출하는 코드 영역 추출부(100); 추출된 코드 영역을 디스어셈블링(disassembling) 하는 디스어셈블링부(200); 디스어셈블링(disassembling) 된 프로그램의 인스트럭션 시퀀스(instruction sequence)를 프로시저(procedure)로 분리하는 프로시저 분리부(300); 분리된 프로시저들의 API 콜 시퀀스에 대하여 퍼지 해싱 함수를 통해 해시값을 생성하여 버스마크 DB에 저장하는 버스마크 생성부(400); 저장된 해시값을 이용하여 입력받은 프로그램의 유사성을 측정하는 유사성 측정부(500)를 포함하여 구성된다.5, the API-based software similarity measurement system 10 of a function using fuzzy hashing according to an embodiment of the present invention includes a code area extraction unit 100 for receiving a program and extracting a code area, ; A disassembly part (200) for disassembling the extracted code area; A procedure separator 300 for separating an instruction sequence of a disassembled program into a procedure; A bus mark generating unit 400 for generating a hash value through a fuzzy hashing function with respect to an API call sequence of separated procedures and storing the generated hash value in a bus mark DB; And a similarity measuring unit 500 for measuring the similarity of the inputted program using the stored hash value.

여기서, 코드 영역 추출부(100), 디스어셈블링부(200), 프로시저 분리부(300), 버스마크 생성부(400) 및 유사성 측정부(500)를 포함하여 구비되는 소프트웨어 유사성 측정 시스템(10)은 상술한 소프트웨어 유사성 측정방법을 실행시키기 위한 컴퓨팅 장치 또는 마이크로프로세서를 구비한 연산장치일 수 있고, 각 구성 요소는 컴퓨팅 장치에 구비된 장치 요소에 의해 구분되는 구성요소일 수 있고, 하나의 프로세서에 의해 구분되는 구성요소일 수 있다.Here, the software similarity measurement system 10 (including the code domain extraction unit 100, the disassembly unit 200, the procedure separation unit 300, the bus mark generation unit 400, and the similarity measurement unit 500) May be a computing device or a computing device having a microprocessor for executing the above-described method for measuring software similarity, each of which may be a component separated by a device element included in the computing device, As shown in FIG.

이하에서 보다 구체적으로 본 발명의 실시예에 따른 퍼지 해싱을 사용한 함수의 API 기반 소프트웨어의 유사성 측정방법 및 그 측정 시스템을 도면을 참조하여 단계적으로 상세히 설명하기로 한다.Hereinafter, a method for measuring the similarity of an API-based software of a function using fuzzy hashing according to an embodiment of the present invention and a measurement system thereof will be described step by step with reference to the drawings.

특징 추출(Feature Extraction)Feature Extraction

여기서 소프트웨어 버스마크(Software birthmark)는 프로그램의 고유한 특징으로 정의될 수 있다. Here, the software birthmark can be defined as a unique feature of the program.

본 발명의 실시예에서 제안하는 소프트웨어 유사성 측정 시스템(10)은 배포가 완료된 네이티브 코드(native code)를 가지는 프로그램들에서 그들 안에 API 콜(call)을 포함하는 프로시저를 기반으로 한다. 즉, 하나의 프로그램 안에서 우리는 다음과 같은 특징을 추출한다.:The software similarity measurement system 10 proposed in the embodiment of the present invention is based on a procedure including an API call in programs with native codes that have been distributed. In other words, in one program we extract the following features:

- API 콜을 포함하는 프로시저 세트(set)- a set of procedures (API calls)

- 각 프로시저의 API 콜 시퀀스들(call sequence)API call sequences of each procedure

- 대상 프로그램에 심어진 DDLLs 및 APIs 정보- DDLLs and APIs information embedded in the target program

종래기술(Yongman Han et al.)에 의해 제안한 방법은 프로그램 전체 영역에 대한 API 콜 시퀀스(call sequence)를 특징으로 추출하였고, 그것을 MD5 해시 함수를 통하여 버스마크를 생성하였다. The method proposed by Yongman Han et al. Is characterized by extracting an API call sequence for the entire program area and generating a bus mark through the MD5 hash function.

프로그램은 기본적으로 함수들로 구성된다. 그렇기 때문에 프로그램의 전체 영역을 대상으로 시퀀스를 만드는 것은 적절하지 않다. 또한 암호학적 해시 함수는 원본 데이터가 조금만 변경되어도 전혀 다른 값을 출력하기 때문에 소프트웨어 버스마크의 처음 동기(motivation)인 유사성 측정에는 적합하지 않다. The program basically consists of functions. Therefore, it is not appropriate to create a sequence for the entire area of the program. In addition, the cryptographic hash function is not suitable for similarity measurement, which is the initial motivation of the software bus mark because the original data is slightly changed even if the original data is slightly changed.

본 발명의 실시예에 따른 소프트웨어 유사성 측정 시스템(10)은 프로그램의 특징을 추출하기 위하여 처음 디스어셈블링한 프로그램 내의 인스트럭션들(instructions)을 함수 단위로 구분한다. 다음, 각 함수 내의 콜(call) 명령어 중에서 API 를 호출하는 명령어들의 시퀀스를 생성한다. 마지막으로 함수의 API 콜 시퀀스 들은 퍼지 해시 함수(fuzzy hash function) h에 의하여 그것의 고유한 값을 생성하고 버스마크 데이터베이스에 저장한다.The software similarity measurement system 10 according to the embodiment of the present invention classifies instructions in a program that is first disassembled in order to extract the characteristics of the program. Next, a sequence of instructions for calling the API among the call instructions in each function is generated. Finally, the API call sequences of the functions generate their own values by the fuzzy hash function h and store them in the bus mark database.

상술한 바와 같이, 데이터의 유사성을 측정하기 위한 퍼지 해시 함수(fuzzy hash function) 역시 전체 데이터를 대상으로 적용하는 것이 적절하지 않기 때문에, 본 발명의 실시예에서는 프로그램 내에서 규칙적인 단위로 구분 가능한 프로시저들에 퍼지 해시 함수(fuzzy hash function)을 적용하여 적절하게 사용한다.As described above, since the fuzzy hash function for measuring the similarity of data is also not suitable to be applied to the entire data, in the embodiment of the present invention, Apply the fuzzy hash function to the scissors appropriately.

버스마크 생성(Generating Birthmark)Generating Birthmark

본 발명의 실시예에서 버스마크(birthmark)는 한 프로그램의 분리된 프로시저들(procedures) 상에 API 콜 시퀀스를 기반으로 한다. 주어진 한 프로그램 P 상에 프로시저의 전체 집합 Pf는 각각의 다음의 [수학식 2]으로 나타낸다.In an embodiment of the present invention, a birthmark is based on an API call sequence on separate procedures of a program. On a given program P, the entire set of procedures P f is represented by Equation (2) below.

Figure 112016069854407-pat00004
Figure 112016069854407-pat00004

여기서, m은 하나의 프로시저에 있는 API 콜 시퀀스의 크기이고, APIm 은APIi ∈ Pf 인 API 콜 시퀀스(call sequence)를 의미한다. 이때 버스마킹 프로시저(birthmarking procedure)는 다음과 같이 정의한다.Where m is the size of the API call sequence in a procedure, and API m is an API call sequence with API i ∈ P f . At this time, the birth marking procedure is defined as follows.

정의 6. (Birthmarking procedure) 주어진 프로그램 P에 대한 프로시저 f ∈ Pf 가 있다고 하자. 그리고 Bf 는 프로시저에 대한 버스마크(birthmark)를 생성하는 함수라고 하고 하자. 프로시저 버스마크(procedure birthmark) Bf(fi)는 다음의 [수학식 3]과 같이 정의한다.Definition 6. (Birthmarking procedure) Suppose there is a procedure f ∈ P f for a given program P. Let B f be a function that creates a birthmark for the procedure. The procedure bus mark B f (f i ) is defined as the following equation (3).

Figure 112016069854407-pat00005
Figure 112016069854407-pat00005

여기서, h는 정의 4.에 의해 정의된 퍼지 해시 함수를 나타내고, 한 프로그램에서 각각 추출된 프로시저 버스마크(procedure birthmark)는 유사성 측정을 위해 퍼지 해시 함수(fuzzy hash function)를 통해 값을 생성한다. 상술한 종래의 버스마크(Yongman Han et al.)는 한 프로그램의 전체 영역에서 추출한 API 콜 시퀀스에 대해 암호학적 해시 함수인 MD5를 통해 값을 생성한다. Here, h represents the fuzzy hash function defined by Definition 4., and the procedure busmark extracted from each program in one program generates a value through a fuzzy hash function for similarity measurement . The above-mentioned conventional bus mark (Yongman Han et al.) Generates a value through the cryptographic hash function MD5 for the API call sequence extracted from the entire area of one program.

이 방법은 앞서 설명한 바와 같이, 몇 가지 문제점을 가지고 있기 때문에, 본 발명의 실시예에서는 이를 개선하기 위하여 각 프로시저에서 추출한 m개의 API 코콜 시퀀스{API1,API2, ...,APIm}에 대해 퍼지 해시 함수(fuzzy hash function) h를 적용한다.([수학식 3] 참조)As described above, the method has some problems. Therefore, in order to improve the above-mentioned problem, m API cocole sequences {API 1 , API 2 , ..., API m } A fuzzy hash function h is applied (see Equation 3)

정의 7. (Program Birthmark) 주어진 프로그램 P에서 싸이즈 n을 가지는 프로시저 들의 전체 집합 P = {f1, f2, ..., fn} 이 있다고 하자. 프로그램 버스마크 함수 Bp는 프로시저 버스마크 Bf(fi)에 의하여 |Pf| = |Bp| → n 길이를 가지는 Bf(fi)리스트로 정의하고 다음의 [수학식 4]와 같이 정의될 수 있다.Definition 7. (Program Birthmark) A procedure with size n in a given program P Let P = {f 1 , f 2 , ..., f n } be the complete set of The program bus mark function B p is defined as | Pf | by the procedure bus mark B f (f i ) = | Bp | → n defined by f B (f i) having a length and a list can be defined as the following equation 4].

Figure 112016069854407-pat00006
Figure 112016069854407-pat00006

퍼지 해싱을 이용한 유사성 측정Similarity measurement using fuzzy hashing

본 발명의 실시예에서 사용하는 퍼지 해시 함수(Fuzzy hash function)는 상술한 CTPH(Context-Triggered Piecewise Hashing) 이다. CTPH의 spamsum 알고리즘은 실제 USENET 뉴스 리더(newsreader)를 위해 개발된 편집 거리 포뮬러(edit distance formula)의 가중치된 버전(version)을 사용한다. The fuzzy hash function used in the embodiment of the present invention is the above-mentioned Context-Triggered Piecewise Hashing (CTPH). The CTPH spamsum algorithm uses a weighted version of the edit distance formula developed for the actual USENET newsreader.

명확성을 기하기 위해, 상기 가중치된 편집 거리(edit distance)는 [수학식 6] 및 [수학식 7]에 의해 표현된 s1 및 s2로 주어진 e(s1, s2)로 정의된다. 여기서, i는 삽입(insertions)의 수이고, d는 삭제(deletions)의 수이며, c는 변화(changes)의 수이고, w는 스왑(swaps)의 수이다. 그리고, l1 및 l2는 s1 및 s2의 각 길이들이다. For the sake of clarity, the weighted edit distance is defined as e (s1, s2) given by s1 and s2 expressed by [Equation 6] and [Equation 7]. Where i is the number of insertions, d is the number of deletions, c is the number of changes, and w is the number of swaps. And, l 1 and l 2 are the respective lengths of s1 and s2.

Figure 112016069854407-pat00007
Figure 112016069854407-pat00007

Figure 112016069854407-pat00008
Figure 112016069854407-pat00008

Figure 112016069854407-pat00009
Figure 112016069854407-pat00009

편집 거리(edit distance)는 0 - 64에서 0 - 100으로 리스케일(rescale) 되고, 0은 호몰로지(homology)가 없는 것으로(no homology) 전환되고, 100은 거의 동일한 파일로 여겨진다. 다음의 [수학식 8]에 의해 산출되는 길이 l1 과 l2의 스트링에 대한 최종 매치 점수 M은 다음의 [수학식 8]에 의해 산출된다.The edit distance is rescaled from 0-64 to 0-100, 0 is converted to no homology (no homology), and 100 is considered to be almost the same file. The final match score M for strings of lengths l 1 and l 2 calculated by the following formula (8) is calculated by the following formula (8).

Figure 112016069854407-pat00010
Figure 112016069854407-pat00010

여기서, S는 리스케일 상수를 나타내고, 0 - S에서 부터 0 - 100까지 파일 유사성 정도로 리스케일되고 전환된다. 예를 들어, S=64이고, 0은 100으로 리스케일 될 때, 동일한 파일로 인정된다. 그리고, S=64가 0으로 리스케일 될 때, 호몰로지가 없는 것으로 인정된다.(no homology) 디폴트 값인 S = 64 일때, S 및 64의 항목들은 삭제된다.Where S represents the rescale constant and is rescaled and converted to a degree of file similarity from 0 - S to 0 - 100. For example, when S = 64 and 0 is rescaled to 100, it is recognized as the same file. Then, when S = 64 is rescaled to 0, it is recognized that there is no homology. (No homology) When S = 64 which is the default value, S and 64 items are deleted.

본 발명의 실시예에서는 최종적으로 매치 점수(match score) M에 대한 다음의 [수학식 9]를 프로시저 버스마크에 대한 유사성 측정 함수(similarity function) Simf 로서 정의한다. Bf(f1) → α 및 Bf(f2) → β는 주어진 두 개의 프로시저 각 f1 및 f2들로부터 얻어진다고 가정한다.In the embodiment of the present invention, the following equation (9) for the match score M is finally defined as a similarity function Sim f for the procedure bus mark. It is assumed that B f (f 1 ) → α and B f (f 2 ) → β are obtained from the two given procedure angles f 1 and f 2 .

Figure 112016069854407-pat00011
Figure 112016069854407-pat00011

프로그램 유사성 측정Program similarity measurement

본 발명의 실시예의 과제는 두 프로그램 사이의 유사성을 측정하는 것이므로, 이를 위하여 앞에서 한 프로그램상의 API call 이 발생하는 프로시저 들의 집합을 통하여 퍼지 해시(fuzzy hash)를 사용한 프로시저 버스마크(procedure birthmark)의 리스트(list)를 생성하였다. 프로시저 버스마크 리스트(procedure birthmark list)를 통하여 두 프로그램 사이의 유사성을 측정한다.The task of the embodiment of the present invention is to measure the similarity between the two programs. For this purpose, a procedure birth mark using a fuzzy hash is used through a set of procedures in which an API call on the program is generated. &Lt; / RTI &gt; Measure the similarity between the two programs through the procedure's birthmark list.

유사성 측정은 다이스 계수(Dice coefficient) 또는 소렌슨 인덱스(Sorensen Index)로 알려졌고, 정보 복구(information retrieval)에 사용된다. 본 발명의 실시예에서는 이것을 확장하여 두 프로그램 사이에 유사성을 측정하는 함수를 다음과 같이 정의한다.Similarity measures are known as the Dice coefficient or Sorensen Index and are used for information retrieval. In the embodiment of the present invention, a function for measuring similarity between two programs is defined as follows.

정의 8. (Program Similarity)Definition 8. (Program Similarity)

두 개의 프로그램 또는 구성요소 P, Q ∈ Р가 있다고 가정한다. Bf(fi ∈ P) → αi 및 Bf(fi ∈ Q) → βi 가 버스마킹 프로시저 함수 Bf에 의해 추출된 버스마크 값들이라고 한다. 그리고 나서, 프로그램 유사성은 다음의 [수학식 10]에 의해 정의된다.Suppose there are two programs or components P, Q ∈ Р. B f (f i ∈ P) → α i and B f (f i ∈ Q) → β i are the bus mark values extracted by the bus marking procedure function B f . Then, the program similarity is defined by the following equation (10).

Figure 112016069854407-pat00012
Figure 112016069854407-pat00012

여기서, n 및 k는 프로그램 P 및 Q에 대한 API 콜(call)들을 포함하는 프로시저들의 수를 나타내고, 각 αi 및 βi 는 두 프로그램 P 및 Q로부터 추출된 각 프로시저들에 대한 Bf를 통해 생성된 값들이다.Where n and k denote the number of procedures including API calls for programs P and Q, and [alpha] i and [beta] i for each procedure extracted from both programs P and Q, Bf .

실행(Implementation)Implementation

이하에서는 본 발명의 실시예에서 제안하는 유사성 측정 시스템(10)(birthmarking system)을 보다 구체적으로 설명한다. 본 발명의 실시예에 따른 소프트웨어 유사성 측정 시스템(10)은 총 5단계를 거치는데, 최초 프로그램을 입력받아 4단계를 거쳐서 추출된 버스마크(birthmark)를 데이터베이스(버스마크 DB)에 저장한다. 이후 2단계를 거쳐서 프로시저들, 혹은 다른 프로그램 전체와 유사성을 측정한다. 이에 대한 전체적인 워크플로우(workflow)는 도 6에 나타낸다.Hereinafter, the similarity measuring system 10 (birthmarking system) proposed in the embodiment of the present invention will be described in more detail. The software similarity measurement system 10 according to the embodiment of the present invention carries out a total of five steps. The first step receives the first program and stores the extracted birthmark in the database (bus mark DB) through four steps. Then, through two steps, measure the similarity with the procedure or the whole other program. The overall workflow for this is shown in Fig.

본 발명의 실시예에 따른 소프트웨어 유사성 시스템(birthmarking system)은 총 5단계를 거쳐서 유사성을 평가한다. 이전 연구의 대부분은 두 프로그램 만을 대상으로 유사성을 평가하기 위해서 제안되어왔으나, 본 발명의 실시예에서 제안한 시스템은 데이터베이스(database)에 저장되어 있는 모든 프로그램의 프로시저(procedure) 단위 버스마크(birthmark)로 유사성을 평가하기 때문에, 많은 프로그램과 비교를 자동화시킬 수 있는 장점이 있다. A software similarity system according to an embodiment of the present invention evaluates similarity through a total of five steps. Most of the previous researches have been proposed for evaluating the similarity of only two programs. However, the system proposed in the embodiment of the present invention is not limited to the procedure unit of every program stored in the database, Because of its similarity, it has the advantage of automating many programs and comparisons.

또한, 버스마크(birthmark)는 프로시저(procedure) 단위로 분리되어 저장되기 때문에 전체 프로그램이 아닌 부분적인 유사성을 측정할 수 있고, 이것은 전체 프로그램을 대상으로 비교하였던 종래의 기술에 비해 프로시저 상에서 복제된 코드에 대해서도 탐지가 가능하다. 그리고, 퍼지 해시(fuzzy hash)를 통해 축소된 ㅂ버버스마크 정보는 기존의 시퀀스(sequence)에 대한 비교 처리에 비해 훨씬 효율적이다.In addition, since the birthmark is stored separately in procedure units, partial similarity can be measured rather than the whole program. This is because, compared with the conventional technology in which the entire program is compared, It is also possible to detect the code. Also, the reduced bus bar mark information through the fuzzy hash is much more efficient than the comparison process for existing sequences.

단계 1((a) 단계): Step 1 (step (a)):

코드 영역 추출부(100)는 입력받은 프로그램 p 상에 코드 영역을 추출한다. 여기서 코드 영역이란, 마이크로프로세서(microprocessor)에 의해 해석되어 실행되는 코드들의 집합을 의미한다. 실행 가능한 파일은 운영체제에 따라서 특정 포맷을 가진다. 예를 들어, Windows 플랫폼의 경우 PE 포맷을 가지고, 유닉스, 리눅스 계열의 운영체제는 ELF 나 COFF 에 해당하는 포맷을 가진다.The code region extracting unit (100) extracts a code region on the received program p. Here, the code area refers to a set of codes interpreted and executed by a microprocessor. Executable files have a specific format depending on the operating system. For example, the Windows platform has the PE format, and the UNIX and Linux operating systems have the ELF or COFF format.

단계 2((b) 단계):Step 2 (step (b)):

디스어셈블링부(200)는 단계 1 에서 추출한 코드 영역을 디스어세블링(disassembling) 한다. 디스어셈블리가 필요한 이유는 인스트럭션 시퀀스(instruction sequence)의 의미를 파악하여 프로시저(procedure)를 구분하고 그 안에서 API 콜 시퀀스를 추출하기 위함이다. 본 발명의 실시예에서는 신뢰 되고 자동화된 디스어셈블링을 수행하기 위하여 디스톰3(distorm3)를 활용하였다. 또한 프로시저로 구분할 단계 3을 위하여 상술한 프로시저의 기본구조를 인식하고, 디스어셈블리 처리 방식 중 제어 흐름에 초점을 두고 있는 순환 리커시브 디슨트 어셈블리(recursive decent disassembly) 방식을 통하여 콜 인스트럭션(call instruction)에 대한 참조 프로시저 들을 인식한다.The disassembling unit 200 disassembles the code region extracted in the step 1. Disassembly is necessary to identify the meaning of an instruction sequence and to distinguish a procedure and extract an API call sequence therein. In an embodiment of the present invention, distorm 3 is utilized to perform reliable and automated disassembly. In addition, in order to discriminate the procedure, step 3 is performed by recognizing the basic structure of the above procedure and executing a call instruction through a recursive decent disassembly method focusing on the control flow among the disassembly processing methods instruction (s).

단계 3((c) 단계): Step 3 (step (c)):

프로시저 분리부(300)는 프로그램의 디스어셈블링 된 인스트럭션 시퀀스(instruction sequence)는 프로시저로 분리된다. 또한, 각각의 프로시저에서 API 콜이 발생하지 않는 것들은 제거된다. 이 단계에서의 결과는 결국 프로시저의 고유한 이름(name)과 그 안에서 발생한 API 콜 시퀀스들에 대한 집합이다. 본 발명의 실시예에 따른 소프트웨어 유사성 측정 시스템(10) 및 방법은 유사한 프로시저에 대한 디스어셈블리 결과를 검토할 수 있도록 제공할 수 있다. 그래서 선택적으로 디스어셈블리 결과를 저장해 놓을 수 있다.The procedure separator 300 separates the disassembled instruction sequence of the program into a procedure. Also, those that do not cause API calls in each procedure are removed. The result at this stage is eventually a collection of API call sequences occurring within the procedure's unique name. A software similarity measurement system 10 and method in accordance with an embodiment of the present invention may provide for reviewing disassembly results for similar procedures. So you can optionally store the disassembly results.

단계 4((d) 단계): Step 4 (step (d)):

버스마크 생성부(400)가 분리된 프로시저 들의 API 콜 시퀀스에 대하여 퍼지 해시 함수(fuzzy hash function)를 통해 해시 값(hash value)을 생성하고 버스마크 DB에 저장하는 단계이다.The bus mark generating unit 400 generates a hash value through a fuzzy hash function on the API call sequence of the separated procedures and stores the hash value in the bus mark DB.

버스마크 DB의 저장은 먼저 실행 파일에 대한 정보를 가지는 테이블(table) 과 그것과 연결된 프로시저 리스트(procedure list)를 가지는 테이블로 구성할 수 있다. 종래의 기술에서는 카테고리(category) 분류를 위해 DLLs 의 갯수와 APIs 의 갯수를 저장하지만, 본 발명의 실시예에서는 DLLs 과 APIs의 갯수를 가지고 어플리케이선(aplications)의 성격을 파악하여 카테고리를 분류한다는 것은 현실적으로 불가능하고 많은 오탐을 발생시킬 수 있다는 것을 검증하였다.The storage of the bus mark DB can be made up of a table having information on an executable file and a table having a procedure list linked thereto. In the conventional technology, the number of DLLs and the number of APIs are stored for category classification. However, in the embodiment of the present invention, the number of DLLs and APIs is used to classify categories by identifying the characteristics of application aplications Proved that it is impossible in reality and can cause a lot of false positives.

또한, 최근의 applications 는 많은 복합적인 기능들을 내장한다. 그렇기 때문에 카테고리의 명확한 분류가 되지 않을 가능성이 높고 오히려 높은 비용을 가지고 처리될 수도 있다. 따라서 본 발명의 실시예에 따른 소프트웨어 유사성 측정 시스템(10) 및 방법은 프로그램 그 자체의 유사성에만 집중한다.Also, recent applications have many complex functions built in. Therefore, there is a high likelihood that a category will not be clearly classified, and it may be processed at a higher cost. Thus, the software similarity measurement system 10 and method according to the embodiment of the present invention focuses on the similarity of the program itself.

유사성 측정(Similar Relation Assessment)((e) 단계)Similar Relation Assessment (step (e))

정의 9. (Similarity Measure)주어진 P,Q에서 Q가 만약 P와 같은 소스에서 파생 되었다면(즉, 같은 프로그램의 서로 다른 버전), 본 발명의 실시예에서는 P 와 Q가 서로 유사하다고 하고 P ≒ Q 로 표기할 수 있다. P ≒ Q 이라면, Bp(P) → α와 Bp(Q) → β에 의해 얻어지는 α 및 β의 두 값이 α≒β로 정의 될 수 있다.Similarity Measure If a Q at a given P, Q is derived from a source such as P (that is, a different version of the same program), then in an embodiment of the invention, P and Q are similar, . If P≈Q, then two values of α and β obtained by B p (P) → α and B p (Q) → β can be defined as α≈β.

그러므로 유사성 측정 함수 Sim p(α,β)는 다음의 [수학식 11]에 의해 정의될 수 있다.Therefore, the similarity measurement function Sim p (?,?) Can be defined by the following equation (11).

Figure 112016069854407-pat00013
Figure 112016069854407-pat00013

앞서, 본 발명의 실시예에서는 ε=0.35로서 문턱값을 결정했다. 문턱값으로 부터, [0.0,0.35]의 유사성 범위는 독립적(independent)의 분류기준이고, [0.35,0.65]는 비결정적(inconclusive)의 분류기준이고, [0.65,1]은 프로그램 유사의 분류기준이다.In the embodiment of the present invention, the threshold value was determined as? = 0.35. From the threshold value, the similarity range of [0.0, 0.35] is an independent classification criterion, [0.35, 0.65] is a noncritical classification criterion, and [0.65,1] to be.

일반적으로, 종래의 기술들은 서로 다른 문턱값 ε을 제시하였지만, 본 발명의 실시예에서 문턱값 ε=0.35는 복구성(resilience) 및 신뢰성(credibility)의 특성에 기반한 실험 결과를 바탕으로 결정하였다.Generally, although the prior arts have presented different thresholds epsilon, in the embodiment of the present invention the threshold value epsilon = 0.35 was determined based on experimental results based on the characteristics of resilience and credibility.

실험 및 평가(Evaluation)Evaluation and Evaluation

본 발명의 실시예에 따른 소프트웨어 유사성 측정 시스템(10) 및 방법의 평가(evalution)를 위하여 실험 환경은 인텔 코어(Intel Core) i7 2.6 GHz, Memory 16Gb 의 윈도우즈 7 32bit 환경을 구성하였다. System 은 파이선(python)으로 구현하였고, pefile, distorm3, ssdeep 의 packages을 활용하였다. 또한 디스어셈블(disassemble) 에 대한 검증 작업을 위하여 Hex-Rays사의 IDA pro 6.1 을 사용하였다.For the evaluation of the software similarity measurement system 10 and method according to the embodiment of the present invention, the experimental environment constituted the Intel Core i7 2.6 GHz, Memory 16Gb Windows 7 32 bit environment. The system is implemented in python, using pefile, distorm3, and sdeep packages. We also used IDA pro 6.1 from Hex-Rays for disassembly verification.

본 발명의 실시예에서 평가(evaluation)는 두 가지이다. 첫번째는 버스마크(birthmark)의 복구성(resilient)을 검증하고, 종래의 유사성 측정방법에서 제안한 접근법의 문제점을 검증한다. In the embodiment of the present invention, there are two evaluations. The first verifies the resilient of the birthmark and verifies the problems of the proposed approach in the conventional similarity measurement method.

두번째는 신뢰성(Credibility)을 검증한다. 이것은 서로 독립된 프로그램 간에 ≤ ε 관계를 보여준다. 마지막으로 본 발명의 실시예에 따른 시스템의 성능(performance)을 검증한다.The second verifies the credibility. This shows the relationship ≤ ε between independent programs. Finally, the performance of the system according to an embodiment of the present invention is verified.

버전 version 스펙Specifications 어플리케이션application (Version-specific Applications)(Version-specific Applications)

본 발명의 실시예에서 첫번째 실험은 서로 유사한 프로그램들의 집합을 통해서 버스마킹 시스템(birthmarking system)의 복구적(resilient)이다는 것을 증명하는 것이다. 그것을 위하여 원격 터미널 접속 프로그램으로 잘 알려진 푸티(putty) 의 버전별 (v0.52-v0.62) 유사성을 측정한다 ([표 1] 참조). 각각의 컴파일러의 버전은 PEiD 툴(tool)을 사용하여 식별하였다.The first experiment in the embodiment of the present invention is to prove that the birthmarking system is resilient through a set of similar programs. To do this, we measure the similarity (v0.52-v0.62) similarity of the well-known version of putty to the remote terminal access program (see [Table 1]). The versions of each compiler were identified using the PEiD tool.

Figure 112016069854407-pat00014
Figure 112016069854407-pat00014

[표 1]에서 나타난 10개의 프로그램은 버전을 업데이트 할 때마다 원본 소스 코드가 수정되어 왔다. 그래서 본 발명의 실시예에서는 가설을 세운다. 첫번째로 각 버전별 푸티(putty) 프로그램은 서로 어느 정도의 유사성을 가지고 있다. 두번째 버전이 업데이트 될수록 하위 버전과의 유사성은 줄어들고, 그 차이는 가장 오랜 버전과 가장 최신 버전의 유사성이 가장 크다. 마지막으로 자기 자신과의 유사성은 항상 100% 일치하여야 한다.The 10 programs shown in [Table 1] have been modified from the original source code every time the version is updated. Thus, the embodiment of the present invention makes a hypothesis. First, each version of the putty program has some similarity to each other. The closer the second version is updated, the less similarity with the lower version, and the difference is the most similar to the oldest and latest version. Finally, similarities with yourself should always be 100% identical.

본 발명의 실시예에서 첫번째 실험은 두 가지 방식으로 진행하였다. 첫번째는 종래기술(Yongman Han et al.)에서 제안한 전체 프로그램에서 API call sequence를 추출하여 퍼지 해시 함수(fuzzy hash function)으로 값을 생성한 버스마크이고, 다른 하나는 본 발명의 실시예에서 제안한 하나의 프로그램 안에 각 프로시저(procedure) 들에 대한 API call sequence를 추출하여 퍼지 해시 함수(fuzzy hash function)로 값을 생성한 버스마크 이다.In an embodiment of the present invention, the first experiment proceeded in two ways. The first is a bus mark that extracts an API call sequence from the entire program proposed by the prior art (Yongman Han et al.) To generate a value using a fuzzy hash function, and the other is a bus mark Is a bus mark that extracts an API call sequence for each procedure and generates a value with a fuzzy hash function.

[표 2]는 푸티(putty)에 대한 버전별 프로그램들의 전체 영역에서 API call sequence를 추출하고 퍼지 해시 함수(fuzzy hash function) h를 통해 버스마크를 생성하여 유사성을 측정한 결과이고, 유사성이 40% 이상인 필드(field)에 대해서는 하이라이트(highlight) 표기하였다. [Table 2] shows the results of API call sequence extraction from all areas of version programs for putty, and similarity measurement by generating bus marks through fuzzy hash function h, Highlights are shown for fields that are more than%.

[표 2]의 실험 결과에서 종래기술(Yongman Han et al.)의 연구에 문제점을 발견할 수 있다. 일부 버전들을 제외하고 모든 유사성 측정 결과는 0.0 이다. 하지만 종래기술(Yongman Han et al.) 에서는 MD5 해시 함수(hash function)를 적용하였기 때문에 1.0에 해당하는 해시 값만 유효할 것이다. 또한 한 프로그램의 전체를 대상으로 API call sequence를 생성하는 것은 프로그램의 특징과 상관없이 프로그램 컴파일 때마다 프로시저의 위치변화에 따라서 유사한 프로그램이라 하여도 오류 긍정(false positive)이나 오류 부정(false negative)을 발생시킬 수 있다. From the results of the experiment in [Table 2], it is possible to find a problem in the study of the prior art (Yongman Han et al.). All similarity measurement results are 0.0, except for some versions. However, since Yongman Han et al. Applied the MD5 hash function, only the hash value corresponding to 1.0 will be valid. In addition, the API call sequence for a whole program can be generated by a similar program depending on the position of the procedure every time the program is compiled, irrespective of the characteristics of the program, Can be generated.

따라서 종래기술에서 제안한 접근법은 [표 2]의 결과에서 소프트웨어 버스마크(software birthmark)의 특성인 복구성(resiliency)을 만족하지 못한다는 것을 증명하였다.Therefore, the approach proposed in the prior art proves that the result of [Table 2] does not satisfy the resiliency which is characteristic of the software birthmark.

Figure 112016069854407-pat00015
Figure 112016069854407-pat00015

Figure 112016069854407-pat00016
Figure 112016069854407-pat00016

본 발명의 실시예에서 제안한 novel API-based software birthmark 는 실험결과로서 [표 3] 처럼 보여준다. 실험 결과에서 푸티(putty) 프로그램들의 전체 버전은 약 66% 이상의 유사성을 가지고 있다고 보여준다. 또한 본 발명의 실시예에서 세운 가설에 의하여 검증을 했을 때, 버전이 차이가 커질수록 유사성이 감소하는 결과가 나왔고, 그 차이는 가장 오랜 버전과 가장 최신 버전의 유사성이 약 66%로 가장 큰 차이가 있다는 것을 증명하였다. 추가적으로, 0.56과 0.57 versions 는 컴파일러(compiler)의 변화가 있었던 시점이다. The novel API-based software birthmark proposed in the embodiment of the present invention is shown in Table 3 as an experimental result. Experimental results show that the full version of putty programs has a similarity of about 66%. In addition, when verifying by the hypothesis set forth in the embodiment of the present invention, the similarity decreases as the versions become larger, and the difference is that the similarity of the oldest version with the latest version is about 66% . Additionally, the 0.56 and 0.57 versions are the time when the compiler changed.

복구성(정의 2.) 및 신뢰성(정의 3.)의 특성들을 증명하기 위해, 본 발명의 실시예에서는 문턱값 ε의 결정이 필요하다. 앞서, 문턱값은 각 방법의 실험결과에 의해 적절하게 결정된다. 푸티 버전 스펙을 갖는 첫번째 실험결과에서는 ε=0.35라면 복구성(resilience)이 만족 되었다. 그리고 푸티(putty) 프로그램의 모든 버전들은 [표 3]과 같은 결과를 보여 주었다. 그러므로, 본 발명의 실시예에서는 문턱값 ε=0.35로 결정할 수 있다. 또한, 신뢰성을 만족시키기 위해, 문턱값 ε=0.35로 나타낼 것이다. 복구성의 상세한 결과들은 도 7에 나타낸다. 도 7에 나타난 그래프는 [표 2] 및 [표 3]의 데이터에 기반한 것이다. In order to demonstrate the characteristics of the reconstruction (definition 2) and reliability (definition 3), the embodiment of the present invention requires determination of the threshold value epsilon. In the foregoing, the threshold value is suitably determined by the experimental result of each method. In the first experimental results with the footty version specification, the resilience was satisfied with ε = 0.35. All versions of the PuTTY program showed the same results as in [Table 3]. Therefore, in the embodiment of the present invention, the threshold value? = 0.35 can be determined. Further, in order to satisfy the reliability, the threshold value? = 0.35. Detailed results of recoverability are shown in FIG. The graph shown in Fig. 7 is based on the data of [Table 2] and [Table 3].

도 6에 나타낸 바와 같이, 본 발명의 실시예에서 실험을 통하여 자기 자신(x=0)과 멀어지는 버전일수록 유사성이 감소한다는 것을 증명하였고, 본 발명의 실시예에서 제안한 소프트웨어 유사성 측정 시스템(10) 및 방법이 복구성(resiliency)을 만족하는 것을 확인하였다.As shown in FIG. 6, in the embodiment of the present invention, it has been proved through experiments that the degree of similarity decreases as the version is farther from itself (x = 0), and the software similarity measurement system 10 proposed in the embodiment of the present invention And confirm that the method satisfies the resiliency.

다른 Other 어플리케이션의Application 평가(Evaluation of other Applications) Evaluation of other Applications

본 발명의 실시예에서 두번째 실험은 독립적으로 구현된 어플리케이션(application) 들을 대상으로 수행한다. [표 4]에서 나타낸 바와 같이 본 발명의 실시예에서는 샘플 프로그램(sample program) 들을 특정 카테고리로 분류하여 선정 하였다. 또한 몇몇 프로그램들은 2가지 버전의 차이를 두어서 유사성을 측정하기 위해 선정하였다. 모든 프로그램들은 윈도우즈(Windows) 에서 실행될 수 있는 PE 포맷을 가지고 있고, 32bit 운영 시스템(operating system)에 맞추어 컴파일되어 있다.In the embodiment of the present invention, the second experiment is performed on independently implemented applications. As shown in Table 4, in the embodiment of the present invention, sample programs are classified into specific categories and selected. In addition, some programs were chosen to measure similarity by placing differences between the two versions. All programs have a PE format that can be run on Windows and are compiled for a 32-bit operating system.

Figure 112016069854407-pat00017
Figure 112016069854407-pat00017

[표 4]에 나타낸 바와 같이, 본 발명의 실시예에서는 원본 버스마크(오직 API 콜 시퀀스 포함)와 퍼지 해싱을 적용한 버스마크의 감축률(reduction ratio)을 측정하였다. 감축률은 평균 약 41% 정도이다. 이것은 버스마크의 싸이즈가 사실상 원본 버스마크보다 퍼지 해싱을 이용한 버스마크에 더 효과적이라는 것을 의미한다. 또한, 데이터베이스에 대한 저장 오버헤드의 감소를 의미한다.As shown in Table 4, in the embodiment of the present invention, the reduction ratios of the bus marks using the original bus mark (including API call sequence only) and the fuzzy hashing were measured. The average reduction rate is about 41%. This means that the size of the bus mark is actually more effective for bus marking using fuzzy hashing than the original bus mark. It also means a reduction in the storage overhead for the database.

DLLsDLLs // APIs를APIs 갖는  Have 프리free 필터링에In filtering 대한 상관 분석(Correlation Analysis for Pre-filtering with  Correlation Analysis for Pre-filtering with DLLsDLLs // APIsAPIs ))

API는 운영 시스템(Operating System)에서 어플리케이션을 개발하는 개발자들에게 제공하는 함수들의 리스트로 정의될 수 있다. 특히, 윈도우즈 시스템(Windows System)은 API들을 DLL로 캡슐화된 모듈을 공유 메모리에 적재하여 다양한 어플리케이션이 사용할 수 있도록 제공한다. An API can be defined as a list of functions provided to developers who develop applications in an operating system. In particular, the Windows system loads modules encapsulated in DLLs into a shared memory so that it can be used by various applications.

DLLs를 기능상으로 구분한다면 수많은 DLLs 로 분리되어 메모리에 항상 상주하여야 하기 때문에 윈도우즈(Windows) 시스템은 특정한 계층으로 구분하여 그 개수를 줄여서 메모리에 상주시킨다. 그렇기 때문에 기능상으로 명확히 구분되지 않은 USER32.dll, KERNEL32.dll, ADVAPI32.dll 등의 이름만을 가지고 어플리케이션의 성격을 구분할 수 없다. If the DLLs are functionally separated, they must always reside in memory, separated by a large number of DLLs, so that the Windows system is divided into specific classes and resident in memory. For this reason, it is not possible to distinguish the nature of the application by only names such as USER32.dll, KERNEL32.dll, and ADVAPI32.dll that are not clearly distinguished by function.

또한, 최근에는 시용자의 요구에 따라 복합적인 기능을 하는 어플리케이션들이 등장하면서 단순히 API 호출 횟수 만으로 어플리케이션의 특징을 판단하기가 어렵다.In addition, in recent years, it has been difficult to judge the characteristics of an application merely by the number of API calls with the appearance of applications having a complex function according to a request of a user.

이에 본 발명의 실시예에서는 상술한 바와 같이, 이 문제점을 지적 하였고 이를 검증하기 위하여 프로그램의 API 콜 프리퀀시(call frequency)에 대한 Top 50 으로 같은 카테고리(category)에 있는 프로그램과 상관분석(correlation analysis)을 수행하였고, 도 8에 나타낸다. In the embodiment of the present invention, as described above, this problem has been pointed out and in order to verify this, the top 50 for the API call frequency of the program and the correlation analysis with the program in the same category, And is shown in Fig.

도 8에 나타낸 바와 같이, 각각의 그래프는 샘플 프로그램에 대하여 카테고리 별로 2개의 프로그램들의 API call 발생 프리퀀시(frequency) 에 대한 상관 계수(correlation coefficient)이다. 각각의 카테고리에 대한 상관 계수(correlation coefficient) 값은 매우 낮게 평가되어 있고, 이것은 종래기술(Yongman Han et al.) 에서 제안한 DLLs 와 APIs 의 이름, 갯수 만으로 카테고리를 분류할 수 없다는 것을 의미한다. As shown in FIG. 8, each graph is a correlation coefficient for an API call generation frequency of two programs for each sample program. The correlation coefficient values for each category are evaluated very low, which means that categories can not be categorized only by the names and number of DLLs and APIs proposed in the prior art (Yongman Han et al.).

이처럼 본 발명의 실시예에서는 프로시저(procedure)로 분리된 API 콜 시퀀스(call sequence)에 대해 퍼지 해싱(fuzzy hashing)을 적용한 소프트웨어 유사성 측정 시스템(10)(birthmarking system) 및 그 방법을 제안하였다. As described above, in the embodiment of the present invention, a software similarity measuring system (10) (birthmarking system) and a method thereof are proposed in which a fuzzy hashing is applied to an API call sequence separated by a procedure.

또한 본 발명의 실시예는 종래기술에서 제안한 최근 소프트웨어 버스마크(software birthmark) 시스템을 개선하고, 그것을 검증하기 위하여 실험을 진행 하였다. 소프트웨어 유사성 측정 또는 소프트웨어 버스마크(software birthmark) 는 전통적으로 복구성(Resiliency) 및 신뢰성(Credibility)의 두 속성을 만족하기 위하여 연구되어 왔다. The embodiments of the present invention also improved the recent software birthmark system proposed in the prior art and conducted experiments to verify it. Software similarity measurement or software birthmark has traditionally been studied to satisfy both attributes of resiliency and credibility.

본 발명의 실시예에서는 실험에서 같은 프로그램의 다른 버전(version)의 푸티 프로그램(putty program)을 통하여 복구성(Resiliency)을 평가하였고, 종래기술에서 제안한 접근법의 문제점을 검증하였다. 그 결과 본 발명의 실시예에서 제안한 소프트웨어 유사성 시스템(birthmarking system) 이 더 우수하다는 결과를 얻을 수 있었다. In the embodiment of the present invention, in the experiment, the resiliency was evaluated through putty programs of different versions of the same program, and the problems of the approach proposed in the prior art were verified. As a result, it was found that the software similarity system proposed in the embodiment of the present invention is superior.

그리고 신뢰성(Credibility)을 평가하기 위한 실험에서 카테고리별 18개의 어플리케이션을 선정하였다. 이중 에는 같은 프로그램의 다른 버전을 포함하여 유사성을 측정하였고, 그 결과 정확히 구별할 수 있다는 결과를 얻었다.In the experiment to evaluate the credibility, 18 applications were selected for each category. Among them, similarities were measured including other versions of the same program, and as a result, we were able to distinguish correctly.

또한 종래기술(Yongman Han et al.)에서 제안한 버스마크 접근법의 카테고리 분류에 대한 문제점을 지적하였고, 그것은 본 발명의 실시예에서 수행한 실험을 통해 확인되었다. 각 프로그램의 API 콜 프리퀀시(call frequency) 상위 50개의 API와 그 횟수를 통해 같은 카테고리의 프로그램들과 상관 분석(correlation analysis)을 수행하였고, 전부 낮은 연관성을 가진다는 결과를 얻었다. 따라서 그들이 제안한 접근법으로는 프로그램(programs)의 기능상 카테고리를 분류할 수 없다는 결과를 얻을 수 있었다.It also pointed out a problem with the category classification of the bus mark approach proposed in the prior art (Yongman Han et al.), Which was confirmed through experiments performed in the embodiments of the present invention. We performed correlation analysis with the programs of the same category through the top 50 APIs of the call frequency of each program and the number of times, and all the results showed that they have low correlation. Therefore, we could get the result that the proposed approach could not classify functional categories of programs.

즉, 본 발명의 실시예에서는 종래기술(Yongman Han et al.)에서 제안한 버스마킹 시스템(birthmarking system) 또는 소프트웨어 유사성 측정 시스템(10)을 개선하는 기술로서, 소프트웨어 버스마크(software birthmark)는 프로그램의 네이티브 코드(native code)를 대상으로 분할된 프로시저(procedure) 안에서 API call sequence를 추출하고 그것을 퍼지 해시 함수(fuzzy hash function)을 통하여 생성한다. 퍼지 해시(fuzzy hash)는 전통적인 암호학적 해시 함수(hash function)와는 다르게 데이터(data)의 유사성을 측정하기 위하여 제안된 해시 함수(hash function)이다.That is, in the embodiment of the present invention, as a technique for improving the bus marking system or the software similarity measurement system 10 proposed in the prior art (Yongman Han et al.), A software birthmark is a program Extracts the API call sequence from a partitioned procedure for native code and generates it through a fuzzy hash function. A fuzzy hash is a hash function proposed to measure the similarity of data, unlike the traditional cryptographic hash function.

본 발명의 실시예에서는 프로시저(procedure) 단위로 API call sequence 를 추출하기 때문에 컴파일러(compiler)의 영향을 받지 않고 특징을 버스마크(birthmark)에 반영할 수 있다. 이것은 종래의 버스마크(birthmark)를 확실히 개선한 방법이고 실험을 통하여 증명하였다. In the embodiment of the present invention, since the API call sequence is extracted on a procedure-by-procedure basis, the feature can be reflected on the birthmark without being affected by the compiler. This is a clear improvement of the conventional birthmark and proved through experimentation.

그리고, 본 발명의 또 다른 실시예로서, 하드웨어와 결합되어 상술한 3차원 지형 모델과 토질 분류를 이용한 비탈면 안정성 평가방법을 실행시키기 위하여 컴퓨터가 판독 가능한 매체에 저장된 컴퓨터프로그램일 수 있다.Further, as another embodiment of the present invention, a computer program stored in a computer-readable medium for executing the slope stability evaluation method using the three-dimensional topography model and soil classification combined with hardware may be used.

즉, 본 발명의 실시예에 따른 장치로서, 컴퓨터로 읽을 수 있는 기록매체에 컴퓨터가 읽을 수 있는 코드로서 구현하는 것이 가능하다. 컴퓨터가 읽을 수 있는 기록매체는 컴퓨터 시스템에 의하여 읽힐 수 있는 데이터가 저장되는 모든 종류의 기록장치를 포함한다. 기록매체의 예로는 ROM, RAM, 광학 디스크, 자기 테이프, 플로피 디스크, 하드 디스크, 비휘발성 메모리 등을 포함한다. 또한 컴퓨터가 읽을 수 있는 기록매체는 네트워크로 연결된 컴퓨터 시스템에 분산되어 분산방식으로 컴퓨터가 읽을 수 있는 코드가 저장되고 실행될 수 있다.That is, the apparatus according to the embodiment of the present invention can be implemented as a computer-readable code on a computer-readable recording medium. A computer-readable recording medium includes all kinds of recording apparatuses in which data that can be read by a computer system is stored. Examples of the recording medium include ROM, RAM, optical disk, magnetic tape, floppy disk, hard disk, nonvolatile memory and the like. The computer-readable recording medium may also be distributed over a networked computer system so that computer readable code can be stored and executed in a distributed manner.

본 명세서에서 설명되는 실시 예와 첨부된 도면은 본 발명에 포함되는 기술적 사상의 일부를 예시적으로 설명하는 것에 불과하다. 따라서, 본 명세서에 개시된 실시예들은 본 발명의 기술적 사상을 한정하기 위한 것이 아니라 설명하기 위한 것이므로, 이러한 실시 예에 의하여 본 발명의 기술 사상의 범위가 한정되는 것은 아님은 자명하다. 본 발명의 명세서 및 도면에 포함된 기술적 사상의 범위 내에서 당업자가 용이하게 유추할 수 있는 변형 예와 구체적인 실시 예는 모두 본 발명의 권리범위에 포함되는 것으로 해석되어야 할 것이다.The embodiments and the accompanying drawings described in the present specification are merely illustrative of some of the technical ideas included in the present invention. Accordingly, the embodiments disclosed herein are for the purpose of describing rather than limiting the technical spirit of the present invention, and it is apparent that the scope of the technical idea of the present invention is not limited by these embodiments. It will be understood by those of ordinary skill 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.

10: 유사성 측정 시스템, 100: 코드 영역 추출부
200: 디스어셈블링부 300: 프로시저 분리부
400: 버스마크 생성부 500: 유사성 측정부
10: similarity measurement system, 100: code region extraction unit
200: Disassembly unit 300: Procedure separation unit
400: bus mark generating unit 500: similarity measuring unit

Claims (16)

(a) 입력받은 프로그램으로부터 코드 영역을 추출하는 단계;
(b) 추출된 코드 영역을 디스어셈블링(disassembling) 하는 단계;
(c) 디스어셈블링(disassembling) 된 프로그램의 인스트럭션 시퀀스(instruction sequence)를 프로시저(procedure)로 분리하는 단계;
(d) 분리된 프로시저들의 API 콜 시퀀스에 대하여 퍼지 해시 함수(fuzzy hash function)를 통해 해시값을 생성하여 버스마크 DB에 저장하는 단계; 및
(e) 저장된 해시값을 이용하여 입력받은 프로그램의 유사성을 측정하는 단계를 포함하는 것을 특징으로 하는 퍼지 해싱을 사용한 함수의 API 기반 소프트웨어의 유사성 측정방법.
(a) extracting a code area from an input program;
(b) disassembling the extracted code region;
(c) separating an instruction sequence of a disassembled program into a procedure;
(d) generating a hash value through a fuzzy hash function on the API call sequence of the separated procedures and storing the hash value in the bus mark DB; And
(e) measuring the similarity of the input program using the stored hash value. &lt; Desc / Clms Page number 19 &gt;
청구항 1에 있어서,
상기 코드 영역은,
마이크로프로세서에 의해 해석되어 실행되는 코드(code) 들의 집합인 것을 특징으로 하는 퍼지 해싱을 사용한 함수의 API 기반 소프트웨어의 유사성 측정방법.
The method according to claim 1,
Wherein the code region comprises:
And a set of codes that are interpreted and executed by the microprocessor.
청구항 1에 있어서,
상기 (b) 단계는,
추출된 코드 영역을 리커시브 디슨트 디스어셈블리(recursive decent disassembly) 방식을 이용하여 콜 인스트럭션(call instruction)에 대한 참조 프로시저(procedure) 들을 인식하는 단계를 포함하는 것을 특징으로 하는 퍼지 해싱을 사용한 함수의 API 기반 소프트웨어의 유사성 측정방법.
The method according to claim 1,
The step (b)
And recognizing reference procedures for a call instruction using a recursive decent disassembly scheme for the extracted code region. &Lt; RTI ID = 0.0 &gt; 8. &lt; / RTI & Based software similarity measure.
청구항 1에 있어서,
상기 (c) 단계는,
분리된 각각의 프로시저에서 API 콜이 발생하지 않는 프로시저를 제거하는 단계를 포함하는 것을 특징으로 하는 퍼지 해싱을 사용한 함수의 API 기반 소프트웨어의 유사성 측정방법.
The method according to claim 1,
The step (c)
And removing a procedure that does not cause an API call in each of the separated procedures.
청구항 1에 있어서,
상기 (c) 단계는,
분리된 프로시저들을 선택적으로 프로시저 DB에 저장하는 단계를 포함하는 것을 특징으로 하는 퍼지 해싱을 사용한 함수의 API 기반 소프트웨어의 유사성 측정방법.
The method according to claim 1,
The step (c)
And selectively storing the separated procedures in a procedure DB. A method of measuring similarity of an API-based software of a function using fuzzy hashing.
청구항 1에 있어서,
상기 (d) 단계는,
생성된 해시값을 실행파일에 대한 정보를 가지는 실행파일 테이블과, 실행파일 테이블과 연결된 프로시저 리스트가 구비된 리스트 테이블로 구성하여 데이터베이스에 저장하는 단계를 포함하는 것을 특징으로 하는 퍼지 해싱을 사용한 함수의 API 기반 소프트웨어의 유사성 측정방법.
The method according to claim 1,
The step (d)
And storing the generated hash value in a database in the form of an executable file table having information on the executable file and a list table provided with a procedure list linked to the executable file table, Based software similarity measure.
청구항 1에 있어서,
상기 (e) 단계는,
저장된 해시값을 이용하여 입력받은 프로그램의 상기 (a) 단계 내지 (e) 단계에서 생성된 해시값을 유사도 측정함수를 통해 프로그램 유사성을 판단하는 단계인 것을 특징으로 하는 퍼지 해싱을 사용한 함수의 API 기반 소프트웨어의 유사성 측정방법.
The method according to claim 1,
The step (e)
Wherein the hash value generated in the steps (a) through (e) of the input program is determined by using a similarity measure function, using the stored hash value, based on the API of the function using fuzzy hashing A method for measuring similarity of software.
청구항 7에 있어서,
상기 유사도 측정함수는,
Figure 112016069854407-pat00018

(여기서, ε는 문턱값을 나타내고, 각 α 및 β 두 프로그램 P 및 Q로부터 추출된 각 프로시저들에 대한 Bf를 통해 생성된 버스마크 값을 나타낸다.)와 같은 식을 만족하는 것을 특징으로 하는 퍼지 해싱을 사용한 함수의 API 기반 소프트웨어의 유사성 측정방법.
The method of claim 7,
Wherein the similarity measure function comprises:
Figure 112016069854407-pat00018

(Where? Represents a threshold value, and represents a bus mark value generated through B f for each procedure extracted from the programs? And Q for each? And?). A method for measuring the similarity of API based software of a function using fuzzy hashing.
프로그램을 입력받아 코드 영역을 추출하는 코드 영역 추출부;
추출된 코드 영역을 디스어셈블링(disassembling) 하는 디스어셈블링부;
디스어셈블링(disassembling) 된 프로그램의 인스트럭션 시퀀스(instruction sequence)를 프로시저(procedure)로 분리하는 프로시저 분리부;
분리된 프로시저들의 API 콜 시퀀스에 대하여 퍼지 해시 함수(fuzzy hash function)를 통해 해시값을 생성하여 버스마크 DB에 저장하는 버스마크 생성부; 및
저장된 해시값을 이용하여 입력받은 프로그램의 유사성을 측정하는 유사성 측정부를 포함하는 것을 특징으로 하는 퍼지 해싱을 사용한 함수의 API 기반 소프트웨어의 유사성 측정 시스템.
A code region extraction unit for receiving a program and extracting a code region;
A disassembly unit for disassembling the extracted code region;
A procedure separator for separating an instruction sequence of a disassembled program into a procedure;
A bus mark generating unit for generating a hash value through a fuzzy hash function on the API call sequence of the separated procedures and storing the hash value in the bus mark DB; And
And a similarity measuring unit for measuring the similarity of the inputted program using the stored hash value.
청구항 9에 있어서,
상기 디스어셈블링부는,
추출된 코드 영역을 리커시브 디슨트 디스어셈블리(recursive decent disassembly) 방식을 이용하여 콜 인스트럭션(call instruction)에 대한 참조 프로시저(procedure) 들을 인식하는 것을 특징으로 하는 퍼지 해싱을 사용한 함수의 API 기반 소프트웨어의 유사성 측정 시스템.
The method of claim 9,
The disassembling unit includes:
Characterized in that the extracted code area is recognized by recursive decent disassembly to reference procedures for a call instruction. Similarity measurement system.
청구항 9에 있어서,
상기 프로시저 분리부는,
분리된 각각의 프로시저에서 API 콜이 발생하지 않는 프로시저를 제거하는 것을 특징으로 하는 퍼지 해싱을 사용한 함수의 API 기반 소프트웨어의 유사성 측정 시스템.
The method of claim 9,
Wherein the procedure separator comprises:
And removing the procedure that does not cause the API call in each of the separated procedures.
청구항 9에 있어서,
상기 프로시저 분리부는,
분리된 프로시저들을 선택적으로 프로시저 DB에 저장하는 것을 특징으로 하는 퍼지 해싱을 사용한 함수의 API 기반 소프트웨어의 유사성 측정 시스템.
The method of claim 9,
Wherein the procedure separator comprises:
And the stored procedure is selectively stored in the procedure DB. The system for measuring similarity of an API-based software of a function using fuzzy hashing.
청구항 9에 있어서,
상기 버스마크(birthmark) 생성부는,
생성된 해시값을 실행파일에 대한 정보를 가지는 실행파일 테이블과, 실행파일 테이블과 연결된 프로시저 리스트가 구비된 리스트 테이블로 구성하여 버스마크 DB에 저장하는 것을 특징으로 하는 퍼지 해싱을 사용한 함수의 API 기반 소프트웨어의 유사성 측정 시스템.
The method of claim 9,
Wherein the birthmark generating unit comprises:
Wherein the generated hash value is constituted by an executable file table having information on an executable file and a list table provided with a procedure list linked to an executable file table and stored in a bus mark DB. Based software similarity measurement system.
청구항 9에 있어서,
상기 유사성 측정부는,
저장된 해시값을 이용하여 생성된 입력받은 프로그램의 해시값을 유사도 측정함수를 통해 프로그램 유사성을 판단하는 것을 특징으로 하는 퍼지 해싱을 사용한 함수의 API 기반 소프트웨어의 유사성 측정 시스템.
The method of claim 9,
Wherein the similarity measuring unit comprises:
Wherein the hash value of the input program generated using the stored hash value is used to determine the program similarity through the similarity measure function.
청구항 14에 있어서,
상기 유사도 측정함수는,
Figure 112016069854407-pat00019

(여기서, ε는 문턱값을 나타내고, 각 α 및 β 두 프로그램 P 및 Q로부터 추출된 각 프로시저들에 대한 Bf를 통해 생성된 버스마크 값을 나타낸다.)와 같은 식을 만족하는 것을 특징으로 하는 퍼지 해싱을 사용한 함수의 API 기반 소프트웨어의 유사성 측정 시스템.
15. The method of claim 14,
Wherein the similarity measure function comprises:
Figure 112016069854407-pat00019

(Where? Represents a threshold value, and represents a bus mark value generated through B f for each procedure extracted from the programs? And Q for each? And?). Similarity measurement system for API based software of functions using fuzzy hashing.
하드웨어와 결합되어,
청구항 1의 퍼지 해싱을 사용한 함수의 API 기반 소프트웨어의 유사성 측정방법을 실행시키기 위하여 컴퓨터가 판독 가능한 매체에 저장된 컴퓨터프로그램.
Combined with hardware,
A computer program stored on a computer-readable medium for executing a method of determining the similarity of an API-based software of a function using the fuzzy hashing of claim 1.
KR1020160091284A 2016-07-19 2016-07-19 Api-based software similarity measuring method and system using fuzzy hashing KR101792631B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020160091284A KR101792631B1 (en) 2016-07-19 2016-07-19 Api-based software similarity measuring method and system using fuzzy hashing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020160091284A KR101792631B1 (en) 2016-07-19 2016-07-19 Api-based software similarity measuring method and system using fuzzy hashing

Publications (1)

Publication Number Publication Date
KR101792631B1 true KR101792631B1 (en) 2017-11-02

Family

ID=60383162

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020160091284A KR101792631B1 (en) 2016-07-19 2016-07-19 Api-based software similarity measuring method and system using fuzzy hashing

Country Status (1)

Country Link
KR (1) KR101792631B1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111930610A (en) * 2020-07-07 2020-11-13 北京白泽洞冥科技有限公司 Software homology detection method, device, equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111930610A (en) * 2020-07-07 2020-11-13 北京白泽洞冥科技有限公司 Software homology detection method, device, equipment and storage medium
CN111930610B (en) * 2020-07-07 2024-05-17 北京鸿渐科技有限公司 Software homology detection method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109684840B (en) Android malicious software detection method based on sensitive calling path
US6282698B1 (en) Detecting similarities in Java sources from bytecodes
CN102054149B (en) Method for extracting malicious code behavior characteristic
CN101359352B (en) API use action discovering and malice deciding method after confusion of multi-tier synergism
Jacobson et al. Labeling library functions in stripped binaries
US8549635B2 (en) Malware detection using external call characteristics
Wang et al. Detecting software theft via system call based birthmarks
US7493596B2 (en) Method, system and program product for determining java software code plagiarism and infringement
Alazab et al. Malware detection based on structural and behavioural features of API calls
CN109271788B (en) Android malicious software detection method based on deep learning
KR101110308B1 (en) Apparatus and method for detecting malicious code using packed file properties
Tian et al. DKISB: Dynamic key instruction sequence birthmark for software plagiarism detection
Oprisa et al. From plagiarism to malware detection
CN109543408A (en) A kind of Malware recognition methods and system
CN107506622A (en) A kind of software dynamic birthmark and plagiarism detection method based on memory object access sequence
KR20180133726A (en) Appratus and method for classifying data using feature vector
CN105468972B (en) A kind of mobile terminal document detection method
CN112817877B (en) Abnormal script detection method and device, computer equipment and storage medium
CN108171057B (en) Android platform malicious software detection method based on feature matching
KR101792631B1 (en) Api-based software similarity measuring method and system using fuzzy hashing
Collberg et al. Software watermarking in the frequency domain: implementation, analysis, and attacks
Jang et al. Bitshred: Fast, scalable code reuse detection in binary code
Chae et al. Credible, resilient, and scalable detection of software plagiarism using authority histograms
KR101628602B1 (en) Similarity judge method and appratus for judging similarity of program
Lim et al. Analyzing stack flows to compare Java programs

Legal Events

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