KR102069142B1 - Apparatus and method for automatic extraction of accurate protocol specifications - Google Patents

Apparatus and method for automatic extraction of accurate protocol specifications Download PDF

Info

Publication number
KR102069142B1
KR102069142B1 KR1020180159407A KR20180159407A KR102069142B1 KR 102069142 B1 KR102069142 B1 KR 102069142B1 KR 1020180159407 A KR1020180159407 A KR 1020180159407A KR 20180159407 A KR20180159407 A KR 20180159407A KR 102069142 B1 KR102069142 B1 KR 102069142B1
Authority
KR
South Korea
Prior art keywords
message
protocol
format
field
unit
Prior art date
Application number
KR1020180159407A
Other languages
Korean (ko)
Inventor
이행호
정창민
안미림
김명섭
구영훈
심규석
채병민
Original Assignee
국방과학연구소
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 국방과학연구소 filed Critical 국방과학연구소
Priority to KR1020180159407A priority Critical patent/KR102069142B1/en
Application granted granted Critical
Publication of KR102069142B1 publication Critical patent/KR102069142B1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/18Protocol analysers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/02Capturing of monitoring data
    • H04L43/026Capturing of monitoring data using flow identification
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/06Notations for structuring of protocol data, e.g. abstract syntax notation one [ASN.1]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Communication Control (AREA)

Abstract

The present invention relates to an apparatus for automatic extraction of accurate protocol specifications and a method thereof. According to the present invention, the apparatus for automatic extraction of accurate protocol specifications comprises: a protocol traffic input unit which receives a plurality of traffic files for a single protocol; a user-defined setting value input unit which receives a user-defined value for performing structural analysis on the plurality of input traffic files; a protocol structure analysis unit for extracting protocol specifications by performing the structural analysis on the plurality of input traffic files based on the user-defined value; and an output unit for outputting the protocol specifications.

Description

명확한 프로토콜 사양 자동 추출을 위한 장치 및 방법{APPARATUS AND METHOD FOR AUTOMATIC EXTRACTION OF ACCURATE PROTOCOL SPECIFICATIONS}APPARATUS AND METHOD FOR AUTOMATIC EXTRACTION OF ACCURATE PROTOCOL SPECIFICATIONS

본 발명은 명확한 프로토콜 사양 자동 추출을 위한 장치 및 방법에 관한 것으로서, 비공개 프로토콜에 대한 사양을 자동으로 추출하는 기술에 관한 것이다. The present invention relates to a device and a method for automatically extracting a specific protocol specification, and to a technique for automatically extracting a specification for a private protocol.

인터넷 트래픽 사용이 보편화, 다양화되고 인터넷 응용의 트래픽 발생량이 비대해짐에 따라 네트워크를 이용하는 응용 및 악성행위의 수도 급격히 증가하고 있다. 이러한 환경 하에 발생하는 프로토콜 중 다수는 Skype 프로토콜, SCADA 프로토콜, 바이러스 백신 도구가 사용하는 소프트웨어 업데이트, Botnet의 명령 및 제어를 위한 프로토콜 등과 같이 독점적이며, 최소한으로 문서화되어 있는 혹은 전혀 알려지지 않은 비공개 프로토콜이다. 특히 산업현장 및 기반시설에서 사용되는 EWS(Engineering Workstation) 통신 프로토콜은 표준화된 프로토콜을 사용하지 않고, 독자적으로 개발된 프로토콜을 사용함으로써 트래픽 모니터링 및 분석 등의 네트워크 관리 작업이 매우 어렵다.As the use of Internet traffic becomes more common and diversified, and the amount of traffic generated by Internet applications increases, the number of applications and malicious acts using the network is rapidly increasing. Many of the protocols that occur under these circumstances are proprietary, minimally documented or completely unknown, such as the Skype protocol, SCADA protocol, software updates used by antivirus tools, and protocols for command and control of Botnet. In particular, EWS (Engineering Workstation) communication protocols used in industrial sites and infrastructures do not use standardized protocols, but use proprietary protocols, making network management tasks such as traffic monitoring and analysis very difficult.

한편, 최근 3.20 사이버테러, 서울메트로 PC 해킹사고, 한수원 사이버테러 등 크고 작은 보안 사고들이 꾸준히 발생함에 따라 사이버 테러는 새로운 공동 관심사로 부상하고 있다. 오늘날 비공개 프로토콜에 대한 구조분석 기술 확보가 시급한 시점이다.Meanwhile, cyber terrorism has emerged as a new common concern due to the steady occurrence of large and small security incidents such as 3.20 cyber terrorism, Seoul Metro PC hacking accident, and KHNP cyber terrorism. Today it is urgent to secure structural analysis technology for private protocols.

이러한 비공개 프로토콜에 대한 구조분석을 위해 프로토콜 사양을 추출할 수 있는 기술에 대한 연구가 진행되고 있지만, 명확하게 추출하는 표준화된 방법론은 없으며 대부분 수동 또는 반자동적으로 수행된다. 따라서 현재까지의 비공개 프로토콜에 대한 구조분석 기술은 전문 인력이 비공개 프로토콜의 구조 분석을 위해 일일이 네트워크 메시지를 확인하여야 하는 비효율적인 형태이다.Although there are studies on techniques for extracting protocol specifications for structural analysis of these private protocols, there is no standardized methodology for clearly extracting and most of them are performed manually or semi-automatically. Therefore, the structure analysis technology for the private protocols to date is an inefficient form in which a professional person must check the network message for the structure analysis of the private protocol.

예컨대, 제1 인용문헌(J. Wang, N. Borisov, and D. Brumley, “Generic application level protocol analyzer”, US20070112969A1)은 손으로 작성한 문법을 통해 프로토콜의 사양을 확인하고 파싱할 수 있는 기술이다. 그러나 프로토콜 분석자의 작업 능력에 따라 출력 결과가 가변적이며, 오류가 발생하기 쉽고 시간이 굉장히 많이 소모되는 비효율적인 형태이므로, 기하급수적으로 증가하는 오늘날의 응용 발생 및 업데이트 속도에 대처할 수 없다. 프로토콜 사양을 자동으로 추출하는 기술이 필요한 시점이다.For example, the first reference (J. Wang, N. Borisov, and D. Brumley, “Generic application level protocol analyzer”, US20070112969A1) is a technique that can identify and parse protocol specifications through handwritten grammar. However, the output result is variable according to the protocol analyst's ability to work, and it is inefficient and error-prone and time consuming. Therefore, it cannot cope with exponentially increasing application generation and update rates. It's time for a technique that automatically extracts protocol specifications.

이를 해결하기 위한 자동 프로토콜 리버스 엔지니어링 기술 중 일부는 너무 많은 메시지 유형들을 출력하여 명확한 프로토콜 사양을 파악하기 어렵다. 또한, 일부는 프로토콜의 빈번한 값만을 메시지 유형들의 필드 형식으로 추출하기 때문에 완벽한 프로토콜 사양을 파악하기 어렵다. Some of the automatic protocol reverse engineering techniques to solve this problem are outputting too many message types, making it difficult to identify a clear protocol specification. In addition, some extract only the frequent values of the protocol into the field types of the message types, making it difficult to grasp the complete protocol specification.

전자의 예로 제2 인용문헌(G. Bossert, F. Guihery, G. Hiet, “Towards Automated Protocol Reverse Engineering Using Semantic Information”, Proceedings of the 9th ACM symposium on Information, computer and communications security, pp. 51-62, 2014.) 에서의 출력은 너무 많은 메시지 유형들을 출력하므로 구문(syntax)이 명확하다고 할 수 없다. 이러한 형태의 구문(syntax)은 각 개별 패킷을 상세하게 분석하는데 유용할 수 있으나, 프로토콜의 구조를 직관적으로 파악하는데 있어서는 효과적이지 않다. Examples of the former include G. Bossert, F. Guihery, G. Hiet, “Towards Automated Protocol Reverse Engineering Using Semantic Information,” Proceedings of the 9th ACM symposium on Information, computer and communications security, pp. 51-62 , 2014.) outputs too many message types, so the syntax is not clear. This type of syntax can be useful for analyzing each individual packet in detail, but is not effective for intuitively understanding the structure of the protocol.

예컨대, HTTP 프로토콜의 두 요청 메시지의 Method 필드가 “GET”이므로 같은 유형의 요청 메시지임에도 불구하고 서로 다른 메시지 유형으로 분류된다. 또한, 같은 메시지 유형 내에서만 필드의 값이 정적인 필드와 동적인 필드를 분류하기 때문에, 다른 메시지 유형으로 분류된 필드들은 실제로 같은 유형의 필드임에도 불구하고 구별할 수 없다. For example, since the Method field of the two request messages of the HTTP protocol is "GET", they are classified into different message types despite the same type of request message. In addition, because field values classify static and dynamic fields only within the same message type, fields classified as different message types are indistinguishable, even though they are actually the same type of field.

후자의 예로, 제3 인용문헌(J. Luo, and S Yu. “Position-based automatic reverse engineering of network protocols”, Journal of Network and Computer Applications Vol.36, Issue.3, pp.1070-1077, 2013.)의 경우 연관 규칙 마이닝의 지지도를 기반으로 프로토콜의 키워드를 추출하므로, 필드의 값이 정적인 필드만을 추출하며 값이 동적인 필드는 추출할 수 없다.As an example of the latter, reference is made to J. Luo, and S Yu. “Position-based automatic reverse engineering of network protocols”, Journal of Network and Computer Applications Vol. 36, Issue. 3, pp.1070-1077, 2013 In case of.), The keyword of the protocol is extracted based on the support of association rule mining. Therefore, only the field whose value is static is extracted and the field whose value is dynamic cannot be extracted.

프로토콜 사양을 추출하는 프로토콜 리버스 엔지니어링 기술의 이상적인 목표는 프로토콜을 구성하는 주요 3요소인 구문, 의미, 타이밍과 관련된 구문(syntax), 의미(semantics), 유한 상태 머신(finite state machine) 등을 포함하여 상세한 사양을 추출하는 것이다. The ideal goal of protocol reverse engineering techniques for extracting protocol specifications includes syntax, semantics, timing-related syntax, semantics, and finite state machines. Extract detailed specifications.

그러나 대부분의 선행 기술은 구문(syntax), 의미(semantics), 유한 상태 머신(finite state machine) 중 일부만을 추출하기에 구문(syntax), 의미(semantics), 유한 상태 머신(finite state machine)을 자동으로 모두 추출하는 기술이 필요하다.However, most of the prior art automatically extracts syntax, semantics, and finite state machines to extract only some of the syntax, semantics, and finite state machines. You need a technique to extract all of them.

본 발명은 전술한 문제 및 다른 문제를 해결하는 것을 목적으로 한다. 또 다른 목적은, 자동으로 프로토콜 구문(syntax), 의미(semantics), 유한 상태 머신(finite state machine)을 포함하여 명확한 프로토콜 사양을 추출하는 장치 및 방법을 제공하는 것을 그 목적으로 한다.The present invention aims to solve the above and other problems. Another object is to provide an apparatus and method for automatically extracting explicit protocol specifications, including protocol syntax, semantics, and finite state machines.

