KR102548779B1 - Methods and apparatus for extracting and inspecting document files inserted into documents in ms-cfb format - Google Patents

Methods and apparatus for extracting and inspecting document files inserted into documents in ms-cfb format Download PDF

Info

Publication number
KR102548779B1
KR102548779B1 KR1020220161816A KR20220161816A KR102548779B1 KR 102548779 B1 KR102548779 B1 KR 102548779B1 KR 1020220161816 A KR1020220161816 A KR 1020220161816A KR 20220161816 A KR20220161816 A KR 20220161816A KR 102548779 B1 KR102548779 B1 KR 102548779B1
Authority
KR
South Korea
Prior art keywords
document
sector
file
cfb
fat
Prior art date
Application number
KR1020220161816A
Other languages
Korean (ko)
Inventor
배원융
Original Assignee
시큐레터 주식회사
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 시큐레터 주식회사 filed Critical 시큐레터 주식회사
Priority to KR1020220161816A priority Critical patent/KR102548779B1/en
Application granted granted Critical
Publication of KR102548779B1 publication Critical patent/KR102548779B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/55Detecting local intrusion or implementing counter-measures
    • G06F21/56Computer malware detection or handling, e.g. anti-virus arrangements
    • G06F21/562Static detection
    • G06F21/565Static detection by checking file integrity
    • 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/566Dynamic detection, i.e. detection performed at run-time, e.g. emulation, suspicious activities

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Virology (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

본 명세서는 서버가 CFB(Compound File Binary) 형식의 문서에 삽입된 문서파일을 추출하고 검사하기 위한 방법에 있어서, 상기 CFB 형식의 문서 내에 개체 삽입된 문서가 있는지 검사하는 단계; 상기 검사의 결과에 근거하여, 상기 개체 삽입된 문서를 추출하는 단계; 및 상기 추출된 문서를 검사대상 문서로 추가하는 단계; 를 포함하며, 상기 CFB 형식의 문서는 MS-DOC 형식의 문서 또는 XLS 형식의 문서를 포함할 수 있다.In the present specification, a method for a server to extract and examine a document file inserted into a CFB (Compound File Binary) format document includes: checking whether there is an object inserted document in the CFB format document; extracting the object-embedded document based on a result of the inspection; and adding the extracted document as a document to be inspected. and the CFB format document may include an MS-DOC format document or an XLS format document.

Description

MS-CFB 형식의 문서에 삽입된 문서파일을 추출하고 검사하기 위한 방법 및 이를 위한 장치 { METHODS AND APPARATUS FOR EXTRACTING AND INSPECTING DOCUMENT FILES INSERTED INTO DOCUMENTS IN MS-CFB FORMAT }Method for extracting and examining document files inserted into documents in MS-CFB format and device therefor

본 명세서는 MS-CFB (Compound File Binary: 여러 파일과 폴더를 파일 하나에 저장하는 형식으로 저장된 바이너리 기반 파일 포맷) 형식의 문서에 삽입된 문서파일을 추출하고 검사하기 위한 방법 및 장치에 관한 것이다.The present specification relates to a method and apparatus for extracting and examining a document file inserted into a document in the MS-CFB (Compound File Binary: a binary-based file format stored in a format in which multiple files and folders are stored in one file) format.

지능형 지속 위협(Advanced Persistent Threat, APT) 공격은 공격자가 특정 타깃을 정하고 목표한 정보를 빼내기 위해 고도의 공격기법을 적용하여 지속적으로 다양한 형태의 악성 코드를 활용한다. 특히 APT 공격은 초기 침입단계에서 탐지하지 못하는 경우가 많으며, 실행(Portable Executable, PE) 파일보다는 악성 코드를 포함하는 비실행(Non-Portable Executable, Non-PE) 파일을 이용하는 경우가 많다. In the Advanced Persistent Threat (APT) attack, an attacker sets a specific target and applies advanced attack techniques to continuously utilize various types of malicious codes to steal target information. In particular, APT attacks are often undetectable at the initial intrusion stage and often use Non-Portable Executable (Non-PE) files containing malicious codes rather than Portable Executable (PE) files.

비실행 파일은 실행 파일과 반대되는 개념으로써, 자체적으로 실행되지 않는 파일을 의미한다. 비실행 파일로는 워드 파일, 엑셀 파일, 한글 파일, PDF 파일 등의 문서 파일, 이미지 파일, 동영상 파일, 자바스크립트 파일, 및 HTML 파일을 예로 들 수 있다. APT 공격에 악성 코드가 포함된 비실행 파일이 많이 이용되는 이유는 비실행 파일을 실행하는 응용 프로그램이 기본적으로 어느 정도의 보안 취약성을 가지고 있기 때문이다. 뿐만 아니라, 악성 코드를 비실행 파일에 포함시키면 파일을 변경하여 변종 악성 코드를 손쉽게 만들 수 있기 때문이다. A non-executable file is a concept opposite to an executable file, and means a file that is not executed by itself. Examples of non-executable files include document files such as word files, Excel files, Hangul files, and PDF files, image files, video files, JavaScript files, and HTML files. The reason why non-executable files containing malicious codes are frequently used in APT attacks is that applications that execute non-executable files basically have some level of security vulnerability. In addition, if the malicious code is included in the non-executable file, the modified malicious code can be easily created by changing the file.

특히, MS-CFB 형식의 문서 내에 개체 삽입을 이용하여, 동일한 형식의 문서가 지정되는 경우, 삽입된 문서는 단순 추출이 불가능 할 수 있다. In particular, when a document of the same format is specified using object insertion in a MS-CFB format document, simple extraction of the inserted document may not be possible.

예를 들어, 완전한 MS-CFB 형식의 파일은 그 파일의 실제 데이터와 그것을 MS-CFB 구조로 연결하는 정보가 포함되어 있어야 한다. 삽입된 MS-CFB문서는 기존 연결 정보가 모두 사라지고 파일의 실제 데이터만 상위 문서에 나열된 상태로 포함되어 삽입된 파일의 위험 탐지가 불가능 할 수 있다.For example, a complete MS-CFB format file must contain the actual data of the file and the information linking it to the MS-CFB structure. In the inserted MS-CFB document, all existing connection information disappears and only the actual data of the file is included as listed in the upper document, making it impossible to detect the danger of the inserted file.

본 명세서의 목적은, MS-CFB 형식의 문서에 삽입된 문서파일을 추출하고 검사하기 위한 방법을 제안한다.The purpose of this specification is to propose a method for extracting and examining a document file inserted into a document in MS-CFB format.

본 명세서가 이루고자 하는 기술적 과제들은 이상에서 언급한 기술적 과제들로 제한되지 않으며, 언급되지 않은 또 다른 기술적 과제들은 이하의 명세서의 상세한 설명으로부터 본 명세서가 속하는 기술분야에서 통상의 지식을 가진 자에게 명확하게 이해될 수 있을 것이다.The technical problems to be achieved by this specification are not limited to the above-mentioned technical problems, and other technical problems not mentioned are clear to those skilled in the art from the detailed description of the specification below. will be understandable.

본 명세서의 일 양상은, 서버가 CFB(Compound File Binary) 형식의 문서에 삽입된 문서파일을 추출하고 검사하기 위한 방법에 있어서, 상기 CFB 형식의 문서 내에 개체 삽입된 문서가 있는지 검사하는 단계; 상기 검사의 결과에 근거하여, 상기 개체 삽입된 문서를 추출하는 단계; 및 상기 추출된 문서를 검사대상 문서로 추가하는 단계; 를 포함하며, 상기 CFB 형식의 문서는 MS-DOC 형식의 문서 또는 XLS 형식의 문서를 포함할 수 있다.One aspect of the present specification is a method for a server to extract and inspect a document file inserted into a CFB (Compound File Binary) format document, comprising: checking whether there is an entity-embedded document in the CFB format document; extracting the object-embedded document based on a result of the inspection; and adding the extracted document as a document to be inspected. and the CFB format document may include an MS-DOC format document or an XLS format document.

또한, 상기 개체 삽입된 문서를 추출하는 단계는 상기 개체 삽입된 문서와 관련된 디렉토리 항목들을 획득하는 단계; 상기 디렉토리 항목들에 근거하여, 제1 복합 파일 헤더를 생성하는 단계; 상기 디렉토리 항목들에 근거하여, 섹터 체인을 생성하는 단계; 상기 획득된 디렉토리 항목들을 트리 구조로 연결하는 단계; 상기 제1 복합 파일 헤더, 및 상기 섹터 체인에 근거하여, CFB 연결구조를 생성하는 단계; 및 상기 CFB 연결구조에 근거하여, 문서 추출 데이터를 생성하는 단계; 를 포함할 수 있다.In addition, the step of extracting the entity-embedded document may include acquiring directory entries related to the entity-embedded document; based on the directory entries, generating a first compound file header; based on the directory entries, creating a sector chain; connecting the obtained directory entries in a tree structure; generating a CFB connection structure based on the first composite file header and the sector chain; and generating document extraction data based on the CFB connection structure. can include

또한, 상기 섹터 체인은 Mini FAT Sector, Directory Sector, User-defined data, FAT Sector, 및 DIFAT Sector에 근거할 수 있다.In addition, the sector chain may be based on Mini FAT Sector, Directory Sector, User-defined data, FAT Sector, and DIFAT Sector.

또한, 상기 섹터 체인은 상기 복합 파일 헤더의 Mini Stream Cutoff Size에 근거하여, 일반 섹터 체인, 또는 미니 섹터 체인으로 구분될 수 있다.Also, the sector chain may be divided into a normal sector chain or a mini sector chain based on the Mini Stream Cutoff Size of the composite file header.

또한, 상기 문서 추출 데이터를 생성하는 단계는 상기 복합 파일 헤더를 기록하는 단계; Mini Fat의 User-data를 기록하는 단계; FAT의 User-data를 기록하는 단계; Directory Entry를 기록하는 단계; 상기 미니 섹터 체인을 기록하는 단계; 및 상기 섹터 체인을 기록하는 단계; 를 포함할 수 있다.Also, the generating of the document extraction data may include recording the composite file header; Recording User-data of Mini Fat; Recording user-data of FAT; Recording a Directory Entry; writing the mini-sector chain; and recording the sector chain; can include

본 명세서의 또 다른 일 양상은, CFB(Compound File Binary) 형식의 문서에 삽입된 문서파일을 추출하고 검사하기 위한 서버에 있어서, 통신부; 메모리; 및 기 통신부 및 상기 메모리를 기능적으로 제어하는 프로세서; 를 포함하고, 상기 프로세서는 상기 CFB 형식의 문서 내에 개체 삽입된 문서가 있는지 검사하고, 상기 검사의 결과에 근거하여, 상기 개체 삽입된 문서를 추출하며, 상기 추출된 문서를 검사대상 문서로 추가하고, 상기 CFB 형식의 문서는 MS-DOC 형식의 문서 또는 XLS 형식의 문서를 포함할 수 있다.Another aspect of the present specification is a server for extracting and examining a document file inserted into a CFB (Compound File Binary) format document, comprising: a communication unit; Memory; and a processor functionally controlling the communication unit and the memory. The processor checks whether there is an entity-embedded document in the CFB format document, extracts the entity-embedded document based on the result of the inspection, and adds the extracted document as a document to be inspected, , The CFB format document may include an MS-DOC format document or an XLS format document.

본 명세서의 실시예에 따르면, MS-CFB 형식의 문서에 삽입된 문서파일을 추출하고 검사할 수 있다.According to an embodiment of the present specification, a document file inserted into a document of MS-CFB format can be extracted and inspected.

본 명세서에서 얻을 수 있는 효과는 이상에서 언급한 효과로 제한되지 않으며, 언급하지 않은 또 다른 효과들은 아래의 기재로부터 본 명세서가 속하는 기술분야에서 통상의 지식을 가진 자에게 명확하게 이해될 수 있을 것이다.Effects obtainable in the present specification are not limited to the effects mentioned above, and other effects not mentioned will be clearly understood by those skilled in the art from the description below. .

도 1은 본 명세서와 관련된 서버 또는 클라이언트를 나타내는 도면이다.
도 2는 본 명세서에 적용될 수 있는 비정상 입력의 예시이다.
도 3은 본 명세서가 적용될 수 있는 개체 삽입 문서의 예시이다.
도 4 및 도 5는 본 명세서가 적용될 수 있는 MS-CFB 연결 구조의 예시이다.
도 6은 본 명세서가 적용될 수 있는 서버의 일 실시예이다.
도 7은 본 명세서가 적용될 수 있는 개체 삽입된 문서 추출의 예시이다.
도 8은 본 명세서가 적용될 수 있는 복합 파일 헤더를 예시한다.
도 9는 본 명세서가 적용될 수 있는 저장영역 할당의 예시이다.
도 10은 본 명세서가 적용될 수 있는 mini Fat 배열의 섹터들의 예시이다.
도 11은 본 명세서가 적용될 수 있는 디렉토리 항목 배열의 섹터의 예시이다.
도 12는 본 명세서가 적용될 수 있는 사용자 정의 데이터 섹터 체인의 예시이다.
도 13은 본 명세서가 적용될 수 있는 FAT 배열의 섹터들의 예시이다.
도 14는 본 명세서가 적용될 수 있는 DIFAT 배열의 섹터를 예시한다.
본 명세서에 관한 이해를 돕기 위해 상세한 설명의 일부로 포함되는, 첨부 도면은 본 명세서에 대한 실시예를 제공하고, 상세한 설명과 함께 본 명세서의 기술적 특징을 설명한다.
1 is a diagram showing a server or client related to the present specification.
2 is an example of an abnormal input that can be applied to this specification.
3 is an example of an object insertion document to which the present specification can be applied.
4 and 5 are examples of MS-CFB connection structures to which the present specification can be applied.
6 is an embodiment of a server to which this specification can be applied.
7 is an example of object inserted document extraction to which the present specification can be applied.
8 illustrates a composite file header to which this specification can be applied.
9 is an example of storage area allocation to which the present specification can be applied.
10 is an example of sectors of a mini Fat array to which the present specification can be applied.
11 is an example of a sector of a directory entry arrangement to which the present specification can be applied.
12 is an example of a user-defined data sector chain to which this specification can be applied.
13 is an example of sectors of a FAT arrangement to which this specification can be applied.
14 illustrates a sector of a DIFAT arrangement to which this specification can be applied.
The accompanying drawings, which are included as part of the detailed description to aid understanding of the present specification, provide examples of the present specification and describe technical features of the present specification together with the detailed description.

이하, 첨부된 도면을 참조하여 본 명세서에 개시된 실시예를 상세히 설명하되, 도면 부호에 관계없이 동일하거나 유사한 구성요소는 동일한 참조 번호를 부여하고 이에 대한 중복되는 설명은 생략하기로 한다. 이하의 설명에서 사용되는 구성요소에 대한 접미사 "모듈" 및 "부"는 명세서 작성의 용이함만이 고려되어 부여되거나 혼용되는 것으로서, 그 자체로 서로 구별되는 의미 또는 역할을 갖는 것은 아니다. 또한, 본 명세서에 개시된 실시예를 설명함에 있어서 관련된 공지 기술에 대한 구체적인 설명이 본 명세서에 개시된 실시예의 요지를 흐릴 수 있다고 판단되는 경우 그 상세한 설명을 생략한다. 또한, 첨부된 도면은 본 명세서에 개시된 실시예를 쉽게 이해할 수 있도록 하기 위한 것일 뿐, 첨부된 도면에 의해 본 명세서에 개시된 기술적 사상이 제한되지 않으며, 본 명세서의 사상 및 기술 범위에 포함되는 모든 변경, 균등물 내지 대체물을 포함하는 것으로 이해되어야 한다. Hereinafter, the embodiments disclosed in this specification will be described in detail with reference to the accompanying drawings, but the same or similar components are given the same reference numerals regardless of reference numerals, and redundant description thereof will be omitted. The suffixes "module" and "unit" for components used in the following description are given or used together in consideration of ease of writing the specification, and do not have meanings or roles that are distinct from each other by themselves. In addition, in describing the embodiments disclosed in this specification, if it is determined that a detailed description of a related known technology may obscure the gist of the embodiment disclosed in this specification, the detailed description thereof will be omitted. In addition, the accompanying drawings are only for easy understanding of the embodiments disclosed in this specification, the technical idea disclosed in this specification is not limited by the accompanying drawings, and all changes included in the spirit and technical scope of this specification , it should be understood to include equivalents or substitutes.

제1, 제2 등과 같이 서수를 포함하는 용어는 다양한 구성요소들을 설명하는데 사용될 수 있지만, 상기 구성요소들은 상기 용어들에 의해 한정되지는 않는다. 상기 용어들은 하나의 구성요소를 다른 구성요소로부터 구별하는 목적으로만 사용된다.Terms including ordinal numbers, such as first and second, may be used to describe various components, but the components are not limited by the terms. These terms are only used for the purpose of distinguishing one component from another.

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

단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함한다.Singular expressions include plural expressions unless the context clearly dictates otherwise.

본 명세서에서, "포함한다" 또는 "가지다" 등의 용어는 명세서상에 기재된 특징, 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것이 존재함을 지정하려는 것이지, 하나 또는 그 이상의 다른 특징들이나 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것들의 존재 또는 부가 가능성을 미리 배제하지 않는 것으로 이해되어야 한다.In this specification, terms such as "comprise" or "having" are intended to indicate that there is a feature, number, step, operation, component, part, or combination thereof described in the specification, but one or more other features It should be understood that the presence or addition of numbers, steps, operations, components, parts, or combinations thereof is not precluded.

또한, 명세서에서 사용되는 "부"라는 용어는 소프트웨어 또는 하드웨어 구성요소를 의미하며, "부"는 어떤 역할들을 수행한다. 그렇지만 "부"는 소프트웨어 또는 하드웨어에 한정되는 의미는 아니다. "부"는 어드레싱할 수 있는 저장 매체에 있도록 구성될 수도 있고 하나 또는 그 이상의 프로세서들을 재생시키도록 구성될 수도 있다. 따라서, 일 예로서 "부"는 소프트웨어 구성요소들, 객체지향 소프트웨어 구성요소들, 클래스 구성요소들 및 태스크 구성요소들과 같은 구성요소들과, 프로세스들, 함수들, 속성들, 프로시저들, 서브루틴들, 프로그램 코드의 세그먼트들, 드라이버들, 펌웨어, 마이크로 코드, 회로, 데이터, 데이터베이스, 데이터 구조들, 테이블들, 어레이들 및 변수들을 포함한다. 구성요소들과 "부"들 안에서 제공되는 기능은 더 작은 수의 구성요소들 및 "부"들로 결합되거나 추가적인 구성요소들과 "부"들로 더 분리될 수 있다.Also, the term “unit” used in the specification means a software or hardware component, and “unit” performs certain roles. However, "unit" is not meant to be limited to software or hardware. A “unit” may be configured to reside in an addressable storage medium and may be configured to reproduce on one or more processors. Thus, as an example, “unit” can refer to components such as software components, object-oriented software components, class components and task components, processes, functions, properties, procedures, subroutines, segments of program code, drivers, firmware, microcode, circuitry, data, databases, data structures, tables, arrays and variables. Functionality provided within components and "parts" may be combined into fewer components and "parts" or further separated into additional components and "parts".

또한, 본 명세서의 일 실시예에 따르면 "부"는 프로세서 및 메모리로 구현될 수 있다. 용어 "프로세서"는 범용 프로세서, 중앙 처리 장치 (CPU), 마이크로프로세서, 디지털 신호 프로세서 (DSP), 제어기, 마이크로제어기, 상태 머신 등을 포함하도록 넓게 해석되어야 한다. 몇몇 환경에서는, "프로세서"는 주문형 반도체 (ASIC), 프로그램가능 로직 디바이스 (PLD), 필드 프로그램가능 게이트 어레이 (FPGA) 등을 지칭할 수도 있다. 용어 "프로세서"는, 예를 들어, DSP 와 마이크로프로세서의 조합, 복수의 마이크로프로세서들의 조합, DSP 코어와 결합한 하나 이상의 마이크로프로세서들의 조합, 또는 임의의 다른 그러한 구성들의 조합과 같은 처리 디바이스들의 조합을 지칭할 수도 있다.Also, according to one embodiment of the present specification, "unit" may be implemented as a processor and a memory. The term “processor” should be interpreted broadly to include general-purpose processors, central processing units (CPUs), microprocessors, digital signal processors (DSPs), controllers, microcontrollers, state machines, and the like. In some circumstances, “processor” may refer to an application specific integrated circuit (ASIC), programmable logic device (PLD), field programmable gate array (FPGA), or the like. The term "processor" refers to a combination of processing devices, such as, for example, a combination of a DSP and a microprocessor, a combination of a plurality of microprocessors, a combination of one or more microprocessors in conjunction with a DSP core, or any other such configuration. may also refer to

용어 "메모리"는 전자 정보를 저장 가능한 임의의 전자 컴포넌트를 포함하도록 넓게 해석되어야 한다. 용어 메모리는 임의 액세스 메모리 (RAM), 판독-전용 메모리 (ROM), 비-휘발성 임의 액세스 메모리 (NVRAM), 프로그램가능 판독-전용 메모리 (PROM), 소거-프로그램가능 판독 전용 메모리 (EPROM), 전기적으로 소거가능 PROM (EEPROM), 플래쉬 메모리, 자기 또는 광학 데이터 저장장치, 레지스터들 등과 같은 프로세서-판독가능 매체의 다양한 유형들을 지칭할 수도 있다. 프로세서가 메모리로부터 정보를 판독하고/하거나 메모리에 정보를 기록할 수 있다면 메모리는 프로세서와 전자 통신 상태에 있다고 불린다. 프로세서에 집적된 메모리는 프로세서와 전자 통신 상태에 있다.The term “memory” should be interpreted broadly to include any electronic component capable of storing electronic information. The term memory includes random access memory (RAM), read-only memory (ROM), non-volatile random access memory (NVRAM), programmable read-only memory (PROM), erasable-programmable read-only memory (EPROM), electrical may refer to various types of processor-readable media, such as erasable PROM (EEPROM), flash memory, magnetic or optical data storage, registers, and the like. A memory is said to be in electronic communication with the processor if the processor can read information from and/or write information to the memory. Memory integrated with the processor is in electronic communication with the processor.

본 명세서에서 사용되는 "비실행 파일"이란 실행 파일 또는 실행 가능한 파일과 반대되는 개념으로서 자체적으로 실행되지 않는 파일을 의미한다. 예를 들어, 비실행 파일은 PDF 파일, 한글 파일, 워드 파일과 같은 문서 파일, JPG 파일과 같은 이미지 파일, 동영상 파일, 자바 스크립트 파일, HTML 파일 등이 될 수 있으나, 이에 한정되지 않는다.As used herein, a "non-executable file" is a concept opposite to an executable file or an executable file, and means a file that is not itself executed. For example, the non-executable file may be a PDF file, a Korean file, a document file such as a word file, an image file such as a JPG file, a video file, a JavaScript file, and an HTML file, but is not limited thereto.

아래에서는 첨부한 도면을 참고하여 실시예에 대하여 본 명세서가 속하는 기술 분야에서 통상의 지식을 가진 자가 용이하게 실시할 수 있도록 상세히 설명한다. 그리고 도면에서 본 개시를 명확하게 설명하기 위해서 설명과 관계없는 부분들은 생략될 수 있다.Hereinafter, with reference to the accompanying drawings, embodiments will be described in detail so that those skilled in the art can easily carry out the embodiments. In addition, in order to clearly describe the present disclosure in the drawings, parts irrelevant to the description may be omitted.

도 1은 본 명세서와 관련된 서버 또는 클라이언트를 나타내는 도면이다.1 is a diagram showing a server or client related to the present specification.

본 명세서에서 서버(또는 클라우드 서버) 또는 클라이언트는 제어부(100) 및 통신부(130)를 포함할 수 있다. 제어부(100)는 프로세서(110) 및 메모리(120)를 포함할 수 있다. 프로세서(110)는 메모리(120)에 저장된 명령어들을 수행할 수 있다. 프로세서(110)는 통신부(130)를 제어할 수 있다.In this specification, a server (or cloud server) or a client may include a control unit 100 and a communication unit 130. The controller 100 may include a processor 110 and a memory 120 . The processor 110 may execute instructions stored in the memory 120 . The processor 110 may control the communication unit 130 .

프로세서(110)는 메모리(120)에 저장된 명령어에 기초하여 서버 또는 클라이언트의 동작을 제어할 수 있다. 서버 또는 클라이언트는 하나의 프로세서를 포함할 수 있고, 복수의 프로세서를 포함할 수 있다. 서버 또는 클라이언트가 복수의 프로세서를 포함하는 경우, 복수의 프로세서 중 적어도 일부는 물리적으로 이격된 거리에 위치할 수 있다. 또한, 서버 또는 클라이언트는 이에 한정되지 않고 알려진 다양한 방식으로 구현될 수 있다.The processor 110 may control the operation of the server or client based on instructions stored in the memory 120 . A server or client may include one processor or may include a plurality of processors. When the server or the client includes a plurality of processors, at least some of the plurality of processors may be located at physically separated distances. In addition, the server or client may be implemented in various known ways without being limited thereto.

통신부(130)는, 서버 또는 클라이언트와 무선 통신 시스템 사이, 서버 또는 클라이언트와 다른 서버 또는 클라이언트 사이, 또는 서버 또는 클라이언트와 외부서버 사이의 무선 통신을 가능하게 하는 하나 이상의 모듈을 포함할 수 있다. 또한, 통신부(110)는, 서버 또는 클라이언트를 하나 이상의 네트워크에 연결하는 하나 이상의 모듈을 포함할 수 있다.The communication unit 130 may include one or more modules enabling wireless communication between a server or client and a wireless communication system, between a server or client and another server or client, or between a server or client and an external server. Also, the communication unit 110 may include one or more modules that connect a server or a client to one or more networks.

제어부(100)는 메모리(120)에 저장된 응용 프로그램을 구동하기 위하여, 서버 또는 클라이언트의 구성요소들 중 적어도 일부를 제어할 수 있다. 나아가, 제어부(100)는 상기 응용 프로그램의 구동을 위하여, 서버 또는 클라이언트에 포함된 구성요소들 중 적어도 둘 이상을 서로 조합하여 동작 시킬 수 있다.The controller 100 may control at least some of the components of the server or client in order to drive an application program stored in the memory 120 . Furthermore, the control unit 100 may combine and operate at least two or more of the components included in the server or client to drive the application program.

본 명세서에서 서버는 리버싱 엔진 또는/및 CDR 서비스를 제공하는 CDR 엔진을 포함할 수 있다.In this specification, the server may include a reversing engine or/and a CDR engine providing CDR services.

리버싱(Reversing) 엔진Reversing Engine

리버싱 엔진이란, 악성 비실행 파일에 대한 리버스 엔지니어링(리버싱) 과정을 자동화 한 분석/진단 엔진이다. The reversing engine is an analysis/diagnostic engine that automates the reverse engineering (reversing) process for malicious non-executable files.

예를 들어, 리버싱 엔진은 다음의 단계를 수행할 수 있다.For example, the reversing engine may perform the following steps.

1. 파일 분석: 비실행 파일 자체의 외관(예를 들어, 속성, 작성자, 작성 날짜, 파일 타입)을 분석하는 단계로서, 일반 백신 프로그램과 유사하게 비실행 파일 자체의 정보만으로 악성여부를 진단할 수 있다.1. File analysis: As a step of analyzing the appearance of the non-executable file itself (eg, attribute, author, date of creation, file type), similar to general vaccine programs, maliciousness can be diagnosed only with the information of the non-executable file itself. can

2. 정적 분석: 비실행 파일 내의 데이터를 추출, 분석해서 정상, 악성 여부를 판별하는 단계로서, 비실행 파일은 실행하지 않고 파일 구조에 맞게 내부 데이터를 추출하여 비교 분석하여 악성여부를 진단할 수 있다. 이는 매크로, URL 추출 분석 등에 적합할 수 있다.2. Static analysis: This step is to extract and analyze the data in the non-executable file to determine whether it is normal or malicious. The non-executable file is not executed, and internal data is extracted according to the file structure and compared and analyzed to diagnose maliciousness. there is. This may be suitable for macros, URL extraction analysis, and the like.

3. 동적 분석: 비실행 파일을 편집기, 리더기가 포함된 응용프로그램을 통해 읽어들이고 모니터링하면서 행위를 분석하여 악성 여부를 판별하는 단계로서, 매크로, 하이퍼링크, DDE 등 정상기능을 이용한 악성 행위를 탐지하기에 용이하다.3. Dynamic analysis: This step is to determine whether or not the non-executable file is malicious by reading and monitoring the non-executable file through an application program including an editor and reader, and analyzing the behavior while monitoring it. Detecting malicious behavior using normal functions such as macros, hyperlinks, and DDE easy to do

4. 디버깅 분석: 비실행 파일을 읽어들이고 디버깅하여 취약점, 익스플로잇 등을 분석하는 단계로서, 매크로, 하이퍼링크, DDE를 포함하여 문서 내 본문, 표, 폰트, 그림 등을 이용한 응용프로그램의 취약점을 탐지하기에 적합하다.4. Debugging analysis: This step analyzes vulnerabilities and exploits by reading and debugging non-executable files. Detects vulnerabilities of applications using text, tables, fonts, pictures, etc. in documents, including macros, hyperlinks, and DDE. suitable for doing

리버싱 엔진은 디버깅 분석에 사용될 수 있는 디버깅 엔진을 포함할 수 있다. 디버깅 엔진은 비실행 파일의 열람 과정을 디버깅하여 문서 입력, 처리, 출력단계에서 발생하는 취약점을 진단할 수 있다. 여기서 취약점이란, 응용프로그램이 응용프로그램의 개발자가 개발한 코드(로직)에서 예상하지 못한 값을 입력 받았을 때, 발생하는 오류, 버그 등을 이용하는 것으로서, 공격자는 취약점을 통해 비정상 종료로 인한 서비스 거부, 원격 코드 실행 등의 악성 행위를 실행할 수 있다.The reversing engine may include a debugging engine that may be used for debugging analysis. The debugging engine can diagnose vulnerabilities occurring in document input, processing, and output stages by debugging the process of reading non-executable files. Vulnerability here refers to the use of errors and bugs that occur when an application program receives an unexpected value from the code (logic) developed by the application developer. Malicious actions such as remote code execution can be executed.

CDR(Contents Disarm and Reconstruction)Content Disarm and Reconstruction (CDR)

CDR 서비스는 비실행 파일을 분해해 악성파일 혹은 불필요한 파일을 제거하고 콘텐츠는 원본과 최대한 동일하게 하여, 새로운 파일을 만드는 솔루션이다.The CDR service is a solution that disassembles non-executable files, removes malicious or unnecessary files, and creates new files by making the contents the same as the original as much as possible.

즉, Contents Disarm and Reconstruction(CDR)은 문서 내의 컨텐츠를 무해화(Disarm)하고 재조합(Reconstruction)하여 안전한 문서를 만들어 고객에게 제공하는 서비스를 의미하며, 무해화 대상 파일은 비실행 파일 일체(예를 들어, 워드, 엑셀, 파워포인트, 한글, PDF)를 대상으로 할 수 있으며, 무해화 대상 컨텐츠는 액티브 컨텐츠(예를 들어, 매크로, 하이퍼링크, OLE 객체 등)일 수 있다.In other words, Contents Disarm and Reconstruction (CDR) means a service that disarms and reconstructs the contents in a document to create a safe document and provides it to customers. For example, Word, Excel, PowerPoint, Hangul, PDF) may be targeted, and the harmless target content may be active content (eg, macro, hyperlink, OLE object, etc.).

