WO2023229068A1 - Ms excel 문서 포맷에서 dde 무해화를 위한 방법 및 장치 - Google Patents

Ms excel 문서 포맷에서 dde 무해화를 위한 방법 및 장치 Download PDF

Info

Publication number
WO2023229068A1
WO2023229068A1 PCT/KR2022/007493 KR2022007493W WO2023229068A1 WO 2023229068 A1 WO2023229068 A1 WO 2023229068A1 KR 2022007493 W KR2022007493 W KR 2022007493W WO 2023229068 A1 WO2023229068 A1 WO 2023229068A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
dde
external link
server
format
Prior art date
Application number
PCT/KR2022/007493
Other languages
English (en)
French (fr)
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 PCT/KR2022/007493 priority Critical patent/WO2023229068A1/ko
Priority to KR1020227017869A priority patent/KR102468434B1/ko
Publication of WO2023229068A1 publication Critical patent/WO2023229068A1/ko

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • G06F40/106Display of layout of documents; Previewing

Definitions

  • This specification relates to a method and device for detoxification of DDE (DYNAMIC DATA EXCHANGE) objects in MS Excel document format.
  • DDE DYNAMIC DATA EXCHANGE
  • the OOXML (Office Open XML, Open XML) standard is a file format based on XML. Promoted by Microsoft, it was approved as a European standard (ECMA-376) and an international standard (ISO/IEC 29500).
  • This standard includes WordprocessML (Word documents: .docx, .docm, etc.), PresentationML (PowerPoint documents: .pptx, .pptm, etc.), and SpreadsheetML (Excel documents: .xlsx, .xlsm, etc.).
  • the MS-XLS standard is a binary-based file format stored in CFB (Compound File Binary: a format for storing multiple files and folders in one file) and is used for Excel documents (.xls).
  • Dynamic Data Exchange allows information to be shared or communicated between programs across Windows, OS/2, and other operating systems. For example, when changing a form in a database program or changing a data item in a spreadsheet program, forms or items that may be in use at the same time in another program may be set to change together.
  • DDE is IPC (Inter Process Communication), which uses shared memory as a common exchange area and can provide protocols, commands, and message formats to application programs.
  • DDE uses a client/server model in which data requested by an application is considered the client, and data provided by the application is considered the server.
  • XLS or XLSX documents contain DDE objects that can cause external programs to run, resulting in security vulnerabilities. If the included DDE object is unconditionally removed for the purpose of detoxification, problems with the layout being distorted during operation may frequently occur in office documents.
  • the purpose of this specification is to propose a method for performing detoxification of DDE objects so that the layout does not change in the MS Excel document format.
  • One aspect of the present specification provides a method for a server to disarm Dynamic Data Exchange (DDE) from a non-executable file, comprising: determining the format of the non-executable file; Based on the format of the non-executable file being MS-OOXML SpreadsheetML format, searching for a first file for defining a content type in the non-executable file; Checking whether there is external link information related to the DDE based on the first file; Confirming the location of the external link file based on the presence of the external link information; Based on the location of the external link file, checking whether the DDE-related element is present in the external link file; and detoxifying 1) the service name attribute and 2) the DDE server topic attribute of the DDE-related elements; may include.
  • DDE Dynamic Data Exchange
  • the first file may be a [Content_Types].xml file.
  • the step of checking whether the external link information exists may be based on the content type in the element of the first file.
  • the external link file may be an externalLink1.xml file.
  • the service name attribute may be a ddeService attribute
  • the DDE server topic attribute may be a ddeTopic attribute.
  • searching for a Workbook stream may include.
  • the virPath field may be replaced with '_'.
  • a server for disarming DDE Dynamic Data Exchange
  • a communication unit comprising: a communication unit; a memory including a CDR engine for performing the detoxification; and a processor that functionally controls the communication unit and the memory, wherein the processor determines the format of the non-executable file and, based on the format of the non-executable file being the MS-OOXML SpreadsheetML format, executes the non-executable file.
  • DDE Dynamic Data Exchange
  • detoxification of a DDE object can be performed so that the layout is not changed in the MS Excel document format.
  • FIG. 1 is a diagram showing a server or client related to this specification.
  • Figure 2 is an example of abnormal input that can be applied to this specification.
  • Figure 3 illustrates a DDE detoxification method in MS-OOXML SpreadsheetML to which this specification can be applied.
  • Figure 4 illustrates the binary code of SupBook to which this specification can be applied.
  • Figure 5 illustrates a DDE detoxification method in XLS format to which this disclosure can be applied.
  • unit refers to a software or hardware component, and the “unit” performs certain roles. However, “wealth” is not limited to software or hardware.
  • the “copy” may be configured to reside on an addressable storage medium and may be configured to run on one or more processors.
  • part refers to software components, such as object-oriented software components, class components, and task components, processes, functions, properties, procedures, Includes subroutines, segments of program code, drivers, firmware, microcode, circuits, data, databases, data structures, tables, arrays, and variables.
  • the functionality provided within the components and “parts” may be combined into smaller numbers of components and “parts” or may be further separated into additional components and “parts”.
  • unit may be implemented with a processor and memory.
  • processor should be interpreted broadly to include general purpose processors, central processing units (CPUs), microprocessors, digital signal processors (DSPs), controllers, microcontrollers, state machines, etc.
  • processor may refer to an application-specific integrated circuit (ASIC), programmable logic device (PLD), field programmable gate array (FPGA), etc.
  • ASIC application-specific integrated circuit
  • PLD programmable logic device
  • FPGA field programmable gate array
  • processor refers to a combination of processing devices, 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 combination with a DSP core, or any other such combination of configurations. It may also refer to
  • memory should be interpreted broadly to include any electronic component capable of storing electronic information.
  • the terms memory include 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, etc.
  • RAM random access memory
  • ROM read-only memory
  • NVRAM non-volatile random access memory
  • PROM programmable read-only memory
  • EPROM erasable-programmable read-only memory
  • electrical may refer to various types of processor-readable media, such as erasable PROM (EEPROM), flash memory, magnetic or optical data storage, registers, etc.
  • EEPROM erasable PROM
  • flash memory magnetic or optical data storage, registers, etc.
  • non-executable file refers to a file that does not execute on its own, as opposed to an executable file or executable file.
  • non-executable files may be document files such as PDF files, Hangul files, Word files, image files such as JPG files, video files, JavaScript files, HTML files, etc., but are not limited thereto.
  • FIG. 1 is a diagram showing a server or client related to this specification.
  • a server or cloud server or client may include a control unit 100 and a communication unit 130.
  • the control unit 100 may include a processor 110 and a memory 120.
  • the processor 110 may execute instructions stored in the memory 120.
  • the processor 110 can control the communication unit 130.
  • 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 multiple processors. When a server or client includes a plurality of processors, at least some of the plurality of processors may be located physically spaced apart from each other. Additionally, the server or client is not limited to this and may be implemented in various known ways.
  • the communication unit 130 may include one or more modules that enable 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. Additionally, the communication unit 110 may include one or more modules that connect servers or clients to one or more networks.
  • the control unit 100 may control at least some of the components of the server or client to run the application program stored in the memory 120. Furthermore, the control unit 100 can operate at least two of the components included in the server or client in combination with each other to run the application program.
  • the server may include a reversing engine or/and a CDR engine that provides a CDR service.
  • the reversing engine is an analysis/diagnosis engine that automates the reverse engineering process for malicious non-executable files.
  • a reversing engine can perform the following steps:
  • File analysis This is the step of analyzing the appearance of the non-executable file itself (e.g., properties, author, creation date, file type). Similar to a general anti-virus program, it is possible to diagnose maliciousness using only the information of the non-executable file itself. You can.
  • Static analysis This is a step to extract and analyze the data in a non-executable file to determine whether it is normal or malicious. Non-executable files are not executed, but internal data is extracted and compared and analyzed according to the file structure to diagnose maliciousness. there is. This can be suitable for macros, URL extraction analysis, etc.
  • Dynamic analysis This is a step to determine whether it is malicious by analyzing its behavior while executing and monitoring non-executable files. It is easy to detect malicious behavior using normal functions such as macros, hyperlinks, and DDE.
  • Debugging analysis This is the step of analyzing vulnerabilities, exploits, etc. by executing and debugging non-executable files. It detects vulnerabilities in the application using the body of the document, tables, fonts, pictures, etc., including macros, hyperlinks, and DDE. It is suitable for
  • the reversing engine may include a debugging engine that can be used for debugging analysis.
  • the debugging engine can diagnose vulnerabilities that occur in the document input, processing, and output stages by debugging the viewing process of non-executable files.
  • a vulnerability refers to taking advantage of errors, bugs, etc. that occur when an application receives unexpected values from the code (logic) developed by the application developer. Through the vulnerability, an attacker can cause denial of service due to abnormal termination, etc. It can perform malicious actions such as remote code execution.
  • Figure 2 is an example of abnormal input that can be applied to this specification.
  • an application program 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 execution flow is changed to an unintentional one by the developer, resulting in a vulnerability.
  • the debugging engine automatically debugs the document viewing process, sets breakpoints at specific points related to vulnerabilities, checks specific values related to input values, and determines whether the input value causes a vulnerability or not, thereby diagnosing whether it is malicious.
  • the debugging engine can identify non-executable files and start debugging by running an application to view them.
  • the debugging engine checks whether the module is the target of analysis, and if so, can set a breakpoint at the specified address.
  • a malicious non-executable file may terminate the application if certain conditions, such as the version of the application or the operating system environment, are not met, or may have branching points that branch to a flow in which no malicious action occurs.
  • the server is analyzed by an analyst in advance and breakpoints can be set at branch points that have this possibility.
  • the server can set conditions in relation to the branch point that can continue to run the application without terminating it or lead to a flow in which malicious actions can occur.
  • the server can detect vulnerabilities according to detection logic and then store the results in an analysis report.
  • the automated reversing engine included in the server automatically performs and analyzes the above-mentioned steps, and can diagnose and block malicious non-executable files through diagnostic algorithms researched and developed by analysts.
  • CDR Content Disarm and Reconstruction
  • the CDR service is a solution that creates a new file by disassembling non-executable files, removing malicious or unnecessary files, and keeping the content as identical as possible to the original.
  • CDR Contents Disarm and Reconstruction
  • the files subject to detoxification include all non-executable files (e.g. For example, Word, Excel, PowerPoint, Hangul, PDF) can be targeted, and the content targeted for detoxification can be active content (eg, macros, hyperlinks, OLE objects, etc.).
  • MS-OOXML SpreadsheetML and MS-XLS are exemplified in the MS Excel document format, but it is not limited thereto, and of course can be similarly applied to other MS Excel document formats. Additionally, the file names exemplified below may be changed to appropriate file names if necessary.
  • SpreadsheetML is an XML schema for Microsoft Office Excel.
  • Table 1 illustrates the file structure containing elements related to DDE included in MS-OOXML SpreadsheetML.
  • An XLSX document may include [Content_Types].xml, workbook.xml [.rels], and externalLink1.xml. .
  • the above-mentioned files are classified according to the information and purpose they contain, and are not limited to the file name.
  • DDE-related information is included in externalLink1.xml.
  • PartName which is the location information of externalLink1.xml
  • ContentType which is the structure information of externalLink1.xml
  • the server can confirm that there is an external link based on ContentType.
  • Table 3 below illustrates the configuration of workbook.xml.
  • Table 4 below illustrates the configuration of workbook.xml.rel.
  • the ddeLink element represents a connection to an external Dynamic Data Exchange (DDE) server.
  • DDE Dynamic Data Exchange
  • the hierarchy of names defined by the DDE server is Application, Topic, and Item. Topics often correspond to units, such as file, document, or database names, and items represent subsets of data, such as cell ranges, rows, fields, or columns. DDE items can have multiple values.
  • Service name (ie, application name) for DDE connection.
  • Topic for DDE server Describes the DDE application (usually a document of that application) to which the channel is related.
  • ddeService can be viewed as an execution command, and ddeTopic serves as an argument for these commands. Removing xml that is not analyzed in this specification, including ddeLink, causes enormous complexity. There is also a problem that proper reconstruction is not guaranteed.
  • MSEXCEL can be registered in ddeService, and ⁇ .. ⁇ .. ⁇ .. ⁇ Windows ⁇ System32 ⁇ cmd.exe /c calc.exe can be registered in ddeTopic. This means that ddeService cannot be specified with “cmd” alone.
  • the server can replace the attribute values of ddeService and ddeTopic with '_' (low line) for the length of the string that previously existed as an attribute value. there is.
  • Figure 3 illustrates a DDE detoxification method in MS-OOXML SpreadsheetML to which this specification can be applied.
  • the server determines the format of the non-executable file (S3010).
  • the server may check the Multipurpose Internet Mail Extensions (MIME) type of the non-executable file to determine whether the non-executable file is in MS-OOXML SpreadsheetML format.
  • MIME types can represent the characteristics and format of a document, file, or collection of bytes, and these MIME types are defined and standardized in IETF's RFC 6838.2022.4.30.
  • the server searches for a first file for defining the content type in the non-executable file based on the fact that the format of the non-executable file is MS-OOXML SpreadsheetML format (S3020). For example, the server may search for [Content_Types].xml (the first file) among the files included in the non-executable file.
  • the server checks whether there is external link information based on the first file (S3030). For example, the server can check that the ContentType in the Override element in [Content_Types].xml is ““application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml”.
  • the server confirms the location of the external link file related to the DDE based on the presence of external link information (S3040).
  • the external link file could be externalLink1.xml.
  • the server can check the location of the external link-related xml file in PartName of [Content_Types].xml.
  • the server checks whether there are DDE-related elements in the external link file (S3050). For example, the server can check whether the ddeLink element exists in externalLink1.xml.
  • the server deactivates 1) the service name attribute and 2) the DDE server topic attribute of the DDE-related element (S3060).
  • the service name attribute may be the ddeService attribute
  • the DDE server topic attribute may be the ddeTopic attribute. If the string of the ddeService attribute or ddeTopic attribute contains the “cmd” statement, the server can replace the existing string by inserting ‘_’ (low line, 0x5F) equal to the length of the string existing in both attributes. If it is simply removed or replaced with a space, the non-executable file may be judged to be broken, so the server replaces it with ‘_’ (low line, 0x5F).
  • Table 6 below is an example of items that can be added with DDE in an XLS format document.
  • Table 7 illustrates a file structure containing elements related to DDE included in an XLS format document.
  • Table 7 it illustrates the file structure that can be obtained by decompressing the XLS format document in Table 6.
  • the official name used in CFB (Compound Binary File) including the XLS format is as follows.
  • - Stream A word that corresponds to a file. When compared to a compressed file, it is the same as an entry.
  • Workbook Stream includes Globals Substream, and the following are specifications related to DDE among the structures within Globals Substream.
  • WORKBOOKCONTENT [WriteProtect] [FilePass] [Template] INTERFACE WriteAccess [FileSharing] CodePage *2047Lel DSF [Excel9File] RRTabId [ObProj] [ObNoMacros] [CodeName] [FNGROUPS] *Lbl [OleObjectSize] PROTECTION 1*Window1 Backup HideObj Date1904 Calc Precision RefreshAll BookBool FORMATTING *(PIVOTCACHEDEFINITION) [DOCROUTE] *UserBView UsesELFs 1*BUNDLESHEET METADATA [MTRSettings] [ForceFullCalculation] Country *SUPBOOK *LBL *RTD [RecalcId] *HFPicture *MSODRAWINGGROUP [SHAREDSTRINGS] ExtSST *WebPub [WOpt] [CrErr] [BookExt ] *FeatHdr *DConn [THE
  • the server can specify SUPBOOK and target SUPBOOK without understanding the entire structure of Globals Substream.
  • a SupBook record specifies the supporting link associated with the DDE and the beginning of a collection of records defined by the Globals Substream augmented Backus-Naur form (ABNF).
  • ABNF Globals Substream augmented Backus-Naur form
  • a collection of records can specify the contents of an external workbook, a DDE data source, or an Object Linking and Embedding (OLE) data source.
  • OLE Object Linking and Embedding
  • An XLUnicodeStringNoCch structure that specifies the type of supporting link associated with the DDE and the target of that supporting link (if applicable).
  • the XLUnicodeStringNoCch structure specifies a Unicode string.
  • XLUnicodeStringNoCch the number of characters in the string must be specified in the structure using XLUnicodeStringNoCch.
  • This bit specifies whether the rgb characters are double-byte characters.
  • the size of the array must be equal to the number of characters in the string.
  • the size of the array must be equal to twice the number of characters in the string.
  • the server can access rgb data based on fHighByte.
  • virt-path volume / unc-volume / rel-volume / transfer-protocol /
  • ole-link path-string %x0003 path-string
  • Figure 4 illustrates the binary code of SupBook to which this specification can be applied.
  • 'AE011000' may be a record area indicating the record type and record size.
  • '0B00' can represent cch.
  • '00636D64 032F4320 63616C63' can represent the virPath.
  • virPath can have an XLUnicodeStringNoCch structure. More specifically, in the XLUnicodeStringNoCch structure, the top '00' includes fHighByte and reserved, and '636D64 032F4320 63616C63' can represent rgb.
  • Figure 5 illustrates a DDE detoxification method in XLS format to which this disclosure can be applied.
  • the server determines the format of the non-executable file (S5010).
  • the server may check the MIME type of the non-executable file to determine whether the non-executable file is in XLS format.
  • the server searches for the Workbook stream in the non-executable file based on the format of the non-executable file being XLS format (S5020). For example, the server can search for the Workbook stream among files included in non-executable files.
  • the server checks whether there is a SupBook item based on the Workbook stream (S5030). For example, the server can search whether there is a SupBook item in the content of the Workbook stream.
  • the server searches the virPath field based on the fact that the ctab field of the SupBook item is designated as 0x0000 (S5040).
  • the server checks whether the virPath field includes an execution command related to DDE (S5050). For example, the server can check whether rgb in the virPath field contains an executable command.
  • the server deactivates the virPath field containing the execution command (S5060). For example, if the virPath field contains the “cmd” statement, the server can replace the existing virPath field by inserting ‘_’ (low line, 0x5F) for the length of the virPath field. If it is simply removed or replaced with a space, the non-executable file may be judged to be broken, so the server replaces it with ‘_’ (low line, 0x5F).
  • the server may determine that there is no target for sanitization in the non-executable document, and thus may terminate the sanitization operation.
  • Computer-readable media includes all types of recording devices that store data that can be read by a computer system. Examples of computer-readable media include HDD (Hard Disk Drive), SSD (Solid State Disk), SDD (Silicon Disk Drive), ROM, RAM, CD-ROM, magnetic tape, floppy disk, optical data storage device, etc. This also includes those implemented in the form of carrier waves (e.g., transmission via the Internet). Accordingly, the above detailed description should not be construed as restrictive 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.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Health & Medical Sciences (AREA)
  • Virology (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

본 명세서는 서버가 비실행 파일에서 DDE(Dynamic Data Exchange)를 무해화(Disarming)하는 방법에 있어서, 상기 비실행 파일의 포맷을 판단하는 단계; 상기 비실행 파일의 포맷이 MS-OOXML SpreadsheetML 포맷인 것에 근거하여, 상기 비실행 파일에서 컨텐츠 타입을 정의하기 위한 제1 파일을 탐색 단계; 상기 제1 파일에 근거하여, 상기 DDE와 관련된 외부링크 정보가 있는지 여부를 확인하는 단계; 상기 외부링크 정보가 있는 것에 근거하여, 외부링크 파일의 위치를 확인하는 단계; 상기 외부링크 파일의 위치에 근거하여, 상기 외부링크 파일에 상기 DDE 관련 요소가 있는지 확인하는 단계; 및 상기 DDE 관련 요소의 1) 서비스 이름 속성 및 2) DDE 서버 토픽(Topic) 속성을 무해화하는 단계; 를 포함할 수 있다.

