KR20100113802A - System and method for protecting against malicious traffic and from hacking - Google Patents

System and method for protecting against malicious traffic and from hacking Download PDF

Info

Publication number
KR20100113802A
KR20100113802A KR1020090032313A KR20090032313A KR20100113802A KR 20100113802 A KR20100113802 A KR 20100113802A KR 1020090032313 A KR1020090032313 A KR 1020090032313A KR 20090032313 A KR20090032313 A KR 20090032313A KR 20100113802 A KR20100113802 A KR 20100113802A
Authority
KR
South Korea
Prior art keywords
module
communication request
thread
stack
malicious
Prior art date
Application number
KR1020090032313A
Other languages
Korean (ko)
Other versions
KR101053470B1 (en
Inventor
윤성진
박한규
Original Assignee
윤성진
박한규
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 윤성진, 박한규 filed Critical 윤성진
Priority to KR1020090032313A priority Critical patent/KR101053470B1/en
Publication of KR20100113802A publication Critical patent/KR20100113802A/en
Application granted granted Critical
Publication of KR101053470B1 publication Critical patent/KR101053470B1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1441Countermeasures against malicious traffic
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/02Network architectures or network communication protocols for network security for separating internal from external traffic, e.g. firewalls
    • H04L63/0227Filtering policies
    • H04L63/0236Filtering by address, protocol, port number or service, e.g. IP-address or URL
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/30Network architectures or network communication protocols for network security for supporting lawful interception, monitoring or retaining of communications or communication related information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2463/00Additional details relating to network architectures or network communication protocols for network security covered by H04L63/00
    • H04L2463/146Tracing the source of attacks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Technology Law (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

PURPOSE: A system and a method for controlling a harmful traffic and blocking hacking are provided to prevent the unnecessary load resulting from the inspection of all modules within a process space by selectively performing a malicious module inspection for the module actually involved in communication. CONSTITUTION: A communication request monitoring unit(111) monitors a communication request through an operating system using an application program(120), and a thread reading unit(112) reads out an originating thread of the communication request received at the communication request monitoring unit. A module inspection unit(113) selectively inspects the module related to the communication request through the stack reverse tracking of a stack memory of a read thread. According to the inspection result, a communication request processing unit(114) permit or blocks the communication request.

Description

유해 트래픽 제어 및 해킹을 차단하는 장치 및 방법{System and method for protecting against malicious traffic and from hacking}System and method for protecting against malicious traffic and from hacking}

본 발명은 컴퓨터 상에서 운용되는 네트워크 방화벽에 관한 것으로서, 보다 상세하게는 네트워크 통신 요청을 시도한 쓰레드의 스택 메모리를 역추적하는 방법을 이용하여 실제 네트워크 통신에 관여한 모듈(EXE, DLL 등)에 대해 선별적으로 악성 해킹 툴 여부를 검사, 차단하는 장치 및 방법에 관한 것이다.The present invention relates to a network firewall operating on a computer, and more specifically, to select a module (EXE, DLL, etc.) involved in actual network communication by using a method of backtracking a stack memory of a thread that attempted a network communication request. The present invention relates to an apparatus and method for inspecting and blocking a malicious hacking tool.

초고속 인터넷이 널리 보급되면서 현재 대부분의 개인용 컴퓨터는 항상 인터넷에 연결되어 있는 환경을 갖추게 되었으며, 이러한 인터넷을 경유한 악의적인 해커의 직접적인 공격이나 악성코드를 통한 해킹 및 개인 정보 유출을 막기 위해 다양한 보안 대책의 필요성이 대두되었다. 악성코드란 사용자 몰래 유해한 트래픽(DDOS 공격 목적 혹은 스팸 메일 발송 목적 등)을 발생시키고 개인 정보를 유출하여 해킹을 시도하는 등 컴퓨터 사용자의 이익과 의사에 반하여 악의적인 작동을 하는 프로그램을 통칭한다.With the widespread use of high speed internet, most personal computers are always connected to the internet, and various security measures to prevent direct attack by malicious hackers through the internet or hacking through malicious code and leakage of personal information The need has arisen. Malware refers to programs that perform malicious operations contrary to the interests and intentions of computer users, such as generating harmful traffic (such as DDOS attacks or spam mailings) and hacking by leaking personal information.

현재 이러한 위협을 차단하기 위해 가장 널리 사용되는 보안 대책으로는 안티바이러스(백신) 제품이 있다. 그러나 백신은 이미 알려진 악성 코드에 대하여는 방어가 가능하나, 아직 백신 개발업체에 의해 발견되지 않은 해킹 툴에 의한 개인 정보 유출 문제에 대해서는 방어를 할 수 없다는 문제점이 있다.Currently, the most widely used security countermeasures against these threats are antivirus products. However, the vaccine can defend against known malicious code, but it cannot defend against the problem of personal information leakage by the hacking tool that has not yet been discovered by the vaccine developer.

2009년 2월 11일자 중앙일보에 의하면, 2008년 12월 29일에 개인 PC 상에 설치된 악성 해킹 툴에 의해 공인인증서가 해커의 손에 넘어가 은행 계좌에서 1400만원이 무단인출되는 사고가 발생한 사례가 있으며, 2009년 1월 5일에도 악성 해킹툴에 의해 공인인증서 및 키보드 입력을 가로채는 방법으로 하나은행 인터넷 뱅킹을 통해 2100만원이 무단인출되는 사고가 발생한 바 있다.According to JoongAng Ilbo of February 11, 2009, on December 29, 2008, a malicious hacking tool installed on a personal PC caused the unauthorized certificate to fall into the hacker's hands and resulted in the unauthorized withdrawal of 14 million won from the bank account. In addition, on January 5, 2009, an illegal hacking tool intercepted the public certificate and keyboard input.

또한, 2009년 3월 29일자 뉴욕타임즈에 의하면, 중국의 해커가 전세계 103개국의 정부 및 민간기관의 전산망에 침투, 1295대의 컴퓨터에서 문서를 해킹한 사례가 있으며, 이 사건 역시 “고스트넷”이라고 이름붙여진 악성 해킹툴에 의한 정보 유출로 확인된 바 있다. 특히 이 사건에서는 한국의 대사관 컴퓨터에서도 해킹당한 사실이 발견되었다는 점에서 악성 해킹툴에 의한 피해가 심각한 수준임을 알 수 있다.In addition, according to the New York Times, March 29, 2009, a Chinese hacker penetrated the computer networks of governments and private organizations in 103 countries around the world, hacking documents on 1295 computers, and this was also called "ghostnet." Information leaks have been identified by a named malicious hacking tool. In this case, the damage caused by malicious hacking tools was found to be severe because the hacking was found on the computer of the Korean Embassy.

이러한 사례에서 보듯이, 해커가 직접 제작한 해킹 툴과 같이 알려지지 않은 해킹툴의 경우에는 기존의 백신 제품만으로 차단하는 것은 한계가 있으며, 이러한 악성 해킹툴에 의한 정보 유출을 막기 위해서는 네트워크 방화벽 제품을 반드시 함께 사용해야 한다.As shown in these examples, blocking of unknown hacking tools such as hacking tools produced by hackers with existing antivirus products is limited, and network firewall products must be prevented to prevent information leakage by these malicious hacking tools. Must be used together.

초기의 방화벽 제품들은 패킷의 출발지 주소, 포트와 목적지 주소, 포트를 기준으로 트래픽을 필터링하는 방식을 사용하였다. 그러나 이러한 방식은 관리자에 의해 허용된 포트번호를 악용하는 해킹툴에 의한 해킹을 막기 어렵고, 임시 포트 번호(ephemeral port number)를 사용하는 인스턴트 메신저나 P2P 응용 프로그램의 경우는 적용이 어렵다는 문제점이 있다.Early firewall products used to filter traffic based on the packet's source address, port and destination addresses, and ports. However, this method has a problem that it is difficult to prevent hacking by a hacking tool that exploits a port number allowed by an administrator, and it is difficult to apply to an instant messenger or a P2P application that uses an ephemeral port number.

최근의 보다 진보된 형태의 방화벽 제품에서는 네트워크 통신이 허용된 프로그램(EXE) 목록을 지정하는 방식을 이용한다. 이 방식에서는 사용자가 네트워크 통신을 허용할 프로그램 목록을 수동으로 입력하거나, 특정 프로그램이 통신을 시도하려고 할 때 허용 여부를 사용자에게 질의함으로써 허용 프로그램 목록에 새로운 프로그램을 추가시키는 방법을 사용한다. 이러한 방식을 이용하면 임시 포트 번호를 이용하는 인스턴트 메신저나 P2P 프로그램도 유연하게 설정이 가능하다. 현재 윈도우 운영체제에 포함되어 있는 방화벽이 이러한 모델을 사용하고 있는 예이다.Recent more advanced firewall products use a method of specifying a list of programs (EXEs) that allow network communication. In this method, a user may manually enter a list of programs to allow network communication, or add a new program to the list of allowed programs by asking the user whether to allow the program when a specific program tries to communicate. In this way, instant messenger or P2P programs using temporary port numbers can be flexibly configured. The firewall included with the Windows operating system is an example of this model.

그러나, 이러한 EXE 파일 목록에 기반한 방식에서는 프로세스를 대표하는 EXE 파일을 기준으로 허용 설정을 하기 때문에, DLL 인젝션 기술을 이용하여 악의적인 DLL을 정상적인 프로세스 공간 내로 침투시키는 경우나, EXE 파일이 묵시적 혹은 명시적으로 로딩하는 DLL 파일이 바이러스 등에 의해 변조되었거나 악의적인 목적으로 만들어진 악성 모듈인 경우, 이를 구별하여 차단하지 못한다는 문제점이 있다.However, in the method based on the EXE file list, the allowance is set based on the EXE file representing the process. Therefore, the DLL injection technique is used to infiltrate a malicious DLL into the normal process space, or the EXE file is implied or specified. If the DLL file to be loaded is a malicious module that has been tampered with by a virus or created for malicious purposes, there is a problem in that it cannot be distinguished and blocked.

DLL 인젝션이란 해킹툴에서 많이 사용되는 기술로, 임의의 DLL 모듈을 임의의 프로세스 공간 내로 침투시켜 악성 DLL 모듈의 제작자가 원하는 기능을 해당 프로세스 내에서 해당 프로세스의 권한으로 실행시키는 기술을 말한다.DLL injection is a technology commonly used in hacking tools. It refers to a technology that infiltrates any DLL module into an arbitrary process space and executes a function desired by the creator of a malicious DLL module in the process with the authority of the corresponding process.

또한, EXE 파일 목록에 기반하여 네트워크 통신을 허용하는 모델에서는 해당 프로세스 내에 악의적인 DLL 모듈이 로딩되어 있는가를 확인하려면 해당 프로세스 내에 로딩되어 있는 전체 모듈을 대상으로 조사해야 하기 때문에, 악성 모듈 검사에 과도한 부하가 발생되는 문제점이 있다.Also, in the model that allows network communication based on the list of EXE files, to check whether malicious DLL module is loaded in the process, the whole module loaded in the process needs to be examined. There is a problem that occurs.

상기한 종래 기술의 문제점을 해결하기 위하여 안출된 본 발명은, 네트워크 통신을 시도한 쓰레드를 판독하고 쓰레드의 스택 메모리를 역추적하는 방법을 이용하여, 실제로 통신에 관여한 모듈들만 통신이 이루어지기 직전에 선별적으로 악성코드 검사를 함으로써, DLL 인젝션이나 변조된 DLL에 의한 해킹을 차단할 수 있으며, 실제로 통신에 관여한 모듈만 선별적으로 악성 모듈 검사를 함으로써 프로세스 공간 내의 모든 모듈을 검사함으로써 발생되는 불필요한 부하를 방지하는 유해 트래픽 제어 및 해킹을 차단하는 장치 및 방법을 제공하기 위함을 목적으로 한다.The present invention devised to solve the above-mentioned problems of the prior art, by using a method of reading the thread that attempted the network communication and trace back the stack memory of the thread, only the modules actually involved in the communication just before the communication is made. By selectively inspecting malicious codes, hacking by DLL injection or mutated DLLs can be prevented, and unnecessary loads generated by inspecting all modules in the process space by selectively inspecting only modules that are actually involved in communication. An object of the present invention is to provide an apparatus and method for preventing harmful traffic and preventing hacking.

상기 목적을 달성하기 위한 본 발명은, 유해 트래픽 제어 및 해킹을 차단하는 장치로서,The present invention for achieving the above object, as a device for blocking harmful traffic control and hacking,

응용 프로그램이 운영체제로 요청한 통신 요청을 모니터링하는 통신 요청 모니터링부와;A communication request monitoring unit configured to monitor a communication request requested by the application program to the operating system;

상기 통신 요청 모니터링부에서 수신한 통신 요청의 발신 쓰레드를 판독하는 쓰레드 판독부와;A thread reader for reading the originating thread of the communication request received by the communication request monitoring unit;

상기 쓰레드 판독부에서 판독된 쓰레드의 스택 메모리를 역추적하여 상기 통신 요청과 관련된 모듈을 선별적으로 검사하는 스택 역추적을 통한 모듈 검사부와;A module checker through a stack traceback for selectively checking a stack memory of a thread read by the thread reader and selectively checking a module related to the communication request;

상기 스택 역추적을 통한 모듈 검사부의 검사 결과에 따라 통신 요청을 허용하거나 차단하는 통신 요청 처리부;A communication request processing unit allowing or blocking a communication request according to a test result of the module inspecting unit through the stack traceback;

를 포함하는 것을 특징으로 한다.Characterized in that it comprises a.

또한, 상기 목적을 달성하기 위한 본 발명은, 유해 트래픽 제어 및 해킹을 차단하는 방법으로서,In addition, the present invention for achieving the above object, as a method for blocking harmful traffic control and hacking,

응용 프로그램이 운영체제로 요청한 통신 요청을 모니터링하는 통신 요청 모니터링 단계;A communication request monitoring step of monitoring a communication request requested by an application program to an operating system;

상기 통신 요청 모니터링 단계에서 수신된 통신 요청에서 통신 요청의 발신 쓰레드를 판독하는 쓰레드 판독 단계;A thread reading step of reading the originating thread of the communication request from the communication request received in the communication request monitoring step;

상기 쓰레드 판독 단계에서 판독된 쓰레드의 스택 메모리를 역추적하는 방법으로 악성 모듈을 검사하는 스택 역추적을 통한 모듈 검사 단계;A module checking step of stack tracing to check malicious modules in a method of tracing a stack memory of a thread read in the thread reading step;

상기 스택 역추적을 통한 모듈 검사 단계의 검사 결과에 따라 통신 요청을 허용하거나 차단하는 통신 요청 처리 단계;A communication request processing step of allowing or blocking a communication request according to a check result of the module checking step through the stack traceback;

를 포함하는 것을 특징으로 한다.Characterized in that it comprises a.

본 발명에서 창안한 유해 트래픽 제어 및 해킹을 차단하는 장치 및 방법에 따르면, 네트워크 통신을 시도한 쓰레드를 판독하고 쓰레드의 스택 메모리를 역추적하는 방법을 이용하여, 실제로 통신에 관여한 모듈들만 통신이 이루어지기 직전에 선별적으로 악성코드 검사를 함으로써, DLL 인젝션이나 변조된 DLL에 의한 해킹을 차단할 수 있으며, 실제로 통신에 관여한 모듈만 선별적으로 악성 모듈 검사를 함으로써 프로세스 공간 내의 모든 모듈을 검사함으로써 발생되는 불필요한 부하를 방지할 수 있다.According to the apparatus and method for blocking harmful traffic control and hacking invented in the present invention, by using a method of reading the thread that attempted network communication and backtracking the stack memory of the thread, only the modules actually involved in the communication are made. By inspecting malicious code selectively before losing, it can block hacking by DLL injection or modified DLL, and by inspecting all modules in the process space by selectively inspecting malicious modules only for modules involved in communication. Unnecessary unnecessary load can be prevented.

따라서, 본 발명을 방화벽 소프트웨어에 접목하면 종래의 방화벽 기술로 차단이 불가능했던 DLL 인젝션의 경우나 바이러스 등에 감염된 악성 모듈의 경우에도 차단이 가능해져, 아직 발견되지 않은 악성 해킹 툴에 의해 발생되는 개인 정보 유출이나 인터넷 뱅킹을 통한 무단 인출 등의 해킹 사고를 막을 수 있다. 또한, 실제 통신에 관여한 모듈만 선별적으로 검사함으로써 방화벽 소프트웨어 작동시 발생되는 부하를 줄일 수 있다.Therefore, by incorporating the present invention into the firewall software, it is possible to block even in case of a DLL injection or a malicious module infected with a virus or the like, which cannot be blocked by the conventional firewall technology, and personal information generated by a malicious hacking tool that has not yet been found. Hacking incidents such as leaks or unauthorized withdrawal through internet banking can be prevented. In addition, by selectively inspecting only the modules involved in the actual communication, the load generated when the firewall software is operated can be reduced.

이하 첨부된 도면을 참조하여 본 발명의 일실시예를 상세히 설명한다.Hereinafter, an embodiment of the present invention will be described in detail with reference to the accompanying drawings.

도 1은 본 발명의 바람직한 실시예에 따른 유해 트래픽 제어 및 해킹을 차단하는 장치를 도시한 블록도이다.1 is a block diagram showing an apparatus for blocking harmful traffic control and hacking according to a preferred embodiment of the present invention.

도 1을 참조하면, 유해 트래픽 제어 및 해킹을 차단하는 장치(110)은 응용 프로그램(120)의 네트워크 통신 요청을 모니터링하는 통신 요청 모니터링부(111); 상기 통신 요청 모니터링부에서 수신한 네트워크 통신 요청의 발신 쓰레드를 판독하는 쓰레드 판독부(112); 상기 쓰레드 판독부에서 판독된 쓰레드의 스택 메모리를 역추적하면서 상기 통신 요청에 관여한 모듈들을 검사하는 스택 역추적을 통한 모듈 검사부(113); 상기 모듈 검사 결과에 따라 네트워크 통신 요청을 허용하거나 차단하는 통신 요청 처리부(114)를 포함한다.Referring to FIG. 1, the apparatus 110 for blocking harmful traffic control and hacking includes a communication request monitoring unit 111 for monitoring a network communication request of an application program 120; A thread reader 112 for reading outgoing threads of a network communication request received by the communication request monitoring unit; A module checker (113) through a stack traceback that checks the modules involved in the communication request while tracing the stack memory of the thread read by the thread reader; And a communication request processing unit 114 to allow or block a network communication request according to the module test result.

상기 유해 트래픽 제어 및 해킹을 차단하는 장치(110)는 컴퓨터 내에서 실행 중인 하나 이상의 응용 프로그램(120)과 네트워크 인터페이스 카드(130) 사이에 위치하여, 외부로 나가는 트래픽과 내부로 들어오는 트래픽을 대상으로 유해 트래픽 제어 및 해킹을 차단한다.The device 110 for blocking the harmful traffic control and hacking is located between one or more applications 120 running in the computer and the network interface card 130 to target outgoing traffic and incoming traffic. Block harmful traffic control and hacking.

통신 요청 모니터링부(111)는 응용 프로그램(120)이 운영체제로 요청한 네트워크 통신 요청을 모니터링하고 수신한다. 응용 프로그램(120)은 운영체제에서 제공하는 통신 관련 API를 호출하여 네트워크 통신을 수행하며, 이 네트워크 통신에는 데이터 송신, 데이터 수신, 서버 포트 개설, 상대 호스트로의 연결 등이 포함된다. 이때 사용되는 통신 관련 API의 예로는 connect(), listen(), recv(), send(), recvfrom(), sendto() 등이 있다.The communication request monitoring unit 111 monitors and receives a network communication request requested by the application program 120 to the operating system. The application program 120 performs network communication by calling a communication-related API provided by the operating system. The network communication includes data transmission, data reception, opening a server port, and a connection to a counterpart host. Examples of communication-related APIs used here include connect (), listen (), recv (), send (), recvfrom (), and sendto ().

통신 요청 모니터링부가 구현되는 방법은 크게 커널 모드의 드라이버를 이용하는 방법과 API 후킹을 이용하는 방법이 있다.The communication request monitoring unit may be implemented by using a kernel mode driver and using API hooking.

커널 모드의 드라이버로 구현할 때에는 운영체제에 의해 제공되는 전송 계층 드라이버의 상단에 필터 드라이버 형태로 구현하는 것이 바람직하다. 전송 계층 드라이버는 윈도우 운영체제에서 OSI 참조 모델의 전송 계층에 해당하는 TCP, UDP 등의 프로토콜을 구현하는 드라이버로, 네트워크 관련 드라이버 스택 중 최상단에 위치하고 있다. 이 전송 계층 드라이버의 상단에 필터 드라이버로 설치를 하면 네트워크 통신을 요청하는 사용자 모드 쓰레드와 같은 컨텍스트에서 실행이 되기 때문에 해당 네트워크 통신을 요청한 쓰레드를 판독하는 데 용이한 면이 있다. 전송 계층 드라이버는 TDI(Transport Driver Interface)라는 운영체제 내부에서 표준화된 인터페이스를 상위 드라이버나 TDI 클라이언트에게 공개한다. 따라서 통신 요청 모니터링부(111)를 구현하는 필터 드라이버는 전송 계층 드라이버가 제공하는 TDI 인터페이스에 따라 연결 요청, 서버 포트 개설 요청, 데이터 송신 요청, 데이터 수신 요청에 대한 모니터링을 수행할 수 있다. TDI 인터페이스와 관련된 세부 명세는 마이크로소프트사에 의해 문서로 공개되어 있다. 전송 계층 드라이버의 상단에 필터 드라이버 형태로 구현하는 방법 외에, NDIS IM(Intermediate) 드라이버로 구현하는 방법도 가능하다.When implementing as a kernel mode driver, it is preferable to implement as a filter driver on top of a transport layer driver provided by an operating system. The transport layer driver is a driver that implements protocols such as TCP and UDP corresponding to the transport layer of the OSI reference model in the Windows operating system. It is located at the top of the network-related driver stack. When installed as a filter driver on top of this transport layer driver, it runs in the same context as a user mode thread requesting network communication, which makes it easier to read the thread requesting the network communication. The transport layer driver exposes a standardized interface inside an operating system called a TDI (Transport Driver Interface) to an upper driver or a TDI client. Accordingly, the filter driver implementing the communication request monitoring unit 111 may monitor the connection request, the server port opening request, the data transmission request, and the data reception request according to the TDI interface provided by the transport layer driver. Details of the TDI interface are documented by Microsoft. In addition to the filter driver on the top of the transport layer driver, it is also possible to implement it as an NDIS IM (Intermediate) driver.

커널 모드의 드라이버로 통신 요청 모니터링부(111)를 구현하면, 응용 프로그램이 요청한 네트워크 통신 요청은 윈도우 커널의 I/O 매니저에 의해 IRP(I/O Request Packet)의 형태로 드라이버의 디스패치 루틴에 전달된다. 따라서 드라이버로 전달된 IRP 자료구조의 내용을 살펴봄으로써 구체적인 통신의 내용을 모니터링할 수 있다. IRP 구조체의 형태 및 멤버 변수의 의미는 윈도우 드라이버 킷(WDK)의 매뉴얼에 설명되어 있다.When the communication request monitoring unit 111 is implemented as a driver in a kernel mode, the network communication request requested by an application is transmitted to the driver dispatch routine in the form of an I / O Request Packet (IRP) by an I / O manager of the Windows kernel. do. Thus, by looking at the contents of the IRP data structure passed to the driver, it is possible to monitor the contents of the specific communication. The types of IRP structures and the meaning of member variables are described in the Windows Driver Kit (WDK) manual.

또한, API 후킹을 이용하여 통신 요청 모니터링부(111)를 구현하는 것도 가능하다. API 후킹이란 운영체제가 제공하는 API를 개발자가 만든 임의의 함수로 바꿔치기 하여 응용 프로그램이 운영체제가 제공하는 API를 호출할 때 운영체제의 API를 실제로 호출하기 이전에 관련 내용을 모니터링 및 처리할 수 있는 방법을 말한다. API 후킹은 운영체제가 제공하는 API와 동일한 함수형을 가진 함수를 포함하는 DLL을 응용 프로그램의 프로세스 내에 매핑한 후, KERNEL32.DLL, USER32.DLL, GDI32.DLL 등의 모듈에 포함된 함수를 호출할 때 사용되는 IAT(Import Address Table)의 함수 주소를 교체함으로써 가능하다. 또한, 커널 모드에서 시스템 서비스 디스패치 테이블(SSDT) 내의 함수 주소를 교체하는 방법으로 API 후킹을 구현하는 것도 가능하다.In addition, it is also possible to implement the communication request monitoring unit 111 using API hooking. API hooking is a way to replace the API provided by the operating system with an arbitrary function created by the developer so that when an application calls the API provided by the operating system, the relevant information can be monitored and processed before the operating system's API is actually called. Say API hooking maps a DLL containing a function with the same functional type as the API provided by the operating system into the application's process, and then calls a function included in a module such as KERNEL32.DLL, USER32.DLL, or GDI32.DLL. This can be done by replacing the function address in the IAT (Import Address Table) used. It is also possible to implement API hooking by replacing the function address in the system service dispatch table (SSDT) in kernel mode.

API 후킹을 이용하여 통신 요청 모니터링부(111)를 구현하는 경우에는 윈도우 API나 네이티브 시스템 서비스(Native System Service)의 함수를 호출할 때 사용되는 파라미터를 그대로 수신하는 것이 가능하므로, 이 함수들의 파라미터를 조사하여 응용 프로그램이 호출한 함수의 세부 내용을 모니터링할 수 있다.When the communication request monitoring unit 111 is implemented using API hooking, it is possible to receive parameters used when calling a function of a Windows API or a native system service. You can examine and monitor the details of the function called by your application.

쓰레드 판독부(112)는 상기 통신 요청 모니터링부(111)에서 수신한 통신 요청의 발신 쓰레드를 판독한다. 통신 요청의 발신 쓰레드를 판독하는 목적은, 하기의 스택 역추적을 통한 모듈 검사부(113)에서 해당 통신 요청과 관련된 모듈들만 선별적으로 악성 모듈 검사를 하기 위함이다. 판독 결과는 쓰레드 ID로 표현되는 것이 바람직하다.The thread reading unit 112 reads the originating thread of the communication request received by the communication request monitoring unit 111. The purpose of reading the originating thread of the communication request is to selectively inspect only the modules related to the communication request in the module inspection unit 113 through the stack traceback. The read result is preferably represented by a thread ID.

상기 통신 요청 모니터링부(111)가 커널 모드의 드라이버로 구현되어 있는 경우, 해당 IRP의 발신 쓰레드를 판독하는 방법은 IRP 구조체 내의 Tail.Overlay.Thread(ETHREAD 구조체형) 필드를 직접 조사하거나, NT 커널 5.1 이상부터는 PsGetThreadID() 함수에 Tail.Overlay.Thread 값을 인자로 주어 구할 수 있다. 혹은, 상기 통신 요청 모니터링부(111)를 구현하는 커널 모드의 드라이버를 전송 계층 드라이버의 상단에서 작동되는 필터 드라이버로 구현한 경우에는, 이 드라이버의 디스패치 루틴의 호출이 네트워크 통신을 요청한 사용자 모드의 쓰레드와 같은 컨텍스트에서 실행되기 때문에, PsGetCurrentThreadId()를 호출하여 판독하는 것도 가능하다.When the communication request monitoring unit 111 is implemented as a kernel mode driver, a method of reading the originating thread of the corresponding IRP may be performed by directly examining the Tail.Overlay.Thread (ETHREAD structure type) field in the IRP structure or by NT kernel. From 5.1 onwards, it can be obtained by giving Tail.Overlay.Thread as a parameter to PsGetThreadID () function. Alternatively, when the kernel mode driver that implements the communication request monitoring unit 111 is implemented as a filter driver that operates on the upper layer of the transport layer driver, a call of the dispatch routine of the driver requests a user mode thread for network communication. Since it is executed in the same context, it is also possible to call PsGetCurrentThreadId () to read.

상기 통신 요청 모니터링부(111)가 API 후킹을 이용하여 구현되어 있는 경우, API 후킹 함수는 API를 호출한 쓰레드와 같은 쓰레드 컨텍스트에서 실행되므 로, GetCurrentThreadId() API를 호출함으로써 네트워크 통신 요청을 한 쓰레드를 판독할 수 있다.When the communication request monitoring unit 111 is implemented using API hooking, the API hooking function is executed in the same thread context as the thread calling the API, so that the network communication request is made by calling the GetCurrentThreadId () API. Can be read.

스택 역추적을 통한 모듈 검사부(113)는 상기 쓰레드 판독부(112)에서 판독한 쓰레드의 스택 메모리를 역추적하는 방법을 이용하여 해당 통신 요청에 관여한 모듈만 선별적으로 악성 모듈 검사를 한다. 이 상세한 과정은 도 2를 참조하여 후술한다.The module inspecting unit 113 through the stack traceback selectively checks the module involved in the corresponding communication request by using the method of backtracking the stack memory of the thread read by the thread reader 112. This detailed process will be described later with reference to FIG. 2.

통신 요청 처리부(114)는 상기 스택 역추적을 통한 모듈 검사부(113)의 검사 결과에 따라 통신 요청을 허용하거나 차단한다.The communication request processing unit 114 allows or blocks a communication request according to the inspection result of the module inspecting unit 113 through the stack traceback.

상기 통신 요청 모니터링부(111)가 커널 모드의 드라이버로 구현되어 있을 때에는, 통신을 차단하기 위해서는 수신한 통신 요청 IRP를 하위 드라이버로 내려보내지 않고 IoCompleteRequest()를 이용하여 완료 처리를 하면 된다. 이때 완료 코드를 실패로 설정함으로써 응용 프로그램에게 통신이 실패한 것으로 반환한다. 반면, 통신을 허용하려면 상기 IRP를 하위 드라이버로 IoCallDriver()를 호출하여 넘겨주면 된다.When the communication request monitoring unit 111 is implemented as a kernel mode driver, in order to block communication, the received communication request IRP may be completed by using IoCompleteRequest () without sending down the received communication request IRP to the lower driver. At this time, the completion code is set to Failed and returned to the application as communication failed. On the other hand, in order to allow communication, the IRP is passed to the lower driver by calling IoCallDriver ().

상기 통신 요청 모니터링부(111)가 API 후킹을 이용하여 구현되었을 때에는, 통신을 차단하려면 후킹한 API 함수 내에서 원본 함수를 호출하지 않고 바로 실패를 반환하면 된다. 반면, 통신을 허용하려면 후킹한 API 함수가 받은 파라미터를 그대로 원본 API 함수로 넘겨주면 된다.When the communication request monitoring unit 111 is implemented using API hooking, in order to block communication, a failure may be immediately returned without calling the original function within the hooked API function. On the other hand, to allow communication, pass the parameters received by the hooked API function to the original API function.

통신이 허용되면 해당 통신 요청은 네트워크 인터페이스 카드(130)을 통하여 인터넷(140)과 패킷을 송수신할 수 있게 된다.If communication is allowed, the corresponding communication request may transmit and receive a packet with the Internet 140 via the network interface card 130.

도 2는 상기 스택 역추적을 통한 모듈 검사부(113)를 더 자세히 알아보기 위한 블록도이다.2 is a block diagram illustrating the module inspecting unit 113 through the stack traceback in more detail.

쓰레드 컨텍스트 추출부(201)는 상기 쓰레드 판독부(112)에서 판독된 쓰레드를 대상으로 해당 쓰레드의 컨텍스트를 추출한다. 쓰레드 컨텍스트를 추출하는 이유는 쓰레드 컨텍스트 내에 존재하는 명령어 포인터 레지스터 값과 베이스 포인터 레지스터 값이 하기의 스택 역추적부(202)에서 필요하기 때문이다.The thread context extractor 201 extracts the context of the thread from the thread read by the thread reader 112. The reason for extracting the thread context is that the instruction pointer register value and the base pointer register value existing in the thread context are needed by the stack traceback unit 202 below.

현대의 개인용 컴퓨터 및 서버 컴퓨터의 운영체제는 대부분 멀티 쓰레드 환경을 지원하며, 이러한 멀티 쓰레드 환경에서 하나의 프로세스는 하나 이상의 쓰레드를 포함하는 것이 가능하다. 또한, 시분할 방식의 운영체제 환경에서 다수의 쓰레드는 CPU의 시간(time slice)을 공평하게 나누어 씀으로써 멀티 쓰레드가 동시 병행적으로 실행되도록 한다. 따라서 다수의 쓰레드를 제한된 개수의 CPU에서 교체해가면서 실행하기 위해서는 각 쓰레드마다 CPU의 상태를 저장할 필요가 있으며, 윈도우 운영체제의 경우 커널 쓰레드 오브젝트 내에 CONTEXT라는 자료구조를 이용하여 이를 관리하고 있다. 이 CONTEXT 자료구조에는 CPU의 각종 레지스터의 값이 포함된다.Modern personal computer and server computer operating systems mostly support multi-threaded environments, where a single process can contain more than one thread. In addition, in a time-sharing operating system environment, multiple threads share the CPU's time slice evenly, allowing multiple threads to run concurrently. Therefore, in order to replace a large number of threads in a limited number of CPUs, it is necessary to save the CPU state for each thread. In the case of the Windows operating system, the data structure called CONTEXT is managed in the kernel thread object. This CONTEXT data structure contains the values of the various registers of the CPU.

상기 쓰레드 판독부(112)에서 추출한 쓰레드의 ID를 이용하여 상기 쓰레드의 컨텍스트를 구하기 위해서는 먼저 OpenThread() API에 쓰레드 ID를 인자로 전달하여 쓰레드 핸들을 구한 후, GetThreadContext() API에 쓰레드 핸들과 초기화된 CONTEXT 구조체의 주소를 전달한다. 이때 쓰레드가 블록되어 있는 상태가 아니라면 GetThreadContext() API 실행 중 CPU의 상태가 변화하는 것을 막기 위해 GetThreadContext() API를 호출하기 이전에 SuspendThread() API를 이용하여 쓰레드를 정지 상태로 만드는 것이 바람직하다.To obtain the context of the thread using the ID of the thread extracted by the thread reader 112, first obtain a thread handle by passing the thread ID as an argument to the OpenThread () API, and then initialize the thread handle and the GetThreadContext () API. Passes the address of the constructed CONTEXT structure. In this case, if the thread is not blocked, it is preferable to suspend the thread using the SuspendThread () API before calling the GetThreadContext () API to prevent the CPU from changing while the GetThreadContext () API is running.

스택 역추적부(202)는 상기 쓰레드 판독부(112)에서 판독된 쓰레드의 스택 메모리를 역추적하여 스택 프레임 내에 저장된 하나 이상의 명령어 포인터를 추출한다. 이 상세한 과정은 예시를 통하여 후술한다.The stack traceback unit 202 traces back the stack memory of the thread read by the thread reader 112 and extracts one or more instruction pointers stored in the stack frame. This detailed process will be described later by way of example.

모듈 추출부(203)는 상기 스택 역추적부(202)에서 추출한 명령어 포인터의 주소에 해당하는 모듈을 추출한다. 먼저 EnumProcessModules() API로 상기 쓰레드 판독부(112)에서 판독된 쓰레드를 포함하는 프로세스 내에 로딩되어 있는 모든 모듈을 순회하면서, 각 모듈마다 GetModuleInformation() API를 이용하여 모듈의 베이스 주소(base address)와 모듈의 크기를 구한 뒤, 상기 모듈의 주소 범위 내에 상기 스택 역추적부(202)에서 추출한 명령어 포인터의 주소가 포함되는가를 비교하여 상기 명령어 포인터의 주소에 해당하는 모듈의 핸들을 구한다. 그리고 상기 모듈의 핸들을 파라미터로 GetModuleFileNameEx() API를 호출하여 이 모듈의 디스크상의 경로를 구한다.The module extractor 203 extracts a module corresponding to the address of the instruction pointer extracted by the stack tracer 202. First, the EnumProcessModules () API is used to traverse all the modules loaded in the process including the thread read by the thread reader 112, and each module uses the GetModuleInformation () API and the base address of the module. After obtaining the size of the module, the handle of the module corresponding to the address of the instruction pointer is obtained by comparing whether the address of the instruction pointer extracted by the stack traceback unit 202 is included in the address range of the module. Then, the GetModuleFileNameEx () API is called with the handle of the module as a parameter to obtain the path on the disk of this module.

악성 모듈 검사부(205)는 상기 모듈 추출부(203)에서 추출한 모듈을 대상으로 악성 모듈 검사를 한다. 악성 모듈 검사부(205)는 모듈 DB(206)를 이용하여 악성 모듈 검사를 하는 것이 바람직하다. 모듈 DB(206)는 모듈(EXE, DLL 등)들에 대한 정보를 저장하고 있는 데이터베이스로, 각 모듈의 고유한 코드값과 이 모듈의 악성 여부 등을 저장하고 있다. 바람직하게는 각 모듈을 구분하는 고유한 코드값은, 모듈의 일부 혹은 전부에 일방향 해쉬 함수를 적용하여 산출된 해쉬값을 이용 하거나, 모듈의 고유한 시그니쳐를 추출하여 저장하는 방식을 이용한다. 모듈 DB(206)의 모듈 데이터는 사용자에 의해 추가될 수도 있고, 중앙 서버를 이용하여 실시간으로 업데이트될 수도 있다. 악성 모듈을 검사하는 다양한 실시예는 당업자에게 널리 알려진 기술이므로 그 상세한 설명은 생략한다.The malicious module inspection unit 205 performs a malicious module inspection on the module extracted by the module extraction unit 203. The malicious module inspection unit 205 preferably performs a malicious module inspection using the module DB 206. The module DB 206 is a database that stores information about modules (EXE, DLL, etc.), and stores unique code values of each module and whether the module is malicious. Preferably, a unique code value for distinguishing each module uses a hash value calculated by applying a one-way hash function to a part or all of the modules, or uses a method of extracting and storing a unique signature of a module. The module data of module DB 206 may be added by the user or updated in real time using a central server. Various embodiments of examining malicious modules are well known to those skilled in the art, and thus detailed descriptions thereof will be omitted.

또는, 상기 모듈 추출부(203)에서 디스크상의 모듈 경로를 구하지 않고 직접 메모리상에서 모듈이 위치한 주소 범위를 모듈의 베이스 주소와 크기를 이용하여 구한 뒤, 상기 메모리상의 모듈을 직접 악성 모듈 검사부(205)를 이용하여 검사할 수도 있다. 이러한 방식의 장점은 모듈이 메모리상에 로딩된 후에 바이러스 등에 의하여 변조된 경우에도 악성 모듈 탐지가 가능하다는 것이다.Alternatively, the module extracting unit 203 obtains the address range in which the module is located directly in the memory using the module's base address and size without obtaining the module path on the disk, and then directly searches the module in the memory for the malicious module checking unit 205. You can also check using. The advantage of this approach is that malicious modules can be detected even if the module has been tampered with by a virus after being loaded into memory.

한편, 상기 모듈 추출부(203)에서 추출된 모든 모듈을 대상으로 악성 모듈 검사를 하는 것이 경우에 따라 비효율적일 수 있기 때문에, 추가적인 모듈 필터링부(204)를 이용하여 상기 추출된 모듈을 대상으로 악성 모듈 검사를 할 것인지를 판단할 수 있다. 예를 들어 상기 스택 역추적부(202)를 통해 추출된 모듈의 목록 중 같은 모듈이 여러 번 존재할 수도 있는데, 이러한 경우 같은 모듈에 대해 중복된 검사를 할 필요는 없기 때문에 모듈 필터링부(204)를 이용하여 불필요한 검사는 생략하는 것이 바람직하다. 또는 상기 모듈 추출부(203)에서 추출된 모듈이 여러 정황상 악성 모듈이 아님을 확신할 수 있는 모듈인 경우에도 악성 모듈 검사를 생략함으로써 불필요한 부하를 감소시킬 수 있다.On the other hand, since it may be inefficient in some cases to perform a malicious module inspection on all the modules extracted by the module extraction unit 203, using the additional module filtering unit 204 malicious to the extracted module You can decide whether to inspect the module. For example, the same module may exist multiple times in the list of modules extracted through the stack traceback unit 202. In this case, the module filtering unit 204 is not necessary because the same module does not need to be duplicated. It is desirable to omit unnecessary inspection. Alternatively, even when the module extracted by the module extracting unit 203 is a module which can be sure that the module is not malicious in various contexts, the unnecessary load can be reduced by omitting the malicious module inspection.

이하 도면 5부터 도면 8을 참조하여, 상기 스택 역추적부(202)의 상세한 내용을 예시를 통하여 설명한다.Hereinafter, the details of the stack traceback unit 202 will be described with reference to FIGS. 5 through 8.

도 5는 응용 프로그램(120)의 프로세스 내부 구조(500)를 예시한 블록도이다. 예시된 프로세스 블록도에서는 2개의 쓰레드(507, 508)가 있다. 쓰레드 1(507)은 프로세스를 대표하는 EXE 실행 모듈(501)로부터 시작된 쓰레드로, 정상 모듈(502), WS2_32.DLL(504), NTDLL.DLL(505)를 차례로 경유하여 커널 모드로 네트워크 통신 요청을 하고 있다. 쓰레드 2(508)은 정상적인 프로세스 내로 침투한 악성 모듈(503)로부터 시작된 쓰레드로, WS2_32.DLL(504), NTDLL.DLL(505)를 차례로 경유하여 커널 모드로 네트워크 통신 요청을 하고 있다. WS2_32.DLL은 윈속(WinSock; Windows Socket)을 구현하는 DLL 모듈이며, NTDLL.DLL은 커널이 제공하는 네이티브 시스템 서비스로의 진입점(entry point)을 제공하는 DLL 모듈이다. 본 도면에서는 KERNEL32.DLL, USER32.DLL, GDI32.DLL과 같은 프로그램 실행에 필요한 기타 DLL 모듈은 별도로 도시하지 않았으나, 이것은 예시 목적을 위해 간략화한 것이다.5 is a block diagram illustrating a process internal structure 500 of an application 120. In the illustrated process block diagram, there are two threads 507 and 508. Thread 1 507 is a thread started from the EXE execution module 501 representing the process, and requests network communication in kernel mode via the normal module 502, WS2_32.DLL 504, and NTDLL.DLL 505 in that order. Doing Thread 2 (508) is a thread originating from a malicious module 503 that has penetrated into a normal process, and requests network communication in kernel mode via WS2_32.DLL 504 and NTDLL.DLL 505. WS2_32.DLL is a DLL module that implements WinSock (Windows Socket). NTDLL.DLL is a DLL module that provides an entry point to native system services provided by the kernel. In this figure, other DLL modules required for program execution, such as KERNEL32.DLL, USER32.DLL, and GDI32.DLL, are not shown separately, but this is simplified for illustrative purposes.

도 6은 도 5에서 예시한 프로세스의 가상 메모리 주소 공간을 나타낸 블록도이다.FIG. 6 is a block diagram illustrating a virtual memory address space of the process illustrated in FIG. 5.

하나의 프로세스가 생성되면 운영체제는 각 프로세스에게 독립적인 주소 공간을 할당하며, 이 주소 공간은 커널 주소 영역과 사용자 주소 영역으로 구분된다. 프로세스의 실행에 관여하는 모든 모듈(EXE, DLL 등)은 이 주소 공간 내에 매핑이 된다. 도 6에서는 NTDLL.DLL(601), WS2_32.DLL(602), 악성 모듈(605), 정상 모듈(606), 실행 모듈(607)이 주소 공간에 적절히 매핑되어 있다.When a process is created, the operating system allocates an independent address space for each process, which is divided into a kernel address space and a user address space. All modules (EXEs, DLLs, etc.) involved in the execution of the process are mapped in this address space. In Fig. 6, NTDLL.DLL 601, WS2_32.DLL 602, malicious module 605, normal module 606, and execution module 607 are properly mapped to the address space.

또한, 하나의 쓰레드가 생성될 때마다 운영체제는 각 쓰레드에게 독립적인 스택 메모리 공간을 할당해준다. 도 5에서 예시한 것과 같이 한 프로세스 내에 2개 의 쓰레드(507, 508)가 있는 경우, 프로세스 주소 공간 내에 2개의 스택 메모리 영역(603, 604)이 각각 생성되게 된다. 쓰레드 1(507)을 위해서는 0x00800000부터 0x00900000까지의 스택 메모리(603)가 할당되어 있으며, 쓰레드 2(508)를 위해서는 0x00700000부터 0x00800000까지의 스택 메모리(604)가 할당되어 있다.In addition, each time a thread is created, the operating system allocates a separate stack memory space for each thread. As illustrated in FIG. 5, when there are two threads 507 and 508 in a process, two stack memory regions 603 and 604 are created in the process address space, respectively. The stack memory 603 of 0x00800000 to 0x00900000 is allocated to the thread 1 507, and the stack memory 604 of 0x00700000 to 0x00800000 is allocated to the thread 2 508.

도 7은 쓰레드 2(508)에 할당된 스택 메모리(604)를 상세히 예시하는 블록도이다.7 is a block diagram illustrating in detail the stack memory 604 allocated to thread 2 508.

스택 메모리는 CALL 명령(instruction)을 통해 함수(서브루틴)가 호출될 때마다 새로운 스택 프레임이 생성된다. 각 스택 프레임에는 호출되는 함수로 넘겨주는 파라미터, CALL 명령을 실행하는 시점에서의 명령어 포인터 레지스터 값, 이전 스택 프레임의 베이스 포인터 레지스터 값이 저장된 메모리 주소, 함수에서 사용하는 지역 변수가 차례로 스택에 푸쉬(push)된다. 도 7에서는 각 스택 프레임 내의 파라미터와 지역 변수가 각각 4 바이트를 차지하는 것으로 도시하였으나, 이것은 예시 목적을 위한 것이며 실제로 이 크기는 호출되는 함수에 따라 가변적이다.Stack memory creates a new stack frame each time a function (subroutine) is called through a CALL instruction. Each stack frame is pushed on the stack by the parameters passed to the called function, the instruction pointer register value at the time the CALL instruction is executed, the memory address where the base pointer register value of the previous stack frame was stored, and the local variables used by the function. push). Although FIG. 7 shows that the parameters and local variables in each stack frame each occupy 4 bytes, this is for illustrative purposes and in practice this size varies depending on the function being called.