도 2는 본 명세서에 적용될 수 있는 비정상 입력의 예시이다.2 is an example of an abnormal input that can be applied to this specification.

도 2를 참조하면, 응용프로그램은 비실행 파일을 통해, 비정상적인 값(예를 들어, 입력값이 정상범위인 2를 초과하는 경우)을 입력 받는 경우, 개발자가 의도하지 않은 실행흐름으로 변경되어 취약점이 동작될 수 있다. 디버깅 엔진은 문서 열람 과정을 자동 디버깅하여 취약점과 관련된 특정 지점에 브레이크 포인트를 설정하고 입력값과 관련된 특정값을 확인하여 입력값이 취약점을 일으키는 값인지 아닌지 판별하여 악성 여부를 진단할 수 있다.Referring to FIG. 2, when an application program receives an abnormal value (for example, when the input value exceeds the normal range of 2) through a non-executable file, the application program is changed into an execution flow unintended by the developer and thus vulnerable. this can work. The debugging engine automatically debugs the document browsing process, sets a breakpoint at a specific point related to the vulnerability, checks a specific value related to the input value, determines whether the input value is a value that causes a vulnerability, and diagnoses whether the input value is malicious.

보다 자세하게, 디버깅 엔진은 비실행 파일을 확인하고 이를 열람하기 위한 응용프로그램을 실행하여 디버깅을 시작할 수 있다. 비실행 파일을 열람하는 과정에서 모듈이 로드되면, 디버깅 엔진은 해당 모듈이 분석 대상 모듈인지 확인하고, 분석 대상이라면 지정된 주소에 브레이크 포인트를 설정할 수 있다.More specifically, the debugging engine can start debugging by identifying non-executable files and running an application to view them. If a module is loaded while viewing a non-executable file, the debugging engine checks whether the module is an analysis target module, and if it is an analysis target, it can set a breakpoint at a designated address.

