KR101545687B1 - packet analysis apparatus based on application - Google Patents
packet analysis apparatus based on application Download PDFInfo
- Publication number
- KR101545687B1 KR101545687B1 KR1020140050682A KR20140050682A KR101545687B1 KR 101545687 B1 KR101545687 B1 KR 101545687B1 KR 1020140050682 A KR1020140050682 A KR 1020140050682A KR 20140050682 A KR20140050682 A KR 20140050682A KR 101545687 B1 KR101545687 B1 KR 101545687B1
- Authority
- KR
- South Korea
- Prior art keywords
- packet
- application
- module
- information
- hash
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/04—Processing captured monitoring data, e.g. for logfile generation
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Mining & Analysis (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
Description
본 발명은 패킷 분석 장치에 관한 것으로서, 상세하게는 프로그램 개발 시 또는 개발 후 실행 환경에서 특정 어플리케이션이 비정상 동작할 경우 정확한 원인을 찾지 못할 경우 해당 어플리케이션에 대하여 송/수신 패킷을 모니터링하여 네트워크의 문제인지 또는 프로그램의 내부의 문제인지에 대한 원인 분석을 할 수 있게 한 어플리케이션기반 패킷 분석 장치에 관한 것이다.The present invention relates to a packet analyzing apparatus and, more particularly, to a packet analyzing apparatus, more particularly, to a packet analyzing apparatus, more particularly, Or an internal problem of the program, which is a problem in the application-based packet analysis apparatus.
보다 상세하게는 PC 및 스마트패드(Smart Pad), 스마트폰(Smart Phone) 또는 가정용 월패드와 같은 스마트 디바이스(Smart Device) 안에서 프로그램을 구동하여 실행되고 있는 어플리케이션 단위로 UDP 및 TCP 송/수신 패킷을 모니터링하여 오류의 원인이 네트워크의 문제인지 또는 프로그램의 내부의 문제인지에 대한 원인 분석을 할 수 있게 한 어플리케이션기반 패킷 분석 장치에 관한 것이다.
More specifically, UDP and TCP transmission / reception packets are transmitted in a unit of application that is executed by running a program in a smart device such as a PC, a smart pad, a smart phone, or a household wall pad The present invention relates to an application-based packet analyzing apparatus capable of performing a cause analysis of whether a cause of an error is a network problem or an internal problem of a program.
패킷분석(Packet analysis)란 네트워크상에서는 발생할 수 있는 다양한 에러를 해결하기 위해 네트워크상에 흐르는 실제 데이터를 수집하고 해석하는 것으로서, 네트워크 특징을 파악하고 네트워크를 누가 사용하고 있으며, 무엇이 대역폭을 많이 차지하는지, 네트워크 사용 피크 타임이 언제인지 공격의 가능성이나 악의적인 활동 등을 알아내고 비정상적인 애플리케이션을 찾는 수단으로 사용되고 있다. Packet analysis is the process of collecting and analyzing the actual data flowing on the network to solve various errors that may occur in the network. It analyzes the network characteristics, identifies who is using the network, Network usage Peak time is used as a means of identifying when an attack is likely or malicious activity and looking for unusual applications.
즉, 유무선 환경에서 돌아다니는 패킷을 캡처하여 분석하여, 서버에 장애가 발생했을 때 패킷을 모니터링하여 서버의 문제인지 또는 클라이언트나 네트워크의 원인인지 문제에 대해 파악할 수 있다. In other words, by capturing and analyzing packets traveling in a wired / wireless environment, packets can be monitored when a server fails and the problem of whether the server is a problem or the cause of a client or a network can be identified.
이러한 패킷 분석은 서버 장애 시 장애분석 및 처리, 서버/클라이언트의 동작 원리 분석, 네트워크 장비 개발 시 가능성 점검, 네트워크 통화량 모니터링을 통한 보안 강화 등에 사용된다. This packet analysis is used for failure analysis and processing in the case of server failure, analysis of the operation principle of the server / client, checking of possibility when developing network equipment, and security enhancement by monitoring network call volume.
이러한 패킷 분석 장치나 방법으로는 특허문헌 1 및 2를 포함하여 다양한 기술이 개발되어 있다.Various techniques have been developed for such packet analyzing apparatuses and methods, including
특허문헌 1은 지그비 프로토콜에 따라 무선으로 전송되는 신호에서 패킷을 캡춰한 후 분석하여 사용자의 요구에 따라 표시해주는 지그비 패킷 분석장치에 관한 것이고, 특허문헌 2는 실제 IP망 내부에서 발생하는 다양한 현상들을 고려함으로써 IP망의 성능 파라메터인 점대점 패킷 지연과 패킷 손실을 보다 효율적으로 산출할 수 있도록 해주는 시스템에 관한 것이다.
이러한 다양한 패킷 분석 장치 등 중 일 예로 와이어샤크(wireshark)의 경우, 특정 인터네페이스(interface)에 대한 TCP, UDP 및 기타 프로토콜에 대하여 송/수신 패킷 모니터링이 가능하고, IP주소(ip address) 및 포트(port) 필터링 기능까지 지원한다. In the case of wireshark such as various packet analyzing apparatuses, it is possible to perform transmission / reception packet monitoring for TCP, UDP and other protocols for a specific Internet interface, (port) filtering function.
그러나 이들 분석 도구는 특정 어플리케이션을 지정한 후 해당 어플리케이션에 대한 패킷에 대한 모니터링에는 한계가 있다. However, these analytical tools have limitations in monitoring packets for specific applications after they are specified.
예를 들면 'appA'라는 어플리케이션이 로컬 PC 에서 TCP 클라이언트(Client)로 동작하면서 원격 PC IP주소 192.168.1.101 의 서버(Server) 프로그램과 TCP통신을 하고, 마찬가지로 'appB'라는 어플리케이션이 로컬 PC 에서 TCP클러이언트 로 동작하면서 원격 PC IP주소 192.168.1.101의 서버프로그램과 TCP통신을 한다고 했을 때, 사용자가 로컬 PC에서 와이어샤크를 구동 후 필터링 기능에 원격 IP주소192.168.1.101을 지정 후 패킷을 분석하면, 'appA'와 'appB'가 원격 PC IP주소 192.168.1.101와 송/수신하는 패킷이 모니터링 된다. For example, an application called 'appA' operates as a TCP client on the local PC, and performs TCP communication with the server program of the remote PC IP address 192.168.1.101. Likewise, an application called 'appB' When the user operates the wire shark on the local PC and analyzes the packet after designating the remote IP address 192.168.1.101 as the filtering function, when the user performs the TCP communication with the server program of the remote PC IP address 192.168.1.101 while operating as a client, Packets sent and received by 'appA' and 'appB' with remote PC IP address 192.168.1.101 are monitored.
그러나 사용자가 'appA' 에 해당하는 패킷만 보고자 하지만 'appB' 패킷이 동시에 분석됨으로 이어 하나의 패킷을 분리하여 보는데 문제가 있다.
However, when the user wants to see only the packet corresponding to 'appA', but the 'appB' packet is analyzed at the same time, there is a problem in seeing one packet separately.
본 발명은 상기와 같은 종래기술의 문제점을 해결하기 위해 개발된 것으로서, IP주소 필터링 기능은 물론 어플리케이션 단위로 필터링을 지원하여 복수의 어플리케이션이 하나의 IP주소로 전송되어도 원하는 어플리케이션만을 분리하여 분석할 수 있는 어플리케이션기반 패킷 분석 장치을 제공하는 것을 목적으로 한다. The present invention has been developed to solve the problems of the related art as described above, and it is an object of the present invention to provide an IP address filtering function and a filtering function for each application, so that even when a plurality of applications are transmitted to one IP address, And to provide an application-based packet analyzing apparatus.
즉, 본 발명은 기존의 IP주소 또는 포트 기반 패킷 분석 기술에서 복수의 어플리케이션이 통신할 때 어느 하나의 어플리케이션 패킷만을 분석하지 못하는 단점을 해결하기 위하여 어플리케이션 별로 패킷을 분석할 수 있게 하여 프로그램 개발 시 특정 어플리케이션에 대한 네트워크 송/수신 데이터의 디버깅 및 개발 완료 후 운용 환경에서 실시간 패킷 분석 도구로 네트워크 데이터의 추이 및 불법적인 데이터를 모니터링할 수 있게 한 어플리케이션기반 패킷 분석 장치을 제공하는 것을 목적으로 한다.
That is, according to the present invention, when a plurality of applications communicate in an existing IP address or port-based packet analysis technology, it is impossible to analyze only one application packet, It is an object of the present invention to provide an application-based packet analyzing apparatus capable of monitoring network data trend and illegal data with a real-time packet analyzing tool in an operating environment after debugging and development of network transmission / reception data for an application.
이러한 목적을 이루기 위한 본 발명에 따른 어플리케이션기반 패킷 분석 장치는 GU; 상기 GUI에서 설정한 어플리케이션 정보와 하기 패킷수집(40)에서 수집한 패킷정보를 매핑시키는 어플리케이션정보처리모듈; 상기 GUI에서 설정한 어플리케이션에 대한 프로세스 정보를 관리하는 데이터관리모듈; 어플리케이션 패킷 정보를 수집하는 패킷수집모듈; 및 상기 패킷수집모듈에서 수집된 어플리케이션 패킷과 GUI에서 설정한 값을 참조하여 어플리케이션 별로 패킷을 분석하는 패킷분석모듈로 이루어진 것을 특징으로 한다.In order to achieve the above object, an application-based packet analyzing apparatus according to the present invention comprises: GU; An application information processing module for mapping the application information set by the GUI and the packet information collected by the
상기 GUI는 상기 패킷수집모듈에서 수집할 패킷 정보를 설정하는 패킷수집설정부와, 상기 패킷분석모듈에서 분석된 결과를 출력하는 분석결과표시부로 이루어질 수 있다. The GUI may comprise a packet collection setting unit for setting packet information to be collected by the packet collection module, and an analysis result display unit for outputting a result analyzed by the packet analysis module.
상기 어플리케이션정보처리모듈은 어플리케이션의 프로세스 ID, 프로토콜 형태, 포트번호를 업데이트하는 Ns스래드와, 어플리케이션의 프로세스 ID 프로세스 이름을 업데이트하는 Ps스레드로 이루어질 수 있고, 상기 데이터관리모듈은 어플리케이션의 프로세스 ID, 프로토콜 형태, 포트번호를 관리하는 NS해시와, 어플리케이션의 프로세스 ID 및 이름을 관리하는 Ps해시를 포함하는 어플리케이션해시; 사용자가 설정한 어플레케이션 이름과 소스(source) 및 목적지IP주소(destination ip address), 포트 번호 및 프로토콜 필터링 정보를 관리하는 운용관리해시로 이루어질 수 있다. The application information processing module may include an Ns thread for updating a process ID, a protocol type, and a port number of an application, and a Ps thread for updating a process ID process name of the application. The data management module includes a process ID, An NS hash that manages the protocol type and port number, and a Ps hash that manages the process ID and name of the application; It can be composed of the application name, source and destination IP address, port number, and protocol filtering information set by the user.
또한, 패킷수집모듈은 사용자가 설정한 인터페이스 이름으로 네트워크 데이터 송/수신을 할 수 있도록 오픈(open)된 인터페이스 카드에 대하여 네트워크 송/수신 데이터가 있을 경우 송/수신 패킷을 가로챈 후 그 내용을 패킷분석모듈에 전달하는 패킷리시버를 구비하고, 상기 패킷분석모듈은 패킷수집모듈로부터 받은 네트워크 송/수신 데이터를 파싱하여 패킷에 해당하는 어플리케이션을 찾아 분석하는 패킷파싱모듈과; 상기 데이터관리모듈에 필터링 조건이 설정되었을 경우 패킷수집모듈의 패킷 데이터와 비교하여 데이터를 걸러내는 패킷필터링모듈; 및 상기 GUI의 출력 포멧을 생성하는 출력포멧생성모듈을 구비하고 있다.
In addition, the packet collection module intercepts the transmission / reception packet when there is network transmission / reception data to the opened interface card so that network data can be transmitted / received by the interface name set by the user, A packet parsing module for parsing network transmission / reception data received from the packet collection module to find and analyze an application corresponding to the packet; A packet filtering module for comparing the packet data with the packet data of the packet collection module when the filtering condition is set in the data management module; And an output format generation module for generating an output format of the GUI.
상기와 같은 본 발명에 따른 어플리케이션기반 패킷 분석 장치는 패킷을 어플리케이션 단위로 세분화하여 패킷 감시를 할 수 있도록 구성하여 단위 별로 필터링을 적용할 수 있으므로 기존 분석도구와 비교했을 때 패킷 모니터링 및 분석이 용이해지는 효과가 있다.The above-described application-based packet analyzing apparatus according to the present invention can classify the packets into application units and perform packet monitoring so that filtering can be applied for each unit, so that packet monitoring and analysis are facilitated It is effective.
즉, 본 발명은 어플리케이션 장애시 장애분석 및 처리, 서버/클라이언트의 동작 원리 분석, 네트워크 장비 개발 시점이나 운영 시점에서 이용할 수 있는데, 기존의 분석 방법에 비해 쉽게 네트워크를 분석할 수 있고, 패킷 분석의 단위를 특정 어플리케이션으로 좁힐 수 있으므로 데이터 분석 시간을 단축하고, 원하는 어플리케이션만을 분석할 수 있는 효과가 있다.
That is, the present invention can be used at the time of application failure analysis and processing, server / client operation principle analysis, network equipment development, and operation time. Since the unit can be narrowed down to a specific application, the data analysis time can be shortened and the desired application can be analyzed.
도 1은 본 발명에 따른 어플리케이션기반 패킷 분석 장치를 구비한 통신망의 개념도
도 2는 발명에 따른 어플리케이션기반 패킷 분석 장치를 구성하는 소프트웨어의 구성도
도 3은 발명에 따른 어플리케이션기반 패킷 분석 장치를 구성하는 GUI의 패킷수집 설정 GUI 예시도
도 4는 발명에 따른 어플리케이션기반 패킷 분석 장치에서 관리하는 자료구조도
도 5는 발명에 따른 어플리케이션기반 패킷 분석 장치에서 패킷에 대한 데이터 포멧
도 6은 분석결과의 일예의 화면1 is a conceptual diagram of a communication network having an application-based packet analyzing apparatus according to the present invention.
2 is a block diagram of software constituting an application-based packet analyzing apparatus according to the invention
FIG. 3 is an example of a packet collection setting GUI of a GUI constituting an application-based packet analyzing apparatus according to the invention
4 is a data structure diagram managed by the application-based packet analyzing apparatus according to the present invention.
FIG. 5 is a diagram illustrating a data format of a packet in an application-
6 shows an example of the analysis result screen
이하 본 발명에 따른 어플리케이션기반 패킷 분석 장치를 첨부된 도면을 참조하여 상세하게 설명한다. Hereinafter, an application-based packet analyzing apparatus according to the present invention will be described in detail with reference to the accompanying drawings.
본 발명은 다양한 변경을 가할 수 있고 여러 가지 실시예를 가질 수 있는 바, 특정 실시예들을 도면에 예시하고 상세한 설명에 상세하게 설명하고자 한다. 그러나 이는 본 발명을 특정한 실시 형태에 대해 한정하려는 것이 아니며, 본 발명의 사상 및 기술 범위에 포함되는 모든 변경, 균등물 내지 대체물을 포함하는 것으로 이해되어야 한다.While the invention is susceptible to various modifications and alternative forms, specific embodiments thereof are shown by way of example in the drawings and will herein be described in detail. It is to be understood, however, that the invention is not to be limited to the specific embodiments, but includes all modifications, equivalents, and alternatives falling within the spirit and scope of the invention.
각 도면을 설명하면서 유사한 참조부호를 유사한 구성요소에 대해 사용하였다. 본 발명을 설명함에 있어서 관련된 공지 기술에 대한 구체적인 설명이 본 발명의 요지를 흐릴 수 있다고 판단되는 경우 그 상세한 설명을 생략한다.
Like reference numerals are used for like elements in describing each drawing. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, the present invention will be described in detail with reference to the accompanying drawings.
본 발명은 네트워크의 분석을 보다 쉽게 할수 있다. The present invention makes it easier to analyze the network.
이러한 본 발명에 따른 어플리케이션기반 패킷 분석 장치는 소프트웨어 즉 프로그램으로 만들어진 것으로 물리적인 장치는 아니지만 이하에서 수단이나, 모듈로 표현하여 설명한다. The application-based packet analyzing apparatus according to the present invention is made of software, that is, a program, and is not a physical apparatus, but will be described below as means or modules.
본 발명에 따른 어플리케이션기반 패킷 분석 장치는 도 1에 도시한 바와 같인 네크워크 상에서 사용될 수 있고, 도 2에 도시한 바와 같이, GUI(10); 상기 GUI에서 설정한 어플리케이션 정보와 하기 패킷수집(40)에서 수집한 패킷정보를 매핑시키는 어플리케이션정보처리모듈(20); 상기 GUI에서 설정한 어플리케이션에 대한 프로세스 정보를 관리하는 데이터관리모듈(30); 어플리케이션 패킷 정보를 수집하는 패킷수집모듈(40); 및 상기 패킷수집모듈에서 수집된 어플리케이션 패킷과 GUI에서 설정한 값을 참조하여 어플리케이션 별로 패킷을 분석하는 패킷분석모듈(50)로 이루어진다.The application-based packet analyzing apparatus according to the present invention can be used on a network as shown in FIG. 1, and includes a
이러한 본 발명은 상기 GUI(10)에서 설정한 패킷 수집 정보에 의하여 상기 어플리케이션정보처리모듈(20)이 GUI에서 설정한 어플리케이션에 대한 프로세스정보를 데이터관리모듈(30)에 의해 정보를 구축하여 패킷수집모듈(40)이 수집한 데이터를 패킷분석모듈(50)이 GUI(10)에서 설정한 값을 참조하여 어플리케이션 별로 패킷을 분석한다. According to the present invention, the
이러한 본 발명의 어플리케이션기반 패킷 분석 장치는 프로그램 개발 시, 특정 어플리케이션(프로그램)에 대한 네트워크 송/수신 데이터의 디버깅, 및 개발 완료 후 운용 환경에서 실시간 패킷 분석 도구로 네트워크 데이터의 추이 및 불법적인 데이터를 모니터링 하는 목적으로 이용될 수 있으며, 운용 환경으로는 PC 및 기타 스마트디바이스(Smart Device)에 이상이 생길 경우, 본 발명 프로그램을 이용하여 문제 해결의 도구로 이용될 수 있으며 정상적인 상태일지라도 허가되지(불명확한) 않은 어플리케이션에 의하여 네트워크를 통하여 데이터 송/수신이 이루어지고 있는지 모니터링할 수 있다.The application-based packet analyzing apparatus of the present invention is capable of debugging network transmission / reception data for a specific application (program) at the time of program development, and for analyzing trends of network data and illegal data And can be used for monitoring purposes. In the case where an abnormality occurs in a PC or other smart device as an operating environment, it can be used as a tool for solving problems by using the program of the present invention, and even if a normal state is not permitted It is possible to monitor whether data is transmitted / received through the network by an application.
도 3은 상기 GUI(10)에서 패킷 수집 정보를 설정하는 화면으로, 수집 대상 어플리케이션의 인터페이스 이름(LAN 카드 이름) 선택과 수집대상 어플리케이션 정보를 설정할 수 있게 구성되어 있다. 어플리케이션 설정은 시스템(Windows or Linux)에 등록된 어플리케이션 이름 리스트를 출력하며, 만일 본 발명에 따라 분석이 이루어지고 있는 도중 중 새로운 어플리케이션이 감지되면, 리스트에 추가하고, 기존에 있던 어플리케이션이 없어질 경우는 그대로 유지하여 데이터를 분석할 수 있게 한다.3 is a screen for setting the packet collection information in the
상기 GUI(10)는 아이콘 또는 윈도 등 그래픽 표시를 기초로 한 조작 환경을 제공한다. 본 발명에 따란 장치에서 GUI(10)는 상기 패킷수집모듈(40)에서 수집할 패킷 정보를 설정하는 패킷수집설정부(10c)와, 상기 패킷분석모듈(50)에서 분석된 결과를 출력하는 분석결과표시부(10r)로 이루어진다. The GUI 10 provides an operating environment based on graphic display such as icons or windows. In the apparatus according to the present invention, the GUI 10 includes a packet
상기 어플리케이션정보처리모듈(20)은 GUI(10)의 패킷수집설정(10c)에서 설정한 어플리케이션 정보와 패킷수집보듈(40)에서 수집한 패킷정보를 매핑시켜주기 위하여 어플리케이션의 프로세스 ID(process id), 프로토콜 형태(protocol type)(UDP 또는 TCP), 프로세스 이름(process name) 정보를 주기적으로 수집 후, 이 값을 상기 데이터관리모듈(30)에 구비된 어플리케이션해시(30a)에 저장하여 패킷분석모듈(50)에서 분석할 때 패킷수집모듈(40)에서 수집한 데이터를 어플리케이션 별로 구별해 주기 위한 정보로 이용된다. The application
상기 어플리케이션정보처리모듈(20)은 어플리케이션의 프로세스 ID, 프로토콜 형태, 포트번호를 업데이트하는 Ns스래드(20n)와, 어플리케이션의 프로세스 ID 프로세스 이름을 업데이트하는 Ps스레드(20p)로 이루어질 수 있다. The application
상기 데이터관리모듈(30)은 각종 데이터를 관리하기 위한 모듈로, 관리되는 데이터항목은 도 4에 도시한 바와 같이, 운용관리해시(30o)는 사용자가 설정한 어플리케이션 이름과 소스(source) 및 목적지IP주소(destination ip address), 포트(port) 번호 및 프로토콜(protocol)(UDP or TCP) 필터링 정보를 관리한다. The
또한 데이터관리모듈(30)은 어플리케이션의 프로세스(process) id, 포트(port) 번호 및 프로토콜 형태(protocol type)를 관리하는 어플리케이션해시(30a)을 구비하고 있으며, 상기 어플리케이션해시(30a)는 프로세스 ID, 프로토콜 형태, 포트번호를 관리하는 NS해시와, 어플리케이션의 프로세스 ID 및 이름을 관리하는 Ps해시를 포함한다. 상기 Ps해시에는 어플리케이션의 프로세스 ID(process id) 및 프로세스(process) 이름이 관리되는데 Ns해시 데이터는 어플리케이션정보처리모듈(20)의 Ns스레드(20n)가 주기적으로 업데이트하고, Ps해시 데이터는 Ps스레드(20p)가 주기적으로 업데이트 한다.The
즉, 상기 어플리케이션정보처리모듈(20)은 어플리케이션의 프로세스 ID, 프로토콜 형태, 포트번호를 업데이트하는 Ns스래드(20n)와, 어플리케이션의 프로세스 ID 프로세스 이름을 업데이트하는 Ps스레드(20p)를 구비하고 있다. That is, the application
상기 패킷수집모듈(40)은 사용자가 설정한 인터페이스 이름으로 네트워크 데이터 송/수신을 할 수 있도록 오픈(open)된 인터페이스 카드에 대하여 네트워크 송/수신 데이터가 있을 경우 송/수신 패킷을 가로챈 후 그 내용을 패킷분석모듈에 전달하는 패킷리시버(40r)를 구비하고 있으며, 패킷의 형태는 도 5에 도시한 바와 같다. The
상기 패킷분석모듈(50)은 패킷수집모듈(40)의 인터페이스오프너(40o)로부터 받은 네트워크 송/수신 데이터를 파싱하여 패킷에 해당하는 어플리케이션을 찾아 분석하는 패킷파싱모듈(50p); 상기 데이터관리모듈에 필터링 조건이 설정되었을 경우 패킷수집모듈의 패킷 데이터와 비교하여 데이터를 걸러내는 패킷필터링모듈(50f); 및 상기 GUI의 출력 포멧을 생성하는 출력포멧생성모듈(50c)을 구비하고 있다. The
즉, 패킷분석모듈(50)은 패킷수집모듈(40)의 패킷리시버(40r)로부터 받은 네트워크 송/수신 데이터를 파싱하여, 이 패킷에 해당하는 어플리케이션을 찾은 후, 분석결과를 GUI의 분석결과표시부(10r)를 통해 데이터 형태로 가공 후 그 결과를 GUI에서 도시할 수 있게 한다. 네트워크 송/수신 데이터가 어느 어플리케이션에 대한 패킷인지 찾기 위해서 패킷리시버(40r)로 받은 패킷에서 도 5에 도시한 소스/목적지IP주소(source/destination ip address), 포트t 번호, 프로토콜과, 도 4에 도시한 데이터관리모듈(30)의 정보를 비교한다. 패킷리시버(40r)에는 어플리케이션 이름 정보가 없기 때문에 비교 잡업을 수행하는 것이며 검색 로직은 다음과 같다.That is, the
1. 현재 오픈되어 있는 인터페이스 이름(LAN 카드)의 IP주소(ip address)를 얻어온다.1. Retrieve the IP address (ip address) of the currently opened interface name (LAN card).
2. 인터페이스의 IP주소와 패킷리시버(40r)의 패킷의 소스IP주소가 동일하면 외부로 송신하는 패킷이다.2. If the IP address of the interface and the source IP address of the packet of the
3. 2와 같지 않으면 외부에서 수신되는 패킷이다. 3. If it is not equal to 2, it is a packet received from the outside.
(인터페이스의 IP주소와 패킷리시버(40r) 패킷의 목적지IP주소가 동일)(The IP address of the interface is the same as the destination IP address of the packet receiver (40r) packet)
4. 외부 송신일 경우 패킷리시버(40r) 패킷의 소으포트번호(source port number)와 Ns해시 관리항목의 포트가 동일하면서 패킷리시버(40r) 패킷의 프로토콜과 Ns해시관리항목의 프로토콜이 동일한 것을 검색한다.4. In case of external transmission, it is checked that the protocol of the
5. 4가 아닌 경우, 패킷리시버(40r) 패킷의 목적지포트번호와 Ns해시 관리항목의 포트가 동일하면서 패킷리시버(40r) 패킷의 프로토콜과 Ns해시 관리항목의 프로토콜이 동일한 것을 검색한다.5.4, it is searched that the protocol of the
6. 검색된 Ns해시 관리항목의 프로세스ID와 Ps해시관리목록의 프로세스ID가 동일한 값을 검색한다.6. Retrieve the process ID of the found Ns hash management entry and the process ID of the Ps hash management list to the same value.
7. 6번에서 검색된 Ps해시 관리항목의 어플리케이션이 패킷리시버(40r) 패킷을 전송 또는 수신해야할 패킷이다.7. It is a packet that the application of the Ps hash management item retrieved in 6 should transmit or receive the packet receiver (40r) packet.
8. 어플리케이션인포(App_Info) 관리항목의 필터 정보를 조회하여 필터링 조건이 걸려 있을 경우 패킷리시버(40r) 패킷 데이터와 비교하여 데이터를 걸러 내며 어플리케이션인포(App_Info) 관리항목의 필터 정보 포멧(format)은 상용 tcpdump의 동일한 포멧을 적용한다.
8. If the filter information of the application information (App_Info) management item is inquired and the filtering condition is applied, the filter information format is filtered by comparing the packet information with the
패킷분석모듈(50)은 위의 7번 과정에서 검색된 어플리케이션 정보와 8번에서 필터링된 패킷리시버(40r) 패킷을 추가하여 GUI에 도시 할 수 있도록 데이터를 GUI(10) 모듈에 전달하면 GUI에서는 수신된 데이터를 분석결과가 화면에 출력한다. 도 6은 분석결과 화면의 일예이다.
The
상기한 바와 같이 본 발명에 따른 어플리케이션기반 패킷 분석 장치는 소프트웨어로 구성되고, 다양하게 변형하여 실시할 수 있으나 그 일예로 리눅스 시스템을 이용한 것으로 도 7에 개념도가 도시되어 있으며, 이를 기준으로 설명한다. As described above, the application-based packet analyzing apparatus according to the present invention is composed of software and can be variously modified and implemented. For example, a conceptual diagram is shown in FIG. 7 using a Linux system.
1. 리눅스 시스템에 외부로부터 들어오는 패킷을 캡처하기 위한 도구 ApplicationPcap을 동작시킨다.1. Run ApplicationPcap, a tool for capturing incoming packets from the Linux system.
ApplicationPcap은 사용자가 원하는 프로그램 별로 패킷을 캡처 및 분석할 수 있다.ApplicationPcap allows you to capture and analyze packets by program you want.
2. ApplicationPcap이 시작되면 외부로부터 들어오는 패킷을 수집한다.2. When ApplicationPcap starts, it collects incoming packets from outside.
수집하는 패킷은 ip address나 port 번호로 필터링이 가능하다.The packets to be collected can be filtered by ip address or port number.
3. 사용자가 패킷 수집을 종료하면 ApplicationPcap은 그 동안 수집된 패킷을 운용자가 설정한 프로그램 별로 별개의 분석 파일로 분리하여 저장한다.3. When the user finishes collecting packets, ApplicationPcap separates collected packets into separate analysis files for each program set by the operator.
4. 운영자는 ApplicationPcap이 수집한 파일을 확인하여 수집된 패킷을 분석한다.4. The operator analyzes the collected packets by checking the files collected by ApplicationPcap.
저장된 파일은 WireShark 및 기타 패킷 분석 도구에서 확인 가능한 표준 포멧으로 되어 있기 때문에 WireShark와 같은 도구로 확인 가능하다.Saved files are available in a standard format that can be verified by WireShark and other packet analysis tools, so they can be found with tools such as WireShark.
본 발명에 따른 어플리케이션기반 패킷 분석 장치를 이루는 소프트웨어의 블록은 도 2에 도시한 바와 같다. 2 is a block diagram illustrating a software block of an application-based packet analysis apparatus according to the present invention.
pkt_collect 블록pkt_collect block
pkt_collect블록은 libpcap이라는 라이브러리를 이용하여 특정 인터페이스 카드로 수신되는 패킷을 수집하는 기능으로 캡처 대상 인터페이스를 open 한 후 특정 ip address 및 UDP 또는 TCP port를 filtering 하여 패킷을 수신한다. 수신된 패킷은 pkt_buf 라는 저장소(memory)에 저장한 후 수집 종료가 이루어 진 시점에서 그 결과를 파싱 하여 각 각 어플리케이션(App_info) 별로 저장 파일을 분리하여 파일로 저장할 수 있게 한다.The pkt_collect block collects packets received by a specific interface card using a library named libpcap. The pkt_collect block opens a capture target interface and receives packets by filtering a specific ip address and UDP or TCP port. The received packet is stored in a memory called pkt_buf, and the result is parsed at the time of completion of collection to separate the storage file for each application (App_info) and save it as a file.
본 프로그램에서 사용하는 패킷 수집 라이브러리 libpcap 의 주요 api는 다음과 같다.
The main api of the packet capture library libpcap used in this program is as follows.
pcap_open_livepcap_open_live
pcap_open_live()는 네트워크의 패킷들을 보기 위해 필요한 packet capture descriptor를 얻기 위해 사용된다. NIC의 promiscuous mode란 자신이 목적지가 아닌 패킷들도 받아들이는 모드를 말한다. promiscuous로 동작하지 않도록 설정해도 라이브러리 내부에서 필요에 의해 일부 promiscuous모드로 동작할 수 있으며 함수 원형은 다음과 같다.pcap_open_live () is used to get the packet capture descriptor needed to view packets on the network. The promiscuous mode of a NIC is a mode in which it accepts packets that are not its destination. Even if it is set to not work as promiscuous, it can operate in some promiscuous mode as needed inside the library. The function prototype is as follows.
pcap_t *pcap_open_live(char *device, int snaplen, int promisc, int to_ms, char *ebuf);pcap_t * pcap_open_live (char * device, int snaplen, int promisc, int to_ms, char * ebuf);
device 사용할 네트워크 디바이스를 지시하는 스트링device A string indicating the network device to use.
snaplen 캡쳐할 최대 bytessnaplen Maximum bytes to capture
promisc NIC가 promiscuous mode로 동작할 지 여부promisc Whether the NIC will operate in promiscuous mode
to_ms millisecond 단위의 read timeoutto_ms read timeout in milliseconds
ebuf pcap_open_live()가 실패할 경우에만 에러 메시지가 저장
ebuf Save error messages only if pcap_open_live () fails
pcap_compilepcap_compile
네트워크를 돌아다니는 모든 패킷이 다 필요할 경우도 있겠지만 그렇지 않을 수도 있다. 예를 들어 자신이 관리하고 있는 웹서버의 트래픽을 분석해보려 할 때 해당 서버의 주소와 포트넘버를 목적지로 하는 패킷 만을 캡쳐해 분석할 필요가 있다. 이처럼 자신이 원하는 패킷만을 뽑는것을 필터링 이라고 하며 다음은 필터링 함수 원형이다.There may or may not be a need for all packets traveling around the network. For example, when analyzing the traffic of a Web server managed by the user, it is necessary to capture and analyze only packets destined to the address and port number of the corresponding server. This way of picking only the packets you want is called filtering, and the following is the filtering function prototype.
int pcap_compile(pcap_t *p, struct bpf_program *fp, char *str, int optimize, bpf_u_int32 netmask);int pcap_compile (pcap_t * p, struct bpf_program * fp, char * str, int optimize, bpf_u_int32 netmask);
p 패킷 캡쳐 descriptorp packet capture descriptor
fp 필터링 룰에 따라 결정될 구조체The structure to be determined according to the fp filtering rule
str 스트링 형태의 필터링 룰Filtering rules in the form of a str string
optimize 결과 코드를 수행할 때 최적화 여부Optimize Whether to optimize when executing result code
netmask 네트워크의 maskmask of netmask network
pcap_compile()을 통해 결정된 bpf_program 구조체를 적용할 때 사용되는 함수 원형은 다음과 같다.The function prototype used when applying the bpf_program structure determined by pcap_compile () is as follows.
int pcap_setfilter(pcap_t *p, struct bpf_program *fp);int pcap_setfilter (pcap_t * p, struct bpf_program * fp);
p 패킷 캡쳐 descriptorp packet capture descriptor
fp pcap_compile()에서 결과 에서 return 된 값
fp The value returned from the result in pcap_compile ()
pcap_next_expcap_next_ex
pcap_open_live와 pcap_compile 거친 후 설정된 descriptor에 packet 이 수신되면 호출되면 함수로 이 api를 이용하여 packet을 캡처 한다. 다음은 함수 원형이다.pcap_open_live and pcap_compile If a packet is received in the set descriptor, it will be used as a function to capture the packet using this API. The following is a function prototype.
int pcap_next_ex(pcap_t *p, struct pcap_pkthdr *h, unsigned char *pp);int pcap_next_ex (pcap_t * p, struct pcap_pkthdr * h, unsigned char * pp);
p 패킷 캡쳐 descriptorp packet capture descriptor
h 패킷의 정보를 가리키고 있는 포인터h Pointer indicating information of the packet
pp packet data 버퍼pp packet data buffer
Config 블록Config block
Config블록은 사용자가 패킷 캡처를 원하는 프로그램(appInfo) 정보를 설정 파일로 관리한 후 설정한 파일을 파싱하여 패킷 수집 종료 후 Ns_Hash 정보(process id, protocol type, port 번호)와 Ps_Hash 정보(process id, protocol type, process 이름)를 참조하여 패킷 분석 결과 파일을 만들 때 각각의 프로그램 별로 별개의 수집 결과 파일로 만들기 위한 관리 기능을 제공한다.The Config block manages the program information (appInfo) that the user wants to capture packets as a configuration file and parses the set file. After completing the packet collection, Ns_Hash information (process id, protocol type, port number) and Ps_Hash information protocol type, and process name) to provide a management function for creating a separate collection result file for each program when creating a packet analysis result file.
프로그램(appInfo) 관리 항목은 다음과 같다.The program (appInfo) management items are as follows.
Process Info 블록Process Info block
Process info 블록은 패킷 수집 결과를 사용자가 설정한 프로그램 별로 패킷 수집 결과 파일을 만들기 위한 목적으로 Ns_Hash 정보(process id, protocol type, port 번호)와 Ps_Hash 정보(process id, protocol type, process 이름)를 주기적으로 update 하는 기능으로 thread로 동작해야 한다.The process info block periodically sends Ns_Hash information (process id, protocol type, port number) and Ps_Hash information (process id, protocol type, and process name) for the purpose of creating a packet collection result file for each program set by the user. This is a function to update to a thread.
Ns_Hash 관리 항목은 다음과 같다.Ns_Hash management items are as follows.
Ns_Hash 관리 항목을 주기적으로 update 하는 절차는 다음과 같다.The procedure for periodically updating the Ns_Hash management item is as follows.
1. update thread 생성1. Create an update thread
2. 현재 실행되고 있는 프로그램(프로세스) 정보 list를 차례로 검색한다.2. Search the currently running program (process) information list in order.
process id, process 이름, protocol type(UDP, TCP), port 번호 process id, process name, protocol type (UDP, TCP), port number
3. 읽어온 프로세스 정보를 Ns_Hash 에 insert or update 한다.3. Insert or update the read process information in Ns_Hash.
Ps_Hash 관리 항목은 다음과 같다.Ps_Hash management items are as follows.
Ps_Hash 관리 항목을 주기적으로 update 하는 절차는 다음과 같다.The process of periodically updating Ps_Hash management items is as follows.
1. update thread 생성1. Create an update thread
2. 현재 실행되고 있는 프로그램(프로세스) 정보 list를 차례로 검색한다.2. Search the currently running program (process) information list in order.
process id, protocol 이름process id, protocol name
3. 읽어온 프로세스 정보를 Ps_Hash 에 insert or update 한다.
3. Insert or update the read process information into Ps_Hash.
pkt_result 블록pkt_result block
pkt_result 블록은 패킷 수집 종료 후 libpcap 라이브러리를 이용하여 수집 저장된 버퍼 pkt_buf를 파싱하여 프로그램 별로 별개의 수집 결과 파일로 만드는 기능을 한다.The pkt_result block parses the collected buffer pkt_buf using the libpcap library after completing the packet collection, and creates a separate collection result file for each program.
다음 그림은 수집된 패캣을 파싱하여 별개의 결과 파일로 저장하는 절차이다.The following figure shows the procedure for parsing collected packets and saving them as separate result files.
1. 수집 패킷 버퍼 pkt_buf 로부터 수신 packet 단위로 읽어온다.1. The packet is read from the collection packet buffer pkt_buf in units of received packets.
2. packet 이 없을 경우 종료한다.2. If there is no packet, terminate.
3. 읽어온 packet의 내용 중 protocol 정보(UDP or TCP)와 port 번호로 Ns_Hash 에서 해당 프로그램(application)이 있나 검색한다. Ns_Hash는 App_Info 참조할 수 있는 정보를 가지고 있다. App_Info는 프로그램의 process pid, packet 수집 결과 저장 파일 정보를 가지고 있다.3. Retrieve whether there is an application in Ns_Hash with protocol information (UDP or TCP) and port number among the contents of the read packet. Ns_Hash has information that can refer to App_Info. App_Info contains the process pid of the program and file information of the packet collection result.
4. Ns_Hash 에서 정보를 찾지 못하면 pkt_buf 에서 다음 수신 packet을 읽어온다. 4. If no information is found in Ns_Hash, the next incoming packet is read from pkt_buf.
5. Ns_Hash 에서 정보를 찾은 경우 해당 프로그램에 대한 결과 파일로 packet을 저장한다. App_Info가 가지고 있는 수집 결과 저장 파일에 packet 저장5. If the information is found in Ns_Hash, store the packet in the result file for the program. Store packet in the collection result file that App_Info has
6. 1번부터 다시 수행한다.
6. Perform from
수집 전체 수행 절차Collective Complete Procedure
다음 그림은 본 소프트웨어의 패킷 수집 전체 수행 절차이다.The following figure shows the overall procedure of packet collection of this software.
1. 사용자는 수집 시작 명령을 내린다. 명령어를 내리기 전에 패킷 수집 설정에 필요한 정보는 cfg.ini 파일에 설정되어 있어야 한다. config.in 정보 - 네트워크 인터페이스, 수집 프로그램(프로세스), 필터링 정보 등1. The user issues an acquisition start command. The information needed to configure the packet collection must be set in the cfg.ini file before the command is issued. config.in information - network interface, collection program (process), filtering information, etc.
2. cfg.ini를 파싱하여 수집 프로세스 정보를 관리한다.2. Manage the collection process information by parsing cfg.ini.
3. 프로세스 정보를 주기적으로 update 하는 thread를 생성한다. 3. Create a thread that periodically updates the process information.
프로세스 id, 프로세스가 열고 있는 port 번호 관리 : Ns_HashProcess id, the port number that the process is opening Manage: Ns_Hash
프로세스 id, 프로세스 이름 관리 : Ps_HashProcess id, process name Management: Ps_Hash
이 정보는 수집종료 후 패킷을 프로세스별로 저장할 때 저장파일 구별을 위한 값으로 사용된다.This information is used as a value for distinguishing the storage file when the packet is stored by process after the end of collection.
4. cfg.ini 에 설정된 정보로 패킷 수집 device를 open 한다. libpcap api 사용4. Open the packet collection device with the information set in cfg.ini. Using libpcap api
5. cfg.ini 에 설정된 정보로 패킷 수집 필터링 기능을 할 수 있게 한다. libpcap api 사용5. It enables packet collection filtering function with the information set in cfg.ini. Using libpcap api
6. device open과 필터링 기능 후 패킷 수신을 하는 thread를 생성한다.6. Create a thread to receive packets after device open and filtering.
7. 패킷을 수신한다. libpcap api 사용7. Receive the packet. Using libpcap api
8. 수집시작 상태인 경우 수신된 패킷을 버퍼에 저장한다.8. If the acquisition start state, store the received packet in the buffer.
9. 수집 종료 시 까지 7 ~ 8번을 계속 수행한다. 단, 패킷 저장 버퍼 size를 초과한 경우 패킷 저장후 자동 종료한다.9. Continue 7 to 8 until collection ends. However, if the size of the packet storage buffer is exceeded, it is automatically terminated after storing the packet.
10. 사용자는 수집종료 명령을 내린다.10. The user issues an end-of-collection command.
11. 패킷 수집 버퍼로부터 패킷을 파싱한다. 패킷 단위별로 파싱11. Parset the packet from the packet collection buffer. Parsing by packet unit
12. 파싱된 정보 중 port 번호로 프로세스 정보를 찾는다. Ns_Hash와 Ps_Hash 정보로부터 search12. Find the process information with the port number of the parsed information. From Ns_Hash and Ps_Hash information search
13. 파싱된 패킷 정보를 해당 프로세스 저장파일에 저장한다. 즉 운영자가 설정한 프로그램별 구분되어 각자의 파일로 패킷을 저장한다.13. Store the parsed packet information in the corresponding process save file. In other words, the packet is stored in each file separately for each program set by the operator.
14. 패킷이 더이상 없을 때까지 11 ~ 13번을 반복 수행한다.
14. Repeat steps 11 through 13 until there are no more packets.
이번 장에서는 주요 class에 대한 member와 function에 대하여 설명한다.
This section describes the members and functions for the main classes.
소프트웨어 구성 주요 ClassSoftware Configuration Key Class
다음은 소프트웨어 디렉토리 구조도이다.The following is a software directory structure diagram.
/iklim/pcap/ 원천 소스 root 디렉토리 / iklim / pcap / source root directory
/iklim/pcap/bin/ 캡처 실행파일 관련 디렉토리로 file은 다음과 같다. / iklim / pcap / bin / The directory for the capture executable file.
pcap : 캡처 실행파일pcap: capture executable
cfg.ini : 캡처 대상 설정 파일cfg.ini: capture target configuration file
vp : process 확인 실행파일vp: process verification executable
ps.dat : pcap 실행 시 자동 생성하는 파일 - process 이름 및 pid 참조ps.dat: file to be automatically created when pcap is executed - reference to process name and pid
ns.dat : pcap 실행 시 자동 생성하는 파일 - process 이름 및 port 번호 참조ns.dat: File to be automatically created when pcap is executed - Refer to process name and port number
/iklim/pcap/bin/data/ 캡처 저장 파일 디렉토리
/ iklim / pcap / bin / data / Capture save file directory
주요 클래스 맴버 변수 및 함수Key class member variables and functions
본 소프트웨어의 main함수로서 패킷 캡처 시작, 종료를 관리하며 주요 맴버 변수는 다음과 같다.The main function of this software is to manage start and end of packet capture. The main member variables are as follows.
Main 주요 멤버 변수Main key member variables
Main의 주요 함수는 다음과 같다.Main functions are as follows.
CApplicationPcapDlg 클래스는 본 Main으로부터 호출되어 패킷 캡처 기능을 수행하며 주요 맴버 변수는 다음과 같다.The CApplicationPcapDlg class is called from this Main to perform the packet capture function. The main member variables are as follows.
CApplicationPcapDlg 클래스의 주요 함수는 다음과 같다.The main functions of the CApplicationPcapDlg class are as follows.
CAppInfo 클래스는 config 설정 정보를 관리하여 수집한 페킷을 파일로 저장하는 기능을 수행하며 주요 맴버 변수는 다음과 같다.The CAppInfo class manages the config configuration information and stores the collected packets in a file. The main member variables are as follows.
CAppInfo 클래스의 주요 함수는 다음과 같다.The main functions of the CAppInfo class are as follows.
CHashMap 클래스는 프로세스 name, pid, port 번호를 hash로 관리하기 위한 template class 기능을 수행한다. CHashMap 클래스의 주요 함수는 다음과 같다.The CHashMap class performs a template class function to manage hash of process name, pid, and port number. The main functions of the CHashMap class are as follows.
CNsHash 클래스는 프로세스 별 사용하는 pid, port 번호를 hash로 관리하는 기능을 수행하며 주요 맴버 변수는 다음과 같다. The CNsHash class manages the pid and port number used by each process with hash. The main member variables are as follows.
CNsHash 클래스의 주요 함수는 다음과 같다.The main functions of the CNsHash class are as follows.
CPsHash 클래스는 프로세스 별 사용하는 pid, process 이름을 hash로 관리하는 기능을 수행하며 주요 맴버 변수는 다음과 같다.The CPsHash class manages the pid and process name used by each process with hash. The main member variables are as follows.
CPsHash 클래스의 주요 함수는 다음과 같다.The main functions of the CPsHash class are as follows.
CNsThread 클래스는 프로세스 별 사용하는 process pid, process 이름을 관리하는 hash를 주기적으로 update 하는 thread로 주요 맴버 변수는 다음과 같다.The CNsThread class is a thread that periodically updates the hash that manages the process pid and process name used by each process. The main member variables are as follows.
CNsThread 클래스의 주요 함수는 다음과 같다.The main functions of the CNsThread class are as follows.
CPsThread 클래스 프로세스 별 process pid, process 이름을 관리하는 hash를 주기적으로 update 하는 thread로 주요 맴버 변수는 다음과 같다.The CPsThread class is a thread that periodically updates hash that manages the process-specific process pid and process name. The main member variables are as follows.
CPsThread 클래스의 주요 함수는 다음과 같다.The main functions of the CPsThread class are as follows.
CPacket 클래스는 libpcap 라이브러리를 사용하여 수집된 packet을 parsing 하기 위해 사용되는 기능으로 주요 맴버 변수는 다음과 같다.The CPacket class is used to parse collected packets using the libpcap library. The main member variables are:
CPacket 클래스의 주요 함수는 다음과 같다.The main functions of the CPacket class are:
CPcapDump 클래스는 libpcap 라이브러리를 사용하여 수집된 packet을 저장하는 기능으로 주요 맴버 변수는 다음과 같다.The CPcapDump class is a function that stores collected packets using the libpcap library. The main member variables are as follows.
CPacket 클래스의 주요 함수는 다음과 같다.The main functions of the CPacket class are:
설정 및 패킷캡처Setup and Packet Capture
본 소프트웨어는 리눅스에서 구현된 것으로 GUI 형식의 사용자 인터페이스는 제공하지 않으며 대신 패킷 캡처를 위한 설정 값을 config 파일에 관리하여 소프트웨어를 구동 시킨다.This software is implemented in Linux and does not provide a GUI-based user interface. Instead, it manages the configuration values for packet capture in a config file to run the software.
디렉토리 구조 및 파일Directory structure and files
다음은 소프트웨어 디렉토리 구조이다. The following is a software directory structure.
/iklim/pcap/ 원천 소스 root 디렉토리 / iklim / pcap / source root directory
/iklim/pcap/bin/ 캡처 실행파일 관련 디렉토리로 file은 다음과 같다. / iklim / pcap / bin / The directory for the capture executable file.
pcap : 캡처 실행파일pcap: capture executable
cfg.ini : 캡처 대상 설정 파일cfg.ini: capture target configuration file
vp : process 확인 실행파일vp: process verification executable
ps.dat : pcap 실행 시 자동 생성하는 파일 - process 이름 및 pid 참조ps.dat: file to be automatically created when pcap is executed - reference to process name and pid
ns.dat : pcap 실행 시 자동 생성하는 파일 - process 이름 및 port 번호 참조ns.dat: File to be automatically created when pcap is executed - Refer to process name and port number
/iklim/pcap/bin/data/ 캡처 저장 파일 디렉토리
/ iklim / pcap / bin / data / Capture save file directory
캡처 대상 config 설정Capture target config settings
패킷 캡처를 위한 값을 cfg.ini 에 interface 이름, 캡처 데이터 maximum size, 캡처filter, 캡처대상 프로그램 실행파일 이름, 서비스 종류를 설정하여 프로그램 구동 시 이 설정 값을 참조할 수 있게 한다.The value for packet capture is set in cfg.ini as interface name, maximum size of capture data, capture filter, name of program execution target file to be captured, and service type, so that this value can be referred to when the program is started.
다음은 캡처 대상 config 설정파일 cfg.ini에 대한 설정예이다.The following is an example of the configuration for the capture target config file cfg.ini.
interface-nameinterface-name
캡처 대상의 패킷 캡처 인터페이스 입력Capture interface to capture packets to capture
interface-name 설정 참조See interface-name configuration
buffer-sizebuffer-size
캡처 buffer size : size 초과 시 캡처정보 파일로 자동 저장 후 종료Capture buffer size: Automatically save and exit as capture information file when size is exceeded
filterfilter
필터링 입력 : UDP / TCP ip 및 port 필터링 정보 설정Filtering input: UDP / TCP ip and port filtering information setting
filter 설정 예 참조See filter configuration example
app-nameapp-name
응용프로그램 파일명Application filename
packet 캡처 데이터 & 캡처 파일 이름 생성에 영향을 받음Affected by packet capture data & capture filename generation
app-name 설정 참조See app-name settings
app-typeapp-type
응용프로그램 종류Application type
svc-namesvc-name
서비스 이름Service Name
svc-typesvc-type
서비스 종류Type of service
svc-providersvc-provider
서비스 제공자Service Provider
주의 : 설정파일에서 순서상 반드시 맨 마지막에 위치해야 함Caution: Must be placed at the end of the order in the configuration file
위 에서 설정한 항목에서 app-type, svc-name, svc-type, svc-provider는 패킷캡처 데이터에는 영향을 주지 않으며 단지 캡처 파일 이름에만 영항을 받는다.
In the above configuration, app-type, svc-name, svc-type, and svc-provider do not affect packet capture data, but only capture file name.
interface-name 설정Set interface-name
패킷 캡처를 위한 interface 이름을 cfg.ini 파일에 설정하기 위하여 다음과 같이 inserface 이름을 검색하여 참조한다.To set the interface name for packet capture in the cfg.ini file, refer to the inserface name as follows.
ifconfigifconfig -a 실행-a run
검색된 interface 이름(eth0, ..)를 cfg.ini 파일의 interface-name 에 설정한다.Set the detected interface name (eth0, ..) to the interface-name in the cfg.ini file.
filter 설정filter setting
패킷 캡처 시 filtering 기능을 cfg.ini 파일에 다음과 같이 설정하며 filtering 에 대한 규칙은 tcpdump와 동일하므로 자세한 설정법은 tcpdump 를 참조한다.The packet filtering function is set in the cfg.ini file as follows, and the rule for filtering is the same as that of tcpdump, so refer to tcpdump for detailed configuration.
filter=filter =
filtering 미적용filtering not working
filter=port 40001filter =
UDP or TCP port 40001 번만 캡처UDP or
filter=dst port 40001filter =
UDP or TCP destinatioport 40001 번만 캡처UDP or
filter=src port 40001filter =
UDP or TCP source port 40001 번만 캡처UDP or
filter=udp port 40001filter =
UDP port 40001 번만 캡처
filter=host 192.168.1.2filter = host 192.168.1.2
UDP or TCP host ip address 가 192.168.1.2 인 것만 캡처UDP or TCP host only capture IP address 192.168.1.2
filter=port 40001 and host 192.168.1.2filter =
UDP or TCP port 가 40001 이며 host ip address 가 192.168.1.2 인 것만 캡처UDP or TCP port is 40001 and host ip address is 192.168.1.2.
app-name 설정Set app-name
패킷 캡처 시 캡처대상 프로세스 이름을 cfg.ini 파일에 설정하기 위하여 프로세스 이름 검색 프로그램인 vp 라는 프로그램을 이용한다. vp 는 리눅스 상용 shell command 는 아니며 본 프로젝트에서 구현한 사용자 프로그램 이며 소프트웨어 원천 소스 root 의 하위 경로 bin(/iklim/pcap/bin)에 존재하며 프로세스 이름을 알 경우에는 vp 를 사용할 필요는 없다. vp 실행결과는 다름과 같다.To set the capture target process name in the cfg.ini file when capturing a packet, use a process name search program called vp. vp is not a commercial shell command in Linux, it is a user program implemented in this project and exists in the sub-path bin (/ iklim / pcap / bin) of the software source root, and you do not need to use vp if you know the process name. The results of running vp are the same.
vp 실행 디렉토리에서 vp 실행Run vp from the executable directory
./vp./vp
vp 실행 결과 참조 & app-name 설정Refer to vp execution result & app-name setting
검색된 프로세스 이름(urecv, trecv, ..)를 cfg.ini 파일의 app-name 에 설정한다.
Set the retrieved process name (urecv, trecv, ..) to the app-name in the cfg.ini file.
캡처 실행 및 종료Capture execution and termination
cfg.ini 설정작업이 끝나면 프로그램을 실행하여 패킷 캡처를 진행하고 원하는 시점에서 종료를 수행하여 캡처 정보를 파일로 저장한다.
Once the cfg.ini configuration is done, run the program to proceed with the packet capture and exit at the desired point to save the capture information to a file.
프로그램 실행Run the program
실행 방법은 다음과 같다.Here's how it works.
실행파일 경로로 이동Go to executable path
프로그램 원천 소스 root 의 하위 bi디렉토리Sub-bi directory of program source source root
실행파일 구동Run the executable
./pcap./pcap
root 권한으로 실행해야 한다.
It should be run as root.
프로그램 진행 상태 확인Check program progress
pcap을 실행하면 다음과 같이 캡처 상태가 1초 단위로 출력된다.When pcap is executed, the capture state is output in 1 second as follows.
exNameexName
process 이름 (cfg.ini 에서 설정한 app-name)process name (app-name set in cfg.ini)
exCntexCnt
exName의 process 개수Number of processes in exName
프로그램 종료Exit the program
종료 방법은 다음과 같다.The method of termination is as follows.
캡처 파일 저장후 프로그램 종료Save the capture file and exit the program
s 엔터s Enter
아래와 같이 캡처 파일 이름이 출력되므로 해당 디렉토리에 있는 file을 ftp 이용하여 windows로 가져와 Wireshark로 확인한다.As the capture file name is displayed as below, please bring the file in that directory to windows using ftp and check with Wireshark.
캡처 파일 저장없이 프로그램 종료Exit the program without saving the capture file
x 엔터x Enter
캡처 파일을 생성하지 않고 프로그램이 종료된다.The program ends without generating a capture file.
패킷 캡처 확인Confirm Packet Capture
리눅스 에서 패킷 캡처 후 생성된 결과 파일은 Windows 에서 WireShark 를 이용하여 확인한다. 따라서 리눅스로부터 결과 파일을 ftp를 이용하여 windows 로 가져와 확인한다. 도 6은 리눅스에서 생성된 패킷 캡처 결과 파일을 WireShark 에서 확인한 예이다
The result file generated after packet capture on Linux is confirmed by using WireShark in Windows. So, check out the result file from Linux using ftp to windows. Fig. 6 is an example of a packet capture result file generated by Linux from WireShark
[개발 시스템 환경][Development System Environment]
위와 같은 프로그램의 구현하기 위한 시스템 환경은 다양하게 변형하여 실시할 수 있으나 바람직한 소프트웨어 OS환경 및 compile방법에 대하여 설명한다. 본 소프트웨어는 리눅스 환경에서 gcc컴파일러로 개발되었으며 상세 정보는 다음과 같다.
The system environment for implementing the above program can be variously modified, but a preferable software OS environment and a compile method will be described. This software was developed by gcc compiler in Linux environment.
소프트웨어 컴파일 환경Software compilation environment
컴파일 환경Compilation environment
컴파일시 필요한 라이브러리Libraries required for compilation
본 소프트웨어를 컴파일 및 구동하기 위하여는 라이브러리 libpcap 이 설치되어 있어야 하며 만일 설치가 되지 않은 경우라면 라이브러리를 다운받아 설치해야 한다.To compile and run this software, the libpcap library must be installed. If it is not installed, you must download and install the library.
컴파일 절차Compile Procedure
소프트웨어 원천 소스가 위치하는 root 디렉토리로 이동한다.Go to the root directory where the software source is located.
/iklim/pcap : 원천코드를 이곳에 설치했다고 가정/ iklim / pcap: Assuming you installed the source code here
makefile를 실행하여 compile을 한다.Run the makefile to compile.
make clean; makemake clean; make
실행파일 생성 위치Where to create the executable
compile이 성공하면 실행파일이 bi디렉토리에 pcap 실행파일이 생성된다.If the compile succeeds, the executable file pcap is created in the bi directory.
/iklim/pcap/pcap : 실행파일 이름
/ iklim / pcap / pcap: executable name
10: GUI 10c: 패킷수집설정부 10r: 분석결과표시부
20: 어플리케이션정보검색모듈 20n: Ns스래드 20p: Ps스레드
30: 데이터관리모듈 30a: 어플리케이션해시 30o: 운용관리해시
40: 패킷수집모듈 40r: 패킷리시버 40o: 인터페이스오프너
50: 패킷분석모듈 50p: 패킷파싱모듈 50f: 패킷필터링모듈
50c: 출력포멧생성모듈10:
20: Application
30:
40:
50:
50c: output format generation module
Claims (6)
상기 패킷수집모듈은 사용자가 설정한 인터페이스 이름으로 네트워크 데이터 송/수신을 할 수 있도록 오픈(open)된 인터페이스 카드에 대하여 네트워크 송/수신 데이터가 있을 경우 송/수신 패킷을 가로챈 후 그 내용을 패킷분석모듈에 전달하는 패킷리시버(40r)를 구비하되,
상기 패킷리시버(40r)는 어플리케이션 이름 정보가 없기 때문에 비교 잡업을 수행하며, 검색 로직은,
1. 현재 오픈되어 있는 인터페이스 이름(LAN 카드)의 IP주소(ip address)를 얻어오고,
2. 인터페이스의 IP주소와 패킷리시버(40r)의 패킷의 소스IP주소가 동일하면 외부로 송신하는 것으로 인식하고,
3. 2와 같지 않으면 외부에서 수신되는 것으로 인식하며,(인터페이스의 IP주소와 패킷리시버(40r) 패킷의 목적지IP주소가 동일)
4. 외부로부터 송신일 경우 패킷리시버(40r) 패킷의 소스포트번호(source port number)와 Ns해시 관리항목의 포트가 동일하면서 패킷리시버(40r) 패킷의 프로토콜과 Ns해시관리항목의 프로토콜이 동일한 것을 검색하고,
5. 4가 아닌 경우, 패킷리시버(40r) 패킷의 목적지포트번호와 Ns해시 관리항목의 포트가 동일하면서 패킷리시버(40r) 패킷의 프로토콜과 Ns해시 관리항목의 프로토콜이 동일한 것을 검색하며,
6. 검색된 Ns해시 관리항목의 프로세스ID와 Ps해시관리목록의 프로세스ID가 동일한 값을 검색하고,
7. 6번에서 검색된 Ps해시 관리항목의 어플리케이션이 패킷리시버(40r) 패킷을 전송 또는 수신해야할 패킷으로 인식하고,
8. 어플리케이션인포(App_Info) 관리항목의 필터 정보를 조회하여 필터링 조건이 걸려 있을 경우 패킷리시버(40r) 패킷 데이터와 비교하여 데이터를 걸러 내며 어플리케이션인포(App_Info) 관리항목의 필터 정보 포멧(format)은 상용 tcpdump의 동일한 포멧을 적용하는 것을 특징으로 하는 어플리케이션기반 패킷 분석 장치.GUI 10; An application information processing module 20 for mapping the application information set in the GUI and the packet information collected by the packet collection module 40; A data management module 30 for managing process information on an application set in the GUI; A packet collection module (40) for collecting application packet information; And a packet analysis module (50) for analyzing a packet for each application by referring to an application packet collected in the packet collection module and a value set in a GUI, the application based packet analysis device comprising:
The packet collection module intercepts a transmission / reception packet when there is network transmission / reception data to an interface card that is opened so that network data can be transmitted / received at an interface name set by the user, And a packet receiver (40r) for delivering the packet to the analysis module,
The packet receiver 40r performs a comparison job because there is no application name information,
1. Obtain the IP address (ip address) of the currently opened interface name (LAN card)
2. If the IP address of the interface and the source IP address of the packet of the packet receiver 40r are the same,
3. If it is not equal to 2, it recognizes that it is received from the outside (the IP address of the interface is the same as the destination IP address of the packet receiver (40r) packet)
4. When transmitting from outside, it is found that the source port number of the packet receiver 40r packet and the port of the Ns hash management item are the same and the protocol of the packet receiver 40r packet is the same as the protocol of the Ns hash management item and,
5. 4, it is searched that the protocol of the packet receiver 40r packet and the protocol of the Ns hash management item are the same while the port of the destination port number of the packet receiver 40r packet and the port of the Ns hash management item are the same,
6. The process ID of the discovered Ns hash management entry and the process ID of the Ps hash management list are retrieved with the same value,
7. The application of the Ps hash management item retrieved at 6 recognizes the packet receiver 40r packet as a packet to be transmitted or received,
8. If the filter information of the application information (App_Info) management item is inquired and the filtering condition is applied, the filter information format is filtered by comparing the packet information with the packet receiver 40r packet data, and the filter information format of the application information (App_Info) Wherein the same format of the commercial tcpdump is applied.
상기 GUI는 상기 패킷수집모듈에서 수집할 패킷 정보를 설정하는 패킷수집설정부(10c)와, 상기 패킷분석모듈에서 분석된 결과를 출력하는 분석결과표시부(10r)로 이루어진 것을 특징으로 하는 어플리케이션기반 패킷 분석 장치.The method according to claim 1,
Wherein the GUI comprises a packet collection setting unit (10c) for setting packet information to be collected by the packet collection module, and an analysis result display unit (10r) for outputting a result analyzed by the packet analysis module Analysis device.
상기 어플리케이션정보처리모듈은 어플리케이션의 프로세스 ID, 프로토콜 형태, 포트번호를 업데이트하는 Ns스래드(20n)와, 어플리케이션의 프로세스 ID 프로세스 이름을 업데이트하는 Ps스레드(20p)로 이루어진 것을 특징으로 하는 어플리케이션기반 패킷 분석 장치.The method according to claim 1,
Wherein the application information processing module comprises an Ns thread 20n for updating a process ID, a protocol type, and a port number of an application, and a Ps thread 20p for updating a process ID process name of the application. Analysis device.
상기 데이터관리모듈은 어플리케이션의 프로세스 ID, 프로토콜 형태, 포트번호를 관리하는 NS해시와, 어플리케이션의 프로세스 ID 및 이름을 관리하는 Ps해시를 포함하는 어플리케이션해시(30a)와;
사용자가 설정한 어플레케이션 이름과 소스(source) 및 목적지IP주소(destinatioip address), 포트 번호 및 프로토콜 필터링 정보를 관리하는 운용관리해시(30o)로 이루어진 것을 특징으로 하는 어플리케이션기반 패킷 분석 장치.The method according to claim 1,
The data management module includes an application hash function (30a) including an NS hash for managing a process ID, a protocol type, and a port number of an application, and a Ps hash for managing a process ID and name of an application;
And an operation management solution (30o) for managing application name, source and destination IP address, port number, and protocol filtering information set by the user.
상기 패킷분석모듈은 패킷수집모듈로부터 받은 네트워크 송/수신 데이터를 파싱하여 패킷에 해당하는 어플리케이션을 찾아 분석하는 패킷파싱모듈(50p);
상기 데이터관리모듈에 필터링 조건이 설정되었을 경우 패킷수집모듈의 패킷 데이터와 비교하여 데이터를 걸러내는 패킷필터링모듈(50f); 및
상기 GUI의 출력 포멧을 생성하는 출력포멧생성모듈(50c)을 구비한 것을 특징으로 하는 어플리케이션기반 패킷 분석 장치.
The method according to claim 1,
The packet analysis module includes a packet parsing module (50p) for parsing the network transmission / reception data received from the packet collection module to find and analyze an application corresponding to the packet;
A packet filtering module 50f for filtering data by comparing the packet data with packet data of the packet collection module when a filtering condition is set in the data management module; And
And an output format generation module (50c) for generating an output format of the GUI.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020140050682A KR101545687B1 (en) | 2014-04-28 | 2014-04-28 | packet analysis apparatus based on application |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020140050682A KR101545687B1 (en) | 2014-04-28 | 2014-04-28 | packet analysis apparatus based on application |
Publications (1)
Publication Number | Publication Date |
---|---|
KR101545687B1 true KR101545687B1 (en) | 2015-08-20 |
Family
ID=54061441
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
KR1020140050682A KR101545687B1 (en) | 2014-04-28 | 2014-04-28 | packet analysis apparatus based on application |
Country Status (1)
Country | Link |
---|---|
KR (1) | KR101545687B1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20180016685A (en) * | 2016-08-04 | 2018-02-19 | 주식회사 시큐다임 | security monitoring system and method of network for visibility of HTTPS-based connection |
-
2014
- 2014-04-28 KR KR1020140050682A patent/KR101545687B1/en active IP Right Grant
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20180016685A (en) * | 2016-08-04 | 2018-02-19 | 주식회사 시큐다임 | security monitoring system and method of network for visibility of HTTPS-based connection |
KR101865690B1 (en) * | 2016-08-04 | 2018-06-12 | 주식회사 시큐다임 | security monitoring system and method of network for visibility of HTTPS-based connection |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR102095334B1 (en) | Log information generating device and recording medium and log information extraction device and recording medium | |
KR101779327B1 (en) | Method and apparatus for generating fingerprint based on rule | |
CN102387045B (en) | Embedded point to point (P2P) flow monitoring system and method thereof | |
CN107026821A (en) | The processing method and processing device of message | |
CN107426059B (en) | DPI equipment feature library automatic updating method and system, DPI equipment and cloud server | |
KR102328938B1 (en) | Management of log data in electronic systems | |
US10749895B2 (en) | Handling network threats | |
CN109922073A (en) | Network security monitoring device, method and system | |
CN113794605A (en) | Method, system and device for detecting kernel packet loss based on eBPF | |
US20230214229A1 (en) | Multi-tenant java agent instrumentation system | |
CN105007175A (en) | Openflow-based flow depth correlation analysis method and system | |
CN111966465B (en) | Method, system, equipment and medium for modifying host configuration parameters in real time | |
CN109040028B (en) | Industrial control full-flow analysis method and device | |
CN111866030A (en) | Industrial protocol identification device and method of mimicry edge gateway | |
CN107360062B (en) | DPI equipment identification result verification method and system and DPI equipment | |
KR101545687B1 (en) | packet analysis apparatus based on application | |
CN111177715A (en) | Mobile App vulnerability detection method and device | |
CN112491828B (en) | Message analysis method, device, server and storage medium | |
CN105530098B (en) | A kind of agreement fingerprint extraction method and system | |
CN114374838A (en) | Network camera monitoring method, device, equipment and medium | |
JP6063340B2 (en) | Command source specifying device, command source specifying method, and command source specifying program | |
KR101922594B1 (en) | Wire and wireless access point for detecting status by monitoring status information, apparatus for detecting status of wire and wireless access point and method thereof | |
US11777832B2 (en) | Iterative development of protocol parsers | |
CN114390088B (en) | Interaction method and device of EDPS (electronic data transfer protocol) through OPC UA client and OPC UA server | |
CN112769599B (en) | Automatic resource access method, system and readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
GRNT | Written decision to grant | ||
FPAY | Annual fee payment |
Payment date: 20180611 Year of fee payment: 4 |
|
FPAY | Annual fee payment |
Payment date: 20190625 Year of fee payment: 5 |