운영체제는 새로 생성되는 쓰레드에게 독립적인 스택 메모리를 할당해 줄때, 스택의 바닥을 NULL 값으로 설정하여, 스택의 언더플로우(underflow)를 방지할 수 있도록 해준다. 도 7의 스택 바닥(710)의 0x007FFFFC(711)는 원래 함수가 호출될 때의 명령어 포인터 레지스터의 값이 저장되는 위치이지만, 이 곳은 스택의 바닥이기 때문에 운영체제가 NULL로 값을 세팅해주었다. 또한 0x007FFFF8(712) 위치는 원래 이전 스택 프레임의 베이스 포인터 레지스터의 값이 저장된 메모리 주소가 저장되는 곳이지만 스택의 바닥에서는 이전 스택 프레임이 존재하지 않기 때문에, 운영 체제는 이 곳에도 NULL로 값을 세팅해준다.When the operating system allocates independent stack memory for newly created threads, it sets the bottom of the stack to NULL, which prevents the stack from underflowing. The 0x007FFFFC 711 of the stack bottom 710 of FIG. 7 is the location where the value of the instruction pointer register when the original function is called is stored, but since this is the bottom of the stack, the operating system sets the value to NULL. Also, the 0x007FFFF8 (712) location is where the memory address where the value of the base pointer register of the previous stack frame is stored, but since the previous stack frame does not exist at the bottom of the stack, the operating system also sets the value to NULL here. Do it.