예를 들어, 악성 비실행 파일은 응용프로그램의 버전이나 운영체제 환경 등의 특정 조건이 만족하지 않으면 응용프로그램을 종료하거나 아무런 악성 행위가 발생하지 않는 흐름으로 분기하는 분기 지점들을 가질 수 있다. 서버는 사전에 분석가에 의해 분석되어 이러한 가능성을 가지는 분기 지점에 브레이크 포인트를 설정할 수 있다. For example, a malicious non-executable file may have branching points at which an application program is terminated or branched into a flow in which no malicious activity occurs unless a specific condition such as an application version or an operating system environment is satisfied. The server can set a breakpoint at a divergence point that has been previously analyzed by an analyst and has this possibility.

또한, 서버는 해당 분기 지점과 연관되어, 응용프로그램을 종료하지 않고 계속 실행하거나 악성 행위가 발생할 수 있는 흐름으로 유도할 수 있는 조건들을 설정할 수 있다.In addition, the server may set conditions associated with a corresponding branching point to continuously execute the application program without terminating or lead to a flow in which a malicious action may occur.

응용프로그램의 프로세스 실행 중 해당 브레이크 포인트 지점에서 프로세스가 멈춘 경우, 서버는 탐지 로직에 따라 취약점 여부를 탐지한 후, 결과를 분석 리포트에 저장하는 단계를 수행할 수 있다.If the process stops at the corresponding breakpoint while the process of the application program is running, the server may perform a step of detecting whether or not there is a vulnerability according to the detection logic and then storing the result in an analysis report.

서버에 포함된 자동화 리버싱 엔진은 전술한 단계들을 자동으로 수행하면서 분석하여 분석가가 연구, 개발한 진단 알고리즘을 통해, 악성 비실행 파일을 진단하고 차단할 수 있다.The automated reversing engine included in the server can analyze and diagnose malicious non-executable files through a diagnosis algorithm researched and developed by an analyst by automatically performing and analyzing the above steps.

도 3은 본 명세서가 적용될 수 있는 개체 삽입 문서의 예시이다.3 is an example of an object insertion document to which the present specification can be applied.

도 3을 참조하면, MS-CFB 형식의 문서 중, MS-Word(예를 들어, attached.doc)에서 파일(예를 들어, attachment.doc)의 개체 삽입 및 XLS(예를 들어, ppt_in_xls.xls)에서 파일의 개체 삽입을 예시한다.Referring to FIG. 3, among MS-CFB format documents, MS-Word (eg, attached.doc) inserts an object of a file (eg, attachment.doc) and XLS (eg, ppt_in_xls.xls) ) exemplifies object insertion in a file.

MS-CFB 형식의 문서는 Tree 구조로 표현될 수 있다. 예를 들어, Tree 구조의 Root dicrectory 밑에 데이터 파일들이 배치될 수 있다. 보다 자세하게, 피삽입 문서가 MS-Word 인 경우, Root dicrectory 밑에 1 개의 ObjectPool 디렉토리가 생성되고, 개체 삽입되는 파일과 관련된 디렉토리(예를 들어, _1729593587)가 하위 디렉토리로 추가 생성될 수 있다. 하위 디렉토리에 삽입되는 파일(예를 들어, attachment.doc)의 데이터(3000)가 모두 저장될 수 있다. Documents in MS-CFB format can be expressed in a tree structure. For example, data files can be placed under the Root dictory of the Tree structure. More specifically, when the document to be inserted is MS-Word, one ObjectPool directory is created under the Root dictory, and a directory (for example, _1729593587) related to a file to be inserted as an object can be additionally created as a subdirectory. All data 3000 of a file (eg, attachment.doc) inserted into a subdirectory may be stored.

동일한 방식으로 복수 개의 파일들이 개체 삽입될 수 있고, 개체 삽입된 파일과 관련된 디렉토리를 Root directory로 하여, 동일한 방식으로 중첩되어 다른 파일이 개체 삽입된 파일에 다시 개체 삽입될 수도 있다.A plurality of files can be object-inserted in the same way, and another file can be object-inserted into the object-embedded file by making the directory related to the object-embedded file the root directory and overlapping in the same way.

보다 자세하게, ObjectPool 디렉토리는 개체 삽입되는 파일과 대응하여, 개체 삽입되는 파일과 관련된 디렉토리가 포함될 수 있다. 따라서, 개체 삽입되는 파일과 관련된 디렉토리는 당해 개체 삽입되는 파일의 데이터 영역일 수 있다.In more detail, the ObjectPool directory corresponds to a file into which an object is inserted, and may include a directory related to a file into which an object is inserted. Accordingly, a directory related to a file into which an object is inserted may be a data area of a file into which an object is inserted.

즉, 개체 삽입된 파일이 N개일 경우 _1729597664과 같은 개체 삽입된 파일과 관련된 디렉토리와 같은 위치에 같은 형식의 디렉토리가 N개 생성될 수 있다.That is, when there are N object inserted files, N directories of the same format may be created in the same location as a directory related to an object inserted file such as _1729597664.

만일, 개체 삽입된 파일의 내부에 다른 파일이 개체 삽입된 경우 _1729597664과 같은 개체 삽입된 파일과 관련된 디렉토리의 자식 레벨에 다시 ObjectPool -> _0000000000 형태로 깊이가 증가할 수 있다.If another file is inserted into the object inserted file, the depth may increase again in the form of ObjectPool -> _0000000000 at the child level of the directory related to the object inserted file, such as _1729597664.

피삽입 문서가 XLS인 경우, Root dicrectory 밑에 MBD0005229D 처럼 MBD000***** 형식의 1 depth의 디렉토리만 생성되며, MBD000***** 형식의 개체 삽입된 파일과 관련된 디렉토리에 삽입되는 파일(3000)의 데이터가 모두 저장될 수 있다. If the inserted document is XLS, only a 1-depth directory of MBD000***** format is created like MBD0005229D under the Root dictory, and the file inserted in the directory related to the object inserted file of MBD000***** format (3000 ) can all be stored.

개체 삽입된 파일이 N개일 경우 MBD000***** 형식의 개체 삽입된 파일과 관련된 디렉토리와 같은 위치에 같은 형식의 디렉토리가 N개 생성될 수 있다.If there are N object inserted files, N directories of the same type can be created in the same location as the directory related to the MBD000***** type of object inserted file.

만일, 개체 삽입된 파일의 내부에 다른 파일이 개체 삽입된 경우 MBD000***** 형식과 같은 개체 삽입된 파일과 관련된 디렉토리의 자식 레벨에 다시 하위 디렉토리의 깊이가 증가할 수 있다.If another file is object-embedded inside the object-embedded file, the depth of the sub-directory may increase again at the child level of the directory related to the object-embedded file, such as the MBD000***** format.

도 4 및 도 5는 본 명세서가 적용될 수 있는 MS-CFB 연결 구조의 예시이다.4 and 5 are examples of MS-CFB connection structures to which the present specification can be applied.

CFB 명세(Spec)는 웹을 통해 공유되고 있다.CFB specifications are being shared through the web.

관련하여, 본 명세서에 적용될 수 있는 명세는 다음과 같다.In relation to this, specifications that can be applied to this specification are as follows.

([MS-CFB]: Compound File Binary File Format, https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cfb/53989ce4-7b05-4f8d-829b-d08d6148375b)([MS-CFB]: Compound File Binary File Format, https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cfb/53989ce4-7b05-4f8d-829b-d08d6148375b)

1One IntroductionIntroduction

당해 문서에서는 이진 파일 형식의 파일로 구현된 스토리지로 구조화된 OLE(Object Linking and Embedding) 또는 COM(Component Object Model)라고 하는 새로운 구조를 지정한다. 이러한 구조 이름은 복합 파일(compound file)로 단축되어 지칭될 수 있다.This document specifies a new structure called OLE (Object Linking and Embedding) or COM (Component Object Model) structured storage implemented as files in binary file format. This structure name can be shortened to a compound file.