Description

MS EXCEL 문서 포맷에서 DDE 무해화를 위한 방법 및 장치
본 명세서는 MS Excel 문서 포맷에서 DDE(DYNAMIC DATA EXCHANGE) 개체의 무해화를 위한 방법 및 장치에 관한 것이다.
OOXML (Office Open XML, Open XML) 규격은 XML을 기반으로 한 파일 포맷이다. 마이크로소프트가 추진하여 유럽 표준 (ECMA-376)과 국제 표준 (ISO/IEC 29500)으로 승인되었다. 이 규격은 WordprocessML (워드 문서: .docx, .docm 등), PresentationML (파워포인트 문서: .pptx, .pptm 등), SpreadsheetML (엑셀 문서: .xlsx, .xlsm 등)를 포함한다.
MS-XLS 규격은 CFB (Compound File Binary: 여러 파일과 폴더를 파일 하나에 저장하는 형식) 형태로 저장된 바이너리 기반 파일 포맷으로 엑셀 문서 (.xls) 에 사용된다. DDE(Dynamic Data Exchange)는 윈도우, OS/2, 그리고 다른 운영체계에서 정보가 공유되도록 하거나 프로그램 간에 통신이 되도록 해준다. 예를 들어, 데이터베이스 프로그램에서 폼을 변경하거나 스프레드시트 프로그램에서 자료항목을 변경할 때, 다른 어떤 프로그램에서 동시에 사용하고 있을지 모르는 폼이나 항목들을 함께 바뀌도록 설정될 수 있다. DDE는 IPC(Inter Process Communication)로, 공통 교환영역으로 공유 메모리를 사용하고, 응용프로그램에 프로토콜이나 명령 그리고 메시지 형식을 제공할 수 있다. DDE는 응용프로그램이 요구한 자료가 클라이언트로, 응용프로그램이 제공하는 자료가 서버로 간주되는 클라이언트/서버 모델을 사용한다.
XLS 또는 XLSX 문서에는 DDE 개체가 포함되어 외부 프로그램을 실행시켜, 보안에 취약한 문제가 발생할 수 있다. 무해화를 위해, 포함된 DDE 개체를 무조건 제거하는 경우 오피스 문서에서 동작 중 레이아웃이 틀어지는 문제가 빈번하게 발생할 수 있다.
본 명세서의 목적은, MS Excel 문서 포맷에서 레이아웃이 변경되지 않도록 DDE 개체의 무해화를 수행하는 방법을 제안한다.
본 명세서가 이루고자 하는 기술적 과제들은 이상에서 언급한 기술적 과제들로 제한되지 않으며, 언급되지 않은 또 다른 기술적 과제들은 이하의 명세서의 상세한 설명으로부터 본 명세서가 속하는 기술분야에서 통상의 지식을 가진 자에게 명확하게 이해될 수 있을 것이다.
본 명세서의 일 양상은, 서버가 비실행 파일에서 DDE(Dynamic Data Exchange)를 무해화(Disarming)하는 방법에 있어서, 상기 비실행 파일의 포맷을 판단하는 단계; 상기 비실행 파일의 포맷이 MS-OOXML SpreadsheetML 포맷인 것에 근거하여, 상기 비실행 파일에서 컨텐츠 타입을 정의하기 위한 제1 파일을 탐색 단계; 상기 제1 파일에 근거하여, 상기 DDE와 관련된 외부링크 정보가 있는지 여부를 확인하는 단계; 상기 외부링크 정보가 있는 것에 근거하여, 외부링크 파일의 위치를 확인하는 단계; 상기 외부링크 파일의 위치에 근거하여, 상기 외부링크 파일에 상기 DDE 관련 요소가 있는지 확인하는 단계; 및 상기 DDE 관련 요소의 1) 서비스 이름 속성 및 2) DDE 서버 토픽(Topic) 속성을 무해화하는 단계; 를 포함할 수 있다.
또한, 상기 제1 파일은 [Content_Types].xml 파일일 수 있다.
또한, 상기 외부링크 정보가 있는지 여부를 확인하는 단계는 상기 제1 파일의 엘리먼트(element) 내의 콘텐츠 타입에 근거할 수 있다.
또한, 상기 외부링크 파일은 externalLink1.xml 파일일 수 있다.
또한, 상기 서비스 이름 속성은, ddeService 속성이고, 상기 DDE 서버 토픽 속성은 ddeTopic 속성일 수 있다.
또한, 상기 비실행 파일의 포맷이 XLS 포맷인 것에 근거하여, Workbook 스트림을 탐색하는 단계; 상기 Workbook 스트림에 근거하여, SupBook 항목이 있는지 여부를 확인하는 단계; 상기 SupBook 항목의 ctab 필드가 0x0000으로 지정되어 있는 것에 근거하여, virPath 필드를 탐색하는 단계; 상기 virPath 필드가 DDE와 관련된 실행 명령을 포함하는 지 여부를 확인하는 단계; 및 상기 실행 명령이 포함된 virPath 필드를 무해화 하는 단계; 를 포함할 수 있다.
또한, 상기 virPath 필드를 무해화 하는 단계는, 상기 virPath 필드를 '_'로 대체할 수 있다.
본 명세서의 또 다른 일 양상은, 비실행 파일에서 DDE(Dynamic Data Exchange)를 무해화(Disarming)하는 서버에 있어서, 통신부; 상기 무해화를 수행하기 위한 CDR 엔진이 포함된 메모리; 및 상기 통신부 및 상기 메모리를 기능적으로 제어하는 프로세서;를 포함하고, 상기 프로세서는 상기 비실행 파일의 포맷을 판단하고, 상기 비실행 파일의 포맷이 MS-OOXML SpreadsheetML 포맷인 것에 근거하여, 상기 비실행 파일에서 컨텐츠 타입을 정의하기 위한 제1 파일을 탐색하며, 상기 제1 파일에 근거하여, 상기 DDE와 관련된 외부링크 정보가 있는지 여부를 확인하고, 상기 외부링크 정보가 있는 것에 근거하여, 외부링크 파일의 위치를 확인하며, 상기 외부링크 파일의 위치에 근거하여, 상기 외부링크 파일에 상기 DDE 관련 요소가 있는지 확인하고, 상기 DDE 관련 요소의 1) 서비스 이름 속성 및 2) DDE 서버 토픽(Topic) 속성을 무해화 할 수 있다.
본 명세서의 실시예에 따르면, MS Excel 문서 포맷에서 레이아웃이 변경되지 않도록 DDE 개체의 무해화를 수행할 수 있다.
본 명세서에서 얻을 수 있는 효과는 이상에서 언급한 효과로 제한되지 않으며, 언급하지 않은 또 다른 효과들은 아래의 기재로부터 본 명세서가 속하는 기술분야에서 통상의 지식을 가진 자에게 명확하게 이해될 수 있을 것이다.
도 1은 본 명세서와 관련된 서버 또는 클라이언트를 나타내는 도면이다.
도 2는 본 명세서에 적용될 수 있는 비정상 입력의 예시이다.
도 3은 본 명세서가 적용될 수 있는 MS-OOXML SpreadsheetML에서 DDE 무해화 방법을 예시한다.
도 4는 본 명세서가 적용될 수 있는 SupBook의 바이너리 코드를 예시한다.
도 5는 본 명세서가 적용될 수 있는 XLS 포맷에서 DDE 무해화 방법을 예시한다.
본 명세서에 관한 이해를 돕기 위해 상세한 설명의 일부로 포함되는, 첨부 도면은 본 명세서에 대한 실시예를 제공하고, 상세한 설명과 함께 본 명세서의 기술적 특징을 설명한다.
이하, 첨부된 도면을 참조하여 본 명세서에 개시된 실시예를 상세히 설명하되, 도면 부호에 관계없이 동일하거나 유사한 구성요소는 동일한 참조 번호를 부여하고 이에 대한 중복되는 설명은 생략하기로 한다. 이하의 설명에서 사용되는 구성요소에 대한 접미사 "모듈" 및 "부"는 명세서 작성의 용이함만이 고려되어 부여되거나 혼용되는 것으로서, 그 자체로 서로 구별되는 의미 또는 역할을 갖는 것은 아니다. 또한, 본 명세서에 개시된 실시예를 설명함에 있어서 관련된 공지 기술에 대한 구체적인 설명이 본 명세서에 개시된 실시예의 요지를 흐릴 수 있다고 판단되는 경우 그 상세한 설명을 생략한다. 또한, 첨부된 도면은 본 명세서에 개시된 실시예를 쉽게 이해할 수 있도록 하기 위한 것일 뿐, 첨부된 도면에 의해 본 명세서에 개시된 기술적 사상이 제한되지 않으며, 본 명세서의 사상 및 기술 범위에 포함되는 모든 변경, 균등물 내지 대체물을 포함하는 것으로 이해되어야 한다.
제1, 제2 등과 같이 서수를 포함하는 용어는 다양한 구성요소들을 설명하는데 사용될 수 있지만, 상기 구성요소들은 상기 용어들에 의해 한정되지는 않는다. 상기 용어들은 하나의 구성요소를 다른 구성요소로부터 구별하는 목적으로만 사용된다.
어떤 구성요소가 다른 구성요소에 "연결되어" 있다거나 "접속되어" 있다고 언급된 때에는, 그 다른 구성요소에 직접적으로 연결되어 있거나 또는 접속되어 있을 수도 있지만, 중간에 다른 구성요소가 존재할 수도 있다고 이해되어야 할 것이다. 반면에, 어떤 구성요소가 다른 구성요소에 "직접 연결되어" 있다거나 "직접 접속되어" 있다고 언급된 때에는, 중간에 다른 구성요소가 존재하지 않는 것으로 이해되어야 할 것이다.
단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함한다.
본 명세서에서, "포함한다" 또는 "가지다" 등의 용어는 명세서상에 기재된 특징, 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것이 존재함을 지정하려는 것이지, 하나 또는 그 이상의 다른 특징들이나 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것들의 존재 또는 부가 가능성을 미리 배제하지 않는 것으로 이해되어야 한다.
또한, 명세서에서 사용되는 "부"라는 용어는 소프트웨어 또는 하드웨어 구성요소를 의미하며, "부"는 어떤 역할들을 수행한다. 그렇지만 "부"는 소프트웨어 또는 하드웨어에 한정되는 의미는 아니다. "부"는 어드레싱할 수 있는 저장 매체에 있도록 구성될 수도 있고 하나 또는 그 이상의 프로세서들을 재생시키도록 구성될 수도 있다. 따라서, 일 예로서 "부"는 소프트웨어 구성요소들, 객체지향 소프트웨어 구성요소들, 클래스 구성요소들 및 태스크 구성요소들과 같은 구성요소들과, 프로세스들, 함수들, 속성들, 프로시저들, 서브루틴들, 프로그램 코드의 세그먼트들, 드라이버들, 펌웨어, 마이크로 코드, 회로, 데이터, 데이터베이스, 데이터 구조들, 테이블들, 어레이들 및 변수들을 포함한다. 구성요소들과 "부"들 안에서 제공되는 기능은 더 작은 수의 구성요소들 및 "부"들로 결합되거나 추가적인 구성요소들과 "부"들로 더 분리될 수 있다.
또한, 본 명세서의 일 실시예에 따르면 "부"는 프로세서 및 메모리로 구현될 수 있다. 용어 "프로세서"는 범용 프로세서, 중앙 처리 장치 (CPU), 마이크로프로세서, 디지털 신호 프로세서 (DSP), 제어기, 마이크로제어기, 상태 머신 등을 포함하도록 넓게 해석되어야 한다. 몇몇 환경에서는, "프로세서"는 주문형 반도체 (ASIC), 프로그램가능 로직 디바이스 (PLD), 필드 프로그램가능 게이트 어레이 (FPGA) 등을 지칭할 수도 있다. 용어 "프로세서"는, 예를 들어, DSP 와 마이크로프로세서의 조합, 복수의 마이크로프로세서들의 조합, DSP 코어와 결합한 하나 이상의 마이크로프로세서들의 조합, 또는 임의의 다른 그러한 구성들의 조합과 같은 처리 디바이스들의 조합을 지칭할 수도 있다.
용어 "메모리"는 전자 정보를 저장 가능한 임의의 전자 컴포넌트를 포함하도록 넓게 해석되어야 한다. 용어 메모리는 임의 액세스 메모리 (RAM), 판독-전용 메모리 (ROM), 비-휘발성 임의 액세스 메모리 (NVRAM), 프로그램가능 판독-전용 메모리 (PROM), 소거-프로그램가능 판독 전용 메모리 (EPROM), 전기적으로 소거가능 PROM (EEPROM), 플래쉬 메모리, 자기 또는 광학 데이터 저장장치, 레지스터들 등과 같은 프로세서-판독가능 매체의 다양한 유형들을 지칭할 수도 있다. 프로세서가 메모리로부터 정보를 판독하고/하거나 메모리에 정보를 기록할 수 있다면 메모리는 프로세서와 전자 통신 상태에 있다고 불린다. 프로세서에 집적된 메모리는 프로세서와 전자 통신 상태에 있다.
본 명세서에서 사용되는 "비실행 파일"이란 실행 파일 또는 실행 가능한 파일과 반대되는 개념으로서 자체적으로 실행되지 않는 파일을 의미한다. 예를 들어, 비실행 파일은 PDF 파일, 한글 파일, 워드 파일과 같은 문서 파일, JPG 파일과 같은 이미지 파일, 동영상 파일, 자바 스크립트 파일, HTML 파일 등이 될 수 있으나, 이에 한정되지 않는다.
아래에서는 첨부한 도면을 참고하여 실시예에 대하여 본 명세서가 속하는 기술 분야에서 통상의 지식을 가진 자가 용이하게 실시할 수 있도록 상세히 설명한다. 그리고 도면에서 본 개시를 명확하게 설명하기 위해서 설명과 관계없는 부분들은 생략될 수 있다.
도 1은 본 명세서와 관련된 서버 또는 클라이언트를 나타내는 도면이다.
본 명세서에서 서버(또는 클라우드 서버) 또는 클라이언트는 제어부(100) 및 통신부(130)를 포함할 수 있다. 제어부(100)는 프로세서(110) 및 메모리(120)를 포함할 수 있다. 프로세서(110)는 메모리(120)에 저장된 명령어들을 수행할 수 있다. 프로세서(110)는 통신부(130)를 제어할 수 있다.
프로세서(110)는 메모리(120)에 저장된 명령어에 기초하여 서버 또는 클라이언트의 동작을 제어할 수 있다. 서버 또는 클라이언트는 하나의 프로세서를 포함할 수 있고, 복수의 프로세서를 포함할 수 있다. 서버 또는 클라이언트가 복수의 프로세서를 포함하는 경우, 복수의 프로세서 중 적어도 일부는 물리적으로 이격된 거리에 위치할 수 있다. 또한, 서버 또는 클라이언트는 이에 한정되지 않고 알려진 다양한 방식으로 구현될 수 있다.
통신부(130)는, 서버 또는 클라이언트와 무선 통신 시스템 사이, 서버 또는 클라이언트와 다른 서버 또는 클라이언트 사이, 또는 서버 또는 클라이언트와 외부서버 사이의 무선 통신을 가능하게 하는 하나 이상의 모듈을 포함할 수 있다. 또한, 통신부(110)는, 서버 또는 클라이언트를 하나 이상의 네트워크에 연결하는 하나 이상의 모듈을 포함할 수 있다.
제어부(100)는 메모리(120)에 저장된 응용 프로그램을 구동하기 위하여, 서버 또는 클라이언트의 구성요소들 중 적어도 일부를 제어할 수 있다. 나아가, 제어부(100)는 상기 응용 프로그램의 구동을 위하여, 서버 또는 클라이언트에 포함된 구성요소들 중 적어도 둘 이상을 서로 조합하여 동작 시킬 수 있다.
본 명세서에서 서버는 리버싱 엔진 또는/및 CDR 서비스를 제공하는 CDR 엔진을 포함할 수 있다.
리버싱(Reversing) 엔진
리버싱 엔진이란, 악성 비실행 파일에 대한 리버스 엔지니어링(리버싱) 과정을 자동화 한 분석/진단 엔진이다.
예를 들어, 리버싱 엔진은 다음의 단계를 수행할 수 있다.
1. 파일 분석: 비실행 파일 자체의 외관(예를 들어, 속성, 작성자, 작성 날짜, 파일 타입)을 분석하는 단계로서, 일반 백신 프로그램과 유사하게 비실행 파일 자체의 정보만으로 악성여부를 진단할 수 있다.
2. 정적 분석: 비실행 파일 내의 데이터를 추출, 분석해서 정상, 악성 여부를 판별하는 단계로서, 비실행 파일은 실행하지 않고 파일 구조에 맞게 내부 데이터를 추출하여 비교 분석하여 악성여부를 진단할 수 있다. 이는 매크로, URL 추출 분석 등에 적합할 수 있다.
3. 동적 분석: 비실행 파일을 실행하고 모니터링하면서 행위를 분석하여 악성 여부를 판별하는 단계로서, 매크로, 하이퍼링크, DDE 등 정상기능을 이용한 악성 행위를 탐지하기에 용이하다.
4. 디버깅 분석: 비실행 파일을 실행하고 디버깅하여 취약점, 익스플로잇 등을 분석하는 단계로서, 매크로, 하이퍼링크, DDE를 포함하여 문서 내 본문, 표, 폰트, 그림 등을 이용한 응용프로그램의 취약점을 탐지하기에 적합하다.
리버싱 엔진은 디버깅 분석에 사용될 수 있는 디버깅 엔진을 포함할 수 있다. 디버깅 엔진은 비실행 파일의 열람 과정을 디버깅하여 문서 입력, 처리, 출력단계에서 발생하는 취약점을 진단할 수 있다. 여기서 취약점이란, 응용프로그램이 응용프로그램의 개발자가 개발한 코드(로직)에서 예상하지 못한 값을 입력 받았을 때, 발생하는 오류, 버그 등을 이용하는 것으로서, 공격자는 취약점을 통해 비정상 종료로 인한 서비스 거부, 원격 코드 실행 등의 악성 행위를 실행할 수 있다.
도 2는 본 명세서에 적용될 수 있는 비정상 입력의 예시이다.
도 2를 참조하면, 응용프로그램은 비실행 파일을 통해, 비정상적인 값(예를 들어, 입력값이 정상범위인 2를 초과하는 경우)을 입력 받는 경우, 개발자가 의도하지 않은 실행흐름으로 변경되어 취약점이 동작될 수 있다. 디버깅 엔진은 문서 열람 과정을 자동 디버깅하여 취약점과 관련된 특정 지점에 브레이크 포인트를 설정하고 입력값과 관련된 특정값을 확인하여 입력값이 취약점을 일으키는 값인지 아닌지 판별하여 악성 여부를 진단할 수 있다.
보다 자세하게, 디버깅 엔진은 비실행 파일을 확인하고 이를 열람하기 위한 응용프로그램을 실행하여 디버깅을 시작할 수 있다. 비실행 파일을 열람하는 과정에서 모듈이 로드되면, 디버깅 엔진은 해당 모듈이 분석 대상 모듈인지 확인하고, 분석 대상이라면 지정된 주소에 브레이크 포인트를 설정할 수 있다.
예를 들어, 악성 비실행 파일은 응용프로그램의 버전이나 운영체제 환경 등의 특정 조건이 만족하지 않으면 응용프로그램을 종료하거나 아무런 악성 행위가 발생하지 않는 흐름으로 분기하는 분기 지점들을 가질 수 있다. 서버는 사전에 분석가에 의해 분석되어 이러한 가능성을 가지는 분기 지점에 브레이크 포인트를 설정할 수 있다.
또한, 서버는 해당 분기 지점과 연관되어, 응용프로그램을 종료하지 않고 계속 실행하거나 악성 행위가 발생할 수 있는 흐름으로 유도할 수 있는 조건들을 설정할 수 있다.
응용프로그램의 프로세스 실행 중 해당 브레이크 포인트 지점에서 프로세스가 멈춘 경우, 서버는 탐지 로직에 따라 취약점 여부를 탐지한 후, 결과를 분석 리포트에 저장하는 단계를 수행할 수 있다.
서버에 포함된 자동화 리버싱 엔진은 전술한 단계들을 자동으로 수행하면서 분석하여 분석가가 연구, 개발한 진단 알고리즘을 통해, 악성 비실행 파일을 진단하고 차단할 수 있다.
CDR(Contents Disarm and Reconstruction)
CDR 서비스는 비실행 파일을 분해해 악성파일 혹은 불필요한 파일을 제거하고 콘텐츠는 원본과 최대한 동일하게 하여, 새로운 파일을 만드는 솔루션이다.
즉, Contents Disarm and Reconstruction(CDR)은 문서 내의 컨텐츠를 무해화(Disarm)하고 재조합(Reconstruction)하여 안전한 문서를 만들어 고객에게 제공하는 서비스를 의미하며, 무해화 대상 파일은 비실행 파일 일체(예를 들어, 워드, 엑셀, 파워포인트, 한글, PDF)를 대상으로 할 수 있으며, 무해화 대상 컨텐츠는 액티브 컨텐츠(예를 들어, 매크로, 하이퍼링크, OLE 객체 등)일 수 있다.
이하에서는 MS Excel 문서 포맷에서 MS-OOXML SpreadsheetML및 MS-XLS를 예시하고 있으나, 이에 한정되지 않으며, 다른 MS Excel 문서 포맷에도 유사하게 적용될 수 있음은 물론이다. 또한, 이하에서 예시하는 파일명들은 필요할 경우, 적합한 파일명으로 변경될 수 있다.
SpreadsheetML은 Microsoft Office Excel 용 XML 스키마(schema)이다.
MS-OOXML SpreadsheetML의 구조
다음의 표 1은 MS-OOXML SpreadsheetML이 포함하는 DDE와 관련된 요소가 포함된 파일구조를 예시한다.
.
*
└+─-─- xl
├+─-─- _rels
│   └+─-─- workbook.xml.rels
├+─-─- calcChain.xml
├+─-─- externalLinks
│   └+─-─- externalLink1.xml
├+─-─- metadata.xml
├+─-─- printerSettings
│   └+─-─- printerSettings1.bin
├+─-─- workbook.xml
└+─-─- worksheets
├+─-─- _rels
│   └+─-─- sheet1.xml.rels
└+─-─- sheet1.xml
표 1을 참조하면, XLSX 문서에 DDE가 추가된 경우 새로 생성되거나 변경된 파일 구조를 예시한다.XLSX 문서는 [Content_Types].xml, workbook.xml [.rels], 및 externalLink1.xml을 포함할 수 있다. 전술한 파일들은 포함되어 있는 정보 및 목적에 의해 분류되며, 당해 파일명에 한정되지 않는다.
※ 참조 : ECMA-376 5th edition 2016 Ecma Office Open XML Part 1 - Fundamentals And Markup Language Reference.pdf
1) [Content_Types].xml
다음의 표 2는 [Content_Types].xml의 구성을 예시한다.
<Types ...>
<Override
PartName="/xl/externalLinks/externalLink1.xml"
ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml"/>
</Types>
DDE 관련 정보는 externalLink1.xml에 포함되어 있다.표 2를 참조하면, [Content_Types].xml에는 externalLink1.xml 의 위치정보인 PartName 및 externalLink1.xml의 구조 정보인 ContentType이 등록될 수 있다.
서버는 ContentType에 근거하여, 외부 링크가 있음을 확인할 수 있다.
2) workbook.xml [.rel]
(1) workbook.xml
다음의 표 3은 workbook.xml의 구성을 예시한다.
<workbook ...>
<externalReferences>
<externalReference r:id="rId2"/>
</externalReferences>
</workbook>
(2) workbook.xml.rel
다음의 표 4는 workbook.xml.rel의 구성을 예시한다.
<Relationships ...>
<Relationship
Id="rId2" Target="externalLinks/externalLink1.xml"
Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink">
</Relationships>
3) externalLink1.xml
다음의 표 5는 externalLink1.xml의 구성을 예시한다.
<externalLink...>
<ddeLink xmlns:r="..." ddeService="cmd" ddeTopic="/C calc">
<ddeItems>
<ddeItem name="A0" advise="1"/>
<ddeItem name="StdDocumentName" ole="1" advise="1"/>
</ddeItems>
</ddeLink>
</externalLink>
표 5를 참조하면, ddelink의 명세는 다음과 같다.
18.14.4 ddeLink (DDE Connection)
ddeLink 요소는 외부 DDE(동적 데이터 교환) 서버에 대한 연결을 나타낸다. DDE는 약 1990년 이후로 안정적으로 문서화된 프로토콜에 따라 Windows 메시지를 사용하여 응용 프로그램 간에 데이터를 보내는 방법이다.
DDE 서버에 의해 정의된 이름의 계층 구조는 응용프로그램(Application), 토픽(Topic) 및 아이템(Item)이다. 토픽은 종종 파일이나 문서 또는 데이터베이스 이름과 같은 유닛에 대응되고 아이템은 셀 범위, 행, 필드, 열과 같은 데이터의 하위 집합을 나타낸다. DDE 아이템들은 여러 값을 가질 수 있다.
- ddeService (Service name): DDE 연결(connection)을 위한 서비스 이름 (i.e., application name).
- ddeTopic (Topic for DDE server): 채널이 관련된 (usually a document of that application) DDE 응용 프로그램에 대해 설명한다.
보다 자세하게, ddeService가 실행 명령을, ddeTopic이 이러한 명령에 대한 인자 역할을 한다고 볼 수 있다. ddeLink를 포함해 본 명세서에서 분석되지 않은 xml을 제거하는 것은 엄청난 복잡도를 야기한다. 또한 제대로 복구(reconstruction)된다는 것도 보장되지 못하는 문제점이 있다.
예를 들어, DDE가 다음과 같은 경우 :
=MSEXCEL|'\..\..\..\Windows\System32\cmd.exe /c calc.exe'!''
ddeService에는 MSEXCEL이 등록되고, ddeTopic에는 \..\..\..\Windows\System32\cmd.exe /c calc.exe이 등록될 수 있다. 이는, ddeService가 “cmd" 만으로는 특정될 수 없다는 것을 의미한다.
따라서, 본 명세서에서 서버는 ddeService 및 ddeTopic의 문자열이 단어로 “cmd”가 포함한 경우, 기존에 속성값으로 존재하던 문자열 길이만큼 ddeService 및 ddeTopic의 속성값을 '_'(low line)로 대체할 수 있다.
이는, DDE 기능 자체는 다른 데이터를 참조하기 때문에 함부로 제거되면 위험하기 때문이다. (예를 들어, 엑셀, 데이터베이스 등)
도 3은 본 명세서가 적용될 수 있는 MS-OOXML SpreadsheetML에서 DDE 무해화 방법을 예시한다.
도 3을 참조하면, 서버는 비실행 파일의 포맷을 판단한다(S3010).
예를 들어, 서버는 비실행 파일이 MS-OOXML SpreadsheetML 포맷인지 여부를 판단하기 위해, 비실행 파일의 MIME(Multipurpose Internet Mail Extensions) type을 확인할 수 있다. MIME type은 문서, 파일 또는 바이트 모음의 특성과 형식을 나타낼 수 있으며, 이러한 MIME type은 IETF의 RFC 6838.2022.4.30에 정의 및 표준화되어 있다.
서버는 비실행 파일의 포맷이 MS-OOXML SpreadsheetML 포맷인 것에 근거하여, 비실행 파일에서 컨텐츠 타입을 정의하기 위한 제1 파일을 탐색한다(S3020). 예를 들어, 서버는 비실행 파일에 포함된 파일 중, [Content_Types].xml(제1 파일)을 탐색할 수 있다.
서버는 제1 파일에 근거하여, 외부링크 정보가 있는지 여부를 확인한다(S3030). 예를 들어, 서버는 [Content_Types].xml에서 Override 엘리먼트(element) 내의 ContentType이 ““application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml” 인지 확인할 수 있다.
서버는 외부링크 정보가 있는 것에 근거하여, DDE와 관련된 외부링크 파일의 위치를 확인한다(S3040). 예를 들어, 외부링크 파일은 externalLink1.xml 일 수 있다. 서버는 [Content_Types].xml의 PartName에서 외부 링크 관련 xml 파일의 위치를 확인할 수 있다.
서버는 외부링크 파일의 위치에 근거하여, 외부링크 파일에 DDE 관련 요소가 있는지를 확인한다(S3050). 예를 들어, 서버는 externalLink1.xml에서 ddeLink 엘리먼트가 존재하는 지 여부를 확인할 수 있다.
서버는 DDE 관련 요소가 있는 것에 근거하여, DDE 관련 요소의 1) 서비스 이름 속성 및 2) DDE 서버 토픽 속성을 무해화한다(S3060). 예를 들어, 서비스 이름 속성은 ddeService 속성일 수 있고, DDE 서버 토픽 속성은 ddeTopic 속성일 수 있다. 서버는 ddeService 속성 또는 ddeTopic 속성의 문자열에 “cmd” 명령문이 포함되어 있는 경우 두 속성에 존재하던 문자열 길이만큼 ‘_' (low line, 0x5F)를 삽입하여, 존재하던 문자열을 대체할 수 있다. 만일, 단순 제거 또는 공백으로 대체되는 경우, 해당 비실행 파일이 깨졌다고 판단될 수 있으므로, 서버는 ‘_' (low line, 0x5F)로 대체한다.
XLS 포맷의 구조
다음의 표 6은 XLS 포맷의 문서에서 DDE 로 추가될 수 있는 항목의 예시이다.
=cmd|'/C calc'!A0
+cmd|'/C calc'!A0
-cmd|'/C calc'!A0
@SUM(A1:A2)*cmd|'/C calc'!A0
이하에서의 예시는 특정 파일명칭에 한정되지 않는다.
다음의 표 7은 XLS 포맷의 문서가 포함하는 DDE와 관련된 요소가 포함된 파일구조를 예시한다.
Figure PCTKR2022007493-appb-img-000001
표 7을 참조하면, 표 6에서의 XLS 포맷 문서를 해제하여 획득될 수 있는 파일 구조를 예시한다.XLS 포맷을 포함하는 CFB(Compound Binary File)에서 사용되는 정식 명칭은 다음과 같다.
- 스토리지(storage): 일반적으로 폴더 혹은 디렉토리라는 명칭과 동일함.
- 스트림(stream): 파일과 대응되는 말로 압축 파일로 대비해 보면 엔트리(entry)와 동일함.
CFB 명세는 웹을 통해 공유되고 있다.
※ 참조 : [MS-XLS]: Excel Binary File Format (.xls) Structure, https://docs.microsoft.com/en-us/openspecs/office_file_formats/ms-xls/cd03cb5f-ca02-4934-a391-bb674cb8aa06
Workbook Stream은 Globals Substream을 포함하며, 다음은 Globals Substream 내 구조 중 DDE와 관련된 명세이다.
2.1.7.20.3 Globals Substream
WORKBOOKCONTENT = [WriteProtect] [FilePass] [Template] INTERFACE WriteAccess [FileSharing] CodePage *2047Lel DSF [Excel9File] RRTabId [ObProj] [ObNoMacros] [CodeName] [FNGROUPS] *Lbl [OleObjectSize] PROTECTION 1*Window1 Backup HideObj Date1904 CalcPrecision RefreshAll BookBool FORMATTING *(PIVOTCACHEDEFINITION) [DOCROUTE] *UserBView UsesELFs 1*BUNDLESHEET METADATA [MTRSettings] [ForceFullCalculation] Country *SUPBOOK *LBL *RTD [RecalcId] *HFPicture *MSODRAWINGGROUP [SHAREDSTRINGS] ExtSST *WebPub [WOpt] [CrErr] [BookExt] *FeatHdr *DConn [THEME] [CompressPictures] [Compat12] [GUIDTypeLib] EOF
WORKBOOK = BOF WORKBOOKCONTENT
SUPBOOK = SupBook [*ExternName *(XCT *CRN)] [ExternSheet] *Continue
상기 Globals Substream 명세의 시퀀스 중 DDE와 관련된 레코드는 SUPBOOK이다.
Globals Substream의 구조는 중첩(nested)하지 않으므로, 서버는 SUPBOOK을 특정하여, Globals Substream의 구조 전체를 파악하지 않고도 SUPBOOK을 타켓팅할 수 있다.
2) SupBook
SupBook의 명세는 다음과 같다.
2.4.271 SupBook
SupBook 레코드는 DDE와 관련된 지원 링크(supporting link)를 지정하고, Globals Substream ABNF(augmented Backus-Naur form)에 의해 정의된 레코드 모음의 시작을 지정한다.
레코드 모음은 외부 workbook, DDE 데이터 소스 또는 OLE(Object Linking and Embedding) 데이터 소스의 내용을 지정할 수 있다.
ctab (2 bytes):
참조된 외부 workbook에서 시트의 수를 지정하는 정의되지 않은 필드, 예약된 필드 또는 서명되지 않은 정수.
- cch 및 virtPath에서 지정한 supporting link의 유형: DDE data source referencing
- Meaning: MUST be 0x0000.
cch (2 bytes):
supporting link type을 지정하거나 virtPath의 문자열 길이를 지정하는 부호 없는 정수.
0x0001 to 0x00ff (inclusive)
virtPath(VirtualPath) (variable):
DDE와 관련된 supporting link의 type과 해당 supporting link의 대상(해당하는 경우)을 지정하는 XLUnicodeStringNoCch 구조.
XLUnicodeStringNoCch
XLUnicodeStringNoCch의 명세는 다음과 같다.
2.5.296 XLUnicodeStringNoCch
XLUnicodeStringNoCch 구조는 유니코드 문자열(string)을 지정한다. XLUnicodeStringNoCch를 사용하는 경우, 문자열의 문자 수를 XLUnicodeStringNoCch를 사용하는 구조에 지정해야 한다.
A - fHighByte (1 bit):
rgb의 문자가 double-byte 문자(charaters)인지 여부를 지정하는 비트이다.
다음 테이블의 값을 따른다 :
- 0x00: All the characters in the string have a high byte of 0x00 and only the low bytes are in rgb.
- 0x01: All the characters in the string are saved as double-byte characters in rgb.
reserved (7 bits):
0 값을 갖고, 무시되어야 한다.
rgb (variable):
문자열을 지정하는 바이트의 배열이다.
If fHighByte is 0x0, 배열의 크기는 문자열의 문자 수와 같아야 한다.
If fHighByte is 0x1, 배열의 크기는 문자열의 문자 수의 2배와 같아야 한다.
전술한 명세를 참조하면, 서버는 fHighByte 를 기준으로 rgb 데이터를 접근할 수 있다.
VirtualPath
VirtualPath의 명세는 다음과 같다.
2.5.277 VirtualPath
다음 문법을 따르는 문자열이여야 한다:
virt-path = volume / unc-volume / rel-volume / transfer-protocol /
startup / alt-startup / library / simple-file-path /
ole-link
ole-link = path-string %x0003 path-string
simple-file-path = [%x0001] file-path
startup = %x0001 %x0006 file-path
도 4는 본 명세서가 적용될 수 있는 SupBook의 바이너리 코드를 예시한다.
도 4를 참조하여, 이하에서는 'AE011000' 부터 '63616C63' 까지의 바이너리 코드를 순서대로 설명한다.
'AE011000' 은 레코드 타입 및 레코드 사이즈를 나타내는 레코드 영역일 수 있다.
'0000' 은 ctab을 나타낼 수 있다.
'0B00'은 cch를 나타낼 수 있다.
'00636D64 032F4320 63616C63'은 virPath를 나타낼 수 있다. virPath는 XLUnicodeStringNoCch 구조를 갖을 수 있다. 보다 자세하게, XLUnicodeStringNoCch 구조에서 최상위 '00'은 fHighByte 및 reserved를 포함하며, '636D64 032F4320 63616C63'은 rgb를 나타낼 수 있다.
전술한 rgb를 보다 자세히 예시하면 다음과 같다 :
[63 6D 64 03 2F 43 20 63 61 6C 63] → "cmd \x03 /C calc"
이는 전술한 명세상의 ole-link와 동일하며, 도 4는 엑셀에서 표 6과 같이 표시될 수 있다. ole-link에서 앞 부분 path-string 을 ps1 이라하고, 뒷 부분 path-string 을 ps2 라 하고 일반화하면 다음과 같다 :
문법: ps1 %x0003 ps2
엑셀: ps1 | ps2
도 5는 본 명세서가 적용될 수 있는 XLS 포맷에서 DDE 무해화 방법을 예시한다.
도 5를 참조하면, 서버는 비실행 파일의 포맷을 판단한다(S5010).
예를 들어, 서버는 비실행 파일이 XLS 포맷인지 여부를 판단하기 위해, 비실행 파일의 MIME type을 확인할 수 있다.
서버는 비실행 파일의 포맷이 XLS 포맷인 것에 근거하여, 비실행 파일에서 Workbook 스트림을 탐색한다(S5020). 예를 들어, 서버는 비실행 파일에 포함된 파일 중, Workbook 스트림을 탐색할 수 있다.
서버는 Workbook 스트림에 근거하여, SupBook 항목이 있는지 여부를 확인한다(S5030). 예를 들어, 서버는 Workbook 스트림의 콘텐츠(Content)에 SupBook 항목이 있는지 여부를 검색 할 수 있다.
서버는 SupBook 항목의 ctab 필드가 0x0000으로 지정되어 있는 것에 근거하여, virPath 필드를 탐색한다(S5040).
서버는 virPath 필드가 DDE와 관련된 실행 명령을 포함하는 지 여부를 확인한다(S5050). 예를 들어, 서버는 virPath 필드의 rgb가 실행 명령을 포함하는 지 여부를 확인할 수 있다.
서버는 실행 명령이 포함된 virPath 필드를 무해화한다(S5060). 예를 들어, 서버는 virPath 필드에 “cmd” 명령문이 포함되어 있는 경우 virPath 필드 길이만큼 ‘_' (low line, 0x5F)를 삽입하여, 존재하던 virPath 필드을 대체할 수 있다. 만일, 단순 제거 또는 공백으로 대체되는 경우, 해당 비실행 파일이 깨졌다고 판단될 수 있으므로, 서버는 ‘_' (low line, 0x5F)로 대체한다.
도 3 및 도 5의 확인 또는 탐색하는 동작에 실패하는 경우, 서버는 당해 비실행 문서에 무해화 대상이 없다고 판단할 수 있으므로, 무해화 동작을 종료할 수 있다.
전술한 본 명세서는, 프로그램이 기록된 매체에 컴퓨터가 읽을 수 있는 코드로서 구현하는 것이 가능하다. 컴퓨터가 읽을 수 있는 매체는, 컴퓨터 시스템에 의하여 읽혀 질 수 있는 데이터가 저장되는 모든 종류의 기록장치를 포함한다. 컴퓨터가 읽을 수 있는 매체의 예로는, HDD(Hard Disk Drive), SSD(Solid State Disk), SDD(Silicon Disk Drive), ROM, RAM, CD-ROM, 자기 테이프, 플로피 디스크, 광 데이터 저장 장치 등이 있으며, 또한 캐리어 웨이브(예를 들어, 인터넷을 통한 전송)의 형태로 구현되는 것도 포함한다. 따라서, 상기의 상세한 설명은 모든 면에서 제한적으로 해석되어서는 아니되고 예시적인 것으로 고려되어야 한다. 본 명세서의 범위는 첨부된 청구항의 합리적 해석에 의해 결정되어야 하고, 본 명세서의 등가적 범위 내에서의 모든 변경은 본 명세서의 범위에 포함된다.
또한, 이상에서 서비스 및 실시 예들을 중심으로 설명하였으나 이는 단지 예시일 뿐 본 명세서를 한정하는 것이 아니며, 본 명세서가 속하는 분야의 통상의 지식을 가진 자라면 본 서비스 및 실시 예의 본질적인 특성을 벗어나지 않는 범위에서 이상에 예시되지 않은 여러 가지의 변형과 응용이 가능함을 알 수 있을 것이다. 예를 들어, 실시 예들에 구체적으로 나타난 각 구성 요소는 변형하여 실시할 수 있는 것이다. 그리고 이러한 변형과 응용에 관계된 차이점들은 첨부한 청구 범위에서 규정하는 본 명세서의 범위에 포함되는 것으로 해석되어야 할 것이다.