상기 또는 다른 목적을 달성하기 위해 본 발명의 일 측면에 따르면, 단일의 프로토콜에 대한 복수의 트래픽 파일을 입력받는 프로토콜 트래픽 입력부; 상기 입력된 복수의 트래픽 파일에 대해 구조분석을 수행하기 위한 사용자 정의값을 입력받는 사용자 정의 설정값 입력부; 상기 사용자 정의값을 기초로 상기 입력된 복수의 트래픽 파일에 대한 구조분석을 수행하여 프로토콜 사양을 추출하는 프로토콜 구조분석부; 및 상기 프로토콜 사양을 출력하는 출력부;를 포함하는 것을 특징으로 하는 명확한 프로토콜 사양 자동 추출을 위한 장치를 제공한다. According to an aspect of the present invention to achieve the above or another object, a protocol traffic input unit for receiving a plurality of traffic files for a single protocol; A user-defined setting value input unit for receiving a user-defined value for performing structural analysis on the plurality of input traffic files; A protocol structure analysis unit extracting a protocol specification by performing structure analysis on the plurality of input traffic files based on the user defined value; And an output unit for outputting the protocol specification.

실시 예에 있어서, 상기 프로토콜 구조분석부는, 상기 복수의 트래픽 파일의 패킷을 플로우 단위로 변환하고, 상기 플로우를 메시지 단위로 분할하는 메시지 조립부;를 포함할 수 있다. In an embodiment, the protocol structure analysis unit may include a message assembly unit for converting packets of the plurality of traffic files into flow units and dividing the flows into message units.

또 다른 실시 예로서, 상기 프로토콜 구조분석부는, 상기 메시지를 대상으로 필드의 유형인 필드 포맷을 생성하고, 상기 필드 포맷을 대상으로 소정 빈도수 이상의 필드 포맷의 연속된 집합인 메시지 포맷을 생성하는 구문추론부;를 포함할 수 있다. In another embodiment, the protocol structure analysis unit generates a field format that is a type of a field for the message and constructs a message format that is a continuous format of a field format of a predetermined frequency or more for the field format. It may include a.

또 다른 실시 예로서, 상기 프로토콜 구조분석부는, 상기 메시지 포맷에 대하여 상기 메시지 포맷을 구성하는 필드들의 의미 유형을 추론하는 의미추론부;를 포함할 수 있다. As another embodiment, the protocol structure analysis unit may include a semantic inference unit for inferring a semantic type of fields constituting the message format with respect to the message format.

또 다른 실시 예로서, 상기 프로토콜 구조분석부는, 상기 메시지 포맷을 대상으로 소정 빈도수 이상의 메시지 포맷의 연속된 집합이며 플로우의 유형인 플로우 포맷을 생성하고, 유한 상태 머신을 생성하는 행동 추론부;를 포함할 수 있다. In another embodiment, the protocol structure analysis unit includes a behavior inference unit for generating a flow format that is a continuous set of message formats of a predetermined frequency or more and a type of a flow, and generates a finite state machine, for the message format; can do.

또 다른 실시 예로서, 상기 메시지 조립부는, 전송 계층 프로토콜로 UDP를 사용하는 프로토콜의 경우 메시지의 단위는 하나의 패킷이라 정의하고, TCP를 사용하는 프로토콜의 경우 메시지의 단위는 동일한 방향의 연속적으로 접해있는 패킷 집합이라 정의하여, 각 플로우들을 메시지의 연속으로 변환할 수 있다. In another embodiment, the message assembly unit may define a unit of a message as one packet in the case of a protocol using UDP as a transport layer protocol, and in the case of a protocol using TCP, the units of a message may be continuously contacted in the same direction. Defined as a set of packets, each flow can be converted to a sequence of messages.

또한, 본 발명의 다른 측면에 따르면, 단일의 프로토콜에 대한 복수의 트래픽 파일을 입력받는 프로토콜 트래픽 입력단계; 상기 입력된 복수의 트래픽 파일에 대해 구조분석을 수행하기 위한 사용자 정의값을 입력받는 사용자 정의 설정값 입력단계; 상기 사용자 정의값을 기초로 상기 입력된 복수의 트래픽 파일에 대한 구조분석을 수행하여 프로토콜 사양을 추출하는 프로토콜 구조분석단계; 및 상기 프로토콜 사양을 출력하는 출력단계;를 포함하는 것을 특징으로 하는 명확한 프로토콜 사양 자동 추출을 위한 방법을 포함한다. In addition, according to another aspect of the invention, the protocol traffic input step of receiving a plurality of traffic files for a single protocol; A user-defined setting value input step of receiving a user-defined value for performing structural analysis on the input plurality of traffic files; A protocol structure analysis step of extracting a protocol specification by performing structure analysis on the input plurality of traffic files based on the user defined value; And an output step of outputting the protocol specification.

실시 예에 있어서, 상기 프로토콜 구조분석단계는, 상기 복수의 트래픽 파일의 패킷을 플로우 단위로 변환하고, 상기 플로우를 메시지 단위로 분할하는 메시지 조립단계;를 포함할 수 있다. In an embodiment, the protocol structure analyzing step may include a message assembling step of converting packets of the plurality of traffic files into a flow unit and dividing the flow into a message unit.

또 다른 실시 예에 있어서, 상기 프로토콜 구조분석단계는, 상기 메시지를 대상으로 필드의 유형인 필드 포맷을 생성하고, 상기 필드 포맷을 대상으로 소정 빈도수 이상의 필드 포맷의 연속된 집합인 메시지 포맷을 생성하는 구문추론단계;를 포함할 수 있다. In another embodiment, the protocol structure analyzing step may include generating a field format that is a type of a field for the message, and generating a message format that is a continuous set of field formats having a predetermined frequency or more for the field format. Syntax reasoning step; may include.

또 다른 실시 예에 있어서, 상기 프로토콜 구조분석단계는, 상기 메시지 포맷에 대하여 상기 메시지 포맷을 구성하는 필드들의 의미 유형을 추론하는 의미추론단계;를 포함할 수 있다. In another embodiment, the protocol structure analyzing step may include a semantic reasoning step of inferring a semantic type of fields constituting the message format with respect to the message format.

또 다른 실시 예에 있어서, 상기 프로토콜 구조분석단계는, 상기 메시지 포맷을 대상으로 소정 빈도수 이상의 메시지 포맷의 연속된 집합이며 플로우의 유형인 플로우 포맷을 생성하고, 유한 상태 머신을 생성하는 행동 추론단계;를 포함할 수 있다. In another embodiment, the protocol structure analyzing step may include: an action inference step of generating a flow format that is a continuous set of message formats having a predetermined frequency or more and a type of a flow, and generating a finite state machine for the message format; It may include.

또 다른 실시 예에 있어서, 상기 메시지 조립단계는, 전송 계층 프로토콜로 UDP를 사용하는 프로토콜의 경우 메시지의 단위는 하나의 패킷이라 정의하고, TCP를 사용하는 프로토콜의 경우 메시지의 단위는 동일한 방향의 연속적으로 접해있는 패킷 집합이라 정의하여, 각 플로우들을 메시지의 연속으로 변환하는 단계;를 포함할 수 있다. In another embodiment, in the message assembling step, in the case of a protocol using UDP as a transport layer protocol, a unit of a message is defined as one packet, and in the case of a protocol using TCP, the units of a message are consecutive in the same direction. Defining a packet set adjacent to the step, converting each flow into a sequence of messages; may include.

본 발명에 따른 명확한 프로토콜 사양 자동 추출을 위한 장치 및 방법의 효과에 대해 설명하면 다음과 같다.Referring to the effects of the apparatus and method for automatic protocol specification automatic extraction according to the present invention.

본 발명의 실시 예들 중 적어도 하나에 의하면, 비공개 프로토콜이 발생시키는 트래픽을 분류하여 신뢰성 있는 네트워크 사용 현황 파악, 확장 계획 수립 및 QoS 정책 설정에 활용이 가능하며, 공격의 탐지 및 차단을 위한 방화벽 및 침입 탐지 시스템과 네트워크 취약성을 파악하기 위한 침투 시험 및 스마트 퍼저 시스템 구축에 유용한 정보를 제공할 수 있다.According to at least one of the embodiments of the present invention, it is possible to classify the traffic generated by the private protocol to be used for reliable network usage, expansion planning and QoS policy setting, firewall and intrusion for the detection and blocking of attacks It can provide useful information for penetration testing and smart purge system construction to detect detection systems and network vulnerabilities.

또한, 본 발명의 실시 예들 중 적어도 하나에 의하면, 프로토콜의 사양으로 프로토콜의 구문(syntax), 의미(semantics), 유한 상태 머신(finite state machine)을 모두 추출할 수 있으며, 필드 포맷, 메시지 포맷, 플로우 포맷으로 구성된 구문(syntax)를 정의함으로써, CSP 알고리즘을 계층적으로 사용하여 기존 기술의 문제점인 메시지의 유형이 너무 많이 추출되는 문제점을 해결하고, 자주 발생하는 바이트 스트림, 주요한 메시지 포맷, 주요 플로우의 유형, 유한 상태 머신의 주요 경로를 명확히 파악할 수 있다.In addition, according to at least one of the embodiments of the present invention, it is possible to extract the syntax, semantics, and finite state machine of the protocol as the specification of the protocol, field format, message format, By defining the syntax of the flow format, the CSP algorithm is used hierarchically to solve the problem of extracting too many types of messages, which is a problem of the existing technology, and frequently occurs byte streams, major message formats, and major flows. Type, the main path of the finite state machine can be clearly identified.

또한, 본 발명의 실시 예들 중 적어도 하나에 의하면, 메시지 포맷은 값이 정적인 필드 포맷 유형, 값이 동적인 필드 포맷 유형, 길이만 알 수 있는 필드 포맷 유형, 값과 길이를 모두 알 수 없는 포맷 유형으로 구분되는 필드 포맷의 연속으로, 메시지 포맷의 내부가 비어 있는 부분 없이 명확하며 상세한 구조를 파악할 수 있다는 장점이 있다. In addition, according to at least one of the embodiments of the present invention, the message format is a field format type whose value is static, a field format type whose value is dynamic, a field format type whose length is only known, and a format whose value and length are not all known. As a series of field formats separated by types, there is an advantage that a clear and detailed structure can be grasped without a blank portion of a message format.

본 발명의 적용 가능성의 추가적인 범위는 이하의 상세한 설명으로부터 명백해질 것이다. 그러나 본 발명의 사상 및 범위 내에서 다양한 변경 및 수정은 당업자에게 명확하게 이해될 수 있으므로, 상세한 설명 및 본 발명의 바람직한 실시 예와 같은 특정 실시 예는 단지 예시로 주어진 것으로 이해되어야 한다.Further scope of the applicability of the present invention will become apparent from the following detailed description. However, various changes and modifications within the spirit and scope of the present invention can be clearly understood by those skilled in the art, and therefore, specific embodiments, such as the detailed description and the preferred embodiments of the present invention, should be understood as given by way of example only.