기존 파일 시스템은 여러 종류의 개체를 하나의 문서에 효율적으로 저장하려고 할 때 어려움이 있다. 복합 파일은 파일 내에 단순화된 파일 시스템을 구현하여 솔루션을 제공한다. 구조화된 스토리지는 단일 파일을 각각 디렉토리와 파일로 작동하는 두 가지 타입의 개체(스토리지 개체와 스트림 개체)의 계층적 집합으로 처리하는 방법을 정의한다. 이러한 체계를 구조화된 스토리지라고 한다. 구조화된 스토리지의 목적은 개별 개체를 플랫 파일에 저장하는 것과 관련된 성능 저하 및 오버헤드를 줄이는 것이다. OLE 구조화된 스토리지의 표준 윈도우 COM 구현체(implementation)를 복합 파일이라고 한다. 구조화된 스토리지에 대한 자세한 내용은 [MSDN-SS]를 참조한다.Existing file systems struggle when trying to efficiently store multiple types of objects in a single document. Compound files provide a solution by implementing a simplified file system within the file. Structured storage defines a way to treat a single file as a hierarchical collection of two types of objects (storage objects and stream objects) that act as directories and files, respectively. This scheme is called structured storage. The purpose of structured storage is to reduce the performance penalty and overhead associated with storing individual objects in flat files. The standard Windows COM implementation of OLE structured storage is called a compound file. For more information on structured storage, see [MSDN-SS].

구조화된 스토리지는 새 개체가 추가되거나 기존 개체의 크기가 커질 때마다 파일을 완전히 다시 작성할 필요가 없어 성능 문제를 해결한다. 새 데이터는 파일에서 사용 가능한 다음 위치에 기록되고, 스토리지 개체는 스토리지 개체 및 스트림 개체의 위치를 유지하는 내부 구조를 업데이트한다. 이와 동시에 구조화된 스토리지를 통해 최종 사용자는 복합 파일을 마치 개별 개체의 중첩된 계층 구조가 아닌 단일 파일인 것처럼 상호 작용하고 관리할 수 있다. 예를 들어 복합 파일은 일반 단일 파일처럼 복사, 백업 및 전자 메일로 보낼 수 있다.Structured storage solves the performance problem by not having to completely rewrite files every time a new object is added or an existing object grows in size. New data is written to the next available location in the file, and the storage object updates the internal structure that holds the location of the storage object and the stream object. At the same time, structured storage allows end users to interact with and manage compound files as if they were a single file rather than a nested hierarchy of individual objects. For example, compound files can be copied, backed up, and emailed just like regular single files.

도 4는 여러 디렉토리와 파일이 계층에 중첩되어 있는 단순화된 파일 시스템을 예시한다. 4 illustrates a simplified file system in which several directories and files are nested in a hierarchy.

도 5는 중첩된(nested) 스토리지 개체 및 스트림 개체를 포함하는 구조화된 저장소 복합 파일 계층을 예시한다.5 illustrates a structured storage compound file hierarchy comprising nested storage objects and stream objects.

도 5를 참조하면, 복합 파일은 스토리지 개체와 스트림 개체의 중첩된 계층 구조를 포함하는 단일 파일이며 디렉토리와 유사한 스토리지 개체와 파일과 유사한 스트림 개체를 포함한다.Referring to FIG. 5 , a compound file is a single file that includes a nested hierarchical structure of storage objects and stream objects, and includes a directory-like storage object and a file-like stream object.

MS-CFB 구조의 파일은 크게 연결부/데이터부를 포함할 수 있다. 예를 들어, MS-CFB 구조를 위한 데이터는 모두 연결부에 해당할 수 있다. A file of the MS-CFB structure may largely include a connection part/data part. For example, all data for the MS-CFB structure may correspond to the connection part.

데이터부는 해당 파일을 처리하는 어플리케이션에서 사용될 수 있다. 예를 들어, 확장자 doc, ppt, xls에서 다른 포멧이나 연결부의 형식은 공통적으로 MS-CFB를 사용할 수 있다. 확장자 doc, ppt, xls의 데이터부는 각 확장자를 처리하는 어플리케이션(예를 들어, 워드, 파워포인트, 엑셀)에서 사용될 수 있다.The data unit can be used in an application that processes a corresponding file. For example, in the extension doc, ppt, xls, MS-CFB can be commonly used for other formats or the format of the connection part. Data parts of the extensions doc, ppt, and xls can be used in applications (eg Word, PowerPoint, and Excel) that process each extension.

MS-CFB 형식의 문서(피삽입 문서)에 삽입되는 문서에 대해, 피삽입 문서는 자신의 연결부에 삽입되는 문서의 데이터부를 위한 정보를 추가할 수 있다. 예를 들어, 삽입되는 문서는 연결부를 제외하고 데이터부만 피삽입 문서에 포함시킬 수 있다. 서버는 피삽입 문서에서 삽입된 문서의 데이터부를 추출하고, 추출된 데이터를 대상으로 MS-CFB 구조를 재생성하여 파일로 저장할 수 있다.For a document to be inserted into a document of MS-CFB format (embedded document), the inserted document can add information for the data portion of the document to be inserted to its own junction. For example, in the document to be inserted, only the data portion may be included in the inserted document excluding the connection portion. The server may extract the data part of the inserted document from the inserted document, regenerate the MS-CFB structure for the extracted data, and save it as a file.

도 6은 본 명세서가 적용될 수 있는 서버의 일 실시예이다.6 is an embodiment of a server to which this specification can be applied.

도 6을 참조하면, 서버는 CFB 형식의 문서에 대해 악성 여부를 판단할 수 있다.Referring to FIG. 6 , the server may determine whether the document in the CFB format is malicious.

서버는 CFB 형식의 문서 내에 개체 삽입된 문서가 있는지를 검사한다(S6010). 예를 들어, 서버는 CFB 형식의 문서에 포함된 루트 디렉토리 내에 하위 디렉토리(예를 들어, ObjectPool 디렉토리)에 근거하여, 개체 삽입된 문서가 있는지 검사할 수 있다. 개체 삽입된 문서는 CFB 형식의 문서일 수 있다. 피삽입 문서인, CFB 형식의 문서는 MS-DOC 및/또는 XLS 형식의 파일을 포함할 수 있다.The server checks whether there is an object-embedded document in the CFB format document (S6010). For example, the server may check whether there is an entity-embedded document based on a subdirectory (eg, ObjectPool directory) in a root directory included in a CFB format document. The object inserted document may be a CFB format document. A CFB format document, which is an inserted document, may include MS-DOC and/or XLS format files.

서버는 검사의 결과에 근거하여, 개체 삽입된 문서를 추출한다(S6020). 예를 들어, 서버는 개체 삽입된 문서가 있는 경우, 개체 삽입된 문서에 대한 악성 검사를 위해, 개체 삽입된 문서를 추출할 수 있다.The server extracts the object-embedded document based on the inspection result (S6020). For example, if there is an object-embedded document, the server may extract the object-embedded document for malicious inspection of the object-embedded document.

도 7은 본 명세서가 적용될 수 있는 개체 삽입된 문서 추출의 예시이다.7 is an example of object inserted document extraction to which the present specification can be applied.

도 7을 참조하면, 서버는 개체 삽입된 문서와 관련된 디렉토리 항목(directory entry)들을 획득한다(S7010). 이후, 서버는 CFB 명세(spec)에 근거하여, 실제 CFB 파일에 쓰이는 형태와 구조체에 획득된 항목들을 대입할 수 있다.Referring to FIG. 7 , the server acquires directory entries related to the object-embedded document (S7010). Thereafter, the server may substitute the acquired items into the form and structure used in the actual CFB file based on the CFB specification.

서버는 디렉토리 항목들에 근거하여, 복합 파일 헤더(compound file header)를 생성한다(S7020).The server creates a compound file header based on the directory entries (S7020).

관련된 명세는 다음과 같다.The relevant specifications are as follows.

1.1 Glossary1.1 Glossary

당해 문서에서는 다음 용어를 사용한다.This document uses the following terms:

ACL(Access Control List): 일부 리소스에 대한 액세스를 인증하기 위한 보안 규칙을 총체적으로 설명하는 ACEs(Access Control Entries) 목록 (예: 개체 또는 개체 집합).Access Control List (ACL): A list (such as an object or set of objects) of Access Control Entries (ACEs) that collectively describes the security rules for authorizing access to some resource.

응용 프로그램(application): 원자적 트랜잭션을 시작, 전파 및 완료해야 하는 participant. 애플리케이션은 트랜잭션을 시작하고 완료하기 위해 트랜잭션 관리자와 통신한다. 응용 프로그램은 다른 응용 프로그램과 주고받는 트랜잭션을 정리하기 위해 트랜잭션 관리자와 통신한다. 또한 응용 프로그램은 리소스 작업에 대한 요청을 제출하기 위해 리소스 관리자와 애플리케이션별로 통신한다.Application: A participant that must initiate, propagate, and complete an atomic transaction. Applications communicate with a transaction manager to start and complete transactions. Applications communicate with a transaction manager to organize transactions sent to and from other applications. Applications also communicate on a per-application basis with resource managers to submit requests for resource operations.

자식 개체(child object), 자식(children): 트리의 루트가 아닌 개체. 객체 o의 자식들은 부모가 o인 모든 객체들의 집합이다.child object, children: An object that is not the root of the tree. The children of object o are the set of all objects whose parent is o.

클래스 식별자(CLSID, class identifier): 소프트웨어 구성 요소를 식별하는 GUID. 예를 들어, DCOM 개체 클래스 또는 COM 클래스.class identifier (CLSID): A GUID that identifies a software component. For example, DCOM object classes or COM classes.

복합 파일(compound file): 단일 파일을 섹터로 분할하여 단일 파일 내에 단순화된 FAT 파일 시스템과 유사한 파일 시스템을 저장하는 구조.Compound file: A structure that divides a single file into sectors to store a simplified FAT file system-like file system within a single file.

Coordinated Universal Time(UTC): UT(Universal Time)를 대략적으로 추적하는 고정밀 원자적 시간 표준Coordinated Universal Time (UTC): A high-precision atomic time standard that approximately tracks Universal Time (UT).

생성 시간(creation time): 스토리지 개체가 생성된 시간(UTC).Creation time: The time the storage object was created (UTC).

디렉토리(directory): 사용자, 그룹, 컴퓨터, 프린터 및 사용자와 응용프로그램에서 이 정보를 사용할 수 있도록 하는 디렉토리 서비스와 같은 개체에 대한 정보를 저장하는 데이터베이스.Directory: A database that stores information about objects such as users, groups, computers, printers, and directory services that make this information available to users and applications.

디렉토리 항목(entry): 스토리지 개체 또는 스트림 개체의 파일 정보를 포함하는 구조.Directory entry: A structure containing the file information of a storage object or stream object.

디렉토리 스트림(stream): 섹터로 그룹화된 디렉토리 항목의 배열.directory stream: An array of directory entries grouped by sectors.

이중 간접 파일 할당 테이블(DIFAT, double-indirect file allocation table): 복합 파일에서 FAT 섹터를 찾는 데 사용되는 구조.Double-indirect file allocation table (DIFAT): A structure used to locate FAT sectors in a compound file.

파일(file): 사용자가 액세스하고 관리할 수 있는 파일 시스템의 데이터 엔티티. 파일은 디렉토리에 고유한 이름을 가지고 있어야 한다. 관련 데이터 집합을 포함하는 하나 이상의 바이트 스트림과 파일 또는 파일 내의 데이터를 설명하는 속성 집합(속성이라고도 함)으로 구성된다. 파일 생성 시간은 파일 속성의 예이다.File: A data entity in the file system that users can access and manage. The file must have a unique name in the directory. It consists of one or more byte streams containing related data sets and a set of attributes (also called attributes) that describe the file or the data within the file. File creation time is an example of a file attribute.

파일 할당 테이블(FAT, file allocation table): FAT 또는 FAT32 파일 시스템을 사용하여 볼륨을 포맷할 때 운영 체제가 생성하는 데이터 구조. 운영 체제는 나중에 파일을 검색할 수 있도록 각 파일에 대한 정보를 FAT에 저장한다.File allocation table (FAT): A data structure created by the operating system when a volume is formatted using the FAT or FAT32 file system. The operating system stores information about each file in the FAT so that the file can be retrieved later.

파일 시스템(file system): 응용 프로그램이 저장 장치에 파일을 저장하고 검색할 수 있도록 하는 시스템. 파일이 계층 구조로 배치된다. 파일 시스템은 파일에 대한 명명 규칙과 트리 구조의 파일에 대한 경로를 지정하는 형식을 지정한다. 각 파일 시스템은 파일 시스템의 데이터 형식과 기능을 정의하는 하나 이상의 드라이버와 DLL로 구성된다. 파일 시스템은 디스켓, 하드 디스크, 주크박스, 이동식 광학 디스크 및 테이프 백업 장치에 존재할 수 있다.file system: A system that allows applications to store and retrieve files on a storage device. Files are laid out in a hierarchical structure. A file system specifies naming conventions for files and a format for specifying paths to files in a tree structure. Each file system consists of one or more drivers and DLLs that define the file system's data formats and functions. File systems can exist on diskettes, hard disks, jukeboxes, removable optical disks, and tape backup devices.

GUID(Global Unique Identifier): 마이크로소프트 프로토콜 기술 문서(TD, technical documents)에서 범용 고유 식별자(UUID, universally unique identifier)와 상호 교환하여 사용되는 용어. Global Unique Identifier (GUID): A term used interchangeably with universally unique identifier (UUID) in Microsoft protocol technical documents (TD).

헤더(header): 복합 파일의 시작 부분에 있는 구조.header: A structure at the beginning of a compound file.

리틀 엔디언(little-endian): 최소 주소의 메모리 위치에 저장된 최하위 바이트로 정렬된 다중 바이트 값.Little-endian: A multi-byte value aligned with the least significant byte stored in the memory location at the lowest address.