도 7의 스택이 처음 생성되었을 때에는 스택 바닥(710)만 존재하는 상태였다가, 악성 모듈(503)이 실행되는 도중 WS2_32.DLL(504)로의 함수 호출이 발생되면 스택 프레임 1(720)이 생성된다. 스택 프레임 1(720)의 0x007FFFF0 번지(722)에는 WS2_32.DLL로의 함수 호출을 하기 직전의 명령어 포인터 레지스터의 값이 저장되어 있으며, 이 값은 0x00600100로 악성 모듈(503)의 주소 범위(605) 내에 포함된다는 것을 알 수 있다. 또한, 0x007FFFEC 번지(723)에는 이전 스택 프레임에서 베이스 포인터 레지스터의 값이 저장되어 있는 메모리 번지가 저장되어 있으며, 이 값은 0x007FFFF8로 스택의 바닥을 가리키고 있음을 알 수 있다.When the stack of FIG. 7 was first created, only the stack bottom 710 was present. If a function call to WS2_32.DLL 504 occurred while the malicious module 503 was executing, stack frame 1 720 was generated. do. 0x007FFFF0 address 722 of stack frame 1720 stores the value of the instruction pointer register immediately before the function call to WS2_32.DLL, which is 0x00600100, which is within the address range 605 of the malicious module 503. It can be seen that it is included. In addition, the 0x007FFFEC address 723 stores a memory address where the value of the base pointer register is stored in the previous stack frame, and this value indicates 0x007FFFF8 indicating the bottom of the stack.

