KR100468372B1 - Apparatus and method for intercepting and detecting network virus using monitoring SMB/CIFS - Google Patents
Apparatus and method for intercepting and detecting network virus using monitoring SMB/CIFS Download PDFInfo
- Publication number
- KR100468372B1 KR100468372B1 KR1020040024522A KR20040024522A KR100468372B1 KR 100468372 B1 KR100468372 B1 KR 100468372B1 KR 1020040024522 A KR1020040024522 A KR 1020040024522A KR 20040024522 A KR20040024522 A KR 20040024522A KR 100468372 B1 KR100468372 B1 KR 100468372B1
- Authority
- KR
- South Korea
- Prior art keywords
- smb
- file
- packet
- virus
- com
- Prior art date
Links
- 241000700605 Viruses Species 0.000 title claims abstract description 88
- 238000000034 method Methods 0.000 title claims abstract description 50
- 238000012544 monitoring process Methods 0.000 title claims abstract description 23
- 230000000903 blocking effect Effects 0.000 claims abstract description 33
- 238000001514 detection method Methods 0.000 claims abstract description 17
- 230000005540 biological transmission Effects 0.000 claims abstract description 9
- 238000007689 inspection Methods 0.000 claims abstract description 8
- 239000000284 extract Substances 0.000 claims description 4
- 230000001394 metastastic effect Effects 0.000 claims 1
- 206010061289 metastatic neoplasm Diseases 0.000 claims 1
- 230000006870 function Effects 0.000 description 18
- 238000010586 diagram Methods 0.000 description 9
- 208000015181 infectious disease Diseases 0.000 description 7
- 238000005516 engineering process Methods 0.000 description 5
- 230000008569 process Effects 0.000 description 5
- 238000001914 filtration Methods 0.000 description 3
- 230000007482 viral spreading Effects 0.000 description 3
- 230000002155 anti-virotic effect Effects 0.000 description 2
- 239000012634 fragment Substances 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000006855 networking Effects 0.000 description 2
- 230000007480 spreading Effects 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 230000009385 viral infection Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 1
- 238000012806 monitoring device Methods 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 238000013519 translation Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/14—Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
- H04L63/1441—Countermeasures against malicious traffic
- H04L63/1466—Active attacks involving interception, injection, modification, spoofing of data unit addresses, e.g. hijacking, packet injection or TCP sequence number attacks
-
- 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/18—Protocol analysers
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/02—Network architectures or network communication protocols for network security for separating internal from external traffic, e.g. firewalls
- H04L63/0227—Filtering policies
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/14—Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
- H04L63/1408—Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic by monitoring network traffic
- H04L63/1416—Event detection, e.g. attack signature detection
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Hardware Design (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
본 발명은 네트워크 상에서 SMB/CIFS 프로토콜을 모니터링 및 분석을 통하여 공유를 통한 네트워크 전이형 바이러스 방화벽 장치 및 그 방법에 관한 것이다.The present invention relates to a network transitive virus firewall device and a method through sharing through monitoring and analyzing the SMB / CIFS protocol on a network.
본 발명에 따르면, 네트워크 패킷을 수집하는 패킷 수집부; 수집된 패킷을 입력받아 파일 입출력(File I/O)이 이루어지는 SMB(Server Message Block, 서버 메시지 블록) 커맨드를 분석하는 SMB/CIFS 프로토콜 분석부; 상기 분석된 데이터를 입력받아 저장하는 내부 파일 경로/스택 저장부; 상기 분석된 데이터를 입력받아 바이러스 감염 여부를 판단하는 바이러스 검사부; 및 바이러스에 감염된 것으로 판단되면, 바이러스를 감염시킨 원격지 정보를 저장하고, 패킷 발송자가 이에 해당하면 패킷 전송을 차단하는 패킷 차단부; 를 포함하는 것을 특징으로 하는 SMB/CIFS 모니터링을 이용한 네트워크 전이형 바이러스 탐지/차단 장치가 제공된다.According to the invention, the packet collecting unit for collecting the network packet; An SMB / CIFS protocol analysis unit configured to receive a collected packet and analyze a SMB (Server Message Block) command in which file input / output (File I / O) is performed; An internal file path / stack storage unit for receiving and storing the analyzed data; A virus inspection unit that receives the analyzed data and determines whether a virus is infected; And a packet blocking unit for storing the remote information that infected the virus if it is determined that the virus has been infected, and blocking the packet transmission if the packet sender corresponds to the virus; Provided is a network transitive virus detection / blocking apparatus using SMB / CIFS monitoring, comprising: a.
Description
본 발명은 SMB/CIFS 모니터링을 이용한 네트워크 전이형 바이러스 탐지/차단 장치 및 그 방법에 관한 것으로서, 특히, 공유를 통한 네트워크 전이형 바이러스의 방화벽 장치 및 그 방법을 제공하기 위한 것이다.The present invention relates to a network transitive virus detection / blocking apparatus using SMB / CIFS monitoring and a method thereof, and more particularly, to provide a network transitive virus firewall apparatus and method through sharing.
종래의 바이러스(Virus) 실시간 감시 기술은 파일 시스템 필터 드라이버(File System Fileter Driver)를 사용하여 파일 시스템의 I/O(Input/Output)를 감시하다가, 파일 오픈(Open) 시, 대상 파일에 대한 바이러스의 감염 여부를 탐지한다. 이때, 바이러스에 감염이 되었다면 바이러스를 치료하고, 파일의 실행을 막아서 바이러스의 실행을 차단하는 방법을 사용한다. 또한, 네트워크를 통하여 유입되는 바이러스는 파일의 핸들(Handle)을 닫을 때 발생하는 I/O 메시지를 조사하여 파일에 대한 바이러스의 감염 여부를 탐지하는 방법을 사용한다.Conventional virus real-time monitoring technology monitors the file system's input / output (I / O) using a file system filer driver. Detects infections At this time, if the virus is infected, the virus is repaired and the execution of the file is blocked by blocking the execution of the virus. In addition, a virus introduced through a network uses a method of detecting an infection of a file by examining an I / O message generated when the handle of a file is closed.
이러한 파일 시스템 필터 드라이버는 마이크로소프트사(Microsoft)의 윈도우즈(Windows)의 커널 모드(Kernel Mode)에서 디바이스 드라이버(Device Driver)로 제작되며, 파일 시스템 디바이스에 IoAttachDevice() API(Application Programming Interface : 응용 프로그래밍 인터페이스)를 사용하여 필터 드라이버로 적용된다. 그리고, 이러한 필터 드라이버는 파일 시스템 디바이스의 모든 I/O를 가로챈 후,가로챈 I/O 중 응용 프로그램에서 CreateFile() API를 호출했을 때 발생하는 파일 생성에 관련된 IRP_MJ_CREATE와 같은 I/O 요청 또는 CloseHandle() API를 호출했을 때 파일의 클로우즈(Close)와 관련된 IRP_MJ_CLOSE와 같은 I/O 요청을 받았을 때, 해당 파일의 바이러스 감염 여부를 탐지한다.The file system filter driver is manufactured as a device driver in Kernel Mode of Microsoft Windows, and the IoAttachDevice () API (Application Programming Interface) is applied to the file system device. Interface is applied as a filter driver. Then, the filter driver intercepts all I / O of the file system device, and then I / O request such as IRP_MJ_CREATE related to file generation that occurs when the application calls the CreateFile () API during the hidden I / O. When calling CloseHandle () API, I / O request such as IRP_MJ_CLOSE related to file close is detected.
위에서 설명한 바와 같은 방법은 Create되고 Close되는 파일에 대한 접근을 실시간으로 탐지할 수 있기 때문에 대부분의 백신 소프트웨어에서는 파일의 바이러스 감염 여부 확인 방법으로 이 기술을 사용하고 있다.Since the method described above can detect the access to the created and closed file in real time, most antivirus software uses this technique to check whether the file is infected with a virus.
백신 소프트웨어 업계에서는 이와 같은 기술을 바이러스 실시간 감시 기술이라 칭하고 있으며, 이와 같은 기술을 탑재한 소프트웨어를 바이러스 실시간 감시기라고 한다. 또한, 네트워크를 통하여 감염되는 바이러스의 경우에도 동일한 방법으로 바이러스 감염 여부를 탐지한다.In the anti-virus software industry, such a technology is called a virus real-time monitoring technology, and the software equipped with such a technology is called a virus real-time monitor. In addition, in the case of a virus that is infected through the network to detect whether the virus is infected in the same way.
그러나, 상술한 종래의 바이러스 실시간 감시기는 파일 시스템 기반으로 이루어져 있기 때문에 네트워크를 통해서 감염되는 바이러스의 경우, 항상 파일 시스템의 I/O가 끝나는 시점에서 바이러스의 감염 유무를 탐지하게 된다. 그리고, 바이러스 실시간 감시기는 네트워크를 통해서 감염되는 바이러스에 대해서는 탐지가 가능하지만, 감염 후 탐지라는 한계를 가지고 있다. 또한, 무엇보다도 파일 시스템 기반이기 때문에 네트워크 상에서 공유를 통해서 전파되는 바이러스의 경우에는 바이러스를 감염시킨 원격지 컴퓨터의 맥 어드레스(MAC Address), IP 주소 또는 NetBIOS 이름 같은 정보를 알 수 없는 한계를 가지고 있다.However, since the virus real-time monitoring device described above is based on the file system, the virus that is infected through the network always detects the presence or absence of the virus at the time when the I / O of the file system ends. In addition, the virus real-time monitor can detect a virus that is infected through the network, but has a limitation of detection after infection. In addition, since it is file system based above all, a virus spreading through a share on a network has a limitation in that information such as a MAC address, an IP address, or a NetBIOS name of a remote computer that has infected the virus is unknown.
상술한 바와 같은 종래 기술의 한계 때문에 공유 폴더를 공격하는 바이러스가 지속적으로 공격할 경우, 바이러스 실시간 감시기가 있다 하더라도, 감염과 치료가 지속적으로 반복된다. 더욱이, ChiHack과 같은 바이러스는 네트워크의 공유 폴더에 있는 마이크로소프트사의 워드(Word) 파일(*.doc)과 엑셀(Excel) 파일(*.xls)을 감염시켜 파일의 헤더(Header) 부분을 손상시킴으로써, 감염되기 이전으로의 복구를 어렵게 하고 있다.Due to the limitations of the prior art as described above, when a virus attacking a shared folder continuously attacks, even if there is a virus real-time monitor, infection and treatment are continuously repeated. Moreover, viruses such as ChiHack can infect Microsoft's Word files (* .doc) and Excel files (* .xls) in shared folders on the network and corrupt the header of the file. This makes it difficult to recover from infection.
또한, 최근에는 네트워크를 통해서 전파되는 바이러스의 수가 급격히 증가하고 있고, 파일/프린터 공유 기능 자체를 사용하지 않는다면, 이와 같은 네트워크를 통하여 전파되는 바이러스의 감염을 막을 수는 있지만, 파일/프린터 공유 기능의 편리성을 사용할 수가 없게 된다.Also, in recent years, the number of viruses spreading through the network is rapidly increasing, and if the file / print sharing function itself is not used, the infection of the virus spreading through the network can be prevented. Convenience will not be available.
한편, 개인용 방화벽(Personal Firewall)에서는 파일/프린터 공유 차단 정채를 사용함으로써, 특정 사용자만 파일/프린터 공유를 사용할 수 있도록 정책(Policy)을 사용할 수 있지만, 이 경우에도 신뢰할 수 있는 사용자를 통하여 감염되는 바이러스의 차단은 불가능하기 때문에, 감염과 치료를 반복하는 문제점이 있다.On the other hand, in Personal Firewall, by using file / print sharing blocking policy, policy can be used so that only specific users can use file / print sharing, but even in this case, Since blocking the virus is impossible, there is a problem of repeating infection and treatment.
상기와 같은 종래 기술의 문제점을 해결하기 위한 본 발명의 목적은 공유를 통한 네트워크 전이형 바이러스를 탐지/차단하기 위하여 SMB/CIFS 모니터링을 이용하는 기술을 제공하기 위한 것이다.An object of the present invention for solving the problems of the prior art as described above is to provide a technique using SMB / CIFS monitoring to detect / block network transitive virus through sharing.
도 1은 본 발명에 이용되는 마이크로소프트사의 윈도우즈 운영 체제의 모드 구분 블록도이고,1 is a mode classification block diagram of a Microsoft Windows operating system used in the present invention,
도 2는 본 발명에 이용되는 SMB/CIFS 프로토콜이 전송되는 방법을 개략적으로 설명한 개념도이고,2 is a conceptual diagram schematically illustrating a method of transmitting the SMB / CIFS protocol used in the present invention,
도 3은 본 발명의 일 실시예에 따른 네트워크 전이형 바이러스 탐지 및 차단 시스템의 전체 구조를 보여주는 구성도이고,3 is a block diagram showing the overall structure of a network transitive virus detection and blocking system according to an embodiment of the present invention,
도 4는 도 3에 도시된 패킷 차단부(310)에서의 동작을 나타낸 흐름도이고,4 is a flowchart illustrating an operation of the packet blocking unit 310 illustrated in FIG. 3.
도 5는 도 3에 도시된 SMB/CIFS 프로토콜 분석부(335)에서의 파일 송수신 과정을 설명한 개념도이고,5 is a conceptual diagram illustrating a file transmission and reception process by the SMB / CIFS protocol analyzer 335 shown in FIG. 3,
도 6은 도 3에 도시된 SMB/CIFS 프로토콜 분석부(335)에서의 동작 절차를 보여 주는 흐름도이고,6 is a flowchart illustrating an operation procedure of the SMB / CIFS protocol analyzer 335 illustrated in FIG. 3.
도 7은 도 3에 도시된 바이러스 검사부(340)에서의 수행 과정을 나타낸 흐름도이다.7 is a flowchart illustrating a process performed by the virus checker 340 shown in FIG. 3.
상기한 목적을 달성하기 위하여 본 발명에 따르면, 네트워크 패킷을 수집하는 패킷 수집부; 상기 패킷 수집부로부터 수집된 패킷을 입력받아 파일 입출력(File I/O)이 이루어지는 SMB(Server Message Block, 서버 메시지 블록) 커맨드를 분석하는 SMB/CIFS 프로토콜 분석부; 상기 SMB/CIFS 프로토콜 분석부에서 분석된 데이터를 입력받아 저장하는 내부 파일 경로/스택 저장부; 상기 SMB/CIFS 프로토콜 분석부에서 분석된 데이터 및 상기 내부 파일 경로/스택 저장부에 저장된 데이터를 입력받아 바이러스 감염 여부를 판단하는 바이러스 검사부; 및 상기 바이러스 검사부에서의 판단 결과, 바이러스에 감염된 것으로 판단되면, 바이러스를 감염시킨 원격지 정보를 저장하고, 패킷 발송자가 이에 해당하면 패킷 전송을 차단하는 패킷 차단부; 를 포함하는 것을 특징으로 하는 SMB/CIFS 모니터링을 이용한 네트워크 전이형 바이러스 탐지/차단 장치가 제공된다.According to the present invention to achieve the above object, a packet collecting unit for collecting a network packet; An SMB / CIFS protocol analyzer configured to receive a packet collected from the packet collector and analyze a SMB (Server Message Block) command in which file input / output (File I / O) is performed; An internal file path / stack storage unit for receiving and storing data analyzed by the SMB / CIFS protocol analyzer; A virus inspection unit that receives data analyzed by the SMB / CIFS protocol analyzer and data stored in the internal file path / stack storage unit to determine whether a virus is infected; And a packet blocking unit for storing the remote information that infected the virus if it is determined that the virus has been infected, and blocking the packet transmission if the packet sender corresponds to the determined result from the virus inspection unit. Provided is a network transitive virus detection / blocking apparatus using SMB / CIFS monitoring, comprising: a.
또한, 보다 더 양호하게는, 상기 SMB/CIFS 프로토콜 분석부는, 상기 패킷 수집부로부터 입력받은 패킷의 SMB 커맨드 타입이 SMB_COM_CONNECT이면 해당 패킷으로부터 TID(Tree IDentification) 및 파일 경로 정보를 추출하여 상기 내부 파일 경로/스택 저장부에 전송하고; 상기 SMB 커맨드 타입이 SMB_COM_CREATE이면 해당 패킷으로부터 TID와 파일명을 추출하고, 상기 TID와 일치하는 TID를 상기 내부 파일 경로/스택 저장부로부터 검색한 후, 상기 SMB_COM_CONNECT에서 추출한 파일 경로명에 파일명을 결합시켜 파일 절대 경로를 완성하여, 이를 상기 내부 파일 경로/스택 저장부에 저장하고, 파일 경로를 상기 바이러스 검사부에 전송하며; 상기 SMB커맨드 타입이 SMB_COM_WRITE이면 해당 패킷으로부터 TID, FID(File IDentification), 파일 데이터, 파일 데이터 옵셋(Offset) 및 파일 데이터 길이를 추출하고, 상기 TID, FID와 일치하는 TID, FID를 상기 내부 파일 경로/스택 저장부로부터 검색한 후, 일치하는 해당 스택을 구성하여 상기 내부 파일/경로 스택 저장부 및 상기 바이러스 검사부로 전송하고; 상기 SMB 커맨드 타입이 SMB_COM_CLOSE이면 해당 패킷으로부터 TID, FID를 추출하고, 상기 TID, FID와 일치하는 TID, FID를 상기 내부 파일 경로/스택 저장부로부터 검색한 후, 일치하는 파일 경로를 찾아 상기 바이러스 검사부에 전송하는 것을 특징으로 하는 SMB/CIFS 모니터링을 이용한 네트워크 전이형 바이러스 탐지/차단 장치가 제공된다.Further, more preferably, the SMB / CIFS protocol analyzer extracts a tree IDentification (TID) and file path information from the packet when the SMB command type of the packet received from the packet collector is SMB_COM_CONNECT, and the internal file path. Transfer to stack storage; If the SMB command type is SMB_COM_CREATE, the TID and the file name are extracted from the packet, the TID matching the TID is retrieved from the internal file path / stack storage unit, and the file name is combined with the file path name extracted from the SMB_COM_CONNECT to absolute file. Complete a path, store it in the internal file path / stack storage, and send a file path to the virus checker; If the SMB command type is SMB_COM_WRITE, the TID, FID (File IDentification), file data, file data offset and file data length are extracted from the corresponding packet, and the TID and FID corresponding to the TID and FID are stored in the internal file path. / Retrieve from the stack storage unit, configure the corresponding stack to be transmitted to the internal file / path stack storage unit and the virus checker; If the SMB command type is SMB_COM_CLOSE, the TID and the FID are extracted from the corresponding packet, the TID and the FID matching the TID and the FID are searched from the internal file path / stack storage unit, and the corresponding file path is found to find the matching file path. Provided is a network transitive virus detection / blocking device using SMB / CIFS monitoring, characterized in that for transmitting to the network.
이하, 첨부된 도면을 참조하면서 본 발명의 일 실시예에 따른 SMB/CIFS 모니터링을 이용한 네트워크 전이형 바이러스 탐지/차단 장치 및 그 방법을 보다 상세하게 설명하기로 한다.Hereinafter, a network transitive virus detection / blocking apparatus using SMB / CIFS monitoring according to an embodiment of the present invention and a method thereof will be described in detail with reference to the accompanying drawings.
먼저, 본 발명에서 이용하고 있는 백그라운 기술을 간략히 살펴 보도록 한다.First, let's briefly look at the background technology used in the present invention.
도 1은 본 발명에 이용되는 마이크로소프트사의 윈도우즈 운영 체제의 모드 구분 블록도이다.Figure 1 is a block diagram of mode division of the Microsoft Windows operating system used in the present invention.
도 1을 참조하면, 마이크로소프트사에서 제공하는 윈도우즈 엑스피는 커널 모드(110)와 유저 모드(User Mode, 150)로 나누어지는데, 커널 모드에서는 운영 체제 커널과 각종 디바이스 드라이버가 구동되고, 유저 모드에서는 주로 어플리케이션(Application)이 구동된다. 그리고, 커널 모드에서 동작을 하는 프로그램들은 디바이스 드라이버의 형태로 존재한다.Referring to FIG. 1, the Windows XP provided by Microsoft is divided into a kernel mode 110 and a user mode 150. In the kernel mode, an operating system kernel and various device drivers are driven. The application is mainly driven. In addition, programs that run in kernel mode exist in the form of device drivers.
마이크로소프트사의 윈도우즈 운영 체제의 커널 모드 네트워크 구조는 윈도우즈 소켓(Socket)의 커널 부분인 AFD(afd.sys), NDIS(네트워크 드라이버 인터페이스 명세 : Network Driver Interface Specification) 및 TDI(전송 드라이버 인터페이스 명세 : Transport Driver Interface)로 구성된다.The kernel-mode network architecture of Microsoft's Windows operating system includes AFD (afd.sys), NDIS (Network Driver Interface Specification), and TDI (Transport Driver Interface Specification), which are kernel parts of Windows Sockets. Interface).
커널 모드에서 최상위 계층에 존재하는 afd.sys는 윈도우즈 소켓에서 유저 모드의 최하위 계층의 DLL(동적 연결 라이브러리 : Dynamic Link Library)인 msafd.dll과 통신을 하고, 아래 계층의 TDI와 인터페이스를 이루게 된다.In kernel mode, afd.sys, which resides at the top level, communicates with msafd.dll, the lowest-level DLL in the user mode (Windows Dynamic Link Library) on Windows Sockets, and interfaces with TDI at the bottom level.
TDI는 프로토콜 스택(Stack)의 상위에 존재하는 커널 모드 인터페이스를 정의한다. NDIS는 NIC 디바이스 드라이버(Network Interface Card Device Driver)들을 위하여 표준 인터페이스를 제공한다.TDI defines a kernel mode interface that resides on top of the protocol stack. NDIS provides a standard interface for NIC device drivers (Network Interface Card Device Drivers).
마이크로소프트사의 윈도우즈 운영 체제의 유저 모드에서 패킷을 모니터링하거나 방화벽을 만드는 방법을 간단하게 설명한다.This article outlines how to create a firewall or monitor packets in user mode on Microsoft's Windows operating system.
후킹(Hooking)이란 후킹하려는 함수의 원본 주소를 저장하고, 자신이 생성한 함수의 주소로 교체한 후, 자신의 함수를 먼저 실행하도록 함으로써, 추후 후킹된 원본 함수를 실행하게 하는 널리 알려진 프로그래밍 기법이다.Hooking is a well-known programming technique that saves the original address of the function to be hooked, replaces it with the address of the function it created, and then executes its own function first to execute the original hooked function later. .
방화벽에서 패킷을 차단하는 방법은 일반적으로 패킷 수신시, 후킹한 원본 함수를 호출하지 않거나, 패킷 수신이 실패하였다는 적절한 상태값으로 원본 함수를 호출함으로써, 또는, 패킷의 내용을 조작함으로써, 정상적인 수신이 이루어지지않게 하는 방법을 사용한다. 패킷을 허용하는 경우에는 원본 함수를 그대로 호출함으로써, 정상적인 수신이 이루어지는 방법을 사용한다. 이러한 방법에는 유저 모드에서의 방화벽 생성 방법과 커널 모드에서의 방화벽 생성 방법이 있는데, 이를 설명하면, 다음과 같다.Firewalls typically block packets at the time of packet reception, either by not calling the hooked original function, by calling the original function with the appropriate status that the packet failed to be received, or by manipulating the contents of the packet. Use a method to prevent this from happening. If the packet is allowed, the normal function is used by calling the original function as it is. These methods include creating a firewall in user mode and creating a firewall in kernel mode.
먼저, 유저 모드에서의 방화벽 생성 방법을 살펴 본다.First, let's look at how to create a firewall in user mode.
* LSP(winsock Layered Service Provider) : 이 방법은 마이크로소프트사에서 제공하는 방법으로서, QOS(Quality Of Service), URL 필터링 및 데이터 스트림(Data Stream)의 암호화에 많이 사용되는 마이크로소프트 네트워킹에 존재하는 컴포넌트인 SPI(Service Provider Interface)를 기반으로 한다.* Winsock Layered Service Provider (LSP): This method is provided by Microsoft, and is a component of Microsoft networking that is widely used for quality of service (QOS), URL filtering, and encryption of data streams. Based on the Service Provider Interface (SPI).
* 윈도우즈 2000 패킷 필터링 인터페이스(Windows 2000 Packet Filtering Interface) : 윈도우즈 2000의 유저 모드에서 응용 프로그램이 아이피 주소 및 포트 정보를 기반으로 패킷을 허용/차단할 수 있도록 필터 디스크립터(Filter Descrypter)를 설치하는 방법을 기반으로 한다.* Windows 2000 Packet Filtering Interface: Based on how to install Filter Descrypter to allow / block packets based on IP address and port information in Windows 2000 user mode. It is done.
* Winsock DLL 교체 : 마이크로소프트사의 윈도우즈 운영 체제의 Winsock DLL을 사용자가 만든 DLL로 교체하여 필터링하는 기법을 기반으로 한다.* Winsock DLL replacement: It is based on the filtering method by replacing Winsock DLL of Microsoft Windows operating system with user-created DLL.
* 글로벌 함수 후킹(Global Function Hooking) : 커넥트(Connect), 리슨(Listen), 센드(Send), 리시브(Recv), 센드투(Sendto), 리시브 프롬(Recvfrom)과 같은 윈도우즈의 소켓 함수들을 후킹하거나 유저 모드의 어플리케이션이 커널 모드의 드라이버와 통신하기 위하여 사용하는 DeviceIoControl() 함수를 후킹하는 기법을 기반으로 한다.Global Function Hooking: Hooks Windows socket functions such as Connect, Listen, Send, Recv, Sendto, and Receive Prompt. It is based on the technique of hooking the DeviceIoControl () function that user-mode applications use to communicate with kernel-mode drivers.
이어서, 마이크로소프트사의 윈도우즈 운영 체제의 커널 모드에서 패킷을 모니터링하거나 방화벽을 만드는 방법을 간단하게 설명한다.The article then briefly explains how to monitor packets or create a firewall in kernel mode on Microsoft's Windows operating system.
* NDIS 패킷 드라이버 : NdisRegisterProtocol 함수를 사용하여 패킷을 송/수신할 수 있는 프로토콜 드라이버를 등록하는 기법을 기반으로 패킷 내용을 수집한다. 마이크로소포트사에서 사용자들에게 제공하는 방법으로서, 일반적인 패킷 모니터링 드라이버들이 이 방법을 사용한다. 그러나, 패킷을 차단할 수 있는 방화벽으로는 사용할 수 없다.* NDIS packet driver: Collects packet contents based on the technique of registering protocol driver that can send / receive packet using NdisRegisterProtocol function. As a method that MicroSopot provides to users, common packet monitoring drivers use this method. However, it cannot be used as a firewall that can block packets.
* 커널 모드 소켓 필터(Kernel Mode Socket Filter) : 유저 모드에서 윈도우즈 소켓의 최하위 계층의 DLL인 msafd.dll이 커널 모드 윈도우즈 소켓인 afd.sys와 통신하는 모든 I/O를 후킹하는 기법을 기반으로 한다.Kernel Mode Socket Filter: Based on the technique that msafd.dll, the lowest level DLL of Windows sockets in user mode, hooks all I / Os that communicate with afd.sys, a kernel mode Windows socket. .
* TDI 필터 드라이버 : tcpip.sys 드라이버(\Device\RawIp, \Device\Udp, \Device\Tcp, \Device\Ip, \Device\MULTICAST)에 의하여 생성된 디바이스에 IoAttackDevice() API를 사용하여 필터 드라이버로 적용하는 방법이다. 또는, tcpip.sys의 드라이버 오브젝트(Driver Object)에 존재하는 디스패치 테이블(Dispatch Table)을 바뀌치기하여 모든 I/O를 후킹하는 기법을 기반으로 한다.* TDI filter driver: Filter driver using IoAttackDevice () API to the device created by tcpip.sys driver (\ Device \ RawIp, \ Device \ Udp, \ Device \ Tcp, \ Device \ Ip, \ Device \ MULTICAST) This is how to apply. Alternatively, it is based on the technique of hooking all I / O by changing the dispatch table in the driver object of tcpip.sys.
* NDIS IM(InterMediate) 드라이버 : 마이크로소프트사에서 사용자들에게 제공하는 방법으로서, TCP/IP와 같은 프로토콜 드라이버와 NIC 드라이버 사이에 끼워 넣어 방화벽, NAT(Network Address Translation) 등을 개발하는 기법이다.* NDIS IM (InterMediate) Driver: A method provided by Microsoft to users. It is a technique for developing a firewall, network address translation (NAT), and the like between a NIC driver and a protocol driver such as TCP / IP.
* NDIS 후킹 필터 드라이버 : NDIS 라이브러리의 함수들을 후킹하는 방법으로서, NdisRegisterProtocol, NdisDeregisterProtocol, NdisOpenAdapter, NdisCloseAdapter 및 NdisSend와 같은 함수들을 후킹하거나, 자신의 프로토콜 드라이버를 등록하는 NdisRegisterProtocol 함수를 사용하여 리턴된 NdisProtocolHandle을 기준으로 TCP/IP와 같은 기존의 등록된 프로토콜 드라이버 링크를 찾아 NDIS와 통신하는 프로토콜 드라이버 및 NIC 드라이버의 I/O를 후킹하는 기법을 기반으로 한다.* NDIS hooking filter driver: A method of hooking functions of the NDIS library, based on the NdisProtocolHandle returned by hooking functions such as NdisRegisterProtocol, NdisDeregisterProtocol, NdisOpenAdapter, NdisCloseAdapter, and NdisSend, or NdisRegisterProtocol which registers its protocol driver. It is based on the technique of hooking existing registered protocol driver links such as TCP / IP and I / O of protocol drivers and NIC drivers that communicate with NDIS.
본 발명에서 제시하는 패킷 수집부 및 패킷 차단부는 상술한 커널 모드 소켓 필터, NDIS 패킷 드라이버, TDI 필터 드라이버, NDIS IM 드라이버 및 NDIS 후킹 필터 드라이버 등에서 구현될 수 있으며, 일반적으로 패킷 차단부는 TDI 필터 드라이버, NDIS IM 드라이버 또는 NDIS 후킹 필터 드라이버에서 구현되고, 패킷 수집부는 NDIS 패킷 드라이버에서 구현된다.The packet collecting unit and the packet blocking unit proposed by the present invention may be implemented in the kernel mode socket filter, the NDIS packet driver, the TDI filter driver, the NDIS IM driver, the NDIS hooking filter driver, and the like. In general, the packet blocking unit may include a TDI filter driver, Implemented in the NDIS IM driver or the NDIS hooking filter driver, the packet collector is implemented in the NDIS packet driver.
이어서, 본 발명의 또 다른 배경 기술에 해당하는 네트워크 파일 공유 프로토콜인 SMB/CIFS에 대하여 간략히 살펴 보도록 한다.Next, the SMB / CIFS network file sharing protocol corresponding to another background of the present invention will be briefly described.
SMB(Server Message Block, 서버 메시지 블록)는 마이크로소프트사, 아이비엠 및 인텔 등에서 공동으로 개발한 프로토콜로서, 네트워크 상에서 다른 시스템의 파일이나 프린터 등을 공유할 수 있도록 하기 위하여 사용하는 프로토콜이다. 이는 유닉스(Unix)의 네트워크 공유 프로토콜인 NFS(Network File System)와 같은 긴능을 수행한다. SMB는 클라이언트/서버 모델을 이용하는 바, 클라이언트는 서버에 파일 억세스나 프린팅 요청을 보내고, 서버는 이 요청을 받아들여 응답을 하게 된다.SMB (Server Message Block) is a protocol developed jointly by Microsoft, IBM, and Intel, and is used to share files or printers of other systems on a network. It performs the same power as Unix's network sharing protocol, NFS (Network File System). SMB uses a client / server model, which sends a file access or print request to the server, which accepts the request and responds.
CIFS(Common Inernet File System, 일반 인터넷 파일 시스템)는 인터넷을 위한 SMB 파일 공유 프로토콜의 확장된 버젼이다. SMB 프로토콜 위에 DNS(Domain Name Service)를 이용한 확장성, 느린 전화 접속 네트워킹을 위한 최적화, 유니 코드를 따르는 파일 이름 지원을 추가함으로써, 윈도우와 유닉스 환경을 동시에 지원하는 인터넷의 표준 파일 규약이다. 또한, CIFS는 네트워크 컴퓨터들 사이에서 정보를 전송하기 위하여 사용되는 다양한 명령들을 정의한다. 한가지 중요한 사실은 이전의 폐쇄적인 SMB 프로토콜과는 달리 CIFS 규약 정의에 여러 유닉스 업체들이 참여했다는 사실이다. 마이크로소프트사에서는 윈도우즈 2000부터 표준 파일 공유 프로토콜로 SMB를 버젼업시킨 CIFS 1.0 프로토콜을 지원하고 있다.CIFS (Common Inernet File System) is an extended version of the SMB file sharing protocol for the Internet. It is the Internet's standard file protocol that supports both Windows and Unix environments by adding scalability using Domain Name Service (DNS) over the SMB protocol, optimizations for slow dial-up networking, and support for Unicode-compliant file names. In addition, CIFS defines various commands used to transfer information between network computers. One important fact is that, unlike the previous closed SMB protocol, several UNIX vendors participated in the definition of the CIFS protocol. Microsoft has supported the CIFS 1.0 protocol, a version of SMB that has been upgraded to the standard file sharing protocol since Windows 2000.
마이크로소프트사의 윈도우즈 2000의 리다이렉터(Redirector)는 사용자가 네트워크 리소스를 마치 자신의 컴퓨터에 연결된 리소스처럼 사용할 수 있도록 해 주는 역할을 담당한다. 리다이렉터는 또한 로컬 컴퓨터의 프로토콜 스택에 요청을 하기 위해서 CIFS를 사용할 수도 있다. CIFS를 지원하는 플랫폼으로는 마이크로소프트사의 윈도우즈 95/98/ME/NT/2000/XP, OS/2 랜 매니저, 랜 매니저 포 유닉스(LAN Manager For UNIX), 윈도우즈 포 워크그룹(Windows For Workgroups), 유닉스, VMS, 매킨토쉬, 아이비엠사의 랜 서버(IBM LAN Server), DEC사의 패쓰웍스(DEC Pathworks), 쓰리콤(3Com)사의 3+OPEN 등이 있다.Microsoft's Windows 2000 redirector allows users to use network resources as if they were connected to their computers. The redirector can also use CIFS to make requests to the local computer's protocol stack. Platforms that support CIFS include Microsoft's Windows 95/98 / ME / NT / 2000 / XP, OS / 2 LAN Manager, LAN Manager For UNIX, Windows For Workgroups, Unix, VMS, Macintosh, IBM LAN Server from IBM, DEC Pathworks from 3C, and 3 + OPEN from 3Com.
도 2는 본 발명에 이용되는 SMB/CIFS 프로토콜이 전송되는 방법을 개략적으로 설명한 개념도로서, 이를 상세히 설명하면, 다음과 같다.2 is a conceptual diagram schematically illustrating a method of transmitting the SMB / CIFS protocol used in the present invention, which will be described in detail as follows.
SMB/CIFS(200)는 넷바이오스(NetBIOS, 210)와 TCP/IP(220)를 경유하는 NBT(NetBIOS Over TCP/IP)를 통하여 전송되며, 또한, 넷바이오스(210)와 IPX(Internetwork Packet, eXchange, 망간 패킷 전송, 230)를 경유하는 NBIPX(NetBIOS Over IPX)를 통하여 전송될 수 있다. 한편, NetBEUI(NetBIOS Extended User Interface, 넷바이오스 확장 유저 인터페이스, 240)를 경유하여 NBT(NetBIOS Frame)를 통하여 직접 전송될 수도 있고, TCP/IP(250)를 경유하여 직접 전송될 수도 있다. 이와 같은 SMB/CIFS 모니터링을 위해서는 패킷 수준에서의 모든 분석이 가능해야 한다.SMB / CIFS (200) is transmitted via NetBIOS Over TCP / IP (NBT) via NetBIOS (NetBIOS, 210) and TCP / IP 220, and also, NetBIOS 210 and IPX (Internetwork Packet, eXchange, network packet transmission, and via NBIPX (NetBIOS Over IPX) via 230. On the other hand, it may be directly transmitted through NBT (NetBIOS Frame) via NetBEOS (NetBIOS Extended User Interface, NetBIOS Extended User Interface, 240), may be directly transmitted via TCP / IP (250). Such SMB / CIFS monitoring requires full analysis at the packet level.
본 발명에서 제시하는 SMB/CIFS 프로토콜 분석부는 SMB/CIFS에서의 전송 방법에 대한 패킷 수준에서의 모든 분석을 포함한다.The SMB / CIFS protocol analysis unit proposed in the present invention includes all analysis at the packet level for the transmission method in SMB / CIFS.
도 3은 본 발명의 일 실시예에 따른 네트워크 전이형 바이러스 탐지 및 차단 시스템의 전체 구조를 보여주는 구성도로서, 이를 상세히 설명하면, 다음과 같다.3 is a block diagram showing the overall structure of a network transitive virus detection and blocking system according to an embodiment of the present invention.
패킷 수집부(330)는 네트워크 패킷을 수집한 후, 수집된 패킷들을 SMB/CIFS 프로토콜 분석부(335)로 전송한다. 상기 SMB/CIFS 프로토콜 분석부(335)는 수집된 패킷들을 분석하여 파일 I/O가 이루어지는 SMB 커맨드(Command)를 분석하여 분석된 데이터를 내부 파dlf 경로/스택 저장부(345)에 저장한 후, 바이러스 검사부(340)에 전송한다.After collecting the network packet, the packet collector 330 transmits the collected packets to the SMB / CIFS protocol analyzer 335. The SMB / CIFS protocol analyzer 335 analyzes the collected packets, analyzes an SMB command in which file I / O is performed, and stores the analyzed data in an internal file path / stack storage unit 345. The virus scan unit 340 transmits the data.
상기 바이러스 검사부(340)는 상기 SMB/CIFS 프로토콜 분석부(335)에서 전송받은 데이터와 상기 내부 파일 경로/스택 저장부(345)에 저장된 데이터를 바이러스데이터베이스(DB, 350)를 참조하여 바이러스 감염 여부를 확인한다. 확인 결과, 바이러스에 감염되었다면, 바이러스를 감염시킨 원격지 정보를 내부 차단 목록 저장부(325)에 저장한다. 이후, 패킷 차단부(310)는 패킷이 수신되었을 때, 패킷의 발송자가 상기 내부 차단 목록 저장부(325)에 저장된 리스트에 포함되어 있으면, 패킷을 차단하고, 그러하지 아니하면 패킷 전송을 허용한다.The virus inspection unit 340 refers to the virus database (DB, 350) by using the data transmitted from the SMB / CIFS protocol analyzer 335 and the data stored in the internal file path / stack storage unit 345 to determine whether a virus is infected. Check. As a result of the check, if the virus is infected, the remote infected information is stored in the internal block list storage unit 325. Thereafter, when the packet is received, the packet blocking unit 310 blocks the packet if the sender of the packet is included in the list stored in the internal block list storage unit 325, and if not, the packet blocking unit 310 allows the packet transmission.
한편, 상기 패킷 수집부(330)는 패킷을 수집하기 위하여 일반적으로 널리 사용되는 유저 모드에서의 네트워크 패킷 모니터링을 하는 방법 또는 커널 모드에서의 네트워크 패킷 모니터링을 하는 방법을 사용하여 패킷을 수집한다.Meanwhile, the packet collecting unit 330 collects packets using a network packet monitoring method in a user mode or a network packet monitoring method in a kernel mode which are generally used to collect packets.
도 4는 도 3에 도시된 패킷 차단부(310)에서의 동작을 나타낸 흐름도로서, 이를 상세히 설명하면, 다음과 같다.4 is a flowchart illustrating an operation of the packet blocking unit 310 shown in FIG. 3, which will be described in detail as follows.
먼저, 스텝 S401에서, 상기 패킷 차단부(310)는 수신된 패킷을 전송받았을 때, 수신된 패킷으로부터 발신자의 맥 주소(MAC Address)와 아이피 주소(IP Address) 정보를 추출한다. 이어서, 스텝 S402에서, 상시 스텝 S401에서 추출된 맥 주소와 아이피 주소가 상기 내부 차단 목록 저장부(325)에 저장되어 있는 리스트에 포함되어 있는지를 비교하여, 포함되어 있으면, 스텝 S405에서, 해당 패킷을 차단하고, 포함되어 있지 아니하면, 해당 패킷을 허용한다.First, in step S401, when receiving the received packet, the packet blocker 310 extracts the MAC address and IP address information of the sender from the received packet. Subsequently, in step S402, the MAC address extracted in step S401 and the IP address are compared or not included in the list stored in the internal block list storage unit 325. Block, and if not included, allow the packet.
한편, 패킷을 차단하는 방법은 상술한 바와 같이, 후킹한 원본 함수를 호출하지 않거나, 패킷 수신이 실패하였다는 적절한 상태값으로 원본 함수를 호출하는 방법을 사용한다. 또는, 패킷의 내용을 조작함으로써, 정상적인 수신이 이루어지지 않게 하는 방법을 사용할 수도 있다. 그리고, 일치하는 정보가 없다면, 패킷을 허용하기 위하여 원본 함수를 그대로 호출함으로써, 정상적인 수신이 이루어지게 한다.On the other hand, as described above, the packet blocking method does not call the hooked original function or calls the original function with an appropriate state value indicating that packet reception has failed. Alternatively, a method of manipulating the contents of a packet to prevent normal reception can be used. If there is no matching information, the original function is called as it is to allow the packet, so that normal reception is made.
도 5는 도 3에 도시된 SMB/CIFS 프로토콜 분석부(335)에서의 파일 송수신 과정을 설명한 개념도로서, 이를 상세히 설명하면, 다음과 같다.FIG. 5 is a conceptual diagram illustrating a file transmission and reception process in the SMB / CIFS protocol analyzer 335 illustrated in FIG. 3.
먼저, 관련된 명령어들에 대한 개략적인 의미를 살펴 보면, 다음과 같다.First, the general meaning of related commands is as follows.
SMB_COM_TREE_CONNECT 명령은 서버와 클라이언트간에 파일 송수신을 하기 위하여 호출되는 명령으로서, 둘 사이의 연결이 일단 성공하면, 더 이상 이 호출은 발생하지 않는다.The SMB_COM_TREE_CONNECT command is called to send and receive files between the server and the client. Once the connection between the two is successful, the call no longer occurs.
또한, SMB_COM_CREATE 명령은 파일 쓰기를 원할 때 클라이언트가 서버에게 Create나 Open을 요청하는 메시지이다.Also, SMB_COM_CREATE command is a message that a client requests Create or Open to the server when it wants to write a file.
또한, SMB_COM_WRITE 명령은 상기 SMB_COM_CREATE 명령이 정상적으로 받아들여지면 파일 쓰기를 위한 직접적인 요청 메시지이다. 이때, 파일이 패킷 사이즈보다 작을 경우에는 Write 요청시에 데이터가 모두 포함되지만, 클 경우에는 파일들이 조각되어 전송된다. 이 조각들은 다시 Write 요청시와 같은 헤더를 포함하지 않고 하위 레이어에서 바로 처리되어 버린다. 예를 들어, NBT의 경우 Write 요청 후의 나머지 데이터들은 SMB 헤더를 포함하지 아니한 TCP 헤더만 가지고 데이터가 전송되는 것이다. 이 데이터의 순서는 TCP 헤더의 시퀀스 넘버(Sequence Number)가 관리한다.In addition, the SMB_COM_WRITE command is a direct request message for writing a file when the SMB_COM_CREATE command is normally accepted. At this time, if the file is smaller than the packet size, all data is included in the write request, but if the file is large, the files are fragmented and transmitted. These fragments are processed directly in the lower layer without including the same headers as the write request again. For example, in the case of NBT, the remaining data after the write request is transmitted only with a TCP header that does not include the SMB header. The order of this data is managed by the sequence number of the TCP header.
또한, SMB_COM_CLOSE 명령은 파일 쓰기가 끝난 후 파일을 Close하는 요청이다.Also, the SMB_COM_CLOSE command is a request to close the file after writing the file.
또한, SMB_COM_TREE_DISCONNECT 명령은 연결 종료를 원할 때 호출되는 요청이다.Also, the SMB_COM_TREE_DISCONNECT command is a request that is called when a connection is terminated.
동작을 상세히 설명하면, 다음과 같다.The operation is described in detail as follows.
클라이언트에서 SMB_COM_TREE_CONNECT(500)로 서버에 연결 요청 패킷을 전송할 때, 해당 패킷 내부에는 서비스에 대한 경로, 패스워드 및 서비스 이름이 포함된다. 이 요청이 있으면, 서버는 TID(Tree IDentification)를 클라이언트에게 알려준다. 이 TID는 클라이언트와 서버 사이에서의 나머지 연결에 대한 고유 번호이다. 한편, SMB_COM_TREE_CONNECT(500) 요청은 파일을 송수신할 때마다 발생하지 않고, 연결이 되면, 더 이상 발생하지 않는다.When a client sends a connection request packet to the server by SMB_COM_TREE_CONNECT 500, the packet includes a path, a password, and a service name for the service. If this request is made, the server informs the client of the Tree IDentification (TID). This TID is a unique number for the rest of the connection between the client and server. On the other hand, the SMB_COM_TREE_CONNECT (500) request does not occur every time a file is transmitted or received, and when a connection is established, it no longer occurs.
클라이언트는 파일 쓰기를 원할 때, 서버에게 SMB_COM_CREATE(501) 요청을 보낸다. 여기에 포함되는 정보는 SMB_COM_TREE_CONNECT(501)에서 얻어 온 TID, 파일명 및 속성 등이다. 이 파일명과 SMB_COM_TREE_CONNECT(501)에서 넘어 온 경로명이 합쳐져서 파일의 경로(절대 경로)가 완성된다. 이 파일 경로는 상기 바이러스 검사부(340)에서 바이러스 감염 여부를 검사할 때 사용된다. 그리고, 서버는 파일 생성을 정상적으로 수행하게 되면, FID(File IDentification)를 보낸다.When a client wants to write a file, it sends an SMB_COM_CREATE 501 request to the server. Information included here is a TID, a file name, an attribute, and the like obtained from SMB_COM_TREE_CONNECT 501. The file name and the path name from SMB_COM_TREE_CONNECT 501 are combined to complete the file path (absolute path). This file path is used when the virus checker 340 checks for a virus infection. When the server performs file generation normally, the server sends a file identification (FID).
SMB_COM_CREATE(501) 요청이 정상적으로 받아 들여지면, 파일 쓰기를 위하여 SMB_COM_WRITE(502) 요청이 발생한다. 이 SMB_COM_WRITE(502) 요청에는 TID, FID, 파일의 옵셋(Offset) 및 데이터 길이 등이 포함된다. 이러한 파일의 옵셋 및 데이터 길이는 상기 바이러스 검사부(340)에서 바이러스 감염 여부를 검사할 때 사용된다.If the SMB_COM_CREATE 501 request is normally accepted, an SMB_COM_WRITE 502 request occurs for file writing. This SMB_COM_WRITE 502 request includes TID, FID, file offset and data length. The offset and data length of the file are used when the virus checker 340 checks for virus infection.
파일 크기가 패킷 크기보다 작을 경우에는 SMB_COM_WRITE(502) 요청 시에 데이터가 모두 포함되지만, 클 경우에는 파일들이 조각으로 전송된다. 이 조각들은 SMB_COM_WRITE(502) 요청 시와 같은 헤더를 포함하지 않고, 하위 레이어에서 바로 처리된다. 예를 들어 NBT의 경우 SMB_COM_WRITE(502) 요청 후의 나머지 데이터들은 SMB 헤더를 포함하지 않는 TCP 헤더만 가지고 데이터가 전송된다. 이 데이터의 순서는 TCP 헤더의 시퀀스 넘버(Sequence Number)가 관리한다. 서버는 TID와 FID를 기반으로 지정된 파일에 대한 쓰기를 수행하게 된다.If the file size is smaller than the packet size, all data is included in the SMB_COM_WRITE 502 request, but if the file size is large, the files are transmitted in pieces. These fragments do not contain the same headers as the SMB_COM_WRITE 502 request and are processed directly at the lower layer. For example, in the case of NBT, the remaining data after the SMB_COM_WRITE 502 request is transmitted only with a TCP header not including the SMB header. The order of this data is managed by the sequence number of the TCP header. The server will write to the specified file based on the TID and FID.
파일 쓰기가 끝나게 되면, 클라이언트는 SMB_COM_CLOSE(503) 요청을 보낸다. SMB_COM_CLOSE(503)에 포함되는 정보는 TID 및 FID이고, 서버가 정상적으로 파일을 닫으면, 성공(Success) 값을 보낸다. 클라이언트가 연결 종료를 원하면, TID에 대한 SMB_COM_DISCONNECT(503) 요청을 하며, 이 요청이 있으면, 서버는 TID를 해제한다.When the file is finished writing, the client sends a SMB_COM_CLOSE 503 request. Information included in the SMB_COM_CLOSE 503 is TID and FID. When the server normally closes the file, a success value is sent. If the client wants to terminate the connection, a SMB_COM_DISCONNECT 503 request is made for the TID, and if so, the server releases the TID.
도 6은 도 3에 도시된 SMB/CIFS 프로토콜 분석부(335)에서의 동작 절차를 보여 주는 흐름도로서, 이를 상세히 설명하면, 다음과 같다.FIG. 6 is a flowchart illustrating an operation procedure of the SMB / CIFS protocol analyzer 335 illustrated in FIG. 3, which will be described in detail as follows.
먼저, 스텝 S600에서, 상기 패킷 수집부(330)으로부터 전송받은 패킷의 SMB/CIFS 커맨드의 프로토콜을 분석한다.First, in step S600, the protocol of the SMB / CIFS command of the packet received from the packet collector 330 is analyzed.
상기 스텝 S600에서의 분석 결과, SMB_COM_CONNECT 명령이면, 스텝 S602에서, 해당 패킷으로부터 TID 및 경로 정보를 추출하여 상기 내부 파일 경로 및 파일 스택 저장부(345)에 저장한다.As a result of the analysis in step S600, if the command is SMB_COM_CONNECT, in step S602, TID and path information are extracted from the packet and stored in the internal file path and file stack storage 345.
상기 스텝 S600에서의 분석 결과, SMB_COM_CREATE 명령이면, 스텝 S604 내지 스텝 S605에서, 해당 패킷으로부터 TID 및 파일명을 추출하고, TID를 통하여 상기 내부 파일 경로 및 파일 스택 저장부(345)에서 일치하는 TID를 검색한 후, SMB_COM_CONNECT에서 추출한 경로명에 파일명을 첨부함으로써 파일 경로(절대 경로)를 완성한다. 그리고, 이를 상기 내부 파일 경로 및 파일 스택 저장부(345)에 저장한 후, 상기 바이러스 검사부(340)에 전송한다.If the result of the analysis in step S600 is the SMB_COM_CREATE command, in step S604 to step S605, the TID and the file name are extracted from the packet, and the matching TID is searched by the internal file path and the file stack storage unit 345 through the TID. After that, the file path (absolute path) is completed by attaching the file name to the path name extracted from SMB_COM_CONNECT. Then, it is stored in the internal file path and file stack storage 345 and then transmitted to the virus checker 340.
상기 스텝 S600에서의 분석 결과, SMB_COM_WRITE 명령이면, 스텝 S607 내지 스텝 S608에서, 해당 패킷으로부터 TID, FID, 파일 데이터, 파일 데이터 옵셋 및 파일 데이터 길이를 추출하고, TID 및 FID를 통하여 상기 내부 파일 경로 및 파일 스택 저장부(345)에 해당 스택을 구성한다. 이와 같은 파일 스택은 일반적으로 메모리 상에 존재하는 연결 리스트 또는 배열 등으로 구성될 수 있거나, 하드 디스크에 파일로 저장될 수 있다. 이어서, 파일 경로, 파일 데이터, 파일 데이터 옵셋 및 파일 데이터 길이를 상기 바이러스 검사부(340)에 전송한다. 또한, 스택이 완료되면, 완료된 스택을 상기 바이러스 검사부(340)에 전송한다.If the result of the analysis in step S600 is the SMB_COM_WRITE command, in step S607 to step S608, the TID, FID, file data, file data offset and file data length are extracted from the packet, and the internal file path and the TID and FID are extracted. The stack is configured in the file stack storage unit 345. Such a file stack may generally be composed of a linked list or an array existing in memory, or may be stored in a file on a hard disk. Subsequently, a file path, file data, file data offset, and file data length are transmitted to the virus checker 340. In addition, when the stack is completed, the completed stack is transmitted to the virus checker 340.
상기 스텝 S600에서의 판단 결과, SMB_COM_CLOSE 명령이면, 스텝 S610 내지 스텝 S611에서, 해당 패킷으로부터 TID 및 FID를 추출하고, 상기 내부 파일 경로 및 파일 스택 저장부(345)로부터 TID 및 FID에 일치하는 파일 경로를 얻어 온다. 이이서, 얻어온 파일 경로를 상기 바이러스 검사부(340)에 전송한다.If it is determined in the step S600 that the command is SMB_COM_CLOSE, in step S610 to step S611, the TID and the FID are extracted from the packet, and the file path matching the TID and the FID from the internal file path and the file stack storage unit 345 is obtained. To get Next, the obtained file path is transmitted to the virus checker 340.
도 7은 도 3에 도시된 바이러스 검사부(340)에서의 수행 과정을 나타낸 흐름도로서, 이를 상세히 설명하면, 다음과 같다.FIG. 7 is a flowchart illustrating a process performed by the virus inspecting unit 340 shown in FIG. 3.
스텝 S700에서, 상기 바이러스 검사부(340)가 상기 SMB/CIFS 프로토콜 분석부(335)로부터 파일 경로 또는 파일 스택 정보를 입력받으면, 두 가지 프로세스가 진행되는 바, 하나하나를 분설하여 설명한다.In step S700, when the virus checker 340 receives the file path or file stack information from the SMB / CIFS protocol analyzer 335, two processes are performed.
상기 바이러스 검사부(340)가 파일 경로 정보를 입력받으면, 스텝 S701 내지 스텝 S704에서, 해당 파일 경로의 파일이 바이러스에 감영되었는지 여부를 상기 바이러스 데이터베이스(350)로부터 확인한 후, 바이러스에 감염이 된 것으로 확인되면, 상기 내부 파일 경로 및 파일 스택 저장부(345)로부터 해당하는 발신자의 맥 주소 및 아이피 주소 정보를 추출하여 상기 내부 차단 목록 저장부(325)에 저장한다.When the virus inspection unit 340 receives the file path information, in step S701 to step S704, the virus database 350 checks whether the file of the file path has been affected by the virus, and then confirms that the virus has been infected. When the internal file path and file stack storage unit 345 extracts the sender's MAC address and IP address information, the internal block list storage unit 325 is stored.
그리고, 상기 바이러스 검사부(340)가 파일 스택 정보를 입력받으면, 스텝 S705 내지 스텝 S708에서, 해당 파일 스택이 바이러스에 감염되었는지 여부를 상기 바이러스 데이터베이스(350)로부터 확인한 후, 바이러스에 감염이 된 것으로 확인되면, 상기 내부 파일 경로 및 파일 스택 저장부(345)로부터 해당하는 발신자 맥 주소 및 아이피 주소 정보를 추출하여 상기 내부 차단 목록 저장부(325)에 저장한다.When the virus inspection unit 340 receives the file stack information, in step S705 to step S708, after checking whether the file stack is infected with the virus from the virus database 350, it is confirmed that the virus is infected. When the caller MAC address and IP address information of the caller are extracted from the internal file path and the file stack storage 345, they are stored in the internal block list storage 325.
한편, 상기 내부 파일 경로 및 파일 스택 저장부(345)에 저장되는 내용들을 예시적으로 보여 주는 것이 아래의 [표 1]이다.Meanwhile, Table 1 below shows an example of contents stored in the internal file path and the file stack storage 345.
[표 1]TABLE 1
상기 [표 1]에서 파일 경로는 SMB_COM_TREE_CONNECT 시에 수집한 경로와 SMB_COM_CREATE 시에 수집된 파일명으로 생성된 파일 경로이고, 파일 스택은 일반적으로 메모리 상에 존재하는 연결 리스트 또는 배열 등으로 구성될 수 있으며 하드 디스크에 파일로 저장될 수도 있다.In [Table 1], the file path is a file path generated by a path collected at SMB_COM_TREE_CONNECT and a file name collected at SMB_COM_CREATE, and a file stack may generally be composed of a connection list or an array that exists in memory and is hard. It can also be stored as a file on disk.
아래의 [표2]는 상기 내부 차단 목록 저장부(325)에 저장되는 내용들을 예시적으로 보여 주는 도표이다.Table 2 below is a diagram showing the contents stored in the internal block list storage unit 325 by way of example.
[표 2]TABLE 2
위에서 양호한 실시예에 근거하여 이 발명을 설명하였지만, 이러한 실시예는 이 발명을 제한하려는 것이 아니라 예시하려는 것이다. 이 발명이 속하는 분야의 숙련자에게는 이 발명의 기술 사상을 벗어남이 없이 위 실시예에 대한 다양한 변화나 변경 또는 조절이 가능함이 자명할 것이다. 그러므로, 이 발명의 보호 범위는 첨부된 청구 범위에 의해서 한정될 것이며, 위와 같은 변화예나 변경예 또는 조절예를 모두 포함하는 것으로 해석되어야 할 것이다.While the invention has been described above based on the preferred embodiments thereof, these embodiments are intended to illustrate rather than limit the invention. It will be apparent to those skilled in the art that various changes, modifications, or adjustments to the above embodiments can be made without departing from the spirit of the invention. Therefore, the protection scope of the present invention will be limited by the appended claims, and should be construed as including all such changes, modifications or adjustments.
이상과 같이 본 발명에 의하면, 네트워크를 통해서 전파되는 바이러스의 감염을 사전에 막을 수 있고, 특히, 파일/프린터 공유를 통해서 전파되는 바이러스를 감시함으로써, 파일/프린터 공유를 보다 안전하게 사용할 수 있는 효과가 있다.As described above, according to the present invention, the virus can be prevented from spreading through the network in advance, and in particular, by monitoring the virus spreading through file / printer sharing, the effect of using file / printer sharing more securely can be achieved. have.
Claims (9)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020040024522A KR100468372B1 (en) | 2004-04-09 | 2004-04-09 | Apparatus and method for intercepting and detecting network virus using monitoring SMB/CIFS |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020040024522A KR100468372B1 (en) | 2004-04-09 | 2004-04-09 | Apparatus and method for intercepting and detecting network virus using monitoring SMB/CIFS |
Publications (1)
Publication Number | Publication Date |
---|---|
KR100468372B1 true KR100468372B1 (en) | 2005-01-31 |
Family
ID=37224133
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
KR1020040024522A KR100468372B1 (en) | 2004-04-09 | 2004-04-09 | Apparatus and method for intercepting and detecting network virus using monitoring SMB/CIFS |
Country Status (1)
Country | Link |
---|---|
KR (1) | KR100468372B1 (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2018136610A (en) * | 2017-02-20 | 2018-08-30 | 三菱スペース・ソフトウエア株式会社 | File monitoring device and file monitoring program |
CN112100618A (en) * | 2019-06-18 | 2020-12-18 | 深信服科技股份有限公司 | Virus file detection method, system, equipment and computer storage medium |
-
2004
- 2004-04-09 KR KR1020040024522A patent/KR100468372B1/en active IP Right Grant
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2018136610A (en) * | 2017-02-20 | 2018-08-30 | 三菱スペース・ソフトウエア株式会社 | File monitoring device and file monitoring program |
CN112100618A (en) * | 2019-06-18 | 2020-12-18 | 深信服科技股份有限公司 | Virus file detection method, system, equipment and computer storage medium |
CN112100618B (en) * | 2019-06-18 | 2023-12-29 | 深信服科技股份有限公司 | Virus file detection method, system, equipment and computer storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10972432B2 (en) | Flexible network security system and method for permitting trusted process | |
US10148687B2 (en) | Content filtering of remote file-system access protocols | |
US6088803A (en) | System for virus-checking network data during download to a client device | |
JP4734592B2 (en) | Method and system for providing secure access to private network by client redirection | |
EP2659416B1 (en) | Systems and methods for malware detection and scanning | |
US6981279B1 (en) | Method and apparatus for replicating and analyzing worm programs | |
JP4778950B2 (en) | Virus detection and removal equipment for computer networks | |
US7647631B2 (en) | Automated user interaction in application assessment | |
US7636943B2 (en) | Method and system for detecting blocking and removing spyware | |
US20060069692A1 (en) | Electronic computer system secured from unauthorized access to and manipulation of data | |
CN110362994B (en) | Malicious file detection method, device and system | |
US20070276950A1 (en) | Firewall For Dynamically Activated Resources | |
US7966643B2 (en) | Method and system for securing a remote file system | |
EP1122932A2 (en) | Protection of computer networks against malicious content | |
US20070162909A1 (en) | Reserving resources in an operating system | |
US20040252692A1 (en) | Method and apparatus for controlling packet transmission and generating packet billing data on wired and wireless network | |
US7587759B1 (en) | Intrusion prevention for active networked applications | |
KR20190028597A (en) | Matching method of high speed snort rule and yara rule based on fpga | |
KR100468372B1 (en) | Apparatus and method for intercepting and detecting network virus using monitoring SMB/CIFS | |
CA2539470A1 (en) | Systems and methods for dynamically updating software in a protocol gateway | |
Carbone et al. | A mechanism for automatic digital evidence collection on high-interaction honeypots | |
Lin et al. | Designing an integrated architecture for network content security gateways | |
Yang et al. | A method for acquiring network information from Linux memory image in software-defined networking | |
US20060224749A1 (en) | Selective exclusion of LSPs on a per-packet basis | |
Wieslander et al. | Investigating Spyware on the Internet |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A201 | Request for examination | ||
PA0109 | Patent application |
Patent event code: PA01091R01D Comment text: Patent Application Patent event date: 20040409 |
|
PA0201 | Request for examination | ||
A302 | Request for accelerated examination | ||
PA0302 | Request for accelerated examination |
Patent event date: 20041030 Patent event code: PA03022R01D Comment text: Request for Accelerated Examination Patent event date: 20040409 Patent event code: PA03021R01I Comment text: Patent Application |
|
E701 | Decision to grant or registration of patent right | ||
PE0701 | Decision of registration |
Patent event code: PE07011S01D Comment text: Decision to Grant Registration Patent event date: 20041224 |
|
GRNT | Written decision to grant | ||
PR0701 | Registration of establishment |
Comment text: Registration of Establishment Patent event date: 20050118 Patent event code: PR07011E01D |
|
PR1002 | Payment of registration fee |
Payment date: 20050119 End annual number: 3 Start annual number: 1 |
|
PG1601 | Publication of registration | ||
PR1001 | Payment of annual fee |
Payment date: 20080110 Start annual number: 4 End annual number: 4 |
|
PR1001 | Payment of annual fee |
Payment date: 20081231 Start annual number: 5 End annual number: 5 |
|
PR1001 | Payment of annual fee |
Payment date: 20091215 Start annual number: 6 End annual number: 6 |
|
PR1001 | Payment of annual fee |
Payment date: 20101115 Start annual number: 7 End annual number: 7 |
|
PR1001 | Payment of annual fee |
Payment date: 20111115 Start annual number: 8 End annual number: 8 |
|
FPAY | Annual fee payment |
Payment date: 20121115 Year of fee payment: 9 |
|
PR1001 | Payment of annual fee |
Payment date: 20121115 Start annual number: 9 End annual number: 9 |
|
FPAY | Annual fee payment |
Payment date: 20131115 Year of fee payment: 10 |
|
PR1001 | Payment of annual fee |
Payment date: 20131115 Start annual number: 10 End annual number: 10 |
|
FPAY | Annual fee payment |
Payment date: 20141117 Year of fee payment: 11 |
|
PR1001 | Payment of annual fee |
Payment date: 20141117 Start annual number: 11 End annual number: 11 |
|
FPAY | Annual fee payment |
Payment date: 20170116 Year of fee payment: 13 |
|
PR1001 | Payment of annual fee |
Payment date: 20170116 Start annual number: 13 End annual number: 13 |
|
FPAY | Annual fee payment |
Payment date: 20190115 Year of fee payment: 15 |
|
PR1001 | Payment of annual fee |
Payment date: 20190115 Start annual number: 15 End annual number: 15 |
|
FPAY | Annual fee payment |
Payment date: 20200115 Year of fee payment: 16 |
|
PR1001 | Payment of annual fee |
Payment date: 20200115 Start annual number: 16 End annual number: 16 |
|
PR1001 | Payment of annual fee |
Payment date: 20210115 Start annual number: 17 End annual number: 17 |
|
PR1001 | Payment of annual fee |
Payment date: 20220117 Start annual number: 18 End annual number: 18 |
|
PR1001 | Payment of annual fee |
Payment date: 20230116 Start annual number: 19 End annual number: 19 |
|
PC1903 | Unpaid annual fee |
Termination category: Default of registration fee Termination date: 20241029 |