mini FAT: FAT에 별도로 할당된 영역이며 미니 스트림을 위한 공간을 할당하는 데 사용되는 파일 할당 테이블(FAT) 구조. FAT보다 작은 단위의 별도 섹터 크기를 갖는다.mini FAT: An area allocated separately to the FAT and a File Allocation Table (FAT) structure used to allocate space for mini streams. It has a separate sector size smaller than FAT.

미니 스트림(mini stream): 미리 정의된 크기 제한보다 작은 스트림 개체에 대한 모든 사용자 정의 데이터를 포함하는 구조.mini stream: A structure containing all user-defined data for a stream object smaller than a predefined size limit.

수정 시간(modification time): 스토리지 개체가 마지막으로 수정된 시간(UTC).modification time: The last time the storage object was modified (UTC).

개체(object): 각각에 연결된 값이 있는 특성 집합입니다. 개체의 두 속성은 특별한 의미를 가짐: 식별 속성과 부모 식별 속성. 식별 속성은 모든 개체에 나타나는 지정된 단일 값 속성. 이 속성의 값은 개체를 식별한다. 복제본의 객체 집합의 경우 식별 특성의 값은 구별된다. 부모 식별 속성은 모든 개체에 나타나는 지정된 단일 값 속성. 이 속성의 값은 개체의 부모를 식별한다.object: A set of attributes, each with a value associated with it. Two properties of an object have special meaning: the identification property and the parent identification property. An identifying attribute is a specified single-valued attribute that appears on every object. The value of this attribute identifies the object. For a set of objects in replicas, the values of the identifying properties are distinct. A parent identifying property is a specified single-valued property that appears on all objects. The value of this property identifies the object's parent.

개체 클래스(object class): COM에서 CLSID에 의해 식별되는 개체의 카테고리, CLSID의 활성화를 통해 멤버들을 얻을 수 있다.Object class: A category of object identified in COM by a CLSID, members obtained through activation of the CLSID.

부모 개체(parent object): 개체는 개체 트리의 루트이거나 상위 개체를 가지고 있다. 두 개체가 동일한 상위 개체를 가질 경우 해당 개체의 RDNs(relative distinguished names)에 다른 값이 있어야 한다.Parent object: An object is the root of the object tree or has a parent object. If two objects have the same parent object, their relative distinguished names (RDNs) must have different values.

루트 저장소 개체(root storage object): 다른 스토리지 개체 및 스트림 개체를 참조하기 전에 액세스해야 하는 복합 파일의 스토리지 개체이다. 스토리지 개체 및 스트림 개체 계층에서 최상위 상위 개체.Root storage object: This is the storage object of the compound file that needs to be accessed before referencing other storage objects and stream objects. The highest-level parent object in the hierarchy of storage objects and stream objects.

섹터(sector): 디스크의 주소 지정 가능한 최소 단위.Sector: The smallest addressable unit on a disk.

섹터 체인(chain): 각 섹터가 복합 파일 내의 다른 위치에 위치할 수 있는 섹터가 링크된 목록. 다양한 크기의 데이터를 위해 필요한 수만큼 섹터를 연결 리스트로 연결하여 표현한다.Sector chain: A linked list of sectors where each sector can be located in a different location within a compound file. It is expressed by connecting as many sectors as necessary for data of various sizes in a linked list.

섹터 번호(number): 복합 파일에 있는 특정 섹터를 식별하는 음수가 아닌 정수.Sector number (number): A non-negative integer identifying a particular sector in a compound file.

섹터 크기(size): 복합 파일에 있는 섹터의 크기(바이트 단위), 일반적으로 512바이트.Sector size (size): The size of a sector in a compound file in bytes, typically 512 bytes.

스토리지(storage): [MS-CFB]에 정의된 스토리지 개체.storage: A storage object defined in [MS-CFB].

스토리지 개체: 복합 파일의 개체로 파일 시스템 디렉토리와 유사하다. 스토리지 개체의 상위 개체는 다른 스토리지 개체 또는 루트 스토리지 개체여야 한다.Storage object: An object of a compound file, similar to a file system directory. A storage object's parent object must be another storage object or a root storage object.

스트림(stream): [MS-CFB]에 설명된 대로 복합 파일의 요소. 스트림에는 응용 프로그램에서 읽거나 쓸 수 있는 바이트 시퀀스가 포함되어 있으며, 스토리지에만 존재할 수 있다.stream: An element of a compound file as described in [MS-CFB]. Streams contain sequences of bytes that can be read or written by applications, and can only exist on storage.

스트림 개체: 파일 시스템 파일과 유사한 복합 파일의 개체. 스트림 개체의 상위 개체는 스토리지 개체 또는 루트 스토리지 개체여야 한다.Stream object: An object in a compound file similar to a file system file. The parent object of a stream object must be either a storage object or a root storage object.

스트림 개체: 큰 문자열 및 이진 속성을 읽고 쓰는 데 사용되는 서버 개체.Stream object: A server object used to read and write large string and binary properties.

할당되지 않은 사용 가능한 섹터(unallocated free sector): 데이터를 보유하도록 할당할 수 있는 빈 섹터.Unallocated free sector: An empty sector that can be allocated to hold data.

유니코드: 유니코드 컨소시엄이 개발한 문자 인코딩 표준.Unicode: A character encoding standard developed by the Unicode Consortium.

사용자 정의 데이터(user-defined data): 스트림 개체의 메인 스트림 부분.User-defined data: The main stream part of a stream object.

UTF-16: 유니코드 표준에서 정의된 유니코드 문자를 인코딩하기 위한 표준.UTF-16: A standard for encoding Unicode characters defined in the Unicode standard.

22 StructuresStructures

2.2 Compound File Header2.2 Compound File Headers

도 8은 본 명세서가 적용될 수 있는 복합 파일 헤더를 예시한다.8 illustrates a composite file header to which this specification can be applied.

도 8을 참조하면, 복합 파일 헤더(Compound File Header) 구조는 파일의 시작 부분(오프셋 0)에 있어야 한다.Referring to FIG. 8, the compound file header structure must be located at the beginning of the file (offset 0).

복합 파일 헤더 구조는 다음을 포함할 수 있다:A compound file header structure may contain:

Header Signature (8 bytes): 복합 파일 구조에 대한 식별 서명이며 값 0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1로 설정해야 한다.Header Signature (8 bytes): This is the identification signature for the compound file structure and should be set to the values 0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1.

Header CLSID (16 bytes): 모두 0(CLSID_NULL)으로 설정해야 하는 예약 및 사용되지 않은 클래스 ID.Header CLSID (16 bytes): Reserved and unused class ID which must be set to all 0 (CLSID_NULL).

Minor Version (2 bytes): nonbreaking changes에 대한 버전 번호. 주 버전 필드가 0x0003 또는 0x0004인 경우 이 필드를 0x003E로 설정해야 한다.Minor Version (2 bytes): Version number for nonbreaking changes. If the major version field is 0x0003 or 0x0004, this field MUST be set to 0x003E.

Major Version (2 bytes): breaking changes에 대한 버전 번호. 이 필드는 0x0003(버전 3) 또는 0x0004(버전 4)로 설정해야 한다.Major Version (2 bytes): Version number for breaking changes. This field should be set to 0x0003 (version 3) or 0x0004 (version 4).

Byte Order (2 bytes): 이 필드는 0xFFE로 설정해야 한다. 이 필드는 모든 정수 필드에 대한 바이트 순서 표시로, 리틀 엔디언(little-endian) 바이트 순서를 지정한다.Byte Order (2 bytes): This field must be set to 0xFFE. This field is a byte order mark for all integer fields, specifying little-endian byte order.

Sector Shift (2 bytes): 이 필드는 주 버전 필드에 따라 0x0009 또는 0x000c로 설정해야 한다.Sector Shift (2 bytes): This field should be set to 0x0009 or 0x000c depending on the major version field.

Mini Sector Shift (2 bytes): 이 필드는 0x0006으로 설정해야 한다.Mini Sector Shift (2 bytes): This field should be set to 0x0006.

Reserved (6 bytes): 이 필드는 모두 0으로 설정해야 한다.Reserved (6 bytes): This field must be set to all zeros.

Number of Directory Sectors (4 bytes): 이 정수 필드에는 복합 파일의 디렉토리 섹터 수가 포함된다.Number of Directory Sectors (4 bytes): This integer field contains the number of directory sectors in the compound file.

Number of FAT Sectors (4 bytes): 이 정수 필드에는 복합 파일의 FAT 섹터 수가 포함된다.Number of FAT Sectors (4 bytes): This integer field contains the number of FAT sectors in the compound file.

First Directory Sector Location (4 bytes): 이 정수 필드에는 디렉토리 스트림의 시작 섹터 번호가 포함된다.First Directory Sector Location (4 bytes): This integer field contains the starting sector number of the directory stream.

Transaction Signature Number (4 bytes): 이 정수 필드는 파일 트랜잭션을 지원하는 구현에 의해 복합 파일이 저장될 때마다 증가하는 시퀀스 번호를 포함할 수 있다. 파일 트랜잭션이 구현되지 않은 경우 모두 0으로 설정해야 하는 필드이다.Transaction Signature Number (4 bytes): This integer field MAY contain a sequence number that is incremented each time a compound file is saved by an implementation that supports file transactions. This field should be set to all 0 if file transaction is not implemented.

Mini Stream Cutoff Size (4 bytes): 대상 데이터를 FAT 또는 Mini FAT 중 할당 위치를 판별하기 위한 데이터 크기 값. 이 정수 필드는 0x00001000으로 설정해야 한다.Mini Stream Cutoff Size (4 bytes): Data size value to determine the allocation location of the target data, either FAT or Mini FAT. This integer field should be set to 0x00001000.

First Mini FAT Sector Location (4 bytes): 이 정수 필드에는 미니 FAT의 시작 섹터 번호가 포함된다.First Mini FAT Sector Location (4 bytes): This integer field contains the starting sector number of the mini FAT.

Number of Mini FAT Sectors (4 bytes): 이 정수 필드에는 복합 파일의 미니 FAT 섹터 수가 포함된다.Number of Mini FAT Sectors (4 bytes): This integer field contains the number of mini FAT sectors in the compound file.

First DIFAT Sector Location (4 bytes): 이 정수 필드에는 DIFAT의 시작 섹터 번호가 포함된다.First DIFAT Sector Location (4 bytes): This integer field contains the starting sector number of DIFAT.

Number of DIFAT Sectors (4 bytes): 이 정수 필드에는 복합 파일의 DIFAT 섹터 수가 포함된다.Number of DIFAT Sectors (4 bytes): This integer field contains the number of DIFAT sectors in the compound file.

DIFAT (436 bytes): 이 32비트 정수 필드의 배열은 복합 파일의 첫 번째 109 FAT 섹터 위치를 포함한다.DIFAT (436 bytes): This array of 32-bit integer fields contains the positions of the first 109 FAT sectors of the compound file.

서버는 명세에 근거하여, 복합 파일 헤더를 생성할 수 있다.The server may create a compound file header based on the specification.

예를 들어, 서버는 다음과 같이 복합 파일 헤더를 생성할 수 있다 :For example, a server could create a compound file header like this:

A. Header Signature (8 bytes): 다음 값으로 저장 : 0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1.A. Header Signature (8 bytes): Stored as the following values: 0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1.

B. Header CLSID (16 bytes): 사용하지 않는 값. 모든 값을 0으로 설정. B. Header CLSID (16 bytes): Unused value. Set all values to 0.

C. Minor Version (2 bytes): 0x003E 값으로 설정.C. Minor Version (2 bytes): Set to 0x003E value.

D. Major Version (2 bytes): 버전 번호를 명시. 0x003 또는 0x004 중 한가지여야 하며 해당 값은 피삽입 문서를 따라 설정함.D. Major Version (2 bytes): Specifies the version number. It must be either 0x003 or 0x004, and the value is set according to the inserted document.

E. Byte Order (2 bytes): byte 순서 표현을 나타내며 0xFFFE로 설정(little endian).E. Byte Order (2 bytes): Indicates byte order representation, set to 0xFFFE (little endian).

F. Sector Shift (2 bytes): Major Version값에 따라 아래 2 경우 중 하나로 설정. 설정된 값을 2의 지수로 계산하여 Sector Size를 구함.F. Sector Shift (2 bytes): Set to one of the 2 cases below according to the Major Version value. Sector Size is obtained by calculating the set value as an exponent of 2.

Major Version 3 -> 0x0009 : Sector Size를 512로 사용 (2^9)Major Version 3 -> 0x0009 : Use Sector Size as 512 (2^9)

Major Version 4 -> 0x000c : Sector Size를 4096으로 사용(2^12)Major Version 4 -> 0x000c : Use Sector Size as 4096 (2^12)

G. Mini Sector Shift (2 bytes) : 0x0006으로 설정. Sector shift와 동일하게 사용하여 Mini Sector의 크기를 표현(2^6 -> 64Byte).G. Mini Sector Shift (2 bytes) : Set to 0x0006. Express the size of Mini Sector using the same as sector shift (2^6 -> 64Byte).

H. Reserved (6 bytes): 모든 값을 0으로 설정.H. Reserved (6 bytes): Set all values to 0.

I. Number of Directory Sectors (4 bytes): Directory Sector의 개수를 저장. Major Version 이 3인 경우 0으로 설정.I. Number of Directory Sectors (4 bytes): Stores the number of Directory Sectors. Set to 0 if Major Version is 3.

J. Number of FAT Sectors (4 bytes): 현재 파일의 FAT Sector의 개수를 저장.J. Number of FAT Sectors (4 bytes): Saves the number of FAT sectors of the current file.

K. First Directory Sector Location (4 bytes): Directory Sector의 첫번째 Sector ID를 저장.K. First Directory Sector Location (4 bytes): Stores the first Sector ID of Directory Sector.