Claims (8)

  1. 서버가 비실행 파일에서 DDE(Dynamic Data Exchange)를 무해화(Disarming)하는 방법에 있어서,
    상기 비실행 파일의 포맷을 판단하는 단계;
    상기 비실행 파일의 포맷이 MS-OOXML SpreadsheetML 포맷인 것에 근거하여, 상기 비실행 파일에서 컨텐츠 타입을 정의하기 위한 제1 파일을 탐색 단계;
    상기 제1 파일에 근거하여, 상기 DDE와 관련된 외부링크 정보가 있는지 여부를 확인하는 단계;
    상기 외부링크 정보가 있는 것에 근거하여, 외부링크 파일의 위치를 확인하는 단계;
    상기 외부링크 파일의 위치에 근거하여, 상기 외부링크 파일에 상기 DDE 관련 요소가 있는지 확인하는 단계; 및
    상기 DDE 관련 요소의 1) 서비스 이름 속성 및 2) DDE 서버 토픽(Topic) 속성을 무해화하는 단계;
    를 포함하는, 무해화 방법.
  2. 제1항에 있어서,
    상기 제1 파일은
    [Content_Types].xml 파일인, 무해화 방법.
  3. 제2항에 있어서,
    상기 외부링크 정보가 있는지 여부를 확인하는 단계는
    상기 제1 파일의 엘리먼트(element) 내의 콘텐츠 타입에 근거하는, 무해화 방법.
  4. 제3항에 있어서,
    상기 외부링크 파일은
    externalLink1.xml 파일인, 무해화 방법.
  5. 제4항에 있어서,
    상기 서비스 이름 속성은, ddeService 속성이고,
    상기 DDE 서버 토픽 속성은 ddeTopic 속성인,
    무해화 방법.
  6. 제1항에 있어서,
    상기 비실행 파일의 포맷이 XLS 포맷인 것에 근거하여, Workbook 스트림을 탐색하는 단계;
    상기 Workbook 스트림에 근거하여, SupBook 항목이 있는지 여부를 확인하는 단계;
    상기 SupBook 항목의 ctab 필드가 0x0000으로 지정되어 있는 것에 근거하여, virPath 필드를 탐색하는 단계;
    상기 virPath 필드가 DDE와 관련된 실행 명령을 포함하는 지 여부를 확인하는 단계; 및
    상기 실행 명령이 포함된 virPath 필드를 무해화 하는 단계;
    를 포함하는, 무해화 방법.
  7. 제6항에 있어서,
    상기 virPath 필드를 무해화 하는 단계는,
    상기 virPath 필드를 ‘_'로 대체하는, 무해화 방법.
  8. 비실행 파일에서 DDE(Dynamic Data Exchange)를 무해화(Disarming)하는 서버에 있어서,
    통신부;
    상기 무해화를 수행하기 위한 CDR 엔진이 포함된 메모리; 및
    상기 통신부 및 상기 메모리를 기능적으로 제어하는 프로세서;를 포함하고,
    상기 프로세서는
    상기 비실행 파일의 포맷을 판단하고, 상기 비실행 파일의 포맷이 MS-OOXML SpreadsheetML 포맷인 것에 근거하여, 상기 비실행 파일에서 컨텐츠 타입을 정의하기 위한 제1 파일을 탐색하며, 상기 제1 파일에 근거하여, 상기 DDE와 관련된 외부링크 정보가 있는지 여부를 확인하고, 상기 외부링크 정보가 있는 것에 근거하여, 외부링크 파일의 위치를 확인하며, 상기 외부링크 파일의 위치에 근거하여, 상기 외부링크 파일에 상기 DDE 관련 요소가 있는지 확인하고, 상기 DDE 관련 요소의 1) 서비스 이름 속성 및 2) DDE 서버 토픽(Topic) 속성을 무해화하는, 서버.