한편, 쓰레드 2(508)가 WS2_32.DLL(504) 내의 코드를 실행하는 도중, 다시 NTDLL.DLL(505)으로의 함수 호출이 발생되면, 스택 프레임 2(730)이 생성된다. 스택 프레임 2(730)의 0x007FFFE0 번지(732)에는 NTDLL.DLL로의 함수 호출이 발생되기 직전의 명령어 포인터 레지스터의 값이 저장되어 있으며, 이 값은 0x71C00100으로 WS2_32.DLL(504)의 주소 범위(602) 내에 있다는 것을 알 수 있다. 또한, 0x007FFFDC 번지(733)에는 이전 스택 프레임에서 베이스 포인터 레지스터의 값이 저장되어 있는 메모리 번지 값이 저장되어 있으며, 이 값은 0x007FFFEC로 이전 스택 프레임인 스택 프레임 1(720)의 베이스 포인터 레지스터의 값이 저장되어 있는 메모리 주소(723)를 가리키고 있음을 알 수 있다.On the other hand, if thread 2 508 executes the code in WS2_32.DLL 504, and a function call to NTDLL.DLL 505 occurs again, stack frame 2 730 is generated. 0x007FFFE0 address 732 of stack frame 2 (730) stores the value of the instruction pointer register just before the function call to NTDLL.DLL occurs. This value is 0x71C00100, which is the address range (602) of WS2_32.DLL (504). You can see that it is within). In addition, the 0x007FFFDC address 733 stores the memory address value in which the value of the base pointer register is stored in the previous stack frame, which is 0x007FFFEC, and the value of the base pointer register of the stack frame 1 720 that is the previous stack frame. It can be seen that it points to the stored memory address 723.