L. Transaction Signature Number (4 bytes): 파일 트랜잭션 값은 따로 저장하지 않으므로 모두 0으로 설정.L. Transaction Signature Number (4 bytes): Set all to 0 as file transaction values are not stored separately.

M. Mini Stream Cutoff Size (4 bytes): user-defined data를 Mini FAT또는 FAT 중 어느 곳에 저장할지 구분하는 크기를 명시. 0x00001000으로 설정. (4096Byte)M. Mini Stream Cutoff Size (4 bytes): Specifies the size that distinguishes whether to save user-defined data in Mini FAT or FAT. Set to 0x00001000. (4096 bytes)

N. First Mini FAT Sector Location (4 bytes): Mini FAT Sector의 첫번째 Sector ID를 저장.N. First Mini FAT Sector Location (4 bytes): Stores the first Sector ID of the Mini FAT Sector.

O. Number of Mini FAT Sectors (4 bytes): 현재 파일의 Mini FAT Sector의 개수를 저장.O. Number of Mini FAT Sectors (4 bytes): Saves the number of Mini FAT Sectors in the current file.

P. First DIFAT Sector Location (4 bytes): DIFAT Sector의 첫번째 Sector ID를 저장.P. First DIFAT Sector Location (4 bytes): Stores the first Sector ID of DIFAT Sector.

Q. Number of DIFAT Sectors (4 bytes): 현재 파일의 DIFAT Sector의 개수를 저장.Q. Number of DIFAT Sectors (4 bytes): Saves the number of DIFAT sectors in the current file.

R. DIFAT (436 bytes): 32bit 정수로 표현된 Sector ID의 배열로 요소들 각각이 FAT Sector의 위치를 가리킨다. 109개까지 저장 가능하며 해당 개수 초과분은 DIFAT sector에 저장.R. DIFAT (436 bytes): An array of Sector IDs expressed as 32-bit integers, each of which points to the location of the FAT Sector. Up to 109 can be stored, and the excess of the number is stored in the DIFAT sector.

다시, 도 7을 참조하면, 서버는 디렉토리 항목에 근거하여, 섹터 체인을 생성한다(S7030). Referring again to FIG. 7 , the server creates a sector chain based on the directory entry (S7030).

도 9는 본 명세서가 적용될 수 있는 저장영역 할당의 예시이다.9 is an example of storage area allocation to which the present specification can be applied.

도 9를 참조하면, 서버는 헤더에 명시된 크기에 근거하여, 섹터 단위로 데이터에 접근할 수 있다. 예를 들어, 서버는 섹터 번호를 Bit Shift 연산하여, Offset을 획득할 수 있다. 섹터는 필요 공간 크기에 따라, 섹터 체인 형태로 구성될 수 있고, 이러한 섹터 체인도 별도의 섹터가 할당되어 저장될 수 있다. 또한, Mini Sector도 섹터 체인 형태로 구성될 수 있다. Referring to FIG. 9 , the server may access data in sector units based on the size specified in the header. For example, the server may obtain an offset by bit shifting a sector number. Sectors may be configured in the form of sector chains according to the required space size, and such sector chains may also be allocated and stored as separate sectors. In addition, Mini Sector can also be configured in the form of a sector chain.

보다 자세하게, 저장영역은 Header와 FAT로 구성되고 기본 단위인 Sector를 각 데이터별 필요량만큼 연결하여 사용될 수 있다. 예를 들어, 섹터 체인의 형태로 구성될 수 있는 섹터는 다음과 같다 : In more detail, the storage area is composed of Header and FAT and can be used by connecting Sector, which is the basic unit, as much as required for each data. For example, sectors that can be configured in the form of a sector chain are:

FAT 영역에 할당되는 데이터 :Data allocated to the FAT area:

A.A. Mini FAT Sector Mini Fat Sector

관련 명세는 다음과 같다.The relevant specifications are as follows.

2.4 Compound File Mini FAT Sectors2.4 Compound File Mini FAT Sectors

mini FAT은 미니 스트림에서 공간을 할당하는 데 사용된다. 미니 스트림은 더 작은 동일한 길이의 섹터로 나뉘며, 미니 스트림에 사용되는 섹터 크기는 복합 파일 헤더(64바이트)에서 지정된다.mini FAT is used to allocate space in mini streams. A mini-stream is divided into smaller equal-length sectors, and the sector size used for a mini-stream is specified in the composite file header (64 bytes).

도 10은 본 명세서가 적용될 수 있는 mini Fat 배열의 섹터들의 예시이다.10 is an example of sectors of a mini Fat array to which the present specification can be applied.

도 10을 참조하면, mini FAT 섹터의 위치는 FAT의 표준 체인에 저장되며 체인의 시작 부분은 헤더(첫 번째 미니 FAT 시작 섹터의 위치)에 저장된다. mini FAT 섹터 번호는 섹터 번호 x 64 바이트의 공식을 사용하여 바이트 오프셋으로 미니 스트림으로 변환할 수 있다. 이 수식은 미니 스트림에 헤더가 저장되지 않기 때문에 파일의 섹터 번호를 바이트 오프셋으로 변환하는 데 사용되는 수식과는 다르다.Referring to FIG. 10, the position of a mini FAT sector is stored in the FAT standard chain, and the start of the chain is stored in the header (the position of the first mini FAT start sector). A mini FAT sector number can be converted to a mini stream as a byte offset using the formula sector number x 64 bytes. This formula differs from the formula used to convert a file's sector number to byte offset because no header is stored in the mini-stream.

미니 스트림은 일반 스트림과 정확히 동일한 방식으로 FAT 내에서 체인으로 연결된다. 미니 스트림의 시작 섹터는 첫 번째 디렉터리 항목(루트 저장소 스트림 ID 0)에서 참조된다.Mini-streams are chained within the FAT in exactly the same way as regular streams. The starting sector of the mini-stream is referenced in the first directory entry (root storage stream ID 0).

파일의 모든 사용자 스트림이 컷오프인 4,096바이트보다 크면 mini FAT 및 미니 스트림이 필요하지 않는다. 이 경우 헤더의 첫 번째 미니 FAT 시작 섹터의 위치를 ENDOFCHANE으로 설정하고 루트 디렉토리 엔트리의 시작 섹터의 위치를 ENDOFCHANE으로 설정할 수 있다.If all user streams in the file are larger than the cutoff of 4,096 bytes, mini FAT and mini streams are not required. In this case, the position of the first mini-FAT start sector of the header can be set to ENDOFCHANE, and the position of the start sector of the root directory entry can be set to ENDOFCHANE.

다시 도 9를 참조하면, 서버는 Mini Sector의 Sector chain을 저장할 수 있다. 예를 들어, 미니 섹터는 4바이트짜리 배열이므로 한 Sector에 최대 128개까지 저장할 수 있다. 서버는 Sector를 필요 수만큼 할당 받고 Directory Entry의 첫 Root Entry 항목을 통해 Mini FAT Start Location을 찾을 수 있다. 미니 섹터는, Header의 Mini Stream Cutoff Size보다 작은 데이터 저장용으로 쓰일 수 있다. 서버는 개념적으로 필요 크기만큼 Sector를 할당하여 섹터 체인을 구성하는 방식과 동일하게 미니 섹터 체인으로 구성할 수 있다.Referring back to FIG. 9 , the server may store the Sector chain of the Mini Sector. For example, since a mini sector is a 4-byte array, up to 128 can be stored in one sector. The server receives the required number of sectors and can find the Mini FAT Start Location through the first root entry of the directory entry. A mini sector can be used for data storage that is smaller than the header's mini stream cutoff size. Conceptually, the server can be configured as a mini-sector chain in the same way as a sector chain is configured by allocating sectors as needed.

B.B. Directory SectorDirectory Sector

관련 명세는 다음과 같다.The relevant specifications are as follows.

2.6 Compound File Directory Sectors2.6 Compound File Directory Sectors

디렉토리 항목 배열은 스트림 및 스토리지 개체에 대한 정보를 복합 파일에 포함하고, 트리 스타일의 containment 구조를 유지하는 데 사용되는 구조이다.An array of directory entries is a structure used to contain information about streams and storage objects in a compound file, and to maintain a tree-style containment structure.

디렉토리 항목 배열은 FAT 내 디렉토리 섹터의 표준 체인으로 할당된다. 각 디렉토리 항목은 스트림 ID라고 하는 음수가 아닌 숫자로 식별된다. 디렉토리 섹터 체인의 첫 번째 섹터는 루트 저장소 디렉토리 항목을 스트림 ID 0의 첫 번째 디렉토리 항목으로 포함해야 한다.An array of directory entries is allocated as a standard chain of directory sectors within FAT. Each directory entry is identified by a non-negative number called a stream ID. The first sector of the directory sector chain must contain the root store directory entry as the first directory entry of stream ID 0.

도 11은 본 명세서가 적용될 수 있는 디렉토리 항목 배열의 섹터의 예시이다.11 is an example of a sector of a directory entry arrangement to which the present specification can be applied.

다시 도 9를 참조하면, Directory Entry 구조체는 128 Byte로 고정되어 있고 512Byte 크기의 Sector 기준으로 4개 항목까지 저장 가능하다. 서버는 Directory Entry 구조체를 배열로서 Sector에 연속하여 기록할 수 있다.Referring back to FIG. 9, the Directory Entry structure is fixed to 128 Bytes and can store up to 4 items based on a 512 Byte Sector. The server can continuously record the Directory Entry structure as an array in the Sector.

C.C. User-defined data(User-Data)User-defined data (User-Data)

관련된 명세는 다음과 같다 :Relevant specifications include:

2.7 Compound File User-Defined Data Sectors2.7 Compound File User-Defined Data Sectors

스트림 섹터는 단순히 임의 바이트의 모음이다. 그것들은 사용자 정의 데이터 스트림의 구성 요소이며, 그 내용에 제한이 없다. 사용자 정의 데이터 섹터는 FAT 또는 미니 FAT에서 체인으로 표현되며, 각 체인은 이름과 크기와 같은 스트림 객체 메타데이터를 보유하기 위해 연결된 단일 디렉터리 엔트리를 가져야 한다.A stream sector is simply a collection of random bytes. They are components of user-defined data streams and are not limited in content. User-defined data sectors are represented as chains in FAT or mini-FAT, and each chain must have a single directory entry associated with it to hold stream object metadata such as name and size.

도 12는 본 명세서가 적용될 수 있는 사용자 정의 데이터 섹터 체인의 예시이다.12 is an example of a user-defined data sector chain to which this specification can be applied.

도 12를 참조하면, 섹터 #0 ~ 섹터 #8이 표시된 도 12의 예시에서 사용자 정의 데이터 섹터 체인은 섹터 #7에서 시작하여 섹터 #1로 계속, 섹터 #3으로 계속, 섹터 #5로 끝난다. 섹터 #5의 다음 섹터 위치는 ENDOFCHIN(0xFFFFE)을 가리킬 수 있다.Referring to FIG. 12, in the example of FIG. 12 where sector #0 to sector #8 are indicated, the user-defined data sector chain starts at sector #7, continues with sector #1, continues with sector #3, and ends with sector #5. The next sector position of sector #5 may point to ENDOFCHIN (0xFFFFE).

모든 사용자 정의 데이터를 보관하려면 사용자 정의 데이터 섹터 체인의 길이가 스트림 개체의 디렉터리 항목에 지정된 스트림 크기보다 크거나 같아야 한다. 스트림 객체의 사용자 정의 데이터 중 마지막 섹터의 사용되지 않는 부분은 의도하지 않은 정보가 유출되지 않도록 0으로 채워야 한다.To hold all user-defined data, the length of the user-defined data sector chain must be greater than or equal to the stream size specified in the stream object's directory entry. The unused part of the last sector among the user-defined data of the stream object must be filled with 0 to prevent unintended information from being leaked.

다시, 도 9를 참조하면, 서버는 Mini FAT에 들어가지 못하는 큰 사이즈의 데이터를 Sector에 바로 기록할 수 있다.Again, referring to FIG. 9, the server can directly record data of a large size that cannot fit into a mini FAT into a sector.

D.D. FAT Sector FAT Sector

관련된 명세는 다음과 같다.The relevant specifications are as follows.

2.3 Compound File FAT Sectors2.3 Compound File FAT Sectors

FAT는 복합 파일 내 공간의 주 할당이다. 파일의 모든 섹터는 할당되지 않은 섹터(free)를 포함하여 어떤 방식으로든 FAT 내에서 표시된다. FAT는 하나 이상의 FAT 섹터로 구성된 섹터 체인이다.FAT is the primary allocation of space within compound files. All sectors of a file are marked within FAT in some way, including unallocated sectors (free). A FAT is a sector chain composed of one or more FAT sectors.

도 13은 본 명세서가 적용될 수 있는 FAT 배열의 섹터들의 예시이다.13 is an example of sectors of a FAT arrangement to which this specification can be applied.

도 13을 참조하면, FAT는 파일 내의 공간 할당을 나타내는 섹터 번호의 배열로, FAT 섹터로 그룹화된다. 각 스트림은 FAT 파일 시스템과 거의 동일한 방식으로 섹터 체인에 의해 FAT에서 표현된다.Referring to FIG. 13, FAT is an array of sector numbers representing space allocation within a file, grouped into FAT sectors. Each stream is represented in FAT by a chain of sectors in much the same way as in the FAT file system.

FAT 섹터의 세트는 단일 배열로 함께 고려될 수 있다. 해당 배열의 각 항목은 체인의 다음 섹터의 섹터 번호를 포함하며, 이 섹터 번호는 체인을 따라 계속하기 위해 FAT 배열로 인덱스로 사용될 수 있다.A set of FAT sectors can be considered together in a single array. Each entry in that array contains the sector number of the next sector in the chain, and this sector number can be used as an index into the FAT array to continue along the chain.