도 1은 본 발명의 실시 예에 따른 명확한 프로토콜 사양 자동 추출을 위한 장치의 구성을 도시한 블록도이다.
도 2는 본 발명의 실시 예에 따라 명확한 프로토콜 사양 자동 추출을 위한 방법의 과정을 도시한 흐름도이다.
도 3은 본 발명의 실시 예에 따라 필드 포맷, 메시지 포맷, 플로우 포맷을 생성하는 CSP 알고리즘 과정을 도시한 흐름도이다.
도 4는 본 발명의 실시 예에 따라 필드 포맷, 메시지 포맷, 플로우 포맷을 생성하기 위한 CSP 알고리즘을 계층적으로 사용하는 계층적 CSP를 도시한 도면이다.
도 5는 본 발명 실시 예에 따라 프로토콜 구문을 추론하는 과정을 도시한 도면이다.
도 6은 본 발명 실시 예에 따라 필드의 값이 동적인 필드 포맷을 생성하기 위한 재귀적 CSP 과정의 예시도이다.
도 7은 본 발명 실시 예에 따라 메시지 포맷 내부의 추가적인 필드 포맷을 생성하기 위한 과정의 예시도이다.
도 8은 본 발명 실시 예에 따라 플로우 포맷과 유한 상태 머신을 추론하는 행동 추론 과정을 도시한 도면이다.
1 is a block diagram showing the configuration of an apparatus for automatic protocol specification automatic extraction according to an embodiment of the present invention.
2 is a flowchart illustrating a process of a method for automatic protocol specification automatic extraction according to an embodiment of the present invention.
3 is a flowchart illustrating a CSP algorithm process of generating a field format, a message format, and a flow format according to an embodiment of the present invention.
4 illustrates a hierarchical CSP hierarchically using a CSP algorithm for generating a field format, a message format, and a flow format according to an embodiment of the present invention.
5 is a diagram illustrating a process of inferring a protocol syntax according to an embodiment of the present invention.
6 is an exemplary diagram of a recursive CSP process for generating a field format in which a field value is dynamic according to an embodiment of the present invention.
7 illustrates an example of a process for generating an additional field format in a message format according to an embodiment of the present invention.
8 is a diagram illustrating a behavior inference process of inferring a flow format and a finite state machine according to an exemplary embodiment of the present invention.

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

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

어떤 구성요소가 다른 구성요소에 "연결되어" 있다거나 "접속되어" 있다고 언급된 때에는, 그 다른 구성요소에 직접적으로 연결되어 있거나 또는 접속되어 있을 수도 있지만, 중간에 다른 구성요소가 존재할 수도 있다고 이해되어야 할 것이다. 반면에, 어떤 구성요소가 다른 구성요소에 "직접 연결되어" 있다거나 "직접 접속되어" 있다고 언급된 때에는, 중간에 다른 구성요소가 존재하지 않는 것으로 이해되어야 할 것이다.When a component is said to be "connected" or "connected" to another component, it may be directly connected to or connected to that other component, but it may be understood that another component may be present in the middle. Should be. On the other hand, when a component is said to be "directly connected" or "directly connected" to another component, it should be understood that there is no other component in between.

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

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

이하, 첨부된 도면을 참조하여 본 발명을 더욱 상세하게 기술할 것이다. 이하의 설명에서 본 발명의 모든 실시형태가 개시되는 것은 아니다. 본 발명은 매우 다양한 형태로 구현될 수 있으며, 여기에 개시되는 실시형태에 한정되는 것으로 해석되어서는 안 된다. 본 실시형태들은 출원을 위한 법적 요건들을 충족시키기 위해 제공되는 것이다. 동일한 구성요소에는 전체적으로 동일한 참조부호가 사용된다.Hereinafter, with reference to the accompanying drawings will be described in more detail the present invention. In the following description, not all embodiments of the present invention are disclosed. The invention may be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. The present embodiments are provided to satisfy legal requirements for an application. The same reference numerals are used throughout the same component.

이하, 본 발명의 바람직한 실시예를 첨부한 도면들을 참조하여 상세히 설명하기로 한다.Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings.

도 1은 본 발명의 실시 예에 따른 명확한 프로토콜 사양 자동 추출을 위한 장치의 구성을 도시한 블록도이다.1 is a block diagram showing the configuration of an apparatus for automatic protocol specification automatic extraction according to an embodiment of the present invention.