도 8은 상기 쓰레드 2(508)가 커널로 통신 요청을 하였을 때의 커널 쓰레드 오브젝트를 예시한 블록도이다.8 is a block diagram illustrating a kernel thread object when the thread 2 508 makes a communication request to the kernel.

도 8을 참조하면, CONTEXT 자료구조(810) 내의 EIP(811)는 현재 명령어 포인터 레지스터의 값으로 바로 다음에 실행할 명령어의 주소를 저장하고 있으며, EBP(812)는 스택 탑(top)에 위치한 스택 프레임 내에서 이전 스택 프레임의 베이스 포인터 레지스터 값을 저장하고 있는 메모리 번지 값을 저장하고 있다.Referring to FIG. 8, the EIP 811 in the CONTEXT data structure 810 stores the address of the next instruction to be executed immediately as a value of the current instruction pointer register, and the EBP 812 is a stack located on a stack top. It stores the memory address value that stores the base pointer register value of the previous stack frame in the frame.

도 8의 예에서 보면 EIP 값은 0x7D600100이고, 이 주소는 NTDLL.DLL(505)의 주소 범위(601)내에 해당한다. 즉, 쓰레드의 컨텍스트에서 구한 EIP 값을 이용하여 이 쓰레드는 현재 NTDLL.DLL 모듈 내의 코드를 실행하고 있음을 알 수 있다. 또한, 도 8의 예에서 보면 EBP 값은 0x007FFFDC이며, 이 값은 현재 스택 탑에 위치한 스택 프레임 2(730) 내에 이전 EBP 값을 저장한 메모리 번지(733)를 가리키고 있음을 알 수 있다.In the example of FIG. 8, the EIP value is 0x7D600100, and this address falls within the address range 601 of NTDLL.DLL 505. In other words, the EIP value obtained from the thread's context shows that this thread is currently executing code in the NTDLL.DLL module. In addition, in the example of FIG. 8, the EBP value is 0x007FFFDC, which indicates that the memory address 733 stores the previous EBP value in the stack frame 2 730 located in the current stack top.