체인 종결자(terminators)(ENDOFCHANE = 0xFFFFF), 프리(free) 섹터(FREESECT = 0xFFFFF), FAT 섹터(FATSECT = 0xFFFFF) 또는 DIFAT 섹터(DIFSECT = 0xFFFFFFF)에 대한 스토리지가 포함된 섹터에 대해 다른 것과 동일한 방식으로 연결되지 않는 특별한 값이 예약된다.Same as others for sectors containing storage for chain terminators (ENDOFCHANE = 0xFFFFF), free sectors (FREESECT = 0xFFFFF), FAT sectors (FATSECT = 0xFFFFF), or DIFAT sectors (DIFSECT = 0xFFFFFFF). A special value that is not linked in any way is reserved.

FAT 섹터의 위치는 DIFAT에서 읽는다. FAT는 그 자체로 표현되지만, 체인으로 표현되지는 않는다. 특수 예약된 섹터 번호(FATSECT = 0xFFFFD)는 FAT에 할당된 섹터를 표시하는 데 사용된다.The location of the FAT sector is read from DIFAT. FAT is represented by itself, but not as a chain. A special reserved sector number (FATSECT = 0xFFFFD) is used to indicate sectors allocated to FAT.

“(섹터 번호 + 1) x 섹터 크기” 공식을 사용하여 섹터 번호를 파일의 바이트 오프셋으로 변환할 수 있다. 이는 파일의 섹터 #0이 0이 아닌 바이트 오프셋 섹터 크기로 시작됨을 의미한다.You can use the “(sector number + 1) x sector size” formula to convert a sector number to a byte offset in a file. This means sector #0 of the file starts with a non-zero byte offset sector size.

다시 도 9를 참조하면, 서버는 FAT 섹터의 섹터 체인을 저장할 수 있다.Referring back to FIG. 9 , the server may store sector chains of FAT sectors.

E.E. DIFAT Sector DIFAT Sector

관련된 명세는 다음과 같다.The relevant specifications are as follows.

2.5 Compound File DIFAT Sectors2.5 Compound File DIFAT Sectors

DIFAT 배열은 FAT 섹터의 스토리지를 나타내는 데 사용된다. DIFAT는 32비트 섹터 번호의 배열로 표시된다. DIFAT 배열은 헤더와 DIFAT 섹터에 모두 저장된다. 헤더에서 DIFAT 배열은 109개의 항목을 차지하며, 각 DIFAT 섹터에서 DIFAT 배열은 전체 섹터에서 4 바이트를 뺀 값을 차지한다. (마지막 필드는 DIFAT 섹터 체인을 연결하기 위한 것이다.)The DIFAT array is used to represent the storage of FAT sectors. DIFAT is represented as an array of 32-bit sector numbers. DIFAT arrays are stored in both the header and DIFAT sectors. In the header, the DIFAT array occupies 109 entries, and in each DIFAT sector, the DIFAT array occupies the total sector minus 4 bytes. (The last field is for linking DIFAT sector chains.)

도 14는 본 명세서가 적용될 수 있는 DIFAT 배열의 섹터를 예시한다.14 illustrates a sector of a DIFAT arrangement to which this specification can be applied.

도 14를 참조하면, DIFAT 섹터들은 각 DIFAT 섹터의 마지막 필드에 의해 함께 연결된다. 최적화로서, 첫 번째 109개의 FAT 섹터는 헤더 자체 내에 표현된다. 512바이트 섹터 복합 파일에서(6.875MB = (1 헤더 섹터 + 109 FAT 섹터 x 128 비빈 항목) x 섹터당 512바이트) 6.875MB보다 작은 복합 파일에는 DIFAT 섹터가 필요하지 않는다.Referring to Figure 14, DIFAT sectors are linked together by the last field of each DIFAT sector. As an optimization, the first 109 FAT sectors are represented within the header itself. In a 512 byte sector composite file (6.875 MB = (1 header sector + 109 FAT sectors x 128 blank entries) x 512 bytes per sector) no DIFAT sectors are required for composite files smaller than 6.875 MB.

DIFAT는 FAT이 섹터 체인을 나타내는 것과 다른 방식으로 FAT 섹터를 나타낸다. DIFAT 배열에 대한 특정 지수 n은 (n+1)번째 FAT 섹터의 섹터 번호를 포함한다. 예를 들어 DIFAT 배열이 인덱스 #0으로 시작하기 때문에, DIFAT의 인덱스 #3에는 네 번째 FAT 섹터에 대한 섹터 번호가 포함된다.DIFAT represents FAT sectors in a different way than FAT represents sector chains. The specific exponent n for the DIFAT array contains the sector number of the (n+1)th FAT sector. For example, since the DIFAT array starts with index #0, index #3 of DIFAT contains the sector number for the fourth FAT sector.

DIFAT 섹터의 저장소는 FAT와 함께 예약되어 있지만, FAT에는 연결되어 있지 않는다. DIFAT 섹터의 공간은 특수 섹터 번호인 DIFISCT(0xFFFFFC)로 표시된다.Storage in the DIFAT sector is reserved with the FAT, but not linked to the FAT. The space of the DIFAT sector is denoted by the special sector number DIFISCT (0xFFFFFC).

제1 DIFAT 섹터의 위치는 헤더에 저장된다.The location of the first DIFAT sector is stored in the header.

ENDOFCHIN(0xFFFFE)의 특별한 값은 마지막 DIFAT 섹터의 "다음 DIFAT 섹터 위치" 필드에 저장되거나 DIFAT 섹터가 필요하지 않을 때 헤더에 저장된다.The special value of ENDOFCHIN (0xFFFFE) is stored in the "next DIFAT sector position" field of the last DIFAT sector or in the header when the DIFAT sector is not needed.

다시 도 9를 참조하면, DIFAT 섹터에서 FAT Sector는 Sector chain으로 표시되지 않는다. 109개 까지의 FAT Sector는 Header 내부의 DIFAT 배열에 저장되나, 이를 초과하는 경우, 서버는 별도의 DIFAT 배열을 저장하기 위해 DIFAT Sector를 할당할 수 있다. DIFAT Sector는 동일하게 4바이트짜리 배열이므로 한 Sector에 최대 128개까지 저장할 수 있다.Referring back to FIG. 9, in the DIFAT sector, the FAT sector is not represented as a sector chain. Up to 109 FAT sectors are stored in the DIFAT array inside the header, but if this is exceeded, the server can allocate a DIFAT sector to store a separate DIFAT array. DIFAT Sector is a 4-byte array, so up to 128 can be stored in one sector.

다시 도 7을 참조하면, 서버는 복합 파일 헤더의 Mini Stream Cutoff Size에 근거하여, 디렉토리 항목 별로 미니 섹터 체인 및/또는 섹터 체인으로 데이터 영역을 할당할 수 있다. 보다 자세하게 서버는 디렉토리 항목의 크기가 Mini Stream Cutoff Size 보다 작으면, 이에 대응하여 미니(mini) 섹터(Mini Fat Sector) 체인으로 데이터 영역을 할당할 수 있다. 만일, 디렉토리 항목의 크기가 Mini Stream Cutoff Size 보다 크면, 서버는 이에 대응하여 섹터(Fat Sector) 체인으로 데이터 영역을 할당할 수 있다.Referring back to FIG. 7 , the server may allocate a data area to a mini sector chain and/or sector chain for each directory item based on the Mini Stream Cutoff Size of the composite file header. In more detail, if the size of the directory entry is smaller than the mini stream cutoff size, the server may allocate a data area in a mini fat sector chain in response to this. If the size of the directory entry is greater than the Mini Stream Cutoff Size, the server may allocate a data area in a fat sector chain in response thereto.

서버는 획득된 디렉토리 항목들을 트리 구조로 연결한다(S7040). 예를 들어, 트리 구조는 레드-블랙 트리(Red-Black Tree)를 포함할 수 있다. 보다 자세하게, 서버는 Left Sibling, Right Sibling 그리고 Color Flag을 이용한 Red-Black Tree 구조로 디렉토리 항목들을 연결할 수 있다.The server connects the obtained directory items in a tree structure (S7040). For example, the tree structure may include a red-black tree. More specifically, the server can connect directory entries in a Red-Black Tree structure using Left Sibling, Right Sibling, and Color Flag.

서버는 복합 파일 헤더, 및 섹터 체인에 근거하여, CFB 연결구조를 생성한다(S7050).The server creates a CFB connection structure based on the composite file header and the sector chain (S7050).

예를 들어, 서버는 Directory Entry의 배열을 저장하는 Directory Sector를 FAT에 할당할 수 있다. 보다 자세하게, 서버는 복합 파일 헤더의 First Directory Sector Location에 Directory Sector의 첫번째 Sector ID를 입력하고, 복합 파일 헤더의 Number of Directory Sectors에 Directory Sector의 총 필요 Sector의 개수를 입력할 수 있다. 예를 들어, Number of Directory Sectors에는 Major Version이 3인 경우 0, Header의 Major Version이 4인 경우 실제 총 필요 Sector의 개수가 입력될 수 있다.For example, a server can allocate a Directory Sector to a FAT that stores an array of Directory Entries. In more detail, the server may input the first sector ID of the directory sector into First Directory Sector Location of the compound file header, and input the total number of required sectors of the directory sector into Number of Directory Sectors of the compound file header. For example, in Number of Directory Sectors, if the Major Version is 3, 0, and if the Major Version of the Header is 4, the number of actual total required sectors may be input.