도 1을 참조하여 살펴보면, 본 발명의 실시 예에 따른 명확한 프로토콜 사양 자동 추출을 위한 장치(100)는, 프로토콜 구조분석부(130) 및 상기 프로토콜 구조분석부(130)에 연결되는 프로토콜 트래픽 입력부(110), 사용자 정의 설정값 입력부(120), 출력부(140)를 포함할 수 있다. Referring to FIG. 1, the apparatus 100 for automatically extracting a specific protocol specification according to an embodiment of the present invention includes a protocol traffic input unit connected to a protocol structure analysis unit 130 and the protocol structure analysis unit 130 ( 110, a user-defined set value input unit 120, and an output unit 140 may be included.

먼저 프로토콜 입력부(110)는 프로토콜 사양을 자동으로 추출하기 위한 특정 단일의 프로토콜에 대한 복수의 트래픽 트레이스를 입력받을 수 있다. 예를 들어 프로토콜 입력부(110)는 실제 네트워크에서 침입 탐지 시스템에서 걸러진 패킷들을 캡쳐한 PCAP(Packet CAPture) 파일 형태의 네트워크 트래픽 트레이스를 입력받을 수 있다.First, the protocol input unit 110 may receive a plurality of traffic traces for a specific single protocol for automatically extracting protocol specifications. For example, the protocol input unit 110 may receive a network traffic trace in the form of a packet capture (PCAP) file that captures packets filtered by an intrusion detection system in an actual network.

사용자 정의 설정값 입력부(120)는 사용자로부터 프로토콜 구조분석을 수행하기 위한 정보를 입력받는다. 프로토콜 구조분석을 하기 위한 정보는 상기 필드 포맷을 생성하기 위한 첫 번째 CSP의 최소 지지도와, 상기 메시지 포맷을 생성하기 위한 두 번째 CSP의 최소 지지도와, 플로우 포맷을 생성하기 위한 세 번째 CSP의 최소 지지도를 입력받는다.The user-defined setting value input unit 120 receives information for performing protocol structure analysis from the user. Information for protocol structure analysis includes minimum support of the first CSP for generating the field format, minimum support of the second CSP for generating the message format, and minimum support of the third CSP for generating the flow format. Get input.

프로토콜 구조분석부(130)는 상기 프로토콜 입력부(110)에서 입력받은 복수의 트래픽 트레이스들을 대상으로, 상기 사용자 정의 설정값 입력부(120)에서 입력받은 최소 지지도들을 이용하여, 본 발명의 실시 예에 따라 명확한 프로토콜 사양 자동 추출 방법을 통해 프로토콜 구조분석을 수행하고 그 결과를 출력부(140)에 전달한다.The protocol structure analysis unit 130 targets a plurality of traffic traces input from the protocol input unit 110 and uses minimum support degrees input from the user-defined set value input unit 120 according to an embodiment of the present invention. The protocol structure analysis is performed through a clear protocol specification automatic extraction method, and the result is transmitted to the output unit 140.

출력부(140)는 전달받은 결과에 대하여 상기 복수의 트래픽 트레이스에 대한 정량적 정보와, 상기 필드 포맷의 정보, 상기 메시지 포맷의 정보, 상기 플로우 포맷의 정보, 유한 상태 머신의 정보를 표시한다.The output unit 140 displays quantitative information on the plurality of traffic traces, information on the field format, information on the message format, information on the flow format, and information on the finite state machine with respect to the received result.

도 2는 본 발명의 실시 예에 따라 명확한 프로토콜 사양 자동 추출을 위한 방법의 과정을 도시한 흐름도이다. 2 is a flowchart illustrating a process of a method for automatic protocol specification automatic extraction according to an embodiment of the present invention.

도 2를 참조하면, 상기 프로토콜 구조분석부(130)에서 수행되는 방법으로, 본 방법을 설명함에 있어서 상기 필드 포맷의 네 가지 유형에 대한 용어를 먼저 정의하고자 한다. Referring to FIG. 2, the method performed by the protocol structure analysis unit 130 will first define terms for the four types of the field format in describing the method.

상기 필드 포맷은 SF(v), DF(v), DF, GAP 네 가지 유형으로 구성된다. (v)는 “value”를 의미하며 (v)가 접미사로 표시된 필드 포맷은 해당 필드의 값을 예측할 수 있는 필드 포맷이다. 즉, SF(v)는 값이 정적인 필드이며 고정 길이 필드이고 값을 예측할 수 있으므로 값을 저장하여 필드 포맷을 추출한다. DF(v)와, DF와, GAP은 모두 값이 동적인 필드이다. 이들은 고정 길이 필드일 수도 있고, 가변 길이 필드일 수도 있다. DF(v)는 값을 예측할 수 있는 필드이므로 가질 수 있는 모든 값을 저장하여 출력한다. DF와 GAP은 값이 너무 가변적이기 때문에 값을 예측할 수 없는 필드이다. DF와 GAP의 차이점은 DF의 경우 길이는 고정되어 있지 않더라도 어느 정도 예측이 가능하다는 점이다. 따라서 DF를 추출할 때에는 길이의 최소값 및 최대값을 추출하며 GAP은 발견될 수 있는 최소 offset과 최대 depth를 통해 메시지 유형에서의 위치만을 추출한다. SF(v)는 계층적 CSP(Contiguous Sequential Pattern) 알고리즘의 첫 번째 CSP를 통해 추출되고, DF(v)는 재귀적 CSP 알고리즘을 통해 추출된다. DF와 GAP은 메시지 포맷 추출 후 각 메시지 포맷에 속하는 SF(v)와 DF(v) 사이에 해당하는 부분의 데이터를 분석하여 추출한다. 메시지 포맷과 플로우 포맷을 각각 계층적 CSP 알고리즘의 두 번째 CSP와 세 번째 CSP를 통해 추출된다.The field format consists of four types: SF (v), DF (v), DF, and GAP. (v) means “value” and the field format with (v) suffix is the field format that can predict the value of the field. That is, since SF (v) is a static field, a fixed length field, and predictable, SF (v) stores the value to extract the field format. DF (v), DF, and GAP are all dynamic fields. These may be fixed length fields or may be variable length fields. Since DF (v) is a predictable field, all the possible values are stored and output. DF and GAP are fields that cannot be predicted because their values are too variable. The difference between DF and GAP is that DF can be predicted to some extent even if the length is not fixed. Therefore, when extracting the DF, the minimum and maximum values of the length are extracted and the GAP extracts only the position in the message type through the minimum offset and maximum depth that can be found. SF (v) is extracted through the first CSP of the hierarchical CSP (Contiguous Sequential Pattern) algorithm, and DF (v) is extracted through the recursive CSP algorithm. After extracting the message format, the DF and the GAP analyze and extract data of a part corresponding to the SF (v) and the DF (v) belonging to each message format. The message format and the flow format are extracted through the second and third CSPs of the hierarchical CSP algorithm, respectively.

상기 필드 포맷은 프로토콜의 메시지들에서 특정 빈도 수 이상 발견되는 바이트 스트림이다. 상기 메시지 포맷은 특정 빈도 수 이상 발견되는 하나의 동일한 메시지에서 연속적으로 나타나는 필드 포맷들의 연속된 집합이다. 상기 플로우 포맷은 특정 빈도 수 이상 발견되는 하나의 동일한 플로우에서 연속적으로 나타나는 메시지 포맷의 연속된 집합이다.The field format is a byte stream found over a certain frequency in messages of the protocol. The message format is a contiguous set of field formats that appear consecutively in one and the same message found over a certain frequency. The flow format is a contiguous set of message formats that appear consecutively in one and the same flow found over a certain frequency.

도 2에서 도시한 바와 같이, 본 방법은 크게 메시지 조립 단계(210), 구문 추론 단계(220), 의미 추론 단계(230), 행동 추론 단계(240)로 순차적으로 수행된다.As shown in FIG. 2, the method is largely performed sequentially as a message assembling step 210, a syntax inference step 220, a semantic inference step 230, and a behavior inference step 240.

메시지 조립 단계(210)에서는 도 1의 프로토콜 트래픽 입력부(110)에서 입력받은 복수의 트래픽 트레이스에 대하여 5-튜플이 같은 패킷들을 시간순으로 정렬하여 플로우 단위로 변환한다. 그리고 플로우를 메시지 단위로 분할한다. 메시지 단위로 분할하는 방법은 전송 계층 프로토콜로 UDP를 사용하는 프로토콜의 경우 메시지의 단위는 하나의 패킷이라 정의하고, TCP를 사용하는 프로토콜의 경우 메시지의 단위는 동일한 방향의 연속적으로 접해있는 패킷 집합이라 정의하여 각 플로우들을 메시지의 연속으로 변환한다.In the message assembling step 210, packets having the same 5-tuple are sorted in chronological order with respect to the plurality of traffic traces received from the protocol traffic input unit 110 of FIG. 1, and converted into flow units. Then divide the flow into message units. In the case of a protocol using UDP as a transport layer protocol, a message unit is defined as one packet. In the case of a protocol using TCP, a message unit is a set of packets that are contiguous in the same direction. Define each flow into a sequence of messages.

구문 추론 단계(220)에서는 SF(v)와 DF(v)를 추출하고 이를 기반으로 하는 메시지 포맷을 추출한다. 그리고 각 메시지 포맷에 추가적인 필드 포맷으로 SF(v), DF(v), DF, GAP 유형의 필드 포맷에 대한 정보를 추가한다.In the syntax inference step 220, SF (v) and DF (v) are extracted and a message format based on the SF (v) is extracted. In addition, information on field formats of SF (v), DF (v), DF, and GAP types is added as an additional field format to each message format.

의미 추론 단계(230)에서는 추출된 메시지 포맷의 SF(v)와 DF(v)가 사전에 정의된 의미 유형에 해당하는지 식별하고 그 정보를 추가한다. 상기 사전에 정의된 의미 유형은 메시지 타입, 메시지 길이, 송신자 식별자, 세션 식별자, 트랜잭션 식별자, 누산기이다.The semantic reasoning step 230 identifies whether SF (v) and DF (v) of the extracted message format correspond to a predefined semantic type and adds the information. The predefined semantic types are message type, message length, sender identifier, session identifier, transaction identifier, and accumulator.

행동 추론 단계(240)에서는 상기 추출된 메시지 포맷을 기반으로 플로우 포맷과 유한 상태 머신을 추출한다.The behavior inference step 240 extracts a flow format and a finite state machine based on the extracted message format.

도 3은 본 발명의 실시 예에 따라 필드 포맷, 메시지 포맷, 플로우 포맷을 생성하는 CSP 알고리즘 과정을 도시한 흐름도이다. 3 is a flowchart illustrating a CSP algorithm process of generating a field format, a message format, and a flow format according to an embodiment of the present invention.

CSP 알고리즘은 프로토콜 구문(syntax) 추출에 적합하도록 수정된 AprioriAll 알고리즘이다.The CSP algorithm is the AprioriAll algorithm modified to be suitable for protocol syntax extraction.

도 4는 본 발명의 실시 예에 따라 필드 포맷, 메시지 포맷, 플로우 포맷을 생성하기 위한 CSP 알고리즘을 계층적으로 사용하는 계층적 CSP를 도시한 도면이다.4 illustrates a hierarchical CSP hierarchically using a CSP algorithm for generating a field format, a message format, and a flow format according to an embodiment of the present invention.

본 발명은 도 3에 도시한 CSP 알고리즘을 도 4에 도시한 것처럼 계층적으로 사용하여 필드 포맷, 메시지 포맷, 플로우 포맷을 생성한다. 도 4에 나타난 첫 번째 CSP는 필드 포맷을 생성하기 위해 사용되고, 두 번째 CSP는 메시지 포맷을 생성하기 위해 사용되고, 세 번째 CSP는 플로우 포맷을 생성하기 위해 사용된다. 첫 번째 CSP와 두 번째 CSP와 세 번째 CSP는 CSP 알고리즘의 입력 데이터로 사용되는 시퀀스 단위, 길이 1인 서브 시퀀스 단위 및 지지도 계산 단위만 다르고 그 외는 동일하다.The present invention uses the CSP algorithm shown in FIG. 3 hierarchically as shown in FIG. 4 to generate a field format, a message format, and a flow format. The first CSP shown in FIG. 4 is used to generate the field format, the second CSP is used to generate the message format, and the third CSP is used to generate the flow format. The first CSP, the second CSP, and the third CSP differ only in the sequence unit used as the input data of the CSP algorithm, the subsequence unit of length 1, and the support calculation unit.

첫 번째 CSP는 상기 도 2의 메시지 조립 입력부(210)에서 추출한 복수의 메시지 시퀀스 내에서 특정 빈도수를 만족하는 공통 부분 바이트스트림의 SF(v)로 추출한다. 두 번째 CSP는 하나의 동일한 메시지 시퀀스에서 나타나는 인접한 SF(v)의 연속이 특정 빈도수를 만족할 때 이를 추출한다. 이 SF(v)의 인접한 연속은 메시지 포맷의 초기 골격이다. 추출된 메시지 포맷은 도 2의 메시지 포맷 내부 추가적 필드 추출(224) 모듈과 의미 추론 단계(230) 단계를 거쳐 완성된다. 세 번째 CSP는 하나의 동일한 플로우에서 나타나는 인접한 메시지 포맷의 연속이 특정 빈도수를 만족할 때 이를 플로우 포맷으로 추출한다. 상기 특정 빈도수 만족이라 함은 CSP 알고리즘의 지지도가 사용자가 설정한 최소 지지도 이상임을 만족하는 것을 말한다.The first CSP is extracted as SF (v) of the common partial byte stream satisfying a specific frequency in the plurality of message sequences extracted by the message assembly input unit 210 of FIG. 2. The second CSP extracts when a sequence of adjacent SF (v) appearing in one same message sequence satisfies a certain frequency. The contiguous sequence of SF (v) is the initial skeleton of the message format. The extracted message format is completed through the additional field extraction 224 module and semantic inference step 230 in the message format of FIG. The third CSP extracts the flow format when a sequence of adjacent message formats appearing in one and the same flow satisfies a certain frequency. The satisfaction of the specific frequency refers to satisfying that the support of the CSP algorithm is equal to or greater than the minimum support set by the user.

아래의 표 1은 상술한 계층적 CSP의 단계별 차이점을 설명하고 있다. Table 1 below describes the step-by-step differences of the hierarchical CSP described above.

단계step 시퀀스 단위Sequence unit 길이 1 항목 단위Length 1 item unit 지지도 계산 단위Support calculation unit 첫 번째 CSPFirst CSP 복수의 송신[수신] 메시지Multiple send [receive] messages 1바이트1 byte 해당 빈발항목서브시퀀스 후보를 포함하고 있는 송신[수신] 메시지 개수 / 전체 송신[수신] 메시지 개수The number of outgoing [receive] messages that contain the corresponding frequent item subsequence candidates / the total number of outgoing [receive] messages 두 번째 CSPSecond CSP 복수의 송신[수신] 메시지Multiple send [receive] messages 필드 포맷Field format 해당 빈발항목서브시퀀스 후보를 포함하고 있는 송신[수신] 메시지 개수 / 전체 송신[수신] 메시지 개수The number of outgoing [receive] messages that contain the corresponding frequent item subsequence candidates / the total number of outgoing [receive] messages 세 번째 CSPThird CSP 복수의 플로우Multiple flows 메시지 포맷Message format 해당 빈발항목서브시퀀스 후보를 포함하고 있는 플로우 개수 / 전체 플로우 개수The number of flows that contain the corresponding frequent item subsequence candidate / the total number of flows

표 1과 같이 계층적 CSP의 첫 번째 CSP와 두 번째 CSP에서는 송신 메시지 시퀀스와 수신 메시지 시퀀스 집합을 따로 분류하여 각각에 대하여 CSP를 수행한다. 이렇게 수행함으로써 송신 메시지에만 해당하는 필드 포맷 및 메시지 포맷과 수신 메시지에만 해당하는 필드 포맷 및 메시지 포맷을 보다 더 올바르게 추출할 수 있다. As shown in Table 1, the first CSP and the second CSP of the hierarchical CSP classify the transmission message sequence and the reception message sequence set separately and perform the CSP for each. By doing this, the field format and message format only for the outgoing message and the field format and message format only for the incoming message can be extracted more correctly.

예컨대, HTTP 프로토콜의 송신 메시지의 method 필드의 값 중 하나인 “GET”은 송신 메시지 시퀀스 집합만으로 CSP를 수행하였을 때에 일반적으로 95% 이상의 지지도를 가지지만, 송신 및 수신의 방향성에 대한 고려 없이 전체 메시지 시퀀스 집합으로 CSP를 수행하였을 때, 지지도 값은 항상 50% 미만의 지지도를 가질 수 밖에 없다. For example, “GET”, which is one of the values of the method field of the HTTP protocol transmission message, generally has 95% or more of support when performing CSP with only a set of transmission message sequences, but does not consider the direction of transmission and reception. When performing CSP with a sequence set, the support value always has less than 50% support.

따라서 사용자가 입력한 50% 이상의 최소 지지도를 만족하지 못하게 되어 “GET”이라는 중요한 필드 포맷을 추출하지 못하게 되며, 반대로 사용자 최소 지지도 값을 50% 미만으로 낮추면 노이즈 데이터들도 필드 포맷으로 추출하게 된다. 그러나 세 번째 CSP에서는 추출된 송신 및 수신 메시지 포맷이 교차되는 양방향의 플로우 포맷을 추출하기 위해 전체 시퀀스 집합을 대상으로 CSP를 수행한다.Therefore, the user cannot input the minimum support value of 50% or more and thus cannot extract the important field format called “GET”. On the contrary, if the user minimum support value is lowered to less than 50%, the noise data is also extracted in the field format. However, in the third CSP, the CSP is performed on the entire sequence set to extract the bidirectional flow format in which the extracted transmission and reception message formats intersect.

다시 도 3을 참조하면, 먼저, 모든 시퀀스로부터 가지고 있는 모든 길이 1 서브 시퀀스를 추출하여 C1에 저장하고, 서브시퀀스 길이를 나타내는 k를 1로 설정한다. 그리고 C1의 요소들에 대한 지지도를 계산하고 지지도가 사용자 설정 최소 지지도 이상인 C1의 요소들을 L1의 요소로 설정한다. Referring back to FIG. 3, first, all length 1 subsequences from all sequences are extracted and stored in C1, and k representing the subsequence length is set to one. Then, the support for the elements of C1 is calculated and the elements of C1 whose support is greater than the user-set minimum support are set as the elements of L1.

L1이 공집합이면 수행을 종료하고 공집합이 아니면 k를 1 증가 시키고, 다음 빈발서브시퀀스(Lk)를 추출하기 위해 모든 서로 다른 두 L1의 요소들을 결합하여 C2의 요소로 하는 C2를 생성한다. If L1 is empty, the execution ends. If not, the value of k is increased by 1, and then, C2 is generated by combining all two different elements of L1 to extract the next frequent subsequence (Lk).

C2의 지지도를 계산하고 사용자가 설정한 최소 지지도 이상인 C2의 요소들을 L2의 요소로 저장한다. 위와 같은 과정을 k가 가장 길이가 긴 메시지 시퀀스의 길이에 도달하거나, 더 이상 추출되는 빈발서브시퀀스가 없을 때까지 길이 k를 증가시키면서 반복하여 모든 길이의 빈발서브시퀀스를 추출한다. 최종적으로 추출된 복수의 빈발서브시퀀스들은 첫 번째 CSP, 두 번째 CSP, 세 번째 CSP에서 각각 필드 포맷, 메시지 포맷, 플로우 포맷에 해당한다.Calculate the support of C2 and store elements of C2 that are above the minimum support set by the user as elements of L2. The above process is repeated while increasing the length k until k reaches the length of the longest message sequence or there are no more frequent subsequences extracted, and the frequent subsequences of all lengths are extracted. Finally, the extracted frequent subsequences correspond to the field format, message format, and flow format in the first CSP, the second CSP, and the third CSP, respectively.

도 2의 구문 추론 단계(220)의 목적은 상세한 메시지 포맷을 위해 구성하는 모든 필드 포맷들이 SF(v), DF(v), DF 및 GAP으로 완전하게 분류된 메시지 포맷을 추출하는 것이다. The purpose of the syntax inference step 220 of FIG. 2 is to extract a message format in which all field formats that constitute the detailed message format are completely classified into SF (v), DF (v), DF, and GAP.

도 5는 본 발명 실시 예에 따라 프로토콜 구문을 추론하는 과정을 도시한 도면이다.5 is a diagram illustrating a process of inferring a protocol syntax according to an embodiment of the present invention.

도 5는 도 2의 구문 추론 단계(220)의 전체적인 개관을 나타낸다.5 shows an overview of the syntax inference step 220 of FIG.

도 2의 SF(v) 추출(221) 모듈에서는 첫 번째 CSP를 사용하여 SF(v)를 추출한다.The SF (v) extraction 221 module of FIG. 2 extracts SF (v) using the first CSP.

도 2의 DF(v) 추출(222) 모듈에서는 추출된 SF(v) 중에서 DF(v)로 변환될 가능성이 있는 SF(v)를 선택한다. 이를 선택하기 위한 조건은 해당 SF(v)의 지지도가 100%가 아니며 위치 분산이 충분히 낮다라는 것이다. 이 위치 분산의 기본 임계값은 200이다. 이 후 선택된 각 SF(v)에 대해 각각 재귀적 CSP를 수행한다.The DF (v) extraction 222 module of FIG. 2 selects SF (v) that is likely to be converted to DF (v) from the extracted SF (v). The condition for selecting this is that the support of the corresponding SF (v) is not 100% and the positional dispersion is low enough. The default threshold for this location variance is 200. Thereafter, recursive CSP is performed for each selected SF (v).

상기 재귀적 CSP의 과정은 다음과 같다. 먼저, 초기 데이터베이스, 즉 메시지 시퀀스들 중 해당 SF(v)를 포함하지 않는 메시지 시퀀스들만을 따로 추출한다. 이 메시지 시퀀스들에 대하여 해당 SF(v)의 최소 offset과 최대 depth를 기준으로 모든 메시지 시퀀스들을 잘라 새로운 데이터베이스를 생성한다. 새로운 데이터베이스, 즉, SF(v)의 최소 offset과 최대 depth를 기준으로 잘린 메시지 시퀀스들을 입력으로 CSP를 수행한다. CSP를 통해 추출된 결과들 중 가장 높은 지지도를 갖는 결과를 해당 SF(v)의 필드 값 배열에 저장한다. 위의 과정을 더 이상 해당 SF(v)의 새로운 값이 추출되지 않을 때까지 반복한다. 이러한 SF(v)는 여러 개의 값을 가지는 필드 포맷이므로 유형을 DF(v)로 변경한다. 따라서 생성된 DF(v)에는 해당 필드 포맷이 가질 수 있는 모든 값을 저장하게 된다.The recursive CSP process is as follows. First, only the message sequences which do not include the corresponding SF (v) among the initial database, that is, the message sequences, are extracted separately. For these message sequences, all message sequences are truncated based on the minimum offset and maximum depth of the corresponding SF (v) to create a new database. CSP is performed by inputting a new database, that is, message sequences truncated based on the minimum offset and maximum depth of SF (v). The result having the highest support among the results extracted through the CSP is stored in the field value array of the corresponding SF (v). The above process is repeated until no new value of the corresponding SF (v) is extracted. Since SF (v) is a field format having several values, the type is changed to DF (v). Therefore, the generated DF (v) stores all the values that the field format can have.

도 6은 본 발명 실시 예에 따라 필드의 값이 동적인 필드 포맷을 생성하기 위한 재귀적 CSP 과정의 예시도이다.6 is an exemplary diagram of a recursive CSP process for generating a field format in which a field value is dynamic according to an embodiment of the present invention.

도 6에 따르면, HTTP 프로토콜의 method 필드와 status code 필드를 예시로 하는 재귀적 CSP 과정을 나타내고 있으며, 도 2의 SF(v) 추출(221)의 결과로 추출된 SF(v) 중 “GET”과 “200”을 값으로 가지는 SF(v)만이 상술한 DF(v)로 변환될 가능성을 만족하므로 각각 재귀적 CSP를 수행한다. According to FIG. 6, a recursive CSP process is illustrated using the method field and the status code field of the HTTP protocol as an example. Among the SF (v) extracted as a result of the SF (v) extraction 221 of FIG. 2, “GET” is shown. Since only SF (v) having a value of and "200" satisfies the possibility of conversion to DF (v) described above, recursive CSP is performed.

값으로 “GET”을 가지는 SF(v)에 대한 재귀적 CSP의 결과로는 상기 SF(v)가 “GET”, “POST”, “HEAD”, “PUT”을 값으로 가지는 DF(v)로 전환됨을 알 수 있다. 또한, 값으로 “200”을 가지는 SF(v)에 대한 재귀적 CSP의 결과로는 상기 SF(v)가 “200”, “301”, “401”을 값으로 가지는 DF(v)로 전환됨을 알 수 있다.As a result of the recursive CSP for SF (v) having "GET" as a value, the SF (v) is DF (v) having "GET", "POST", "HEAD", and "PUT" as values. It can be seen that the conversion. In addition, as a result of the recursive CSP for SF (v) having a value of “200”, the SF (v) is converted to DF (v) having “200”, “301”, and “401” as values. Able to know.

도 2의 메시지 포맷 추출 (223) 모듈은 길이 1 항목 단위를 앞서 추출한 SF(v)와 DF(v)로 하여 두 번째 CSP를 이용하여 메시지 포맷을 추출한다.The message format extraction module 223 of FIG. 2 extracts the message format by using the second CSP using SF (v) and DF (v), which are extracted from the length 1 item unit.

도 2의 메시지 포맷 내부 추가적 필드 추출(224) 모듈에서는 앞서 추출한 각 메시지 포맷을 구성하는 필드 포맷들의 사이를 SF(v), DF(v), DF, GAP으로 구분한다. 이 모듈에는 두 개의 임계값이 사용되며 모듈의 과정은 다음과 같다. In the additional message field extraction module 224 of FIG. 2, the field formats constituting each message format extracted above are divided into SF (v), DF (v), DF, and GAP. Two thresholds are used in this module. The module process is as follows.

두 임계값의 첫 번째는 “이전 필드 포맷과 다음 필드 포맷 사이 부분의 길이 분산”에 대한 임계값이고 두 번째는 “이전 필드 포맷과 다음 필드 포맷 사이 부분의 최대 길이”에 대한 임계값이다. 먼저 각 메시지 포맷에서 구분하고자 하는 필드 포맷들의 사이를 설정한다. 그리고 원본 데이터베이스, 즉, 전체 메시지 시퀀스에서 해당 메시지 포맷에 해당하는 메시지 시퀀스들만을 선별한다. 선별한 모든 메시지 시퀀스들에서 분류하고자 설정한 필드 포맷 사이 부분들에 해당하는 데이터의 최대 길이와 길이 분산을 계산한다. 길이 분산이 첫 번째 임계값보다 큰 경우 GAP으로 분류하고 그렇지 않은 경우 GAP이 아닌 필드 포맷으로 분류한다. 상기 길이 분산에 대한 기본 임계값은 5000이다. GAP은 길이와 값이 매우 가변적인 필드 포맷을 의미한다. 다음으로, GAP이 아닌 포맷의 경우 최대 길이가 두 번째 임계값보다 작으면 DF(v)로 분류하고, 그렇지 않으면 DF로 분류한다. DF(v)로 분류된 필드 포맷에 대해서는 이전 필드 포맷과 다음 필드 포맷 사이 부분의 모든 데이터들을 중복 없이 DF(v)의 값으로 저장한다. 이 값이 하나 밖에 없을 시 SF(v)로 전환한다. 두 번째 길이 분산에 대한 기본 임계값은 25이다. DF는 값은 매우 가변적이나 길이는 어느 정도 고정되어 있는 필드 포맷을 의미한다. DF(v)는 값과 길이를 어느 정도 고정 되어 있는 필드 포맷을 의미한다. 위 과정을 해당 메시지 포맷을 구성하는 모든 필드 포맷 사이에 대하여 수행하고 마찬가지로 모든 메시지 포맷에 대하여 이를 수행한다.The first of the two thresholds is the threshold for "distribution of the length of the portion between the previous field format and the next field format" and the second is the threshold for the "maximum length of the portion between the previous field format and the next field format". First, set between field formats to be distinguished in each message format. Only message sequences corresponding to the corresponding message format are selected from the original database, that is, the entire message sequence. The maximum length and length variance of the data corresponding to the parts between the field formats set to be classified in all the selected message sequences are calculated. If the length variance is greater than the first threshold, it is classified as a GAP, otherwise it is classified as a field format rather than a GAP. The default threshold for the length variance is 5000. GAP means a field format whose length and value are very variable. Next, in the case of the non-GAP format, if the maximum length is smaller than the second threshold, it is classified as DF (v), otherwise it is classified as DF. For a field format classified as DF (v), all data in the portion between the previous field format and the next field format are stored as a value of DF (v) without duplication. If there is only one value, it switches to SF (v). The default threshold for the second length variance is 25. DF stands for a field format whose value is very variable but somewhat fixed in length. DF (v) refers to a field format having a fixed value and length. The above process is performed between all field formats constituting the corresponding message format and similarly for all message formats.

도 7은 본 발명 실시 예에 따라 메시지 포맷 내부의 추가적인 필드 포맷을 생성하기 위한 과정의 예시도이다.7 illustrates an example of a process for generating an additional field format in a message format according to an embodiment of the present invention.

도 7은 본 발명 실시 예에 따라 상술한 바와 같이 도 2의 메시지 포맷 내부 추가적 필드 추출(224) 모듈에서 메시지 내부의 추가적인 필드 포맷을 생성하기 위한 과정의 예시도이다. FIG. 7 is an exemplary diagram of a process for generating an additional field format in a message in the message format additional field extraction 224 module of FIG. 2 as described above according to an embodiment of the present invention.

도 7에 따르면 Part1과 Part3는 이전 필드 포맷과 다음 필드 포맷 사이의 길이 분산이 5000보다 작기 때문에 GAP이 아닌 필드 포맷으로 분류되며, 반면에 Part2는 길이 분산이 5000보다 크기 때문에 GAP으로 분류된다. 또한, Part1은 이전 필드 포맷과 다음 필드 포맷 사이의 최대 길이가 5로 매우 작기 때문에 DF(v)로 분류되며, Part3은 이전 필드 포맷과 다음 필드 포맷 사이의 최대 길이가 128로 25보다 크므로 DF로 분류된다. 상기 모듈이 수행된 후 완전하게 구성된 Message Format을 얻을 수 있다.According to FIG. 7, Part1 and Part3 are classified as non-GAP field formats because the length variance between the previous field format and the next field format is less than 5000, whereas Part2 is classified as GAP because the length variance is larger than 5000. Also, Part1 is classified as DF (v) because the maximum length between the previous field format and the next field format is very small (5), and Part3 is DF because the maximum length between the previous field format and the next field format is 128 and larger than 25. Classified as After the module is executed, a completely configured message format can be obtained.

도 2의 의미 추론 단계 (230)는 6가지 유형의 의미 유형을 미리 정의하고 모든 필드 포맷을 순회하면서 각 의미 유형에 해당하는지 각각의 알고리즘을 통해 확인하여 해당 필드 포맷의 식별된 의미 유형을 저장한다. 본 방법에서는 FieldHunter의 의미 식별 방법론을 본 발명에 맞게 수정하여 각 메시지 포맷을 구성하는 필드 포맷의 의미를 찾는다. 본 알고리즘이 사용하는 의미 식별 방법론과 FieldHunter의 의미 식별 방법론의 차이점은 FieldHunter의 경우, 메시지를 n-gram으로 먼저 분류하여 메시지의 모든 offset이 같은 n-gram을 대상으로 의미 유형을 추론하지만, 본 방법은 필드 포맷과 메시지 포맷을 모두 추출한 후에 특정 메시지 포맷을 구성하는 특정 필드 포맷에 해당하는 데이터들만을 가지고 의미 유형을 추론하기 때문에 의미 식별에 대한 오차가 줄어든다. 또한 FieldHunter의 경우, 인접한 n-gram이 필드 포맷으로 확장될 수 있는지의 확인 과정을 추가적으로 수행한다.The semantic reasoning step 230 of FIG. 2 predefines six types of semantic types, and iterates through all the field formats and checks through each algorithm whether they correspond to each semantic type and stores the identified semantic types of the corresponding field format. . In this method, the meaning identification methodology of FieldHunter is modified according to the present invention to find the meaning of the field format constituting each message format. The difference between the semantic identification methodology used by this algorithm and the semantic identification methodology of FieldHunter is that FieldHunter classifies messages into n-grams first and infers semantic types from n-grams with the same offsets. After extracting both the field format and the message format, the inference of semantic identification is reduced because the semantic type is inferred only with data corresponding to the specific field format constituting the specific message format. In addition, in the case of FieldHunter, an additional process of checking whether adjacent n-grams can be extended to a field format is additionally performed.

도 2의 의미 추론 단계 (230)에서 식별하는 6가지 의미 유형은 메시지 타입, 메시지 길이, 송신자 식별자, 세션 식별자, 트랜잭션 식별자, 누산기이다. 이들을 추론하기 위해 도 2의 메시지 포맷 내부 추가적 필드 추출(224) 모듈에서 수행하는 바와 같이 원본 데이터베이스에서 특정 메시지 포맷의 특정 필드 포맷에 해당하는 데이터들만을 수집하고 각 6가지 의미 유형들에 해당하는지를 판별한다. 따라서 하나의 필드 포맷은 여러 개의 의미 유형에 해당할 수 있다. 이와 같은 과정을 메시지 포맷의 모든 SF(v)와 DF(v)에 대하여 수행한다.The six semantic types identified in semantic inference step 230 of FIG. 2 are message type, message length, sender identifier, session identifier, transaction identifier, and accumulator. To infer them, we collect only the data corresponding to a particular field format of a particular message format from the source database and determine whether they correspond to each of the six semantic types, as performed by the additional field extraction 224 module inside the message format of FIG. do. Therefore, one field format may correspond to several semantic types. This process is performed for all SF (v) and DF (v) of the message format.

도 2의 메시지 타입 추론(231) 모듈은 상술한 바와 같이 식별하고자 하는 필드 포맷이 메시지 타입 의미 유형에 해당하는 필드 포맷인지 추론한다. 먼저, 메시지 타입을 의미하는 필드 포맷은 값이 정적인 필드 포맷이 아니며 가질 수 있는 값이 너무 가변적이지 않은 필드 포맷으로 정의한다. 이러한 동적 필드가 이 필드를 포함하는 메시지의 반대 방향 메시지에도, 같은 위치에서 대응되는 의미를 가진 필드 포맷이 있을 때 이를 메시지 타입 유형으로 분류한다. 즉, 메시지 타입 유형에 해당하는 필드 포맷은 송신과 수신의 관계와 같은 인과 관계가 있다. 이를 찾기 위한 알고리즘에서는 entropy metric H(x)와 casuality meric I(q:r)/H(q)를 사용한다.As described above, the message type inference 231 module infers whether the field format to be identified is the field format corresponding to the message type semantic type. First, a field format that means a message type is defined as a field format in which a value is not a static field format and a value that can have is not too variable. In the opposite direction of a message in which this dynamic field contains this field, when there is a field format having a corresponding meaning in the same position, it is classified as a message type type. That is, the field format corresponding to the message type type has a causal relationship such as a relationship between transmission and reception. The algorithm to find it uses entropy metric H (x) and casualty meric I (q: r) / H (q).

도 2의 메시지 길이 추론(232) 모듈은 상술한 바와 같이 식별하고자 하는 필드 포맷이 메시지 길이 의미 유형에 해당하는 필드 포맷인지 추론한다. 메시지 길이 의미 유형에 해당하는 필드 포맷은 값으로 메시지의 길이를 갖고 있는 동적 필드이다. 이를 찾기 위한 알고리즘은 Pearson 상관 계수를 사용하여 각 메시지의 필드 포맷의 값과 해당 메시지의 길이가 선형 관계가 있음을 확인한다.As described above, the message length inference module 232 of FIG. 2 infers whether a field format to be identified is a field format corresponding to a message length semantic type. The field format corresponding to the message length semantic type is a dynamic field whose value is the length of the message. The algorithm to find this uses the Pearson correlation coefficient to confirm that the value of the field format of each message has a linear relationship with the length of the message.

도 2의 송신자 식별자 추론(233) 모듈은 상술한 바와 같이 식별하고자 하는 필드 포맷이 송신자 식별자 의미 유형에 해당하는 필드 포맷인지 추론한다. 송신자 식별자 의미 유형에 해당하는 필드 포맷은 전자 메일 주소, 사용자 ID, 호스트 IP 주소와 같이 송신자 주소에 종속된 값을 갖는 동적 필드이다. 이를 찾기 위한 알고리즘은 categorical metric : R(x,y)=I(x;y)/H(x,y)를 사용한다.The sender identifier inference 233 module of FIG. 2 infers whether the field format to be identified is the field format corresponding to the sender identifier semantic type as described above. The field format corresponding to the sender identifier semantic type is a dynamic field with values dependent on the sender address, such as e-mail address, user ID, host IP address. The algorithm to find it uses categorical metric: R (x, y) = I (x; y) / H (x, y).

도 2의 세션 식별자 추론(234) 모듈은 상술한 바와 같이 식별하고자 하는 필드 포맷이 세션 식별자 의미 유형에 해당하는 필드 포맷인지 추론한다. 세션 식별자 의미 유형에 해당하는 필드 포맷은 세션에 종속된 값을 갖는 동적 필드이다. 쿠키 또한 이 세션 식별자에 해당한다. 이를 찾기 위한 알고리즘은 송신자 식별자 의미 유형을 식별하는 알고리즘과 마찬가지로 categorical metric을 사용한다.As described above, the session identifier inference 234 module infers whether the field format to be identified is the field format corresponding to the session identifier semantic type. The field format corresponding to the session identifier semantic type is a dynamic field with a value dependent on the session. Cookies also correspond to this session identifier. The algorithm for finding this uses the categorical metric as well as the algorithm for identifying the sender identifier semantic type.

도 2의 트랜잭션 식별자 추론(235) 모듈은 상술한 바와 같이 식별하고자 하는 필드 포맷이 트랜잭션 식별자 의미 유형에 해당하는 필드 포맷인지 추론한다. 트랜잭션 식별자 의미 유형에 해당하는 필드 포맷은 송신 메시지와 수신 메시지 쌍인 트랜잭션에 종속된 값을 가지는 동적 필드이다. 또한, 하나의 트랜잭션을 구성하는 송신 메시지와 수신 메시지의 트랜잭션 식별자는 같다. 이를 찾기 위한 알고리즘은 엔트로피 metric을 사용하고 대응되는 방향의 메시지에서의 필드의 값이, 분석하고자하는 필드의 값과 일치하는지를 확인한다.As described above, the transaction identifier inference 235 module infers whether the field format to be identified is the field format corresponding to the transaction identifier semantic type. A field format corresponding to a transaction identifier semantic type is a dynamic field having a value dependent on a transaction that is a pair of a sending message and a receiving message. In addition, the transaction identifiers of the transmission message and the reception message constituting one transaction are the same. The algorithm for finding this uses an entropy metric and verifies that the value of the field in the message in the corresponding direction matches the value of the field to be analyzed.

도 2의 누산기 추론(236) 모듈은 상술한 바와 같이 식별하고자 하는 필드 포맷이 누산기 의미 유형에 해당하는 필드 포맷인지 추론한다. 누산기 의미 유형에 해당하는 필드 포맷은, 시간의 흐름에 따른 연속적인 메시지들에서 해당하는 값이 어느 정도 일정한 증분치를 가지고 증가하는 동적 필드이다. 이 알고리즘은 이 필드를 찾기 위해 너무 가변적이지 않은 증분이 있는지 각 증분들의 분산을 가지고 확인한다.The accumulator inference 236 module of FIG. 2 infers whether the field format to be identified is the field format corresponding to the accumulator semantic type as described above. A field format corresponding to an accumulator semantic type is a dynamic field in which the corresponding value in a series of messages over time increases with some constant increment. The algorithm checks with the variance of each increment to see if there are increments that are not too variable to find this field.

도 2의 행동 추론 단계(240)는 상기 추출한 메시지 포맷을 사용하여 플로우 포맷과 유한 상태 머신을 추출한다. The behavior inference step 240 of FIG. 2 extracts the flow format and the finite state machine using the extracted message format.

도 8은 본 발명 실시 예에 따라 플로우 포맷과 유한 상태 머신을 추론하는 행동 추론 과정을 도시한 도면이다.8 is a diagram illustrating a behavior inference process of inferring a flow format and a finite state machine according to an exemplary embodiment of the present invention.

즉, 도 8은 도 2의 행동 추론 단계(240)의 과정을 도시한 도면이다.That is, FIG. 8 is a diagram illustrating a process of the behavior inference step 240 of FIG. 2.

도 2의 유한 상태 머신 추출(241) 모듈은 상기 유한 상태 머신을 추출하기 위해 상기 추출된 메시지 포맷을 유한 상태 머신의 state(메시지 포맷)로 사용한다. 상기 state는 동일한 유형의 메시지 집합을 의미한다. 상기 유한 상태 머신 추출(241) 모듈은 각 추출된 메시지 포맷들을 입력 트래픽에 매칭시켜 각 state들에 해당하는 메시지 시퀀스의 전환을 찾아 유한 상태 머신의 transition으로 추출한다. 이 과정에서 각 transition에 대한 매칭된 횟수를 저장하고 도 8에 도시된 바와 같이 각 state에서의 각 transition의 전이 확률을 계산하여 저장한다. 전이 확률은 하나의 state가 가지는 모든 transition과 해당 transition이 일치하는 횟수를 통해 계산된다. 이 전이 확률은 어떤 메시지가 가장 큰 가능성을 가지고 발생하는지 예측할 수 있기에 매우 유용하게 사용될 수 있다. 모든 state와 transition을 추출한 뒤 유한 상태 머신 각 경로의 최 앞단 state들 앞에 “START” state를 연결하고 최 말단 state들 뒤에 “END” state를 연결한다. 도 8에 도시된 “START” state에서 “END” state로 연결된 각 경로는 각각 하나의 플로우를 의미한다. 추출된 유한 상태 머신은 프로토콜의 각 메시지 유형이 어느 정도의 확률을 갖고 어떤 순서로 동작하는지 확인하는데 도움이 된다.The finite state machine extraction 241 module of FIG. 2 uses the extracted message format as the state (message format) of the finite state machine to extract the finite state machine. The state means a set of messages of the same type. The finite state machine extraction 241 module matches each extracted message format to input traffic, finds a transition of the message sequence corresponding to each state, and extracts the transition of the finite state machine. In this process, the number of matches for each transition is stored and the transition probability of each transition in each state is calculated and stored as shown in FIG. 8. The transition probability is calculated by the number of times all transitions in a state match the transition. This transition probability can be very useful because it can predict which message occurs with the greatest likelihood. After extracting all the states and transitions, connect the "START" state before the leading states of each path of the finite state machine and the "END" state after the last states. Each path connected from the “START” state to the “END” state illustrated in FIG. 8 represents one flow. The extracted finite state machine helps to determine how each message type in the protocol has a certain probability and in what order.

도 2의 플로우 포맷 추출(242) 모듈은 길이 1 항목 단위를 메시지 포맷으로 하여 세 번째 CSP를 사용하여 플로우 포맷을 추출한다. 추출된 플로우 포맷은 프로토콜의 주요 플로우 유형을 나타내므로 프로토콜에 대하여 더 자세한 정보를 파악할 수 있다. 또한 플로우 포맷을 사용하여 상기 유한 상태 머신을 간결하게 만드는 데 이용이 가능하다. The flow format extraction 242 module of FIG. 2 extracts a flow format using a third CSP using a length 1 item unit as a message format. The extracted flow format represents the main flow type of the protocol, so that more detailed information about the protocol can be obtained. It is also available to simplify the finite state machine using a flow format.

유한 상태 머신의 Initial State에서부터 End State까지 이어지는 모든 경로들은 각각이 플로우 타입들이다. 유한 상태 머신의 여러 경로들 중 주요 플로우 타입인 플로우 포맷에 해당하는 경로들만을 남겨 유한 상태 머신을 간결하게 축소시킬 수 있다. 따라서 사용자는 이러한 유한 상태 머신을 통해 주요 메시지 타입들의 발생 시퀀스를 더 쉽게 파악할 수 있다.All the paths from the Initial State to the End State of the finite state machine are each flow types. Among the various paths of the finite state machine, only the paths corresponding to the flow format, which is the main flow type, can be condensed to simplify the finite state machine. Thus, this finite state machine allows the user to more easily identify the sequence of occurrences of the major message types.

본 발명에 따른 명확한 프로토콜 사양 자동 추출을 위한 장치 및 방법의 효과에 대해 설명하면 다음과 같다.Referring to the effects of the apparatus and method for automatic protocol specification automatic extraction according to the present invention.

본 발명의 실시 예들 중 적어도 하나에 의하면, 비공개 프로토콜이 발생시키는 트래픽을 분류하여 신뢰성 있는 네트워크 사용 현황 파악, 확장 계획 수립 및 QoS 정책 설정에 활용이 가능하며, 공격의 탐지 및 차단을 위한 방화벽 및 침입 탐지 시스템과 네트워크 취약성을 파악하기 위한 침투 시험 및 스마트 퍼저 시스템 구축에 유용한 정보를 제공할 수 있다.According to at least one of the embodiments of the present invention, it is possible to classify the traffic generated by the private protocol to be used for reliable network usage, expansion planning and QoS policy setting, firewall and intrusion for the detection and blocking of attacks It can provide useful information for penetration testing and smart purge system construction to detect detection systems and network vulnerabilities.

또한, 본 발명의 실시 예들 중 적어도 하나에 의하면, 프로토콜의 사양으로 프로토콜의 구문(syntax), 의미(semantics), 유한 상태 머신(finite state machine)을 모두 추출할 수 있으며, 필드 포맷, 메시지 포맷, 플로우 포맷으로 구성된 구문(syntax)를 정의함으로써, CSP 알고리즘을 계층적으로 사용하여 기존 기술의 문제점인 메시지의 유형이 너무 많이 추출되는 문제점을 해결하고, 자주 발생하는 바이트 스트림, 주요한 메시지 포맷, 주요 플로우의 유형, 유한 상태 머신의 주요 경로를 명확히 파악할 수 있다.In addition, according to at least one of the embodiments of the present invention, it is possible to extract the syntax, semantics, and finite state machine of the protocol as the specification of the protocol, field format, message format, By defining the syntax of the flow format, the CSP algorithm is used hierarchically to solve the problem of extracting too many types of messages, which is a problem of the existing technology, and frequently occurs byte streams, major message formats, and major flows. Type, the main path of the finite state machine can be clearly identified.

또한, 본 발명의 실시 예들 중 적어도 하나에 의하면, 메시지 포맷은 값이 정적인 필드 포맷 유형, 값이 동적인 필드 포맷 유형, 길이만 알 수 있는 필드 포맷 유형, 값과 길이를 모두 알 수 없는 포맷 유형으로 구분되는 필드 포맷의 연속으로, 메시지 포맷의 내부가 비어 있는 부분 없이 명확하며 상세한 구조를 파악할 수 있다는 장점이 있다. In addition, according to at least one of the embodiments of the present invention, the message format is a field format type whose value is static, a field format type whose value is dynamic, a field format type whose length is only known, and a format whose value and length are not all known. As a series of field formats separated by types, there is an advantage that a clear and detailed structure can be grasped without a blank portion of a message format.

상기의 상세한 설명은 모든 면에서 제한적으로 해석되어서는 아니되고 예시적인 것으로 고려되어야 한다. 본 발명의 범위는 첨부된 청구항의 합리적 해석에 의해 결정되어야 하고, 본 발명의 등가적 범위 내에서의 모든 변경은 본 발명의 범위에 포함된다.The foregoing detailed description should not be construed as limiting in all respects, but should be considered as illustrative. The scope of the present invention should be determined by reasonable interpretation of the appended claims, and all changes within the equivalent scope of the present invention are included in the scope of the present invention.

100 : 프로토콜 사양 자동 추출 장치
110 : 프로토콜 트래픽 입력부
120 : 사용자 정의 설정값 입력부
130 : 프로토콜 구조분석부
140 : 출력부
100: protocol specification automatic extraction device
110: protocol traffic input unit
120: user defined input unit
130: protocol structure analysis unit
140: output unit

Claims (12)

단일의 프로토콜에 대한 복수의 트래픽 파일을 입력받는 프로토콜 트래픽 입력부;
상기 입력된 복수의 트래픽 파일에 대해 구조분석을 수행하기 위한 사용자 정의값을 입력받는 사용자 정의 설정값 입력부;
상기 사용자 정의값을 기초로 상기 입력된 복수의 트래픽 파일에 대한 구조분석을 수행하여 프로토콜 사양을 추출하는 프로토콜 구조분석부; 및
상기 프로토콜 사양을 출력하는 출력부;를 포함하며,
상기 프로토콜 구조분석부는,
상기 복수의 트래픽 파일에 포함된 패킷들을 시간순으로 정렬하는 단계;
상기 패킷들을 플로우 단위로 분할해 복수의 플로우들을 설정하는 단계;
분할된 각 플로우에 포함된 패킷을 메시지 단위로 분할해 복수의 메시지들을 설정하는 단계;
상기 복수의 메시지들을 상호 비교하고, 상기 복수의 메시지들 중 기준값보다 많은 메시지들에서 공통적으로 존재하는 바이트 스트림을 필드 포맷으로 추출하는 단계;
상기 복수의 메시지들 중 어느 하나의 메시지에서 연속적으로 존재하는 필드 포맷들을 메시지 포맷으로 추출하는 단계;
상기 복수의 플로우들 중 어느 하나의 플로우에서 연속적으로 존재하는 메시지 포맷들을 플로우 포맷으로 추출하는 단계;
상기 추출한 메시지 포맷을 구성하는 필드 포맷들의 의미 유형을 분석하는 단계; 및
상기 추출된 메시지 포맷과 플로우 포맷을을 분석하여 프로토콜의 유한 상태 머신을 추출하는 단계를 수행해 상기 프로토콜 사양을 추출하는 것을 특징으로 하는 명확한 프로토콜 사양 자동 추출을 위한 장치.
A protocol traffic input unit for receiving a plurality of traffic files for a single protocol;
A user-defined setting value input unit for receiving a user-defined value for performing structural analysis on the plurality of input traffic files;
A protocol structure analysis unit extracting a protocol specification by performing structure analysis on the plurality of input traffic files based on the user defined value; And
And an output unit for outputting the protocol specification.
The protocol structure analysis unit,
Arranging packets included in the plurality of traffic files in chronological order;
Dividing the packets into flow units to set a plurality of flows;
Setting a plurality of messages by dividing a packet included in each divided flow into message units;
Comparing the plurality of messages with each other, and extracting, in a field format, a byte stream that is common to more than a reference value among the plurality of messages;
Extracting field formats continuously present in any one of the plurality of messages into a message format;
Extracting message formats continuously present in any one of the plurality of flows into a flow format;
Analyzing semantic types of field formats constituting the extracted message format; And
And extracting the protocol specification by analyzing the extracted message format and the flow format to extract the finite state machine of the protocol.
제1항에 있어서,
상기 프로토콜 구조분석부는,
상기 복수의 트래픽 파일의 패킷을 플로우 단위로 변환하고, 상기 플로우를 메시지 단위로 분할하는 메시지 조립부;를 포함하는 것을 특징으로 하는 명확한 프로토콜 사양 자동 추출을 위한 장치.
The method of claim 1,
The protocol structure analysis unit,
And a message assembly unit for converting the packets of the plurality of traffic files into a flow unit and dividing the flow into a message unit.
제2항에 있어서,
상기 프로토콜 구조분석부는,
상기 메시지를 대상으로 필드의 유형인 필드 포맷을 생성하고, 상기 필드 포맷을 대상으로 소정 빈도수 이상의 필드 포맷의 연속된 집합인 메시지 포맷을 생성하는 구문추론부;를 포함하는 것을 특징으로 하는 명확한 프로토콜 사양 자동 추출을 위한 장치.
The method of claim 2,
The protocol structure analysis unit,
A syntax inference unit for generating a field format which is a type of a field for the message, and generating a message format which is a continuous set of field formats having a predetermined frequency or more for the field format; Device for automatic extraction.
제3항에 있어서,
상기 프로토콜 구조분석부는,
상기 메시지 포맷에 대하여 상기 메시지 포맷을 구성하는 필드들의 의미 유형을 추론하는 의미추론부;를 포함하는 것을 특징으로 하는 명확한 프로토콜 사양 자동 추출을 위한 장치.
The method of claim 3,
The protocol structure analysis unit,
And a semantic inference unit for inferring a semantic type of fields constituting the message format with respect to the message format.
제4항에 있어서,
상기 프로토콜 구조분석부는,
상기 메시지 포맷을 대상으로 소정 빈도수 이상의 메시지 포맷의 연속된 집합이며 플로우의 유형인 플로우 포맷을 생성하고, 유한 상태 머신을 생성하는 행동 추론부;를 포함하는 것을 특징으로 하는 명확한 프로토콜 사양 자동 추출을 위한 장치.
The method of claim 4, wherein
The protocol structure analysis unit,
A behavior inference unit for generating a flow format that is a continuous set of message formats having a predetermined frequency or more and is a type of a flow, and generates a finite state machine, for the message format; Device.
제5항에 있어서,
상기 메시지 조립부는,
전송 계층 프로토콜로 UDP를 사용하는 프로토콜의 경우 메시지의 단위는 하나의 패킷이라 정의하고, TCP를 사용하는 프로토콜의 경우 메시지의 단위는 동일한 방향의 연속적으로 접해있는 패킷 집합이라 정의하여, 각 플로우들을 메시지의 연속으로 변환하는 것을 특징으로 하는 명확한 프로토콜 사양 자동 추출을 위한 장치.
The method of claim 5,
The message assembly unit,
In case of protocol using UDP as transport layer protocol, the unit of message is defined as one packet, and in case of protocol using TCP, the unit of message is defined as a set of consecutively contiguous packets in the same direction. Apparatus for automatic extraction of clear protocol specifications, characterized in that the conversion to a series of.
단일의 프로토콜에 대한 복수의 트래픽 파일을 입력받는 프로토콜 트래픽 입력단계;
상기 입력된 복수의 트래픽 파일에 대해 구조분석을 수행하기 위한 사용자 정의값을 입력받는 사용자 정의 설정값 입력단계;
상기 사용자 정의값을 기초로 상기 입력된 복수의 트래픽 파일에 대한 구조분석을 수행하여 프로토콜 사양을 추출하는 프로토콜 구조분석단계; 및
상기 프로토콜 사양을 출력하는 출력단계;를 포함하며,
상기 프로토콜 구조분석단계는,
상기 복수의 트래픽 파일에 포함된 패킷들을 시간순으로 정렬하는 단계;
상기 패킷들을 플로우 단위로 분할해 복수의 플로우들을 설정하는 단계;
분할된 각 플로우에 포함된 패킷을 메시지 단위로 분할해 복수의 메시지들을 설정하는 단계;
상기 복수의 메시지들을 상호 비교하고, 상기 복수의 메시지들 중 기준값보다 많은 메시지들에서 공통적으로 존재하는 바이트 스트림을 필드 포맷으로 추출하는 단계;
상기 복수의 메시지들 중 어느 하나의 메시지에서 연속적으로 존재하는 필드 포맷들을 메시지 포맷으로 추출하는 단계;
상기 복수의 플로우들 중 어느 하나의 플로우에서 연속적으로 존재하는 메시지 포맷들을 플로우 포맷으로 추출하는 단계;
상기 추출한 메시지 포맷을 구성하는 필드 포맷들의 의미 유형을 분석하는 단계; 및
상기 추출된 메시지 포맷과 플로우 포맷을 분석하여 프로토콜의 유한 상태 머신을 추출하는 단계를 포함하는 것을 특징으로 하는 명확한 프로토콜 사양 자동 추출을 위한 방법.
A protocol traffic input step of receiving a plurality of traffic files for a single protocol;
A user-defined setting value input step of receiving a user-defined value for performing structural analysis on the input plurality of traffic files;
A protocol structure analysis step of extracting a protocol specification by performing structure analysis on the input plurality of traffic files based on the user defined value; And
An output step of outputting the protocol specification;
The protocol structure analysis step,
Arranging packets included in the plurality of traffic files in chronological order;
Dividing the packets into flow units to set a plurality of flows;
Setting a plurality of messages by dividing a packet included in each divided flow into message units;
Comparing the plurality of messages with each other, and extracting, in a field format, a byte stream that is common to more than a reference value among the plurality of messages;
Extracting field formats continuously present in any one of the plurality of messages into a message format;
Extracting message formats continuously present in any one of the plurality of flows into a flow format;
Analyzing semantic types of field formats constituting the extracted message format; And
Analyzing the extracted message format and flow format to extract a finite state machine of the protocol.
제7항에 있어서,
상기 프로토콜 구조분석단계는,
상기 복수의 트래픽 파일의 패킷을 플로우 단위로 변환하고, 상기 플로우를 메시지 단위로 분할하는 메시지 조립단계;를 포함하는 것을 특징으로 하는 명확한 프로토콜 사양 자동 추출을 위한 방법.
The method of claim 7, wherein
The protocol structure analysis step,
And a message assembling step of converting the packets of the plurality of traffic files into flow units and dividing the flows into message units.
제8항에 있어서,
상기 프로토콜 구조분석단계는,
상기 메시지를 대상으로 필드의 유형인 필드 포맷을 생성하고, 상기 필드 포맷을 대상으로 소정 빈도수 이상의 필드 포맷의 연속된 집합인 메시지 포맷을 생성하는 구문추론단계;를 포함하는 것을 특징으로 하는 명확한 프로토콜 사양 자동 추출을 위한 방법.
The method of claim 8,
The protocol structure analysis step,
A syntax inference step of generating a field format that is a type of a field for the message, and generating a message format that is a continuous set of field formats having a predetermined frequency or more for the field format; Method for automatic extraction.
제9항에 있어서,
상기 프로토콜 구조분석단계는,
상기 메시지 포맷에 대하여 상기 메시지 포맷을 구성하는 필드들의 의미 유형을 추론하는 의미추론단계;를 포함하는 것을 특징으로 하는 명확한 프로토콜 사양 자동 추출을 위한 방법.
The method of claim 9,
The protocol structure analysis step,
And a semantic reasoning step of inferring a semantic type of fields constituting the message format with respect to the message format.
제10항에 있어서,
상기 프로토콜 구조분석단계는,
상기 메시지 포맷을 대상으로 소정 빈도수 이상의 메시지 포맷의 연속된 집합이며 플로우의 유형인 플로우 포맷을 생성하고, 유한 상태 머신을 생성하는 행동 추론단계;를 포함하는 것을 특징으로 하는 명확한 프로토콜 사양 자동 추출을 위한 방법.
The method of claim 10,
The protocol structure analysis step,
A behavior inference step of generating a flow format that is a continuous set of message formats having a predetermined frequency or more and is a type of a flow, and generating a finite state machine, for the message format; Way.
제11항에 있어서,
상기 메시지 조립단계는,
전송 계층 프로토콜로 UDP를 사용하는 프로토콜의 경우 메시지의 단위는 하나의 패킷이라 정의하고, TCP를 사용하는 프로토콜의 경우 메시지의 단위는 동일한 방향의 연속적으로 접해있는 패킷 집합이라 정의하여, 각 플로우들을 메시지의 연속으로 변환하는 단계;를 포함하는 것을 특징으로 하는 명확한 프로토콜 사양 자동 추출을 위한 방법.
The method of claim 11,
The message assembly step,
In case of protocol using UDP as transport layer protocol, the unit of message is defined as one packet, and in case of protocol using TCP, the unit of message is defined as a set of consecutively contiguous packets in the same direction. And converting the sequence to a sequence of clear protocol specifications.
KR1020180159407A 2018-12-11 2018-12-11 Apparatus and method for automatic extraction of accurate protocol specifications KR102069142B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020180159407A KR102069142B1 (en) 2018-12-11 2018-12-11 Apparatus and method for automatic extraction of accurate protocol specifications

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020180159407A KR102069142B1 (en) 2018-12-11 2018-12-11 Apparatus and method for automatic extraction of accurate protocol specifications

Publications (1)

Publication Number Publication Date
KR102069142B1 true KR102069142B1 (en) 2020-02-11

Family

ID=69568832

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020180159407A KR102069142B1 (en) 2018-12-11 2018-12-11 Apparatus and method for automatic extraction of accurate protocol specifications

Country Status (1)

Country Link
KR (1) KR102069142B1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112312590A (en) * 2020-10-10 2021-02-02 腾讯科技(深圳)有限公司 Equipment communication protocol identification method and device
KR102347881B1 (en) * 2020-08-21 2022-01-05 장진욱 Monitoring apparatus for solar power generation supporting automatic protocol setting and automatic protocol setting method of the same
WO2022162655A1 (en) * 2021-01-26 2022-08-04 Elbit Systems C4I and Cyber Ltd. A system and method for producing specifications for fields with variable number of elements

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101466017B1 (en) * 2013-06-26 2014-11-28 국방과학연구소 Packet analysis apparatus and method for protocol analysis

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101466017B1 (en) * 2013-06-26 2014-11-28 국방과학연구소 Packet analysis apparatus and method for protocol analysis

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102347881B1 (en) * 2020-08-21 2022-01-05 장진욱 Monitoring apparatus for solar power generation supporting automatic protocol setting and automatic protocol setting method of the same
CN112312590A (en) * 2020-10-10 2021-02-02 腾讯科技(深圳)有限公司 Equipment communication protocol identification method and device
WO2022162655A1 (en) * 2021-01-26 2022-08-04 Elbit Systems C4I and Cyber Ltd. A system and method for producing specifications for fields with variable number of elements

Similar Documents

Publication Publication Date Title
Narayan et al. A survey of automatic protocol reverse engineering tools
US9275224B2 (en) Apparatus and method for improving detection performance of intrusion detection system
KR102069142B1 (en) Apparatus and method for automatic extraction of accurate protocol specifications
US8676965B2 (en) Tracking high-level network transactions
Estevez-Tapiador et al. Detection of web-based attacks through Markovian protocol parsing
Sija et al. A survey of automatic protocol reverse engineering approaches, methods, and tools on the inputs and outputs view
US20030084318A1 (en) System and method of graphically correlating data for an intrusion protection system
CN108900374B (en) Data processing method and device applied to DPI equipment
CN104115463A (en) A streaming method and system for processing network metadata
TW202019127A (en) Abnormal flow detection device and abnormal flow detection method thereof
WO2003084137A2 (en) Methods for identifying network traffic flows
CN107026821A (en) The processing method and processing device of message
US20220303198A1 (en) Method and apparatus for detecting anomaly of traffic of internet of things device based on automata
CN105743732B (en) Method and system for recording transmission path and distribution condition of local area network files
US20030084340A1 (en) System and method of graphically displaying data for an intrusion protection system
CN101411124A (en) Diagnostic functions in an in-line device
Faisal et al. Modeling Modbus TCP for intrusion detection
US11605009B2 (en) Network device identification
CN112422434A (en) IPFIX message processing method, application thereof and ASIC chip
Goo et al. Framework for precise protocol reverse engineering based on network traces
KR102332727B1 (en) Anomaly detection system using distrubuted storage of traffic of power plant contrl netwrok assets
D'Antonio et al. Flow selection techniques
KR102345152B1 (en) Anomaly detection system using reliability evaluation of power plant contro network asset
CN114553546A (en) Message capturing method and device based on network application
Schumacher Anomaly detection models for cloud-edge intrusion detection in customer networks

Legal Events

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