KR101842263B1 - Method and apparatus for preventing reverse engineering - Google Patents

Method and apparatus for preventing reverse engineering Download PDF

Info

Publication number
KR101842263B1
KR101842263B1 KR1020160108999A KR20160108999A KR101842263B1 KR 101842263 B1 KR101842263 B1 KR 101842263B1 KR 1020160108999 A KR1020160108999 A KR 1020160108999A KR 20160108999 A KR20160108999 A KR 20160108999A KR 101842263 B1 KR101842263 B1 KR 101842263B1
Authority
KR
South Korea
Prior art keywords
application
file
debugging
executable file
attempt
Prior art date
Application number
KR1020160108999A
Other languages
Korean (ko)
Other versions
KR20180023510A (en
Inventor
임경환
조성제
Original Assignee
단국대학교 산학협력단
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 단국대학교 산학협력단 filed Critical 단국대학교 산학협력단
Priority to KR1020160108999A priority Critical patent/KR101842263B1/en
Publication of KR20180023510A publication Critical patent/KR20180023510A/en
Application granted granted Critical
Publication of KR101842263B1 publication Critical patent/KR101842263B1/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
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/55Detecting local intrusion or implementing counter-measures
    • G06F21/554Detecting local intrusion or implementing counter-measures involving event detection and direct action
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/55Detecting local intrusion or implementing counter-measures
    • G06F21/56Computer malware detection or handling, e.g. anti-virus arrangements
    • G06F21/562Static detection
    • G06F21/565Static detection by checking file integrity

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Virology (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Multimedia (AREA)
  • Technology Law (AREA)
  • Debugging And Monitoring (AREA)

Abstract

본 발명의 일 실시예에 따른 원본 실행파일과 스텁(Stub) 파일을 포함하는 어플리케이션이 역공학을 방지하는 방법에 있어서, 어플리케이션의 실행 요청이 있는 경우 원본 실행파일이 실행되지 않고, 스텁 파일이 실행되는 단계; 스텁 파일의 호출 스택을 이용하여, 스텁 파일에 저장된 정상적인 호출 메소드가 아닌 외부 메소드가 있는지 검사하는 단계; 및 외부 메소드가 발견된 경우 어플리케이션을 종료하고, 외부 메소드가 발견되지 않은 경우 원본 실행파일이 실행되도록 하는 어플리케이션 실행 여부 결정 단계를 포함한다.In a method for preventing reverse engineering of an application including a source executable file and a stub file according to an embodiment of the present invention, a source executable file is not executed when an application execution request is made, and a stub file is executed ; Checking whether there is an external method that is not a normal calling method stored in the stub file using the call stack of the stub file; And determining whether the application is executed when the external method is found, and when the external method is not found, executing the original executable file.

Description

어플리케이션에 대한 역공학 차단 방법 및 장치{METHOD AND APPARATUS FOR PREVENTING REVERSE ENGINEERING}[0001] METHOD AND APPARATUS FOR PREVENTING REVERSE ENGINEERING [0002]

본 발명은 어플리케이션에 대한 역공학 차단 방법 및 장치에 관한 것으로서, 보다 자세하게는 원본 실행파일과 스텁(Stub) 파일을 포함하는 어플리케이션이 수행될 경우에 있어, 어플리케이션에 대한 역공학 차단 방법 및 장치에 관한 것이다.BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a reverse engineering blocking method and apparatus for an application, and more particularly, to a reverse blocking method and apparatus for an application when an application including a source executable file and a stub file is executed. will be.

역공학이란 프로그램의 구조를 분석하는 절차로, 프로그램의 동작 원리를 분석하여 어떠한 기능을 갖고 어떤 행위를 하는지 파악을 하는 것을 말한다. 또한 프로그램의 동작 원리를 이해하기 위한 목적으로 소프트웨어 역공학을 하기도 한다. 이러한 과정을 통해 기존에 존재하는 프로그램의 동작 원리와 구조를 이해함으로써 더 확장된 기능을 갖는 프로그램을 제작 할 수 있다. Reverse engineering is the process of analyzing the structure of a program, analyzing the operation principle of a program, and identifying what functions and behaviors are performed. In addition, software reverse engineering is also performed for the purpose of understanding the operation principle of the program. Through this process, it is possible to produce programs with extended functions by understanding the operation principle and structure of existing programs.

하지만 악의적인 목적을 갖고 기존에 존재하는 프로그램을 분석하여 프로그램의 소스코드를 얻어 유사 프로그램을 만들거나 악성코드를 삽입하여 배포하는 사례가 증가하고 있다. However, there is an increasing number of cases in which malicious code is analyzed to analyze existing programs to obtain the source code of the program, creating similar programs, or distributing malicious codes.

안드로이드 어플리케이션은 주로 자바 언어로 작성되어 바이트 코드로 이루어져 있는데, 바이트 코드는 특성상 역공학 공격에 취약한 단점이 있어 많은 안드로이드 어플리케이션들의 저작권 침해 문제가 발생하고 있다. Android applications are mainly written in Java language and are made up of bytecode. Byte code is vulnerable to reverse engineering attack due to its nature, and many Android applications are infringing copyright.

안드로이드 어플리케이션을 역공학 공격으로부터 방어하기 위해 난독화 기법, 패킹, 암호화 등의 어플리케이션이 실행되지 않는 동안 이루어지는 정적 역공학 차단에 대한 기법들이 연구되고 있다. 하지만 이러한 정적 역공학 차단 기법들은 메모리 덤프, 실시간 디버깅 등과 같은 어플리케이션이 수행되는 동안 이루어지는 동적 역공학에 의해 무력화 될 수 있다. Techniques for static reverse-engineering interception while applications such as obfuscation techniques, packing, and encryption are not running to protect Android applications from reverse engineering attacks are being studied. However, these static reverse engineering intercept techniques can be disabled by dynamic reverse engineering during applications such as memory dump, real-time debugging, and so on.

이에 동적 역공학 차단 기법으로 루팅 및 디버깅을 탐지하는 에뮬레이터 환경 탐지 연구들이 진행되고 있다. 하지만 메소드 후킹으로 루팅 및 디버깅 탐지를 우회하여 역공학을 시도하는 경우에는 기존의 동적 역공학 차단 기법으로 이를 탐지하기 어려운 문제가 있다. In this paper, we propose an emulator environment detection algorithm that detects routing and debugging by dynamic reverse engineering interception. However, in case of reverse engineering by bypassing routing and debugging detection by method hooking, there is a problem that it is difficult to detect it by the conventional dynamic reverse engineering blocking technique.

한국 공개특허공보 제10-2015-0134254호: 서버 및 휴대용 단말의 에플리케이션 보호방법 및 장치Korean Patent Laid-Open Publication No. 10-2015-0134254: Method and apparatus for application protection of server and portable terminal

본 발명의 실시예에서 해결하고자 하는 과제는 어플리케이션에 스텁(Stub) 파일을 삽입 후, 스텁 파일의 호출 스택을 이용하여 스텁 파일에 저장된 메소드가 아닌 외부 메소드가 있는지 검사함으로써, 루팅 및 디버깅 시도를 차단할 뿐만 아니라, 메소드 후킹으로 루팅 및 디버깅 탐지를 우회하는 역공학 시도를 차단하기 위한 기술을 제공하는 것이다.A problem to be solved by the embodiment of the present invention is to prevent a routing and debugging attempt by inserting a stub file into an application and inspecting an external method, not a method stored in a stub file, by using a call stack of a stub file In addition, it provides a technique for blocking reverse engineering attempts to bypass routing and debugging detection by method hooking.

다만, 본 발명의 실시예가 이루고자 하는 기술적 과제는 이상에서 언급한 과제로 제한되지 않으며, 이하에서 설명할 내용으로부터 통상의 기술자에게 자명한 범위 내에서 다양한 기술적 과제가 도출될 수 있다.It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory and are intended to provide further explanation of the invention as claimed.

본 발명의 일 실시예에 따른 원본 실행파일과 스텁(Stub) 파일을 포함하는 어플리케이션이 수행되는 경우 상기 어플리케이션에 대한 역공학을 방지하는 방법에 있어서, 상기 어플리케이션의 실행 요청이 있는 경우, 상기 원본 실행파일이 실행되지 않고, 상기 스텁 파일이 실행되는 단계; 상기 스텁 파일의 호출 스택을 이용하여, 상기 스텁 파일에 저장된 정상적인 호출 메소드가 아닌 외부 메소드가 있는지 검사하는 단계; 및 상기 외부 메소드가 발견된 경우 상기 어플리케이션을 종료하고, 상기 외부 메소드가 발견되지 않은 경우 상기 원본 실행파일이 실행되도록 하는 어플리케이션 실행 여부 결정 단계를 포함한다. A method for preventing reverse engineering of an application when an application including a source executable file and a stub file is executed according to an embodiment of the present invention, the method comprising: The file is not executed and the stub file is executed; Checking whether there is an external method that is not a normal calling method stored in the stub file using the call stack of the stub file; And determining whether to execute the application if the external method is found, and if the external method is not found, executing the original executable file.

이때 Custom image flashing 여부, 시스템 속성값 변경 여부, Su 명령어 존재 여부, Busybox를 통한 추가 명령어 삽입 여부, read-only 영역의 파일 시스템에 write 속성이 추가되었는지 여부, 루팅 관련 어플리케이션 설치 여부 및 Root 권한으로 실행되고 있는 프로세스가 있는지 여부 중 적어도 하나를 판단하여 루팅 시도를 탐지하는 단계를 더 포함할 수 있다. At this time, whether the custom image is flashing, whether the system property value is changed, Su command exists, whether additional command is inserted through Busybox, whether the write property is added to the file system of the read-only area, And determining whether at least one of the processes is being executed.

또한 상기 실행 여부 결정 단계에서, 상기 루팅 시도가 탐지된 경우 상기 어플리케이션을 종료하고, 상기 외부 메소드가 발견되지 않고 상기 루팅 시도가 탐지되지 않은 경우 상기 원본 실행 파일이 실행되도록 할 수 있다. In addition, in the execution determination step, the application may be terminated when the routing attempt is detected, and the original execution file may be executed if the external method is not found and the routing attempt is not detected.

더불어 디버깅을 위한 플래그의 유무를 판단하여 디버깅 시도를 탐지하는 단계;를 더 포함하고, 상기 실행 여부 결정 단계에서, 상기 디버깅 시도가 탐지된 경우 상기 어플리케이션을 종료하고, 상기 외부 메소드가 발견되지 않고 상기 디버깅 시도가 탐지되지 않은 경우 상기 원본 실행 파일이 실행되도록 할 수 있다. Further comprising the step of determining whether or not a flag for debugging is detected to detect a debugging attempt, wherein if the debugging attempt is detected, the application is terminated, and if the external method is not found If the debugging attempt is not detected, the original executable file can be executed.

또한 상기 실행 여부 결정 단계에서 상기 원본 실행파일이 실행되도록 결정되기 전까지 상기 스텁 파일은 상기 원본 실행파일의 초기 이름으로 존재하며, 상기 원본 실행파일은 초기 위치 또는 초기 이름이 변경된 채 존재할 수 있다.Also, the stub file exists as an initial name of the original executable file until the original executable file is determined to be executed in the execution determination step, and the original executable file may exist while the initial or initial name is changed.

아울러 상기 실행 여부 결정 단계에서 상기 원본 실행파일이 실행되도록 결정되면, 상기 스텁 파일은 상기 원본 실행파일의 변경된 위치 또는 변경된 이름을 상기 초기 위치 또는 상기 초기 이름으로 복구하여 상기 어플리케이션을 실행시킬 수 있다. If it is determined that the original executable file is to be executed in the execution decision step, the stub file can restore the changed or changed name of the original executable file to the initial location or the initial name to execute the application.

일 실시예에 따른 원본 실행파일과 스텁(Stub) 파일을 포함하는 어플리케이션이 설치된 장치는, 상기 어플리케이션의 실행 요청이 있는 경우, 상기 원본 실행파일이 실행되지 않고, 상기 스텁 파일이 실행되는 단계; 상기 스텁 파일의 호출 스택을 이용하여, 상기 스텁 파일에 저장된 정상적인 호출 메소드가 아닌 외부 메소드가 있는지 검사하는 단계; 및 상기 외부 메소드가 발견된 경우 상기 어플리케이션을 종료하고, 상기 외부 메소드가 발견되지 않은 경우 상기 원본 실행파일이 실행되도록 하는 어플리케이션 실행 여부 결정 단계;를 수행하는 적어도 하나의 프로세서를 갖는다.A device having an application including a source executable file and a stub file according to an embodiment of the present invention executes the source executable file and executes the stub file when the execution request of the application is made; Checking whether there is an external method that is not a normal calling method stored in the stub file using the call stack of the stub file; And determining whether the application is to be executed if the external method is found, and if the external method is not found, executing the original executable file.

이때 Custom image flashing 여부, 시스템 속성값 변경 여부, Su 명령어 존재 여부, Busybox를 통한 추가 명령어 삽입 여부, read-only 영역의 파일 시스템에 write 속성이 추가되었는지 여부, 루팅 관련 어플리케이션 설치 여부 및 Root 권한으로 실행되고 있는 프로세스가 있는지 여부 중 적어도 하나를 판단하여 루팅 시도를 탐지하는 단계를 더 포함할 수 있다. At this time, whether the custom image is flashing, whether the system property value is changed, Su command exists, whether additional command is inserted through Busybox, whether the write property is added to the file system of the read-only area, And determining whether at least one of the processes is being executed.

또한 상기 실행 여부 결정 단계에서, 상기 루팅 시도가 탐지된 경우 상기 어플리케이션을 종료하고, 상기 외부 메소드가 발견되지 않고 상기 루팅 시도가 탐지되지 않은 경우 상기 원본 실행 파일이 실행되도록 할 수 있다. In addition, in the execution determination step, the application may be terminated when the routing attempt is detected, and the original execution file may be executed if the external method is not found and the routing attempt is not detected.

더불어 디버깅을 위한 플래그의 유무를 판단하여 디버깅 시도를 탐지하는 단계;를 더 포함하고, 상기 실행 여부 결정 단계에서, 상기 디버깅 시도가 탐지된 경우 상기 어플리케이션을 종료하고, 상기 외부 메소드가 발견되지 않고 상기 디버깅 시도가 탐지되지 않은 경우 상기 원본 실행 파일이 실행되도록 할 수 있다. Further comprising the step of determining whether or not a flag for debugging is detected to detect a debugging attempt, wherein if the debugging attempt is detected, the application is terminated, and if the external method is not found If the debugging attempt is not detected, the original executable file can be executed.

또한 상기 실행 여부 결정 단계에서 상기 원본 실행파일이 실행되도록 결정되기 전까지 상기 스텁 파일은 상기 원본 실행파일의 초기 이름으로 존재하며, 상기 원본 실행파일은 초기 위치 또는 초기 이름이 변경된 채 존재할 수 있다.Also, the stub file exists as an initial name of the original executable file until the original executable file is determined to be executed in the execution determination step, and the original executable file may exist while the initial or initial name is changed.

아울러 상기 실행 여부 결정 단계에서 상기 원본 실행파일이 실행되도록 결정되면, 상기 스텁 파일은 상기 원본 실행파일의 변경된 위치 또는 변경된 이름을 상기 초기 위치 또는 상기 초기 이름으로 복구하여 상기 어플리케이션을 실행시킬 수 있다. If it is determined that the original executable file is to be executed in the execution decision step, the stub file can restore the changed or changed name of the original executable file to the initial location or the initial name to execute the application.

본 발명의 실시예에 따르면, 어플리케이션의 루팅 및 디버깅 시도를 차단할 뿐만 아니라, 호출 스택을 이용하여 루팅 및 디버깅을 탐지하는 기법에 대한 우회 공격을 탐지함으로써 역공학 시도를 차단할 수 있다. In accordance with an embodiment of the present invention, it is possible to block reverse engineering attempts by not only blocking an application's routing and debugging attempts, but also detecting bypassing attacks on techniques for detecting routing and debugging using a call stack.

도 1은 어플리케이션이 실행되는 경우 기본적인 메소드 호출 순서와 우회 공격이 발생하는 경우 메소드 호출 순서를 비교한 도면이다.
도 2는 어플리케이션에 스텁 파일이 설치되기 전과 후의 폴더 및 파일 구성을 비교한 도면이다.
도 3은 일 실시예에 따른 호출 스택을 이용한 역공학 차단 방법을 설명하기 위한 순서도이다.
FIG. 1 is a diagram comparing a basic method calling order when an application is executed and a method calling order when a bypass attack occurs.
FIG. 2 is a diagram comparing folders and file configurations before and after stub files are installed in an application.
3 is a flowchart illustrating a reverse engineering blocking method using a call stack according to an embodiment.

본 발명의 목적과 기술적 구성 및 그에 따른 작용 효과에 관한 자세한 사항은 본 발명의 명세서에 첨부된 도면에 의거한 이하의 상세한 설명에 의해 보다 명확하게 이해될 것이다. 첨부된 도면을 참조하여 본 발명에 따른 실시예를 상세하게 설명한다.DETAILED DESCRIPTION OF THE EMBODIMENTS Reference will now be made in detail to the preferred embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like reference numerals refer to the like elements throughout. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment according to the present invention will be described in detail with reference to the accompanying drawings.

본 명세서에서 개시되는 실시예들은 본 발명의 범위를 한정하는 것으로 해석되거나 이용되지 않아야 할 것이다. 이 분야의 통상의 기술자에게 본 명세서의 실시예를 포함한 설명은 다양한 응용을 갖는다는 것이 당연하다. 따라서, 본 발명의 상세한 설명에 기재된 임의의 실시예들은 본 발명을 보다 잘 설명하기 위한 예시적인 것이며 본 발명의 범위가 실시예들로 한정되는 것을 의도하지 않는다.The embodiments disclosed herein should not be construed or interpreted as limiting the scope of the present invention. It will be apparent to those of ordinary skill in the art that the description including the embodiments of the present specification has various applications. Accordingly, any embodiment described in the Detailed Description of the Invention is illustrative for a better understanding of the invention and is not intended to limit the scope of the invention to embodiments.

도면에 표시되고 아래에 설명되는 기능 블록들은 가능한 구현의 예들일 뿐이다. 다른 구현들에서는 상세한 설명의 사상 및 범위를 벗어나지 않는 범위에서 다른 기능 블록들이 사용될 수 있다. 또한, 본 발명의 하나 이상의 기능 블록이 개별 블록들로 표시되지만, 본 발명의 기능 블록들 중 하나 이상은 동일 기능을 실행하는 다양한 하드웨어 및 소프트웨어 구성들의 조합일 수 있다.The functional blocks shown in the drawings and described below are merely examples of possible implementations. In other implementations, other functional blocks may be used without departing from the spirit and scope of the following detailed description. Also, although one or more functional blocks of the present invention are represented as discrete blocks, one or more of the functional blocks of the present invention may be a combination of various hardware and software configurations that perform the same function.

또한, 어떤 구성요소들을 포함한다는 표현은 개방형의 표현으로서 해당 구성요소들이 존재하는 것을 단순히 지칭할 뿐이며, 추가적인 구성요소들을 배제하는 것으로 이해되어서는 안 된다.In addition, the expression "including any element" is merely an expression of an open-ended expression, and is not to be construed as excluding the additional elements.

나아가 어떤 구성요소가 다른 구성요소에 연결되어 있다거나 접속되어 있다고 언급될 때에는, 그 다른 구성요소에 직접적으로 연결 또는 접속되어 있을 수도 있지만, 중간에 다른 구성요소가 존재할 수도 있다고 이해되어야 한다. Further, when a component is referred to as being connected or connected to another component, it may be directly connected or connected to the other component, but it should be understood that there may be other components in between.

또한 '제1, 제2' 등과 같은 표현은 복수의 구성들을 구분하기 위한 용도로만 사용된 표현으로써, 구성들 사이의 순서나 기타 특징들을 한정하지 않는다. Also, the expressions such as 'first, second', etc. are used only to distinguish a plurality of configurations, and do not limit the order or other features between configurations.

이하에서는 도면들을 참조하여 본 발명의 실시예들에 대해 설명하도록 한다. Hereinafter, embodiments of the present invention will be described with reference to the drawings.

도 1은 어플리케이션이 실행되는 경우 기본적인 메소드 호출 순서와 우회 공격이 발생하는 경우 메소드 호출 순서를 비교한 도면이다. FIG. 1 is a diagram comparing a basic method calling order when an application is executed and a method calling order when a bypass attack occurs.

도 1을 참조하면, 우회 공격은 주로 시스템 콜 혹은 라이브러리 함수 등을 후킹하고 매개변수 및 반환값 등을 변조하여, 정상적인 흐름과 다르게 매개변수 및 반환값을 변경함으로써 이루어진다. 안드로이드 상에 라이브러리 함수를 후킹을 하기 위해서 사용되는 툴로는, 예를 들면 Xposed 등이 있다. Xposed는 도 1과 같이 Original 함수 내에 매개변수 및 반환값 등을 변조하여, Invoke Original.func()를 통한 Original 함수 호출 시 매개변수 변환에 의하여 Hook 함수가 실행되고, Hook 함수의 실행에 따라 원하는 동작(예를 들면 루팅, 디버깅)을 수행한 후, Original 함수가 다시 수행되도록 한다. Referring to FIG. 1, a detour is mainly performed by hooking up a system call or a library function, modulating parameters and return values, and changing parameters and return values differently from the normal flow. Examples of tools used to hook library functions on Android include Xposed. As shown in Fig. 1, Xposed modifies parameters and return values in original function, and Hook function is executed by parameter conversion when invoking Original function through Invoke Original.func (), and a desired operation (Eg, routing, debugging), and then let the Original function run again.

따라서 우회 공격이 이루어지는 경우 함수의 호출 순서가 변경된다는 점에 착안하여 본 발명의 실시예에서는 호출 스택을 이용해 우회 공격을 탐지하는 방법을 제안한다. Therefore, when the detour attack is performed, the calling order of the function is changed, and in the embodiment of the present invention, a method of detecting the detour attack using the call stack is proposed.

도 2는 어플리케이션에 스텁 파일이 설치되기 전과 후의 폴더 및 파일 구성을 비교한 도면이다.FIG. 2 is a diagram comparing folders and file configurations before and after stub files are installed in an application.

도 2를 참조하면, 어플리케이션의 실행 요청이 있는 경우, 어플리케이션의 원본 실행파일(classes.dex)보다 스텁 파일(Stub.dex)이 먼저 실행될 수 있도록 원본 실행파일의 초기 이름 또는 초기 위치를 변경하고, 스텁 파일을 원본 실행파일의 초기 이름으로 지정하여 삽입할 수 있다. 여기서 초기 이름 및 초기 위치란, 스텁 파일이 어플리케이션에 삽입되기 전, 원본 실행파일의 이름 및 위치를 의미한다. Referring to FIG. 2, when an application execution request is made, the initial name or initial position of the original executable file is changed so that the stub file (Stub.dex) can be executed first of the application executable file (classes.dex) You can insert the stub file by specifying it as the initial name of the original executable file. The initial name and initial location here refer to the name and location of the original executable file before the stub file is inserted into the application.

예를 들면 스텁 파일을 삽입 후, 기존에 존재하는 원본 실행파일(classes.dex)을 /assets 폴더로 이동시키고, 스텁 파일의 이름을 원본 실행파일의 초기 이름 classes.dex으로 지정하여 기존에 존재하는 원본 실행파일을 대체하여 스텁 파일이 실행되도록 할 수 있다. For example, after inserting a stub file, move the existing executable file (classes.dex) to the / assets folder and specify the name of the stub file as the initial name of the original executable file, classes.dex. You can replace the original executable so that the stub file is executed.

이와 같은 스텁 파일의 설치는, 예를 들면 앱스토어 등의 서버가 제공하는 개발자 인터페이스를 통해 이루어질 수 있으며, 또한 개발자 입장에서 개발된 앱에 스텁 파일을 설치하여 이를 앱스토어 등의 서버에 등록할 수 있다. 그러나, 이에 한정되는 것은 아니며 다양한 방법으로 어플리케이션에 스텁 파일을 설치한 후 사용자들에게 배포할 수 있다. Such a stub file can be installed, for example, through a developer interface provided by a server such as an app store. In addition, a stub file can be installed in an app developed by a developer and registered in a server such as an app store have. However, the present invention is not limited to this, and it is possible to install stub files in an application in various ways and distribute them to users.

도 3은 일 실시예에 따른 역공학을 차단하는 방법을 설명하기 위한 순서도이다. 도 3을 통해 설명된 역공학을 차단하는 방법은 원본 실행파일과 스텁(Stub) 파일을 포함하는 어플리케이션, 또는 아래의 각 단계를 수행하는 적어도 하나의 프로세서를 갖는 장치에 의해 수행될 수 있으며, 각 단계를 설명하면 다음과 같다.3 is a flowchart illustrating a method of blocking reverse engineering according to an embodiment. 3 may be performed by an application including a source executable file and a stub file, or an apparatus having at least one processor performing each of the following steps, The steps are as follows.

우선, 어플리케이션에 대한 실행 요청이 있는 경우, 스텁 파일이 실행된다(S310). 스텁 파일은 개발자가 만든 어플리케이션의 원본 패키지 내에 역공학 방지를 위해 추가적으로 삽입되어 있는 파일을 의미하며, 스텁 파일이 삽입되는 과정 및 스텁 파일이 실행되는 과정은 도 2와 함께 상술하였다. First, if there is an execution request for the application, the stub file is executed (S310). The stub file refers to a file that is additionally inserted into the original package of the application created by the developer to prevent reverse engineering. The process of inserting the stub file and the process of executing the stub file have been described above with reference to FIG.

일 실시예에 따른 스텁 파일은 루팅 및 디버깅 탐지를 위한 메소드를 저장할 수 있고, 특히 호출 스택을 이용하여 루팅, 디버깅 시도를 탐지하고, 더불어 루팅 및 디버깅 시도 탐지를 우회하기 위한 시도를 차단할 수 있다. 이를 위해 스텁 파일은 루팅, 디버깅을 탐지하기 위한 메소드 및 정상 실행 시 호출되는 메소드에 대한 정보를 저장해 둘 수 있다. A stub file according to one embodiment may store methods for detecting routing and debugging, and in particular may attempt to detect routing and debugging attempts using the call stack, as well as attempts to bypass routing and debug attempt detection. To do this, the stub file can store information about routines, methods for detecting debugging, and methods invoked during normal execution.

따라서, 스텁 파일이 실행되면 스텁 파일은 루팅 시도 탐지를 위한 메소드를 실행하여 루팅 시도를 탐지할 수 있다(S320). 이때 스텁 파일은 아래의 예시를 구현하기 위한 메소드를 포함할 수 있다. Accordingly, when the stub file is executed, the stub file can execute the method for detecting the routing attempt to detect the routing attempt (S320). At this point, the stub file can contain methods to implement the example below.

예를 들어 자바 어플리케이션의 경우, /system/build.prop 파일을 읽어 ro.build.tags 값 검사를 진행하여 "release-key" 문자열을 확인함으로써 custom image flashing 여부를 확인할 수 있다. For example, for a Java application, you can check whether the custom image is flashing by reading the file /system/build.prop and checking the value of ro.build.tags to see the "release-key" string.

또한 Runtime().exec("getprop") 메소드를 실행시켜 system properties 값들을 가져온 후 ro.debuggable와 ro.secure 값을 검사하여 시스템 속성값 변경 여부를 확인할 수 있다. You can also run the Runtime (). Exec ("getprop") method to retrieve the system properties and check the ro.debuggable and ro.secure values to see if the system property value has changed.

더불어 /system/(x)bin, /data/local/(x)bin 등의 디렉토리에 su 명령어를 검색하여 su 명령어 존재 여부를 확인할 수 있다. In addition, you can check the existence of the su command by searching for the su command in a directory such as / system / (x) bin or / data / local / (x) bin.

아울러 'find', 'tail', 'lsof'와 같은 명령어를 Runtime().exec() 메소드를 통해 실행이 가능한지 검사하여 Busybox를 통한 추가 명령어 삽입 여부를 확인할 수 있다. You can also check whether commands like 'find', 'tail', and 'lsof' can be executed through the Runtime (). Exec () method to check whether additional commands are inserted through Busybox.

더하여 mount 명령어를 실행시켜 read-only 영역의 파일 시스템에 write 속성이 추가되었는지 확인하여 파일 시스템 속성을 확인할 수 있다. In addition, you can check the file system attributes by running the mount command to see if the write attribute has been added to the file system of the read-only area.

또한 현재 설치된 어플리케이션들을 getPackageInfo() 메소드를 통해 가져 온 후 공지된 루팅 관련 어플리케이션의 리스트와 비교를 하여 루팅 관련 어플리케이션 설치 여부를 확인할 수 있다. In addition, currently installed applications can be imported through the getPackageInfo () method and compared with a list of known routing related applications, thereby confirming whether or not the routing related application is installed.

더불어 Runtime().exec("ps") 메소드를 실행시켜 현재 실행되고 있는 프로세스를 가져와 루트 권한으로 실행되고 있는 프로세스들를 확인하고, 루트 권한으로 실행되고 있는 프로세스의 부모 프로세스가 zygote가 아닌 경우가 있는지 확인할 수 있다. In addition, execute the Runtime (). Exec ("ps") method to get the currently running process and check which processes are running as root, and if the parent process of the process running as root is not zygote Can be confirmed.

위와 같이 루팅 시도 탐지 결과, 적어도 어느 하나에 해당하는 경우에는 루팅 시도가 있는 것으로 간주하여 어플리케이션은 실행을 종료하여 루팅 시도를 차단할 수 있다(S350). If at least one of the routing attempts is detected, the application is regarded as having a routing attempt and the execution can be terminated to block the routing attempt (S350).

또한, 스텁 파일이 실행되면 스텁 파일은 디버깅 시도 탐지를 위한 메소드를 실행하여 디버깅 시도를 탐지할 수 있다(S330). 이때 스텁 파일은 아래의 예시를 구현하기 위한 메소드를 포함할 수 있다.In addition, when the stub file is executed, the stub file can detect a debugging attempt by executing a method for detecting a debugging attempt (S330). At this point, the stub file can contain methods to implement the example below.

예를 들어 자바 어플리케이션의 경우, AndroidManifest.xml에 디버깅을 하기 위한 플래그인 "Android:debuggable=true"가 있는 경우, 디버깅 시도가 있는 것이므로, ApplicationInfo.flags 변수에 현재 실행되고 있는 어플리케이션의 플래그 값들을 검사하여 해당 어플리케이션의 android:debuggable 값이 true인지 검사하여 디버깅 시도를 판단할 수 있다. For example, in the case of a Java application, if there is a flag "Android: debuggable = true" for debugging in AndroidManifest.xml, there is an attempt to debug. Therefore, the application flag of the application currently being executed in the ApplicationInfo.flags variable is checked To determine if the application's android: debuggable value is true and attempt to debug it.

위와 같이 디버깅 시도 탐지 결과, 적어도 어느 하나에 해당하는 경우에는 디버깅 시도가 있는 것으로 간주하여 어플리케이션은 실행을 종료하여 디버깅 시도를 차단할 수 있다(S350). If it is determined that there is at least one of the debugging attempts as described above, it is regarded that there is a debugging attempt and the application can terminate the execution and block the debugging attempt (S350).

더불어, 스텁 파일이 실행되면 스텁 파일은 호출 스택을 이용하여 스텁 파일에 저장된 정상적인 호출 메소드가 아닌 외부 메소드가 있는지 검사할 수 있다(S340). In addition, when the stub file is executed, the stub file can check the existence of an external method (S340) by using the call stack instead of the normal calling method stored in the stub file.

예를 들어 스텁 파일은 자바 어플리케이션에 적용되는 경우, For example, if the stub file is applied to a Java application,

dalvik.system.NativeStart->main: 앱을 구동시키기 위한 dalvik 공간을 생성하는 과정을 진행하는 메소드,dalvik.system.NativeStart-> main: method to create dalvik space to run the app,

com.android.internal.os.ZygoteInit->main: 앱이 실행될 때 필요한 프리 로드 클래스와 프리 로드 시스템 리소스를 로딩하는 메소드,com.android.internal.os.ZygoteInit-> main: Preload classes needed when the app is executed, and methods for loading preload system resources,

android.app.ActivityThread->main: 메시지 큐를 생성한 다음, 메시지 루프를 동작시키는 과정을 진행하는 메소드,android.app.ActivityThread-> main: a method that creates a message queue and then runs a message loop,

android.os.Looper->loop: 처리해야할 메시지가 도착하게 되면 이를 처리하기 위해 대기시키는 메소드android.os.Looper-> loop: a method to wait for a message to be processed when it arrives

와 같이 어플리케이션이 동작하기 위해 필요한 동작으로 모든 자바 어플리케이션에 공통적으로 존재하는 정상적인 호출 메소드를 스텁 파일 내에 저장할 수 있다. The normal calling method that is common to all Java applications can be stored in the stub file.

이때 호출 스택은 메소드의 작업에 필요한 메모리 공간을 제공할 수 있다. 메소드가 호출되면 호출 스택에 호출된 메소드를 위한 메모리가 할당되며, 이 메모리는 메소드가 작업을 수행하는 동안 지역변수(매개변수 포함)들과 연산의 중간 결과 등을 저장하는데 사용된다. At this point, the call stack can provide the memory space required for the method's operation. When the method is called, memory is allocated for the called method on the call stack, which is used to store local variables (including parameters) and intermediate results of the operation while the method is performing its work.

따라서 호출 스택을 검사해 보면 메소드 간의 호출관계와 현재 수행중인 메소드가 어느 것인지 알 수 있으며, 스텁 파일에 저장된 메소드가 아닌 외부 메소드가 있는지 확인하여 우회 공격 시도를 탐지하여 차단 할 수 있다.Therefore, by examining the call stack, it is possible to know which relationship between the methods is being executed and which method is currently being executed, and it is possible to detect and block a bypass attempt by checking whether there is an external method other than the method stored in the stub file.

예를 들어 자바 어플리케이션의 경우, 스텁 파일을 통해 Try, cath문을 이용하여 exception 객체를 생성한 후, getStackTrace() 메소드를 통해 해당 함수 호출 시점까지 호출 스택 정보들을 가져올 수 있다. 이때 가져온 정보들을 StackTraceElement 객체에 하나씩 담아서 클래스명, 메소드명 정보 출력할 수 있다. For example, in a Java application, you can create an exception object using the Try and Cath statements through a stub file, and then retrieve the call stack information through the getStackTrace () method up to the point of the function call. At this time, the class information and the method name information can be output by putting the imported information into the StackTraceElement object one by one.

이때 호출 스택 검사 결과, 스텁 파일에 저장된 메소드가 아닌 외부 메소드가 발견된 경우, 우회 공격 시도가 있는 것으로 간주하여 어플리케이션은 실행을 종료하여 우회 공격 시도를 차단할 수 있다(S350). At this time, if an external method other than the method stored in the stub file is found as a result of the call stack check, it is regarded that there is a detour attack, and the application can terminate the execution and block the detour attack attempt (S350).

한편, 호출 스택 검사 결과, 스텁 파일에 저장된 정상적인 호출 메소드가 아닌 외부 메소드가 발견되지 않은 경우 원본 실행파일을 실행한다(S360).On the other hand, if it is determined that an external method other than the normal calling method stored in the stub file is not found as a result of the call stack check, the original executable file is executed (S360).

예를 들어 도 2에서와 같이, 기존에 존재하는 원본 실행파일(classes.dex)을 /assets 폴더로 이동시킨 후, 스텁 파일을 classes.dex 파일명으로 삽입하여 기존에 존재하는 원본 실행파일을 대체하여 먼저 실행되도록 한 경우에는, 원본 실행파일을 DexClassLoader() 메소드를 이용하여 클래스 로더를 생성한 후, 실행 중인 스텁 파일의 클래스 로더를 원본 실행파일의 클래스 로더로 치환하기 위해 makeApplication() 메소드를 호출할 수 있다. 치환된 원본 실행파일은 시작 컴포넌트의 onCreate() 메소드를 호출하게 되어 어플리케이션이 정상적으로 실행될 수 있다. For example, as shown in FIG. 2, move an existing executable file (classes.dex) to the / assets folder, insert a stub file as a classes.dex file name, and replace the existing executable file If it is executed first, create the class loader using the DexClassLoader () method for the original executable file, and then call the makeApplication () method to replace the class loader of the running stub file with the class loader of the original executable file. . The replacement source executable file will invoke the onCreate () method of the startup component so that the application can execute normally.

한편, 일 실시예에 따른 역공학을 차단하는 방법은 어플리케이션의 실행 요청이 있는 경우뿐만 아니라, 어플리케이션의 실행 중에도 호출 스택을 검사하여 수행될 수 있다. 즉, 어플리케이션의 최초 실행시에 더하여 어플리케이션의 실행 중에도 제안 기법을 수행할 수 있다. 이때 어플리케이션의 실행 중간에 수행하기 위해서, 제안 기법을 서비스 형태로 등록하여 백그라운드에서 주기적으로 호출 스택을 검사하여 우회 공격을 탐지하도록 구현할 수 있다.Meanwhile, the method of blocking reverse engineering according to an embodiment can be performed not only when there is an execution request of an application, but also by inspecting the call stack even during execution of an application. In other words, the proposed method can be executed during the execution of the application in addition to the initial execution of the application. In this case, in order to perform the execution during the execution of the application, the proposed technique may be registered as a service type, and the call stack may be periodically checked in the background to detect the bypass attack.

상술한 본 발명의 실시예들은 다양한 수단을 통해 구현될 수 있다. 예를 들어, 본 발명의 실시예들은 하드웨어, 펌웨어(firmware), 소프트웨어 또는 그것들의 결합 등에 의해 구현될 수 있다.The above-described embodiments of the present invention can be implemented by various means. For example, embodiments of the present invention may be implemented by hardware, firmware, software, or a combination thereof.

하드웨어에 의한 구현의 경우, 본 발명의 실시예들에 따른 방법은 하나 또는 그 이상의 ASICs(Application Specific Integrated Circuits), DSPs(Digital Signal Processors), DSPDs(Digital Signal Processing Devices), PLDs(Programmable Logic Devices), FPGAs(Field Programmable Gate Arrays), 프로세서, 컨트롤러, 마이크로 컨트롤러, 마이크로 프로세서 등에 의해 구현될 수 있다.In the case of hardware implementation, the method according to embodiments of the present invention may be implemented in one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs) , FPGAs (Field Programmable Gate Arrays), processors, controllers, microcontrollers, microprocessors, and the like.

펌웨어나 소프트웨어에 의한 구현의 경우, 본 발명의 실시예들에 따른 방법은 이상에서 설명된 기능 또는 동작들을 수행하는 모듈, 절차 또는 함수 등의 형태로 구현될 수 있다. 소프트웨어 코드는 메모리 유닛에 저장되어 프로세서에 의해 구동될 수 있다. 상기 메모리 유닛은 상기 프로세서 내부 또는 외부에 위치하여, 이미 공지된 다양한 수단에 의해 상기 프로세서와 데이터를 주고 받을 수 있다.In the case of an implementation by firmware or software, the method according to embodiments of the present invention may be implemented in the form of a module, a procedure or a function for performing the functions or operations described above. The software code can be stored in a memory unit and driven by the processor. The memory unit may be located inside or outside the processor, and may exchange data with the processor by various well-known means.

이와 같이, 본 발명이 속하는 기술분야의 당업자는 본 발명이 그 기술적 사상이나 필수적 특징을 변경하지 않고서 다른 구체적인 형태로 실시될 수 있다는 것을 이해할 수 있을 것이다. 그러므로 이상에서 기술한 실시예들은 모든 면에서 예시적인 것이며 한정적인 것이 아닌 것으로서 이해해야만 한다. 본 발명의 범위는 상기 상세한 설명보다는 후술하는 특허청구범위에 의하여 나타내어지며, 특허청구범위의 의미 및 범위 그리고 그 등가개념으로부터 도출되는 모든 변경 또는 변형된 형태가 본 발명의 범위에 포함되는 것으로 해석되어야 한다. Thus, those skilled in the art will appreciate that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof. It is therefore to be understood that the embodiments described above are to be considered in all respects only as illustrative and not restrictive. The scope of the present invention is defined by the appended claims rather than the detailed description and all changes or modifications derived from the meaning and scope of the claims and their equivalents are to be construed as being included within the scope of the present invention do.

Claims (12)

하나 이상의 프로세서에 의해 수행되는 어플리케이션에 대한 역공학 차단 방법에 있어서,
어플리케이션의 원본 실행파일을 대체하여 실행되며, 루팅 및 디버깅 탐지를 하는 복수의 메소드 및 상기 어플리케이션이 정상적으로 동작하는 경우 호출되는 메소드에 대한 정보가 저장된 스텁(stub) 파일을 상기 어플리케이션에 삽입하는 단계;
상기 어플리케이션의 실행 요청이 있는 경우, 상기 원본 실행파일을 대체하여 상기 스텁 파일을 실행시키는 단계;
상기 스텁 파일에 저장된 상기 복수의 메소드 중 호출 스택을 검사하는 메소드를 실행하여, 상기 스텁 파일에 저장된 상기 정상적으로 동작하는 경우 호출되는 메소드에 대한 정보가 아닌 외부 메소드가 상기 호출 스택에 있는지 검사하는 단계; 및
상기 외부 메소드가 발견된 경우 상기 어플리케이션을 종료하고, 상기 외부 메소드가 발견되지 않은 경우 상기 원본 실행파일이 실행되도록 하는 어플리케이션 실행 여부 결정 단계를 포함하는
어플리케이션에 대한 역공학 차단 방법.
CLAIMS What is claimed is: 1. A method for blocking reverse engineering for an application performed by one or more processors,
Inserting a stub file, which is executed by replacing the original executable file of the application, storing a plurality of methods for performing routing and debugging detection and information about a method to be called when the application normally operates, into the application;
Executing the stub file by replacing the original executable file when there is an execution request of the application;
Executing a method for inspecting a call stack among the plurality of methods stored in the stub file to check whether an external method stored in the stub file, which is not information about a method to be called in the normal operation, exists in the call stack; And
Determining whether the application is executed if the external method is found and if the external method is not found, executing the original executable file;
A method of blocking reverse engineering for an application.
제1항에 있어서,
상기 복수의 메소드는 루팅 시도를 탐지하는 메소드로서,
Custom image flashing 여부, 시스템 속성값 변경 여부, Su 명령어 존재 여부, Busybox를 통한 추가 명령어 삽입 여부, read-only 영역의 파일 시스템에 write 속성이 추가되었는지 여부, 루팅 관련 어플리케이션 설치 여부 및 Root 권한으로 실행되고 있는 프로세스가 있는지 여부 를 검사하는 메소드 중 적어도 하나를 포함하고,
상기 실행 여부 결정 단계는,
상기 루팅 시도를 탐지하는 메소드를 통해 상기 루팅 시도가 탐지된 경우 상기 어플리케이션을 종료하고, 상기 외부 메소드가 발견되지 않고 상기 루팅 시도가 탐지되지 않은 경우 상기 원본 실행 파일이 실행되도록 하는,
어플리케이션에 대한 역공학 차단 방법.
The method according to claim 1,
Wherein the plurality of methods are methods for detecting a routing attempt,
It is executed with custom image flashing, whether the system property value is changed, Su command exists, whether additional command is inserted through Busybox, whether the write attribute is added to the file system of the read-only area, And a method for checking whether or not a process is present,
The method of claim 1,
Wherein the application is terminated when the routing attempt is detected through a method for detecting the routing attempt, and the source executable file is executed when the routing method is not detected and the external method is not found.
A method of blocking reverse engineering for an application.
제1항에 있어서,
상기 복수의 메소드는 디버깅 시도를 탐지하는 메소드로서,
디버깅을 위한 플래그의 유무를 판단하는 메소드를 포함하고,
상기 실행 여부 결정 단계는,
상기 디버깅 시도를 탐지하는 메소드를 통해 상기 디버깅 시도가 탐지된 경우 상기 어플리케이션을 종료하고, 상기 외부 메소드가 발견되지 않고 상기 디버깅 시도가 탐지되지 않은 경우 상기 원본 실행 파일이 실행되도록 하는,
어플리케이션에 대한 역공학 차단 방법.
The method according to claim 1,
Wherein the plurality of methods are methods for detecting a debugging attempt,
Includes a method for determining the presence or absence of a flag for debugging,
The method of claim 1,
The method comprising: detecting a debugging attempt by the debugging method; terminating the application if the debugging attempt is detected through the method of detecting the debugging attempt; and executing the original executable file if the debugging attempt is not detected without the external method being found.
A method of blocking reverse engineering for an application.
제1항에 있어서,
상기 실행 여부 결정 단계에서 상기 원본 실행파일이 실행되도록 결정되기 전까지 상기 스텁 파일은 상기 원본 실행파일의 초기 이름으로 존재하며, 상기 원본 실행파일은 초기 위치 또는 초기 이름이 변경된 채 존재하는,
어플리케이션에 대한 역공학 차단 방법.
The method according to claim 1,
Wherein the stub file exists as an initial name of the original executable file until the original executable file is determined to be executed in the execution decision step,
A method of blocking reverse engineering for an application.
제4항에 있어서,
상기 실행 여부 결정 단계에서 상기 원본 실행파일이 실행되도록 결정되면, 상기 스텁 파일은 상기 원본 실행파일의 변경된 위치 또는 변경된 이름을 상기 초기 위치 또는 상기 초기 이름으로 복구하여 상기 어플리케이션을 실행시키는,
어플리케이션에 대한 역공학 차단 방법.
5. The method of claim 4,
Wherein the stub file restores the modified or changed name of the original executable file to the initial location or the initial name and executes the application if the original executable file is determined to be executed in the execution determination step,
A method of blocking reverse engineering for an application.
하나 이상의 프로세서를 포함하는 역공학 차단 장치에 있어서,
상기 하나 이상의 프로세서는,
어플리케이션의 원본 실행파일을 대체하여 실행되며, 루팅 및 디버깅 탐지를 하는 복수의 메소드 및 상기 어플리케이션이 정상적으로 동작하는 경우 호출되는 메소드에 대한 정보가 저장된 스텁(stub) 파일을 상기 어플리케이션에 삽입하는 단계;
상기 어플리케이션의 실행 요청이 있는 경우, 상기 원본 실행파일을 대체하여 스텁 파일을 실행시키는 단계;
상기 스텁 파일에 저장된 상기 복수의 메소드 중 호출 스택을 검사하는 메소드를 실행하여, 상기 스텁 파일에 저장된 상기 정상적으로 동작하는 경우 호출되는 메소드에 대한 정보가 아닌 외부 메소드가 상기 호출 스택에 있는지 검사하는 단계; 및
상기 외부 메소드가 발견된 경우 상기 어플리케이션을 종료하고, 상기 외부 메소드가 발견되지 않은 경우 상기 원본 실행파일이 실행되도록 하는 어플리케이션 실행 여부 결정 단계를 수행하는
역공학 차단 장치.
A reverse-engineering interrupter comprising one or more processors,
Wherein the one or more processors comprise:
Inserting a stub file, which is executed by replacing the original executable file of the application, storing a plurality of methods for performing routing and debugging detection and information about a method to be called when the application normally operates, into the application;
Executing a stub file by replacing the original executable file when there is a request to execute the application;
Executing a method for inspecting a call stack among the plurality of methods stored in the stub file to check whether an external method stored in the stub file, which is not information about a method to be called in the normal operation, exists in the call stack; And
If the external method is found, terminating the application, and if the external method is not found, executing the original executable file is performed
Reverse engineering interrupter.
제6항에 있어서,
상기 복수의 메소드는 루팅 시도를 탐지하는 메소드로서,
Custom image flashing 여부, 시스템 속성값 변경 여부, Su 명령어 존재 여부, Busybox를 통한 추가 명령어 삽입 여부, read-only 영역의 파일 시스템에 write 속성이 추가되었는지 여부, 루팅 관련 어플리케이션 설치 여부 및 Root 권한으로 실행되고 있는 프로세스가 있는지 여부를 검사하는 메소드 중 적어도 하나를 포함하고,
상기 실행 여부 결정 단계는,
상기 루팅 시도를 탐지하는 메소드를 통해 상기 루팅 시도가 탐지된 경우 상기 어플리케이션을 종료하고, 상기 외부 메소드가 발견되지 않고 상기 루팅 시도가 탐지되지 않은 경우 상기 원본 실행 파일이 실행되도록 하는,
역공학 차단 장치.
The method according to claim 6,
Wherein the plurality of methods are methods for detecting a routing attempt,
It is executed with custom image flashing, whether the system property value is changed, Su command exists, whether additional command is inserted through Busybox, whether the write attribute is added to the file system of the read-only area, And a method for checking whether or not a process is present,
The method of claim 1,
Wherein the application is terminated when the routing attempt is detected through a method for detecting the routing attempt, and the source executable file is executed when the routing method is not detected and the external method is not found.
Reverse engineering interrupter.
제6항에 있어서,
상기 복수의 메소드는 디버깅 시도를 탐지하는 메소드로서,
디버깅을 위한 플래그의 유무를 판단하여 디버깅 시도를 탐지하는 메소드를 포함하고,
상기 실행 여부 결정 단계는,
상기 디버깅 시도를 탐지하는 메소드를 통해 상기 디버깅 시도가 탐지된 경우 상기 어플리케이션을 종료하고, 상기 외부 메소드가 발견되지 않고 상기 디버깅 시도가 탐지되지 않은 경우 상기 원본 실행 파일이 실행되도록 하는,
역공학 차단 장치.
The method according to claim 6,
Wherein the plurality of methods are methods for detecting a debugging attempt,
And a method for detecting a debugging attempt by determining the presence or absence of a flag for debugging,
The method of claim 1,
The method comprising: detecting a debugging attempt by the debugging method; terminating the application if the debugging attempt is detected through the method of detecting the debugging attempt; and executing the original executable file if the debugging attempt is not detected without the external method being found.
Reverse engineering interrupter.
제8항에 있어서,
상기 실행 여부 결정 단계에서 상기 원본 실행파일이 실행되도록 결정되기 전까지 상기 스텁 파일은 상기 원본 실행파일의 초기 이름으로 존재하며, 상기 원본 실행파일은 초기 위치 또는 초기 이름이 변경된 채 존재하도록 하는,
역공학 차단 장치.
9. The method of claim 8,
Wherein the stub file exists as an initial name of the original executable file until the original executable file is determined to be executed in the execution decision step and that the original executable file exists while the initial location or the initial name is changed,
Reverse engineering interrupter.
제9항에 있어서,
상기 실행 여부 결정 단계에서 상기 원본 실행파일이 실행되도록 결정되면, 상기 스텁 파일은 상기 원본 실행파일의 변경된 위치 또는 변경된 이름을 상기 초기 위치 또는 상기 초기 이름으로 복구하여 상기 어플리케이션을 실행시키는,
역공학 차단 장치.
10. The method of claim 9,
Wherein the stub file restores the modified or changed name of the original executable file to the initial location or the initial name and executes the application if the original executable file is determined to be executed in the execution determination step,
Reverse engineering interrupter.
제1항 내지 제5항 중 어느 한 항의 방법을 프로세서가 수행하도록 하는 컴퓨터 판독 가능 기록매체에 저장된 컴퓨터 프로그램.
A computer program stored on a computer readable medium for causing a processor to perform the method of any one of claims 1 to 5.
제1항 내지 제5항 중 어느 한 항의 방법을 프로세서가 수행하게 하는 명령어를 포함하는 컴퓨터 프로그램이 기록된 컴퓨터 판독 가능 기록매체.A computer-readable recording medium having recorded thereon a computer program for causing a processor to perform the method of any one of claims 1 to 5.
KR1020160108999A 2016-08-26 2016-08-26 Method and apparatus for preventing reverse engineering KR101842263B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020160108999A KR101842263B1 (en) 2016-08-26 2016-08-26 Method and apparatus for preventing reverse engineering

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020160108999A KR101842263B1 (en) 2016-08-26 2016-08-26 Method and apparatus for preventing reverse engineering

Publications (2)

Publication Number Publication Date
KR20180023510A KR20180023510A (en) 2018-03-07
KR101842263B1 true KR101842263B1 (en) 2018-05-14

Family

ID=61688690

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020160108999A KR101842263B1 (en) 2016-08-26 2016-08-26 Method and apparatus for preventing reverse engineering

Country Status (1)

Country Link
KR (1) KR101842263B1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7348701B2 (en) * 2019-05-03 2023-09-21 ライン プラス コーポレーション Methods and systems for loading executable images into memory
CN110445804A (en) * 2019-08-21 2019-11-12 北京安得和众科技有限责任公司 A kind of safe handling protection system about outgoing document

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101246623B1 (en) 2012-09-03 2013-03-25 주식회사 안랩 Apparatus and method for detecting malicious applications

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101246623B1 (en) 2012-09-03 2013-03-25 주식회사 안랩 Apparatus and method for detecting malicious applications

Also Published As

Publication number Publication date
KR20180023510A (en) 2018-03-07

Similar Documents

Publication Publication Date Title
JP5908132B2 (en) Apparatus and method for detecting attack using vulnerability of program
US8316448B2 (en) Automatic filter generation and generalization
EP3039608B1 (en) Hardware and software execution profiling
CN105760773B (en) The system and method for opening file by pregnable application control
US10397261B2 (en) Identifying device, identifying method and identifying program
US10698668B1 (en) Custom code transformations during compilation process
US8245289B2 (en) Methods and systems for preventing security breaches
US8484732B1 (en) Protecting computers against virtual machine exploits
US10235520B2 (en) System and method for analyzing patch file
CN103886252A (en) Software Code Malicious Selection Evaluation Executed In Trusted Process Address Space
CN109271789B (en) Malicious process detection method and device, electronic equipment and storage medium
Tromer et al. Droiddisintegrator: Intra-application information flow control in android apps
CN110717181B (en) Non-control data attack detection method and device based on novel program dependency graph
US11868465B2 (en) Binary image stack cookie protection
Wressnegger et al. Twice the bits, twice the trouble: Vulnerabilities induced by migrating to 64-bit platforms
KR101842263B1 (en) Method and apparatus for preventing reverse engineering
CN111931191A (en) Dynamic detection method and system for binary software stack overflow leakage hole of Linux platform
JP4643201B2 (en) Buffer overflow vulnerability analysis method, data processing device, analysis information providing device, analysis information extraction processing program, and analysis information provision processing program
CN114741700A (en) Public component library vulnerability availability analysis method and device based on symbolic taint analysis
CN111625466A (en) Software detection method and device and computer readable storage medium
WO2020037108A1 (en) Systems and methods for reliably injecting control flow integrity into binaries without source code
US11886589B2 (en) Process wrapping method for evading anti-analysis of native codes, recording medium and device for performing the method
Kawakoya et al. Stealth loader: Trace-free program loading for analysis evasion
KR102271273B1 (en) Process wrapping method for evading anti-analysis of native codes, recording medium and device for performing the method
US11314855B2 (en) Detecting stack pivots using stack artifact verification

Legal Events

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