이상과 같은 내용을 바탕으로 스택 역추적부(202)가 쓰레드 판독부(112)에서 판독한 쓰레드를 대상으로 스택을 역추적하면서 통신 요청에 관여한 모듈을 역추적하는 과정을 예시를 통해 설명한다. 하기의 예는 32비트 인텔 호환 CPU 기준이며, 이 CPU에서 명령어 포인터 레지스터는 EIP이며, 베이스 포인터 레지스터는 EBP이다.Based on the above description, the process of backtracking the module involved in the communication request while the stack traceback unit 202 traces the stack to the thread read by the thread reader 112 will be described by way of example. . The following example is based on a 32-bit Intel compatible CPU, where the instruction pointer register is EIP and the base pointer register is EBP.

먼저 도 8에 예시한 커널 쓰레드 오브젝트(800)의 CONTEXT 자료구조(810)을 쓰레드 컨텍스트 추출부(201)을 이용하여 추출한다.First, the CONTEXT data structure 810 of the kernel thread object 800 illustrated in FIG. 8 is extracted using the thread context extractor 201.

다음, 상기 쓰레드 컨텍스트 내의 EIP(811) 값을 이용하여, 현지 실행중인 모듈을 모듈 추출부(203)를 이용하여 추출한다. 도 8의 예에서 EIP의 값이 0x7D600100이므로, 이 주소에 해당하는 해당하는 모듈은 NTDLL.DLL(601)임을 알 수 있다.Next, using the EIP 811 value in the thread context, the module currently running is extracted using the module extracting unit 203. In the example of FIG. 8, since the value of the EIP is 0x7D600100, it can be seen that the corresponding module corresponding to this address is NTDLL.DLL 601.

다음, 상기 CONTEXT 자료구조(810) 내의 EBP(812) 값을 이용하여 스택 탑에 위치한 스택 프레임 2(730)을 구한다. 상기 CONTEXT 자료구조(810) 내의 EBP(812)의 값이 0x007FFFDC이므로, 이 주소는 스택 프레임 2(730)내에서 이전 스택 프레임의 EBP 값이 저장된 메모리 주소(733)임을 알 수 있다. 스텍 프레임 2(730) 내의 EBP 위치로부터 상대적인 위치를 계산하면, 스택 프레임 2(730) 내의 EIP 값을 구할 수 있다. 스택 프레임 2(730)에서 EIP 값은 EBP 주소 + 4바이트의 위치에 존재하며, 그 주소는 0x007FFFE0(732)이다. 이 EIP 값를 이용하여, 스택 프레임 2(730)가 생성될 때 실행하고 있었던 주소가 0x71C00100임을 알 수 있으며, 모듈 추출부(203)을 이용하여 이 주소에 해당하는 모듈이 WS2_32.DLL(602)임을 알 수 있다.Next, the stack frame 2 730 located in the stack top is obtained by using the EBP 812 value in the CONTEXT data structure 810. Since the value of the EBP 812 in the CONTEXT data structure 810 is 0x007FFFDC, it can be seen that this address is the memory address 733 in which the EBP value of the previous stack frame is stored in the stack frame 2 730. By calculating the relative position from the EBP position in stack frame 2 730, the EIP value in stack frame 2 730 can be obtained. In stack frame 2 730, the EIP value is at the location of the EBP address + 4 bytes, and the address is 0x007FFFE0 732. Using this EIP value, it can be seen that the address that was being executed when the stack frame 2 730 was generated is 0x71C00100, and the module corresponding to this address is WS2_32.DLL 602 using the module extracting unit 203. Able to know.

다음, 스택 프레임 2(730)에서 구한 EBP 값(733)이 NULL이 아니므로 이전 스택 프레임이 존재함을 알 수 있으며, EBP 값을 주소로 하여 이전 스택 프레임을 구할 수 있다. 스택 프레임 2(730)에서 구한 EBP의 값이 0x007FFFEC이므로, 이 주소는 스택 프레임 1(720) 내에서 이전 스택 프레임의 EBP 값이 저장된 메모리 주소(723)임을 알 수 있다. 스택 프레임 1(720) 내의 EBP 위치로부터 상대적인 위치를 계산하면, 스택 프레임 1(720) 내의 EIP 값을 구할 수 있다. 스택 프레임 1(720)에서 EIP(722)의 값은 0x00600100이다. 이 EIP 값을 이용하여, 스택 프레임 1(720)이 생성될 때 실행하고 있었던 주소가 0x00600100임을 알 수 있으며, 모듈 추출부(203)를 이용하여 이 주소에 해당하는 모듈이 악성 모듈(605)임을 알 수 있다.Next, since the EBP value 733 obtained in the stack frame 2 730 is not NULL, it can be known that the previous stack frame exists. The previous stack frame can be obtained by using the EBP value as an address. Since the value of EBP obtained in stack frame 2 730 is 0x007FFFEC, it can be seen that this address is a memory address 723 in which stack EBP value of the previous stack frame is stored in stack frame 720. By calculating the relative position from the EBP position in stack frame 1 720, the EIP value in stack frame 1 720 can be obtained. The value of EIP 722 in stack frame 1 720 is 0x00600100. Using this EIP value, it can be seen that the address that was being executed when the stack frame 1 720 was generated is 0x00600100, and the module corresponding to this address is the malicious module 605 using the module extractor 203. Able to know.

다음, 스택 프레임 1(720)에서 구한 EBP 값이 NULL이 아니므로 이전 스택 프 레임을 구한다. 스택 프레임 1(720)의 EBP(723) 값은 0x007FFFF8이며, 이 주소는 이전 스택 프레임 내에서 EBP 값이 저장되어 있는 주소를 가리킨다. 그러나 0x007FFFF8 주소의 값을 추출하여 보면 그 값이 NULL인 것을 알 수 있으며, 더 이상 처리할 스택 프레임은 존재하지 않는 것으로 판단할 수 있다.Next, since the EBP value obtained in the stack frame 1 720 is not NULL, the previous stack frame is obtained. The EBP 723 value of stack frame 1 720 is 0x007FFFF8, and this address indicates the address where the EBP value is stored in the previous stack frame. However, if you extract the value of address 0x007FFFF8, you can see that the value is NULL, and it can be determined that there is no stack frame to process any more.

이상과 같은 과정을 통해, 스택 역추적부(202)는 쓰레드 2(508)가 커널 모드로 통신 요청을 하기 위해 사용된 모듈이 NTDLL.DLL(505), WS2_32.DLL(504), 악성 모듈(503)임을 역으로 추적할 수가 있게 되는 것이다.Through the above process, the stack traceback unit 202 is a module used by thread 2 508 to make a communication request in kernel mode such as NTDLL.DLL (505), WS2_32.DLL (504), and malicious module ( 503) can be traced back.

상기 스택 역추적부(202)가 특정 프로세스 내의 스택 메모리에 접근할 때에는 OpenProcess() API로 프로세스 핸들을 구한 후, ReadProcessMemory() API로 메모리 값을 읽는 것이 바람직하다. When the stack traceback unit 202 accesses stack memory in a specific process, it is preferable to obtain a process handle using the OpenProcess () API and then read the memory value using the ReadProcessMemory () API.

이하, 본 발명의 바람직한 실시예에 따른 유해 트래픽 제어 및 해킹을 차단하는 방법에 관하여 설명한다.Hereinafter, a method of blocking harmful traffic control and hacking according to a preferred embodiment of the present invention will be described.

도 3은 본 발명의 바람직한 실시예에 따라 유해 트래픽 제어 및 해킹을 차단하는 방법을 도시한 흐름도이다.3 is a flowchart illustrating a method of blocking harmful traffic control and hacking according to a preferred embodiment of the present invention.

도 3을 참조하면, 응용 프로그램이 운영체제에게 요청한 통신 요청을 통신 요청 모니터링부(111)을 이용하여 모니터링하고 수신한다(S301).Referring to FIG. 3, the application program monitors and receives a communication request requested by the operating system using the communication request monitoring unit 111 (S301).

상기 통신 요청 모니터링 단계에서 수신된 통신 요청의 발신 쓰레드를 쓰레드 판독부(112)를 이용하여 판독한다(S302).The originating thread of the communication request received in the communication request monitoring step is read using the thread reader 112 (S302).

상기 쓰레드 판독 단계에서 판독된 쓰레드의 스택 메모리를 스택 역추적을 통한 모듈 검사부(113)를 이용하여 상기 통신에 관여한 모듈만 선별적으로 악성 모 듈 여부를 검사한다(S303).Only the modules involved in the communication are selectively checked for malicious modules by using the module inspecting unit 113 through the stack traceback of the stack memory of the thread read in the thread reading step (S303).

상기 악성 모듈 검사 결과 통신 요청에 관여한 모듈 중 악성 모듈이 포함되어 있다면(S304) 상기 통신 요청을 차단하고(S306), 악성 모듈이 포함되지 않았다면(S304) 상기 통신 요청을 허용(S305)한다.If a malicious module is included in the module involved in the communication request as a result of the malicious module check (S304), the communication request is blocked (S306), and if the malicious module is not included (S304), the communication request is allowed (S305).