PCT/KR2022/007493 2022-05-26 2022-05-26 Ms excel 문서 포맷에서 dde 무해화를 위한 방법 및 장치 WO2023229068A1 (ko)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/KR2022/007493 WO2023229068A1 (ko) 2022-05-26 2022-05-26 Ms excel 문서 포맷에서 dde 무해화를 위한 방법 및 장치
KR1020227017869A KR102468434B1 (ko) 2022-05-26 2022-05-26 Ms excel 문서 포맷에서 dde 무해화를 위한 방법 및 장치

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/KR2022/007493 WO2023229068A1 (ko) 2022-05-26 2022-05-26 Ms excel 문서 포맷에서 dde 무해화를 위한 방법 및 장치

Publications (1)

Publication Number Publication Date
WO2023229068A1 true WO2023229068A1 (ko) 2023-11-30

Family

ID=84237967

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2022/007493 WO2023229068A1 (ko) 2022-05-26 2022-05-26 Ms excel 문서 포맷에서 dde 무해화를 위한 방법 및 장치

Country Status (2)

Country Link
KR (1) KR102468434B1 (ko)
WO (1) WO2023229068A1 (ko)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20070104761A (ko) * 2006-04-24 2007-10-29 이병관 시그니처 그래프를 이용한 하이브리드 기반 침입탐지시스템
KR20120078030A (ko) * 2010-12-31 2012-07-10 주식회사 안랩 비 pe파일의 악성 컨텐츠 포함 여부를 판단하는 방법 및 시스템
KR101860546B1 (ko) * 2017-04-28 2018-05-23 (주)지란지교시큐리티 파일 내 포함된 콘텐츠 무력화 장치 및 방법, 그 기록매체
KR20190138093A (ko) * 2018-06-04 2019-12-12 고려대학교 산학협력단 문서 파일의 악성 코드 무력화 서비스 제공 방법 및 장치

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20070104761A (ko) * 2006-04-24 2007-10-29 이병관 시그니처 그래프를 이용한 하이브리드 기반 침입탐지시스템
KR20120078030A (ko) * 2010-12-31 2012-07-10 주식회사 안랩 비 pe파일의 악성 컨텐츠 포함 여부를 판단하는 방법 및 시스템
KR101860546B1 (ko) * 2017-04-28 2018-05-23 (주)지란지교시큐리티 파일 내 포함된 콘텐츠 무력화 장치 및 방법, 그 기록매체
KR20190138093A (ko) * 2018-06-04 2019-12-12 고려대학교 산학협력단 문서 파일의 악성 코드 무력화 서비스 제공 방법 및 장치

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
LEE, DEOKKYU; SANGJIN LEE: "A Study of Office Open XML Document-Based Malicious Code Analysis and Detection Method", JOURNAL OF THE KOREA INSTITUTE OF INFORMATION SECURITY AND CRYPTOLOGY, vol. 30, no. 3, 1 June 2020 (2020-06-01), pages 429 - 442, XP009550878, ISSN: 1598-3986, DOI: 10.13089/JKIISC.2020.30.3.429 *