또한, 서버는 Mini FAT으로 할당된 Sector chain을 저장하는 Mini FAT Sector를 FAT에 할당할 수 있다. 예를 들어, 서버는 복합 파일 헤더의 Mini FAT Sector Location에 Mini FAT Sector가 시작하는 (FAT의)Sector ID를 입력하고, 복합 파일 헤더의 Number of Mini FAT Sectors에 Mini FAT Sector에 할당된 총 필요 (FAT의)Sector의 개수를 입력할 수 있다. In addition, the server may allocate a Mini FAT Sector to the FAT, which stores the Sector chain allocated to the Mini FAT. For example, the server puts the Sector ID (of the FAT) that the Mini FAT Sector starts with in the Mini FAT Sector Location of the composite file header, and the Total Needs assigned to the Mini FAT Sector in the Number of Mini FAT Sectors of the composite file header ( You can input the number of Sectors of FAT.

또한, 서버는 DIFAT Sector를 할당할 수 있다. 예를 들어, 서버는 복합 파일 헤더에 근거하여, 필요 FAT sector가 몇 개인지 획득할 수 있다. 필요 FAT Sector가 109개를 초과하는 경우, 서버는 초과 분 저장을 위한 DIFAT Sector 할당할 수 있다. DIFAT Sector의 첫 Sector ID는 Header의 First DIFAT Sector Location에 저장될 수 있다. DIFAT Sector의 개수는 Header의 Number of DIFAT Sectors값에 저장될 수 있다. 할당된 DIFAT Sector에 대응되는 FAT의 섹터 체인에는 별도 연결 표시 없이 모두 0xFFFFFFFC 값이 입력될 수 있다.Also, the server may allocate a DIFAT sector. For example, the server may obtain how many required FAT sectors are based on the composite file header. If the number of required FAT sectors exceeds 109, the server can allocate DIFAT sectors for storing the excess. The first Sector ID of the DIFAT Sector can be stored in the Header's First DIFAT Sector Location. The number of DIFAT Sectors can be stored in the Header's Number of DIFAT Sectors value. A value of 0xFFFFFFFC may be input to all sector chains of the FAT corresponding to the allocated DIFAT sector without indicating a separate connection.

또한, 서버는 FAT Sector를 할당할 수 있다. 예를 들어, 서버는 복합 파일 헤더에 근거하여, Sector chain을 모두 저장하기 위해 필요한 FAT sector의 개수를 획득할 수 있다. 할당된 FAT Sector에 대응되는 FAT의 Sector chain에는 별도 연결 표시 없이 모두 0xFFFFFFFD 값이 입력될 수 있다. FAT Sector의 개수는 Header의 Number of FAT Sectors값에 저장될 수 있다.Also, the server may allocate a FAT sector. For example, the server may obtain the number of FAT sectors required to store all sector chains based on the composite file header. A value of 0xFFFFFFFD can be input to all Sector chains of FAT corresponding to the allocated FAT Sector without indicating a separate connection. The number of FAT Sectors can be stored in the Header's Number of FAT Sectors value.

예를 들어, 서버는 할당된 FAT Sector의 첫 ID를 Header의 DIFAT[0] 값에 할당하는 것을 시작으로 연속하여 값을 다음과 같이 입력할 수 있다 :For example, the server can start by allocating the first ID of the allocated FAT sector to the DIFAT[0] value of the Header and continuously enter values as follows:

i. Sector ID of FAT Sector 0 -> Header::DIFAT[0]i. Sector ID of FAT Sector 0 -> Header::DIFAT[0]

ii. Sector ID of FAT Sector 1 -> Header::DIFAT[1]ii. Sector ID of FAT Sector 1 -> Header::DIFAT[1]

iii. …..iii. … ..

iv. Sector ID of FAT Sector 108 -> Header::DIFAT[108]iv. Sector ID of FAT Sector 108 -> Header::DIFAT[108]

v. Sector ID of FAT Sector 109 -> DIFAT[0] in DIFAT Sector 0v. Sector ID of FAT Sector 109 -> DIFAT[0] in DIFAT Sector 0

다시, 도 7을 참조하면, 서버는 CFB 연결구조에 근거하여, 문서 추출 데이터를 생성한다(S7060).Again, referring to FIG. 7 , the server generates document extraction data based on the CFB connection structure (S7060).

서버는 CFB 연결구조를 생성 순서와 동일하게 문서 추출 데이터를 기록하여 생성할 수 있으므로, 도 9와 같은 형식의 문서 추출 데이터가 생성될 수 있다.Since the server can create the CFB connection structure by recording the document extraction data in the same order of creation, document extraction data in the format shown in FIG. 9 can be generated.

예를 들어, 서버는 먼저 복합 파일 헤더를 기록(예를 들어, 기생성된 복합 파일 헤더를 다시 기록)하고, User-data in Mini FAT를 기록한다. 보다 자세하게, User-data in Mini FAT를 기록하기 위해, 서버는 Directory Entry 중 Mini FAT에 할당한 데이터를 Directory Entry 순서대로 기록할 수 있다. 이후, 서버는 User-data in FAT 기록을 위해, User-data in Mini FAT 기록 후, 남은 항목들을 Directory Entry 순서대로 기록하여, 생성할 수 있다. 서버는 Directory Entry를 기록하고, Mini FAT의 연결을 표시하는 Mini Sector chain을 기록하며, (데이터가 있는 경우) DIFAT Sector를 기록하고, FAT의 연결을 표시하는 Sector chain을 기록하여, 문서 추출 데이터를 생성할 수 있다.For example, the server first records the composite file header (eg, re-records the previously created composite file header) and then records User-data in Mini FAT. More specifically, in order to record User-data in Mini FAT, the server may record data allocated to Mini FAT among directory entries in the order of directory entries. Thereafter, for User-data in FAT recording, after User-data in Mini FAT recording, the server may record and create remaining items in the order of Directory Entry. The server records the Directory Entry, records the Mini Sector chain representing the concatenation of Mini FATs, records the DIFAT Sector (if data exists), records the Sector chain representing the concatenation of the FATs, and records the document extraction data. can create

다시, 도 6을 참조하면, 서버는 추출된 문서를 검사대상 문서로 추가한다(S6030). 예를 들어, 서버는 문서 추출 데이터를 추출된 문서로 하여 추출된 파일 목록에 추가할 수 있다. 이를 통해, 서버는 개체 삽입된 문서를 추출하여, 추출된 문서에 대한 악성 검사를 수행할 수 있다.Referring again to FIG. 6 , the server adds the extracted document as a document to be inspected (S6030). For example, the server may take the document extraction data as an extracted document and add it to the extracted file list. Through this, the server can extract the object-embedded document and perform malicious inspection on the extracted document.

전술한 본 명세서는, 프로그램이 기록된 매체에 컴퓨터가 읽을 수 있는 코드로서 구현하는 것이 가능하다. 컴퓨터가 읽을 수 있는 매체는, 컴퓨터 시스템에 의하여 읽혀 질 수 있는 데이터가 저장되는 모든 종류의 기록장치를 포함한다. 컴퓨터가 읽을 수 있는 매체의 예로는, HDD(Hard Disk Drive), SSD(Solid State Disk), SDD(Silicon Disk Drive), ROM, RAM, CD-ROM, 자기 테이프, 플로피 디스크, 광 데이터 저장 장치 등이 있으며, 또한 캐리어 웨이브(예를 들어, 인터넷을 통한 전송)의 형태로 구현되는 것도 포함한다. 따라서, 상기의 상세한 설명은 모든 면에서 제한적으로 해석되어서는 아니되고 예시적인 것으로 고려되어야 한다. 본 명세서의 범위는 첨부된 청구항의 합리적 해석에 의해 결정되어야 하고, 본 명세서의 등가적 범위 내에서의 모든 변경은 본 명세서의 범위에 포함된다.The above specification can be implemented as computer readable code on a medium on which a program is recorded. A computer-readable medium includes all types of recording devices in which data that can be read by a computer system is stored. Examples of computer-readable media include Hard Disk Drive (HDD), Solid State Disk (SSD), Silicon Disk Drive (SDD), ROM, RAM, CD-ROM, magnetic tape, floppy disk, optical data storage device, etc. , and also includes those implemented in the form of a carrier wave (eg, transmission over the Internet). Accordingly, the above detailed description should not be construed as limiting in all respects and should be considered illustrative. The scope of this specification should be determined by reasonable interpretation of the appended claims, and all changes within the equivalent scope of this specification are included in the scope of this specification.

또한, 이상에서 서비스 및 실시 예들을 중심으로 설명하였으나 이는 단지 예시일 뿐 본 명세서를 한정하는 것이 아니며, 본 명세서가 속하는 분야의 통상의 지식을 가진 자라면 본 서비스 및 실시 예의 본질적인 특성을 벗어나지 않는 범위에서 이상에 예시되지 않은 여러 가지의 변형과 응용이 가능함을 알 수 있을 것이다. 예를 들어, 실시 예들에 구체적으로 나타난 각 구성 요소는 변형하여 실시할 수 있는 것이다. 그리고 이러한 변형과 응용에 관계된 차이점들은 첨부한 청구 범위에서 규정하는 본 명세서의 범위에 포함되는 것으로 해석되어야 할 것이다.In addition, although services and embodiments have been described above, this is only an example and does not limit the present specification, and those skilled in the art to which this specification belongs will not deviate from the essential characteristics of the present service and embodiments. It will be appreciated that various modifications and applications not exemplified above are possible. For example, each component specifically shown in the embodiments can be modified and implemented. And differences related to these modifications and applications should be construed as being included in the scope of the present specification as defined in the appended claims.

Claims (7)

서버가 CFB(Compound File Binary) 형식의 문서에 삽입된 문서파일을 추출하고 검사하기 위한 방법에 있어서,
상기 CFB 형식의 문서 내에 개체 삽입된 문서가 있는지 검사하는 단계;
상기 검사의 결과에 근거하여, 상기 개체 삽입된 문서를 원본 문서파일의 형태로 추출하는 단계; 및
상기 추출된 문서를 검사대상 문서로 추가하는 단계;
를 포함하며,
상기 CFB 형식의 문서는
MS-DOC 형식의 문서 또는 XLS 형식의 문서를 포함하고,
상기 개체 삽입된 문서는
상기 원본 문서파일의 데이터부로 구성되며,
상기 개체 삽입된 문서를 원본 문서파일의 형태로 추출하는 단계는
상기 개체 삽입된 문서와 관련된 디렉토리 항목들을 획득하는 단계;
상기 디렉토리 항목들에 근거하여, 복합 파일 헤더를 생성하는 단계;
상기 디렉토리 항목들에 근거하여, 섹터 체인을 생성하는 단계;
상기 획득된 디렉토리 항목들을 트리 구조로 연결하는 단계;
상기 복합 파일 헤더, 및 상기 섹터 체인에 근거하여, CFB 연결구조를 생성하는 단계; 및
상기 CFB 연결구조에 근거하여, 문서 추출 데이터를 생성하는 단계;
를 포함하는, 검사방법.
In a method for a server to extract and inspect a document file inserted in a CFB (Compound File Binary) format document,
checking whether there is an entity-embedded document in the CFB format document;
extracting the object-embedded document in the form of an original document file based on a result of the inspection; and
adding the extracted document as a document to be inspected;
Including,
The above CFB format documents are
Contains a document in MS-DOC format or a document in XLS format;
The document in which the object is inserted is
It is composed of the data part of the original document file,
The step of extracting the object-inserted document in the form of an original document file
acquiring directory entries related to the entity-embedded document;
based on the directory entries, creating a compound file header;
based on the directory entries, creating a sector chain;
connecting the obtained directory entries in a tree structure;
generating a CFB connection structure based on the composite file header and the sector chain; and
generating document extraction data based on the CFB connection structure;
Including, inspection method.
삭제delete 제1항에 있어서,
상기 섹터 체인은
Mini FAT Sector, Directory Sector, User-defined data, FAT Sector, 및 DIFAT Sector에 근거하는, 검사방법.
According to claim 1,
The sector chain
Inspection methods based on Mini FAT Sector, Directory Sector, User-defined data, FAT Sector, and DIFAT Sector.
제3항에 있어서,
상기 섹터 체인은
상기 복합 파일 헤더의 Mini Stream Cutoff Size에 근거하여, 일반 섹터 체인, 또는 미니 섹터 체인으로 구분되는, 검사방법.
According to claim 3,
The sector chain
Based on the Mini Stream Cutoff Size of the composite file header, it is divided into a normal sector chain or a mini sector chain.
제4항에 있어서,
상기 문서 추출 데이터를 생성하는 단계는
상기 복합 파일 헤더를 기록하는 단계;
Mini Fat의 User-data를 기록하는 단계;
FAT의 User-data를 기록하는 단계;
Directory Entry를 기록하는 단계;
상기 미니 섹터 체인을 기록하는 단계; 및
상기 섹터 체인을 기록하는 단계;
를 포함하는, 검사방법.
According to claim 4,
The step of generating the document extraction data is
writing the composite file header;
Recording User-data of Mini Fat;
Recording user-data of FAT;
Recording a Directory Entry;
writing the mini-sector chain; and
recording the sector chain;
Including, inspection method.
CFB(Compound File Binary) 형식의 문서에 삽입된 문서파일을 추출하고 검사하기 위한 서버에 있어서,
통신부;
메모리; 및
상기 통신부 및 상기 메모리를 기능적으로 제어하는 프로세서; 를 포함하고,
상기 프로세서는
상기 CFB 형식의 문서 내에 개체 삽입된 문서가 있는지 검사하고, 상기 검사의 결과에 근거하여, 상기 개체 삽입된 문서를 원본 문서파일의 형태로 추출하며, 상기 추출된 문서를 검사대상 문서로 추가하고,
상기 CFB 형식의 문서는
MS-DOC 형식의 문서 또는 XLS 형식의 문서를 포함하고,
상기 개체 삽입된 문서는 상기 원본 문서파일의 데이터부로 구성되며,
상기 개체 삽입된 문서를 원본 문서파일의 형태로 추출하기 위해, 상기 개체 삽입된 문서와 관련된 디렉토리 항목들을 획득하고, 상기 디렉토리 항목들에 근거하여, 복합 파일 헤더를 생성하며, 상기 디렉토리 항목들에 근거하여, 섹터 체인을 생성하고, 상기 획득된 디렉토리 항목들을 트리 구조로 연결하며, 상기 복합 파일 헤더, 및 상기 섹터 체인에 근거하여, CFB 연결구조를 생성하고, 상기 CFB 연결구조에 근거하여, 문서 추출 데이터를 생성하는, 서버.
In a server for extracting and inspecting a document file inserted in a document in CFB (Compound File Binary) format,
communications department;
Memory; and
a processor functionally controlling the communication unit and the memory; including,
The processor
Checking whether there is an entity-embedded document in the CFB format document, extracting the entity-embedded document in the form of an original document file based on the result of the inspection, and adding the extracted document as a document to be inspected,
The above CFB format documents are
Contains a document in MS-DOC format or a document in XLS format;
The object inserted document is composed of the data part of the original document file,
In order to extract the object-embedded document in the form of an original document file, directory entries related to the object-embedded document are obtained, based on the directory entries, a composite file header is created, and based on the directory entries to create a sector chain, connect the obtained directory entries in a tree structure, create a CFB connection structure based on the composite file header and the sector chain, and extract documents based on the CFB connection structure A server that generates data.
제1항에 있어서,
상기 개체 삽입된 문서는
상기 원본 문서파일의 연결부를 비포함하는, 검사방법.
According to claim 1,
The document in which the object is inserted is
A test method that does not include a connection portion of the original document file.
KR1020220161816A 2022-11-28 2022-11-28 Methods and apparatus for extracting and inspecting document files inserted into documents in ms-cfb format KR102548779B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020220161816A KR102548779B1 (en) 2022-11-28 2022-11-28 Methods and apparatus for extracting and inspecting document files inserted into documents in ms-cfb format

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020220161816A KR102548779B1 (en) 2022-11-28 2022-11-28 Methods and apparatus for extracting and inspecting document files inserted into documents in ms-cfb format

Publications (1)

Publication Number Publication Date
KR102548779B1 true KR102548779B1 (en) 2023-06-28

Family

ID=86993962

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020220161816A KR102548779B1 (en) 2022-11-28 2022-11-28 Methods and apparatus for extracting and inspecting document files inserted into documents in ms-cfb format

Country Status (1)

Country Link
KR (1) KR102548779B1 (en)

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Chintan Shah, "Static Analysis Methods for Detection of Microsoft Office Exploits"(2019.10.)* *
Microsoft Corporation, "MS-CFB: Compound File Binary File Format"(2021.06.)* *

Similar Documents

Publication Publication Date Title
Carrier Defining digital forensic examination and analysis tools using abstraction layers
Carrier File system forensic analysis
Huebner et al. Data hiding in the NTFS file system
JP4944008B2 (en) System, method and computer-accessible recording medium for searching efficient file contents in a file system
CN113221194B (en) Tamper web page hybrid detection technology
WO2014190427A1 (en) Identifying client states
Hand et al. Bin-Carver: Automatic recovery of binary executable files
Jackson Formats over time: Exploring uk web history
Nordvik et al. Reverse engineering of ReFS
Minnaard et al. Timestomping ntfs
KR102548779B1 (en) Methods and apparatus for extracting and inspecting document files inserted into documents in ms-cfb format
KR102547757B1 (en) Methods and apparatus for disarming a link in hwp
KR102468431B1 (en) Method and apparatus for disarming ole object in ms-ooxml
CN107533614B (en) Device for storing data and storage medium
Hesselink et al. Formalizing a hierarchical file system
Göbel et al. Anti-forensic capacity and detection rating of hidden data in the ext4 filesystem
Didriksen Forensic analysis of OOXML documents
KR101828466B1 (en) Method and apparatus for providing an object-based storage interface on the storage device based on file system
KR102494838B1 (en) Methods and apparatus for disarming a link on documentsummaryinformation stream in ms-cfb
KR102468434B1 (en) Method and apparatus for disarming dde in ms excel document format
Basu et al. Unsafe at any copy: Name collisions from mixing case sensitivities
KR102488943B1 (en) Methods and apparatus for disarming a link in ms-ppt
KR102494836B1 (en) Methods and apparatus for disarming a link in ms-doc
KR102538664B1 (en) Methods and apparatus for the disarming of link in the formula function in excel document
US8200895B2 (en) File system recognition structure

Legal Events

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