도 4는 상기 스택 역추적을 통한 모듈 검사 단계(S303)를 설명하기 위한 흐름도이다.4 is a flowchart for explaining a module inspection step S303 through the stack traceback.

도 4를 참조하면, 쓰레드 컨텍스트 추출부(201)을 이용하여 상기 쓰레드 판독 단계(S302)에서 판독한 쓰레드의 컨텍스트를 추출하고, 쓰레드 컨텍스트 내의 베이스 포인터 레지스터 값을 BP 변수에, 명령어 포인터 레지스터 값을 IP 변수에 저장한다(S401).Referring to FIG. 4, the context of the thread read in the thread reading step S302 is extracted using the thread context extracting unit 201, and the base pointer register value in the thread context is converted into a BP variable, and the instruction pointer register value is set. Store in an IP variable (S401).

다음, 상기 IP 변수에 저장되어 있는 주소를 기초로 모듈 추출부(203)를 이용하여 상기 IP 변수에 해당하는 모듈을 추출한다(S402).Next, the module corresponding to the IP variable is extracted using the module extracting unit 203 based on the address stored in the IP variable (S402).

상기 추출된 모듈을 대상으로 악성 모듈 검사를 할 필요가 있는가를 판단하여(S403), 검사가 필요하다면 악성 모듈 검사를 한다(S404).It is determined whether the malicious module needs to be examined for the extracted module (S403), and if necessary, the malicious module is examined (S404).

상기 악성 모듈 검사 결과 악성 모듈로 판단되면(S405) 악성 모듈이 발견되었음을 반환하고(S406), 악성 모듈이 아닌 것으로 판단되면(S405) 이전 스택 프레임을 추출하여 스택 프레임 내의 베이스 포인터 레지스터 값을 BP 변수에, 명령어 포인터 레지스터 값을 IP 변수에 저장한다(S407).If it is determined that the malicious module is a malicious module (S405), a malicious module is found (S406). If it is determined that the malicious module is not a malicious module (S405), the previous stack frame is extracted and the base pointer register value in the stack frame is converted into a BP variable. In operation S407, the instruction pointer register value is stored in the IP variable.

상기 스택 프레임 추출 단계(S407)에서 이전 스택 프레임을 추출한 결과 더 이상 조사할 스택 프레임이 없다고 판단되면(S408) 악성 모듈이 발견되지 않았음을 반환하고(S409), 더 조사할 스택 프레임이 있다고 판단되면(S408) 상기 IP 주소의 모듈 추출 단계(S402)로 되돌아가 반복 처리를 한다.If the stack frame extraction step (S407) extracts the previous stack frame and determines that there are no more stack frames to be investigated (S408), it returns that no malicious module is found (S409) and determines that there are stack frames to be further investigated. In step S408, the process returns to the module extraction step S402 of the IP address and repeats the process.

상기 IP 주소의 모듈 추출 단계(S402)에서 추출된 모듈을 대상으로 악성 모듈 검사를 할 것인가를 판단하는 단계(S403)는 생략될 수도 있다. 이 경우 IP 주소의 모듈 추출 단계(S402)에서 추출되는 모든 모듈을 대상으로 악성 모듈 검사를 한다.The step S403 of determining whether to perform a malicious module inspection on the module extracted in the module extraction step S402 of the IP address may be omitted. In this case, a malicious module is examined for all modules extracted in the module extraction step S402 of the IP address.

이상과 같이 본 발명의 일실시예를 32비트 x86 호환 프로세서 상에서 구동되는 32비트 윈도우 운영체제환경 하에서 설명하였다. 그러나, 본 발명은 이와 같은 특정 플랫폼, 특정 운영체제 환경, 특정한 API의 사용, 특정한 변수 이름의 사용 등에 의해 한정되지 아니하며, 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자에 의해 본 발명의 기술 사상과 아래에 기재된 특허 청구범위의 균등 범위 내에서 다양한 수정 및 변형이 가능함은 당연한 사실이다.As described above, an embodiment of the present invention has been described under a 32-bit Windows operating system environment running on a 32-bit x86 compatible processor. However, the present invention is not limited to such a specific platform, a specific operating system environment, the use of a specific API, the use of a specific variable name, etc., and the spirit of the present invention by those skilled in the art to which the present invention pertains. It is a matter of course that various modifications and variations can be made within the equivalent scope of the claims set out below.

도 1은 본 발명의 바람직한 실시예에 따른 유해 트래픽 제어 및 해킹을 차단하는 장치의 블록도이며,1 is a block diagram of an apparatus for blocking harmful traffic control and hacking according to a preferred embodiment of the present invention,

도 2는 상기 도 1의 스택 역추적을 통한 모듈 검사부의 블록도이며,FIG. 2 is a block diagram of a module inspecting unit through the stack traceback of FIG. 1.

도 3은 본 발명의 바람직한 실시예에 따른 유해 트래픽 제어 및 해킹을 차단하는 방법의 흐름도이며,3 is a flowchart of a method for blocking harmful traffic control and hacking according to a preferred embodiment of the present invention;

도 4은 상기 도 3의 스택 역추적을 통한 모듈 검사 단계를 나타내는 흐름도이고,4 is a flowchart illustrating a module inspection step through the stack traceback of FIG. 3;

도 5은 스택 역추적 과정을 설명하기 위한 응용 프로그램의 모듈간 호출 과정을 예시한 블록도이며,5 is a block diagram illustrating an intermodule call process of an application program for explaining a stack traceback process.

도 6은 실행중인 응용 프로그램에게 할당된 주소 공간(address space)의 레이아웃을 예시한 블록도이며,6 is a block diagram illustrating the layout of an address space allocated to a running application.

도 7은 프로세스 내에서 실행중인 특정 쓰레드의 스택 공간을 구체적으로 예시한 블록도이며,7 is a block diagram specifically illustrating a stack space of a specific thread executing in a process.

도 8은 특정 쓰레드를 관리하기 위해 사용되는 커널 쓰레드 오브젝트를 예시한 블록도이다.8 is a block diagram illustrating a kernel thread object used to manage a particular thread.

< 도면의 주요 참조부호에 대한 설명 ><Description of Major Reference Marks in Drawings>

110: 유해 트래픽 제어 및 해킹을 차단하는 장치110: Device to block harmful traffic and hacking

S403: 모듈 필터링 단계S403: Module Filtering Step

S408: 마지막 스택 프레임 판단 단계S408: final stack frame determination step

500: 응용 프로그램의 프로세스500: process of the application

800: 커널 쓰레드 오브젝트800: kernel thread object

810: 커널 쓰레드 오브젝트 내의 CONTEXT 자료구조810: CONTEXT data structure in kernel thread objects

Claims (12)