Also Published As

Publication number Publication date
KR102468434B1 (ko) 2022-11-18

Similar Documents

Publication Publication Date Title
Halfond et al. Preventing SQL injection attacks using AMNESIA
US7849509B2 (en) Detection of security vulnerabilities in computer programs
WO2010062063A2 (ko) 브라우저 기반 어뷰징 방지 방법 및 시스템
WO2011122724A1 (ko) 아밥 소스코드의 코드 검사를 수행하는 코드검사 수행시스템
WO2013168951A1 (ko) 악성 파일 검사 장치 및 방법
WO2023229063A1 (ko) 무해화(disarming) 동작에서 차이점(delta) 추출 방식을 이용한 원본 파일 백업 공간을 효율화하는 방법 및 이를 위한 장치
WO2024063184A1 (ko) Pdf 또는 hwp에서 link의 무해화를 위한 방법 및 장치
WO2022108318A1 (ko) 스마트 컨트랙트 코드 취약점 분석 장치 및 방법
WO2018236141A1 (ko) 크래시 리포트 그룹핑 방법, 서버 및 컴퓨터 프로그램
WO2018194196A1 (ko) Elf 파일의 난독화 적용 여부의 탐지 및 보안성 평가를 위한 방법 및 시스템
WO2023229068A1 (ko) Ms excel 문서 포맷에서 dde 무해화를 위한 방법 및 장치
WO2014185627A1 (ko) 데이터 프로세싱 시스템 보안 장치와 보안방법
WO2023229062A1 (ko) Ms-ooxml에서 ole object 무해화를 위한 방법 및 장치
WO2023229065A1 (ko) 리버싱 엔진과 cdr 엔진을 활용한 악성 비실행 파일 차단 방법 및 장치
WO2014200201A1 (ko) 시스템 보호를 위한 파일 보안용 관리장치와 관리방법
WO2023229066A1 (ko) 리버싱 엔진 기반의 문서 행위를 판단하기 위한 방법 및 이를 위한 장치
WO2023229061A1 (ko) Pdf 또는 hwp에서 javascript의 무해화를 위한 방법 및 장치
Brandis et al. Threat modelling adobe pdf
WO2024075868A1 (ko) 네트워크 망분리 환경에서 파일 이동시 악성파일의 유입을 알리기 위한 방법 및 이를 위한 장치
Perkins et al. AutoRand: Automatic keyword randomization to prevent injection attacks
KR102538664B1 (ko) Excel 계열의 문서에서 수식 기능에 있는 Link의 무해화를 위한 방법 및 장치
KR102488943B1 (ko) MS-PPT에서 Link의 무해화를 위한 방법 및 장치
KR102494838B1 (ko) MS-CFB의 DocumentSummaryInformation 스트림에서 Link의 무해화를 위한 방법 및 장치
Nguyen-Tuong et al. To B or not to B: blessing OS commands with software DNA shotgun sequencing
KR102494836B1 (ko) MS-DOC에서 Link의 무해화를 위한 방법 및 장치

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 17780860

Country of ref document: US

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22943875

Country of ref document: EP

Kind code of ref document: A1