컴퓨터 시스템에서 유해 트래픽 제어 및 해킹을 차단하는 장치에 있어서,A device for preventing harmful traffic control and hacking in a computer system, 응용 프로그램이 운영체제로 요청한 통신 요청을 모니터링하는 통신 요청 모니터링부와;A communication request monitoring unit configured to monitor a communication request requested by the application program to the operating system; 상기 통신 요청 모니터링부에서 수신한 통신 요청의 발신 쓰레드를 판독하는 쓰레드 판독부와;A thread reader for reading the originating thread of the communication request received by the communication request monitoring unit; 상기 쓰레드 판독부에서 판독된 쓰레드의 스택 메모리를 역추적하여 상기 통신 요청과 관련된 모듈을 선별적으로 검사하는 스택 역추적을 통한 모듈 검사부와;A module checker through a stack traceback for selectively checking a stack memory of a thread read by the thread reader and selectively checking a module related to the communication request; 상기 스택 역추적을 통한 모듈 검사부의 검사 결과에 따라 통신 요청을 허용하거나 차단하는 통신 요청 처리부;A communication request processing unit allowing or blocking a communication request according to a test result of the module inspecting unit through the stack traceback; 를 포함하는 것을 특징으로 하는 유해 트래픽 제어 및 해킹을 차단하는 장치.Apparatus for blocking harmful traffic control and hacking comprising a. 제 1항에 있어서,The method of claim 1, 스택 역추적을 통한 모듈 검사부는,Module inspection unit through the stack traceback, 상기 쓰레드 판독부에서 판독된 쓰레드의 컨텍스트를 추출하는 쓰레드 컨텍스트 추출부와;A thread context extracting unit for extracting a context of a thread read by the thread reading unit; 상기 쓰레드 판독부에서 판독된 쓰레드의 스택 메모리를 상기 쓰레드 컨텍스트 추출부에서 추출된 베이스 포인터 레지스터의 값을 이용하여 역추적하는 스택 역추적부와;A stack traceback unit which traces back the stack memory of the thread read by the thread reader using a value of the base pointer register extracted by the thread context extractor; 상기 쓰레드 컨텍스트 추출부와 상기 스택 역추적부에서 추출한 명령어 포인터의 주소에 해당하는 모듈을 추출하는 모듈 추출부와;A module extracting unit extracting a module corresponding to an address of an instruction pointer extracted from the thread context extracting unit and the stack traceback unit; 상기 모듈 추출부에서 추출된 모듈을 대상으로 악성 모듈 검사를 수행하는 악성 모듈 검사부;A malicious module inspection unit which performs a malicious module inspection on the module extracted by the module extracting unit; 를 포함하는 것을 특징으로 하는 유해 트래픽 제어 및 해킹을 차단하는 장치.Apparatus for blocking harmful traffic control and hacking comprising a. 제 2항에 있어서,3. The method of claim 2, 상기 모듈 추출부에서 추출된 모듈을 대상으로 악성 모듈 검사를 할 것인지를 판단하여, 악성 모듈 검사를 할 필요가 있다고 판단되면 상기 악성 모듈 검사부를 이용하여 악성 모듈 검사를 하고, 악성 모듈 검사를 할 필요가 없다고 판단되면 악성 모듈 검사를 생략하도록 하는 모듈 필터링부;If it is determined that the malicious module inspection is to be performed on the module extracted by the module extracting unit, and it is determined that the malicious module inspection is necessary, it is necessary to inspect the malicious module using the malicious module inspection unit, and perform the malicious module inspection. A module filtering unit to skip the malicious module check if it is determined that there is no; 를 더 포함하는 것을 특징으로 하는 유해 트래픽 제어 및 해킹을 차단하는 장치.Apparatus for blocking harmful traffic control and hack further comprising a. 제 1항 내지 제 3항 중 어느 한 항에 있어서,The method according to any one of claims 1 to 3, 상기 통신 요청 모니터링부는 커널 모드의 드라이버로 만들어지는 것을 특징으로 하는 유해 트래픽 제어 및 해킹을 차단하는 장치.And the communication request monitoring unit blocks harmful traffic control and hacking, wherein the communication request monitoring unit is made of a kernel mode driver. 제 4항에 있어서,The method of claim 4, wherein 상기 통신 요청 모니터링부가 모니터링하는 통신 요청은 IRP(I/O Request Packet)의 형태를 가지는 것을 특징으로 하는 유해 트래픽 제어 및 해킹을 차단하는 장치.Apparatus for blocking harmful traffic control and hacking, characterized in that the communication request monitored by the communication request monitoring unit has the form of an I / O Request Packet (IRP). 제 1항 내지 제 3항 중 어느 한 항에 있어서,The method according to any one of claims 1 to 3, 상기 통신 요청 모니터링부는 API 후킹을 이용하는 것을 특징으로 하는 유해 트래픽 제어 및 해킹을 차단하는 장치.The communication request monitoring unit blocks harmful traffic control and hacking, characterized in that using the API hooking. 컴퓨터 시스템에서 유해 트래픽 제어 및 해킹을 차단하는 방법에 있어서,A method of preventing harmful traffic control and hacking in a computer system, 응용 프로그램이 운영체제로 요청한 통신 요청을 모니터링하는 통신 요청 모니터링 단계;A communication request monitoring step of monitoring a communication request requested by an application program to an operating system; 상기 통신 요청 모니터링 단계에서 수신된 통신 요청에서 통신 요청의 발신 쓰레드를 판독하는 쓰레드 판독 단계;A thread reading step of reading the originating thread of the communication request from the communication request received in the communication request monitoring step; 상기 쓰레드 판독 단계에서 판독된 쓰레드의 스택 메모리를 역추적하여 악성 모듈을 검사하는 스택 역추적을 통한 모듈 검사 단계;A module checking step of stack tracing to check a malicious module by tracing the stack memory of the thread read in the thread reading step; 상기 스택 역추적을 통한 모듈 검사 단계의 검사 결과에 따라 통신 요청을 허용하거나 차단하는 통신 요청 처리 단계;A communication request processing step of allowing or blocking a communication request according to a check result of the module checking step through the stack traceback; 를 포함하는 것을 특징으로 하는 유해 트래픽 제어 및 해킹을 차단하는 방법.Method for blocking harmful traffic control and hacks comprising a. 제 7항에 있어서,The method of claim 7, wherein 스택 역추적을 통한 모듈 검사 단계는,The module inspection step through stack traceback 상기 쓰레드 판독 단계에서 판독된 쓰레드의 컨텍스트를 추출하여, 쓰레드 컨텍스트 내의 베이스 포인터를 BP 변수에, 명령어 포인터를 IP 변수에 대입하는 쓰레드 컨텍스트 추출 단계;A thread context extraction step of extracting a context of a thread read in the thread reading step and assigning a base pointer in a thread context to a BP variable and an instruction pointer to an IP variable; 상기 IP 변수의 값이 가리키는 주소에 로딩되어 있는 모듈을 추출하는 IP 주소의 모듈 추출 단계;Extracting a module of an IP address for extracting a module loaded at an address indicated by the value of the IP variable; 상기 추출된 모듈을 대상으로 악성 모듈 검사를 하여 악성 모듈이라면 상기 모듈을 악성 모듈로 판단하는 악성 모듈 검사 단계;A malicious module inspection step of performing a malicious module inspection on the extracted module and determining the module as a malicious module if it is a malicious module; 상기 악성 모듈 검사 단계에서 악성 모듈이 아닌 것으로 판단되면 상기 쓰레드의 스택 메모리에서 스택 프레임을 추출하여, 스택 프레임 내의 베이스 포인터를 BP 변수에, 명령어 포인터를 IP 변수에 저장하는 스택 프레임 추출 단계;A stack frame extracting step of extracting a stack frame from the stack memory of the thread, and storing a base pointer in a stack frame in a BP variable and an instruction pointer in an IP variable in the malicious module checking step; 상기 스택 프레임 추출 단계의 실행 결과, 더 이상 조사할 스택 프레임이 없다면 악성 모듈이 발견되지 않은 것으로 판단하고, 더 조사할 스택 프레임이 있다면 상기 IP 주소의 모듈 추출 단계로 되돌아가 처리를 계속하는, 마지막 스택 프레임 판단 단계;As a result of the execution of the stack frame extraction step, if there is no stack frame to be investigated further, it is determined that no malicious module is found. If there is a stack frame to be investigated further, the process returns to the module extraction step of the IP address and continues processing Stack frame determination step; 를 포함하는 것을 특징으로 하는 유해 트래픽 제어 및 해킹을 차단하는 방법.Method for blocking harmful traffic control and hacks comprising a. 제 8항에 있어서,The method of claim 8, 상기 IP 주소의 모듈 추출 단계에서 추출된 모듈을 대상으로 악성 모듈 검사를 할 것인지를 판단하여, 악성 모듈 검사를 할 필요가 있다고 판단되면 상기 악성 모듈 검사부를 이용하여 악성 모듈 검사를 하고, 악성 모듈 검사를 할 필요가 없다고 판단되면 악성 모듈 검사를 생략하도록 하는 모듈 필터링 단계;It is determined whether to perform a malicious module test on the module extracted in the module extraction step of the IP address, and if it is determined that the malicious module needs to be inspected, the malicious module checker performs a malicious module check, and a malicious module check is performed. A module filtering step of omitting a malicious module check if it is determined that it is not necessary to do so; 를 더 포함하는 것을 특징으로 하는 유해 트래픽 제어 및 해킹을 차단하는 방법.Method for blocking harmful traffic control and hack further comprising a. 제 7항 내지 제 9항 중 어느 한 항에 있어서,The method according to any one of claims 7 to 9, 통신 요청 모니터링 단계에서 통신 요청의 수신은 커널 모드 드라이버로 수행되는 것을 특징으로 하는 유해 트래픽 제어 및 해킹을 차단하는 방법.Receiving a communication request in the communication request monitoring step is performed by a kernel mode driver, the harmful traffic control and hacking method. 제 10항에 있어서,The method of claim 10, 상기 커널 모드 드라이버에서 수신되는 통신 요청은 IRP(I/O Request Packet)의 형태로 된 것을 특징으로 하는 유해 트래픽 제어 및 해킹을 차단하는 방법.The communication request received from the kernel mode driver is a method for blocking harmful traffic and hacking, characterized in that in the form of IRP (I / O Request Packet). 제 7항 내지 제 9항 중 어느 한 항에 있어서,The method according to any one of claims 7 to 9, 통신 요청 모니터링 단계에서 통신 요청의 수신은 API 후킹을 이용하는 것을 특징으로 하는 유해 트래픽 제어 및 해킹을 차단하는 방법.Receiving a communication request at the communication request monitoring step uses API hooking.
KR1020090032313A 2009-04-14 2009-04-14 Apparatus and method to prevent harmful traffic control and hacking KR101053470B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020090032313A KR101053470B1 (en) 2009-04-14 2009-04-14 Apparatus and method to prevent harmful traffic control and hacking

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020090032313A KR101053470B1 (en) 2009-04-14 2009-04-14 Apparatus and method to prevent harmful traffic control and hacking

Publications (2)

Publication Number Publication Date
KR20100113802A true KR20100113802A (en) 2010-10-22
KR101053470B1 KR101053470B1 (en) 2011-08-03

Family

ID=43133197

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020090032313A KR101053470B1 (en) 2009-04-14 2009-04-14 Apparatus and method to prevent harmful traffic control and hacking

Country Status (1)

Country Link
KR (1) KR101053470B1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014123314A1 (en) * 2013-02-05 2014-08-14 (주)잉카인터넷 System and method for tracking remote access server accessed by mallicious code
US9246937B2 (en) 2011-06-23 2016-01-26 Inca Internet Co., Ltd. Network access control system and method

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102082889B1 (en) * 2018-10-24 2020-04-23 국방과학연구소 Apparatus and method for analyzing protocol

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100520788B1 (en) * 2003-06-03 2005-10-17 주식회사 안철수연구소 Device and Method For Detecting Malicious Thread
KR100647274B1 (en) 2006-03-08 2006-11-23 주식회사 파이오링크 Fire wall system of controlling http traffic and method of operating the system
US20080016339A1 (en) 2006-06-29 2008-01-17 Jayant Shukla Application Sandbox to Detect, Remove, and Prevent Malware

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9246937B2 (en) 2011-06-23 2016-01-26 Inca Internet Co., Ltd. Network access control system and method
WO2014123314A1 (en) * 2013-02-05 2014-08-14 (주)잉카인터넷 System and method for tracking remote access server accessed by mallicious code

Also Published As

Publication number Publication date
KR101053470B1 (en) 2011-08-03

Similar Documents

Publication Publication Date Title
US10599841B2 (en) System and method for reverse command shell detection
US10657251B1 (en) Multistage system and method for analyzing obfuscated content for malware
US11960605B2 (en) Dynamic analysis techniques for applications
US11604878B2 (en) Dynamic analysis techniques for applications
US11625489B2 (en) Techniques for securing execution environments by quarantining software containers
Murray et al. Improving Xen security through disaggregation
US9548990B2 (en) Detecting a heap spray attack
US10505975B2 (en) Automatic repair of corrupt files for a detonation engine
US9584550B2 (en) Exploit detection based on heap spray detection
US10771477B2 (en) Mitigating communications and control attempts
CN109558207B (en) System and method for forming log for anti-virus scanning of file in virtual machine
US11157618B2 (en) Context-based analysis of applications
US20190138715A1 (en) Post sandbox methods and systems for detecting and blocking zero-day exploits via api call validation
US11880465B2 (en) Analyzing multiple CPU architecture malware samples
CN116340943A (en) Application program protection method, device, equipment, storage medium and program product
KR101053470B1 (en) Apparatus and method to prevent harmful traffic control and hacking
WO2021243555A1 (en) Quick application test method and apparatus, device, and storage medium
CN117032894A (en) Container security state detection method and device, electronic equipment and storage medium
KR20110036426A (en) System and method for backtracing stack
Andersson et al. Network-based buffer overflow detection by exploit code analysis
Shlingbaum et al. Virtualized network packet inspection

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20140527

Year of fee payment: 4

FPAY Annual fee payment

Payment date: 20150528

Year of fee payment: 5

LAPS Lapse due to unpaid annual fee