KR101217546B1 - Method and system to detect and intercept heap spray attack based on realtime - Google Patents

Method and system to detect and intercept heap spray attack based on realtime Download PDF

Info

Publication number
KR101217546B1
KR101217546B1 KR1020100117185A KR20100117185A KR101217546B1 KR 101217546 B1 KR101217546 B1 KR 101217546B1 KR 1020100117185 A KR1020100117185 A KR 1020100117185A KR 20100117185 A KR20100117185 A KR 20100117185A KR 101217546 B1 KR101217546 B1 KR 101217546B1
Authority
KR
South Korea
Prior art keywords
heap memory
heap
changed
code
shellcode
Prior art date
Application number
KR1020100117185A
Other languages
Korean (ko)
Other versions
KR20120055790A (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 KR1020100117185A priority Critical patent/KR101217546B1/en
Publication of KR20120055790A publication Critical patent/KR20120055790A/en
Application granted granted Critical
Publication of KR101217546B1 publication Critical patent/KR101217546B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/55Detecting local intrusion or implementing counter-measures
    • G06F21/56Computer malware detection or handling, e.g. anti-virus arrangements
    • G06F21/562Static detection
    • G06F21/563Static detection by source code analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/55Detecting local intrusion or implementing counter-measures
    • G06F21/56Computer malware detection or handling, e.g. anti-virus arrangements
    • G06F21/566Dynamic detection, i.e. detection performed at run-time, e.g. emulation, suspicious activities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1441Countermeasures against malicious traffic
    • H04L63/145Countermeasures against malicious traffic the attack involving the propagation of malware through the network, e.g. viruses, trojans or worms

Abstract

본 발명은 힙 스프레이 공격을 실시간으로 탐지하고 차단할 수 있는 방법 및 시스템에 관한 것이다. 본 발명의 일 태양에 따르면, 힙 스프레이 공격(Heap Spray Attack)의 실시간 탐지 및 차단 방법은 특정 웹페이지의 소스 코드에 포함된 스크립트 코드를 분석하여, 상기 스크립트 코드에 의해 힙 메모리를 변경하는지 감시하는 감시 단계와, 상기 힙 메모리의 변경이 감지되는 경우 변경된 상기 힙 메모리의 영역이 NOP Sled를 포함하는지 판단하는 제1 분석 단계와, 상기 힙 메모리의 변경이 감지되는 경우 변경된 상기 힙 메모리의 영역이 쉘코드를 포함하는지 판단하는 제2 분석 단계, 및 상기 제1 분석 단계 및 제2 분석 단계 모두를 통과한 경우 변경된 상기 힙 메모리의 영역을 변환하여 기록하는 공격 차단 단계를 포함한다.The present invention relates to a method and system that can detect and block heap spray attacks in real time. According to an aspect of the present invention, a method for real-time detection and blocking of a heap spray attack analyzes script code included in source code of a specific web page, and monitors whether the heap memory is changed by the script code. A monitoring step, a first analyzing step of determining whether the changed heap memory area includes a NOP sled when a change of the heap memory is detected, and an area of the changed heap memory is shelled when a change of the heap memory is detected. A second analysis step of determining whether to include a code, and an attack blocking step of converting and recording the changed area of the heap memory when both the first analysis step and the second analysis step are passed.

Description

힙 스프레이 공격의 실시간 탐지 및 차단 방법 및 시스템 {METHOD AND SYSTEM TO DETECT AND INTERCEPT HEAP SPRAY ATTACK BASED ON REALTIME} METHOD AND SYSTEM TO DETECT AND INTERCEPT HEAP SPRAY ATTACK BASED ON REALTIME}

본 발명은 힙 스프레이 공격을 실시간으로 탐지하고 차단할 수 있는 방법 및 시스템에 관한 것으로, 더욱 상세하게는 웹 브라우저의 취약점을 이용하여 웹 브라우저의 힙 메모리를 특정 패턴으로 조작한 뒤 실행되는 취약점 코드를 이용한 힙 스프레이 공격을 실시간으로 탐지하여 사용자의 웹 브라우저 사용에 영향을 미치지 않으면서도 차단할 수 있는 실시간 탐지 및 차단 방법 및 시스템에 관한 것이다.The present invention relates to a method and system that can detect and block a heap spray attack in real time, and more particularly, using a vulnerability code that is executed after manipulating a heap memory of a web browser in a specific pattern using a vulnerability of a web browser. The present invention relates to a real-time detection and blocking method and system that can detect a heap spray attack in real time and block it without affecting the user's web browser use.

인터넷의 사용이 보편화되고 그 기술이 발달함에 따라 인터넷을 통해서 전파될 수 있는 공격 코드의 수 및 종류도 다양화되고 발달하고 있다. 그 중, 가장 취약하고 많은 공격 대상이 되는 것이 웹브라우저의 취약점을 이용한 공격 코드의 공격이며, 그 중 0-Day 공격은 스크립트 언어를 이용하여 웹 브라우저의 취약점을 공격하는 방식이다. 이러한 웹브라우저의 취약점 공격 방식은 그 코드가 자바 스크립트 등의 스크립트 언어로 작성될 수 있기 때문에 누구나 쉽게 복사해서 이용할 수 있으며, 따라서 전문적인 지식이 없더라도 누구나 쉽게 공격 코드를 전파시킬 수 있어 그 파급력이 크다는 문제점이 있다. As the use of the Internet becomes more common and the technology is developed, the number and types of attack codes that can be transmitted through the Internet are also diversified and developed. Among them, the most vulnerable and the most target of attack are attack code exploiting vulnerabilities of web browser. Among them, 0-day attack is a method of attacking web browser vulnerabilities using script language. Since the web browser's vulnerability attack method can be written in a scripting language such as JavaScript, anyone can easily copy and use it. Therefore, anyone can easily propagate the attack code without the expert knowledge. There is a problem.

보다 구체적으로, 대부분의 이러한 공격 코드는 두 단계에 걸쳐서 공격을 진행하며, 먼저 웹브라우저의 메모리 조작을 통해 NOP(No-Operation) Sled 및 쉘코드(Shellcode)가 결합된 패턴을 공격 대상 시스템의 힙 메모리(Heap Memory)에 적재하는 제1단계와, 웹브라우저의 취약점을 이용하여 힙 메모리의 주소로 프로그램을 분기하여 NOP Sled 뒤에 배치된 쉘코드를 실행하도록 하는 제2단계를 포함하여 힙 스프레이 공격(Heap Spray Attack)이라고도 불리운다. 여기서, NOP Sled는 실질적으로 아무런 기능도 하지 않는 No-operation의 연속된 배열을 의미하며, 쉘코드는 일련의 컴퓨터 프로그램 명령으로 이루어진 코드 중 시스템의 권한 획득을 목표로 작성된 코드를 지칭하는 것으로 이러한 쉘코드가 특정 시스템에서 실행될 경우 공격자는 해당 시스템의 권한을 취득할 수 있는 것이다. 또한 힙 메모리는 프로그램을 사용할 수 있는 대량의 자유 메모리를 의미하는 것으로, 힙 메모리 영역을 나타내는 도 1 중 영역 A와 같이 힙 메모리가 NOP Sled와 쉘코드로 적재되어 있다면, 웹 브라우저의 취약점으로 인해 프로세스 또는 스레드(Thread) 실행이 힙 메모리의 영역 A 중 어딘가로 분기되는 경우, NOP Sled를 거쳐서 최종적으로 시스템의 권한을 획득할 수 있는 쉘코드를 실행하게 되는 것이다. More specifically, most of these attack codes are attacked in two stages. First, through the memory manipulation of the web browser, the pattern of the combination of No-Operation (Sled) and Shellcode (Shellcode) is applied to the heap of the target system. Heap spray attack (including the first step of loading into the heap memory and the second step of branching the program to the address of the heap memory using a vulnerability in the web browser to execute shellcode placed after NOP Sled) Also called Heap Spray Attack. Here, NOP Sled refers to a continuous array of no-operations that do virtually no function, and shellcode refers to code written for the purpose of acquiring the system among codes consisting of a series of computer program instructions. If the code is run on a particular system, the attacker could gain privileges on that system. Also, heap memory refers to a large amount of free memory that can be used by a program. If heap memory is loaded with NOP Sled and shellcode, as shown in area A in FIG. Or, if the thread execution is branched somewhere in the area A of the heap memory, it executes shellcode that finally acquires the system authority through the NOP Sled.

이와 같이, 웹브라우저의 메모리를 조작하여 최종적으로 쉘코드까지 실행하도록 유도하는 공격 코드로서 스크립트 언어가 많이 사용되며, 그 중에서도 특히 자바 스크립트나 비주얼 베이직 스크립트로 작성된 코드는 웹 브라우저에서 특별한 어플리케이션의 설치 없이 실행이 가능한 특징을 갖고 있다. 이와 관련하여 웹 브라우저의 경우 ActiveX 객체를 포함하는 운영체제에서 사용 가능한 대부분의 파일 객체를 로드할 수 있기 때문에 웹페이지 안에 삽입된 상기 스크립트 언어로 제작된 공격 코드는 웹 브라우저 내에 존재하는 취약점뿐만 아니라 웹 브라우저에서 로드 가능한 객체 역시 공격 대상으로 할 수 있다. As such, the scripting language is widely used as an attack code for manipulating the memory of the web browser and finally executing the shellcode, and the code written in Javascript or Visual Basic Script is especially used without installing a special application in the web browser. It has a viable feature. In this regard, since a web browser can load most file objects available in an operating system containing an ActiveX object, attack code written in the scripting language embedded in a web page is not only a vulnerability that exists in the web browser, but also a web browser. Loadable objects from can also be targeted.

이러한 공격 코드에 의한 피해를 방지하기 위한 종래 기술의 일례로 공격 코드의 시그니처(Signiture)를 작성한 후, 시그니처 패턴과 일치하는 공격 코드가 검색되면 해당 파일을 차단하는 방안이 제안되었다. 그러나 이러한 종래의 공격 코드 방지 기술은 힙 스프레이 공격에 특화된 것이 아니라 공격 코드라고 판단되는 스크립트 코드를 그 대상으로 하므로 힙 스프레이 공격에 특히 약한 모습을 보이고 있다. 또한, 행위 기반의 탐지가 아닌 스크립트 코드의 시그니처 패턴을 기반으로 탐지를 수행하므로 시그니처가 존재하지 않는 새로운 공격 코드 또는 유사한 변종의 공격 코드를 탐지하거나 차단할 수 없으므로 개개의 공격 코드에 대한 시그니처를 일일히 작성해야 하는 어려움이 있다. 게다가, 시그니처가 이미 존재하는 공격 코드의 경우에도 해당 공격 코드가 암호화되거나 조작되는 경우에는 기존에 작성된 시그니처로는 이를 탐지할 수 없는 문제점이 존재하였다. As an example of the prior art for preventing the damage caused by the attack code, a signature of the attack code is created, and then a method of blocking the file when an attack code matching the signature pattern is found is proposed. However, such a conventional attack code prevention technique is not particularly specialized for a heap spray attack, but targets script code that is determined to be an attack code, and thus has been particularly weak in a heap spray attack. In addition, detection is based on the signature pattern of script code rather than behavior-based detection, so signatures for individual attack codes cannot be detected or blocked because new signatures or similar variants of the signature code do not exist. There is a difficulty to fill out. In addition, even in the case of an attack code in which a signature already exists, there is a problem that the signature that was previously created cannot be detected when the attack code is encrypted or manipulated.

또한, 종래 기술의 다른 예로서 힙 스프레이 공격의 특징을 이용하여 동일한 크기를 갖는 하나 이상의 서브 영역이 연속해서 위치하는 경우 힙 스프레이 공격으로 판단하고 웹 브라우저의 실행을 차단하도록 하는 방안도 제시되었다. 하지만, 일반적이고 정상적인 프로그램의 실행 과정에서도 동일한 크기를 갖는 연속적인 서브 영역이 흔히 존재할 수 있기 때문에 단순히 힙 스프레이 공격의 특징과 유사하다는 이유만으로 공격으로 판단하는 경우 힙 스프레이 공격의 탐지 정확율이 크게 감소하고 오진의 가능성이 높은 문제점이 문제점이 발생할 수 있다. 또한, 종래 기술에 의한 힙 스프레이 공격 판단시 웹 브라우저의 실행을 차단, 즉 웹 브라우저의 실행을 종료시키는 수동적인 방법만을 사용하고 있어 기술적인 내용에 무지한 사용자에게 큰 걱정을 끼칠 수 있으며, 그 정확도가 떨어짐으로 인해 사용자가 정상적인 웹페이지를 방문하였는데도 불구하고 웹 브라우저의 실행이 종료될 가능성도 높아 사용자의 사용상 불편함이 가중되는 문제점 또한 존재하고 있다.In addition, as another example of the prior art, a method of determining a heap spray attack and blocking the execution of a web browser when one or more sub-regions having the same size are continuously positioned using the features of the heap spray attack has been proposed. However, since successive subregions with the same size can often exist in the course of normal and normal program execution, the accuracy of detection of the heap spray attack is greatly reduced when judged as an attack simply because it is similar to the characteristics of the heap spray attack. Problems that are more likely to be misdiagnosed can cause problems. In addition, since the conventional method of determining the heap spray attack is only a passive method of blocking the execution of the web browser, that is, stopping the execution of the web browser, it may cause a great concern for users who are unfamiliar with the technical content. Even if the user visits a normal web page due to the fall, there is a problem that the execution of the web browser is likely to be terminated.

본 발명의 목적은 위에서 언급한 종래 기술의 문제점을 해결하는 것이다. An object of the present invention is to solve the above-mentioned problems of the prior art.

본 발명의 일 목적은 웹 브라우저의 힙 메모리를 실시간으로 감시하면서 NOP Sled 및 쉘코드 모두의 존재 여부를 판단하여 힙 스프레이 공격 탐지시 보다 높은 정확률을 제공할 수 있도록 하는 것이다. One object of the present invention is to monitor the heap memory of the web browser in real time to determine the presence of both NOP Sled and shellcode to provide a higher accuracy when detecting a heap spray attack.

또한, 본 발명의 다른 목적은 힙 스프레이 공격 탐지시 쉘코드의 변환을 통해 힙 스프레이 공격을 차단하면서도 사용자는 웹 브라우저의 실행 종료 없이 정상적으로 웹페이지를 방문할 수 있도록 함으로써 사용자가 불편없이 웹 브라우저를 사용할 수 있도록 하는 것이다.In addition, another object of the present invention is to block the heap spray attack by converting the shellcode when the heap spray attack is detected, while allowing the user to visit the web page normally without ending the execution of the web browser, the user can use the web browser without inconvenience To make it possible.

상기한 바와 같은 본 발명의 목적을 달성하고, 후술하는 본 발명의 특유의 효과를 달성하기 위한, 본 발명의 특징적인 구성은 하기와 같다. In order to achieve the above-described object of the present invention and to achieve the specific effects of the present invention described below, the characteristic structure of the present invention is as follows.

본 발명의 일 태양에 따르면, 힙 스프레이 공격(Heap Spray Attack)의 실시간 탐지 및 차단 방법은 특정 웹페이지의 소스 코드에 포함된 스크립트 코드를 분석하여, 상기 스크립트 코드에 의해 힙 메모리를 변경하는지 감시하는 감시 단계와, 상기 힙 메모리의 변경이 감지되는 경우 변경된 상기 힙 메모리의 영역이 NOP Sled를 포함하는지 판단하는 제1 분석 단계와, 상기 힙 메모리의 변경이 감지되는 경우 변경된 상기 힙 메모리의 영역이 쉘코드를 포함하는지 판단하는 제2 분석 단계, 및 상기 제1 분석 단계 및 제2 분석 단계 모두를 통과한 경우 변경된 상기 힙 메모리의 영역을 변환하여 기록하는 공격 차단 단계의 수행을 통해 얻어진다. According to an aspect of the present invention, a method for real-time detection and blocking of a heap spray attack analyzes script code included in source code of a specific web page, and monitors whether the heap memory is changed by the script code. A monitoring step, a first analyzing step of determining whether the changed heap memory area includes a NOP sled when a change of the heap memory is detected, and an area of the changed heap memory is shelled when a change of the heap memory is detected. And a second analysis step for determining whether to include a code, and an attack blocking step for converting and writing the changed region of the heap memory when both the first analysis step and the second analysis step are passed.

본 발명의 다른 태양에 따르면, 힙 스프레이 공격(Heap Spray Attack)의 실시간 탐지 및 차단 시스템은 특정 웹페이지의 소스 코드에 포함된 스크립트 코드를 분석하여, 상기 스크립트 코드에 의해 힙 메모리를 변경하는지 감시하는 힙 메모리 감시부와, 상기 힙 메모리의 변경이 감지되는 경우 변경된 상기 힙 메모리의 영역이 NOP Sled를 포함하는지 판단하는 제1 분석 모듈 및 상기 힙 메모리의 변경이 감지되는 경우 변경된 상기 힙 메모리의 영역이 쉘코드를 포함하는지 판단하는 제2 분석 모듈을 포함하는 힙 메모리 분석부, 및 상기 제1 분석 단계 및 제2 분석 단계 모두를 통과한 경우 변경된 상기 힙 메모리의 영역을 변환하여 기록하는 힙 스프레이 공격 차단부를 포함한다.According to another aspect of the present invention, a real-time detection and blocking system of a heap spray attack analyzes script code included in source code of a specific web page and monitors whether the heap memory is changed by the script code. A heap memory monitoring unit, a first analysis module that determines whether the changed heap memory area includes NOP Sled when a change of the heap memory is detected, and an area of the changed heap memory when a change of the heap memory is detected Heap memory analysis unit including a second analysis module for determining whether to include shell code, and a heap spray attack blocking for converting and recording the changed region of the heap memory when passing both the first analysis step and the second analysis step Contains wealth.

상술한 바와 같이 본 발명에 따르면, 웹 브라우저의 힙 메모리를 실시간으로 감시하면서 NOP Sled 및 쉘코드 모두의 존재 여부를 판단하므로 힙 스프레이 공격 탐지시 보다 높은 정확률을 제공할 수 있다. As described above, according to the present invention, since the presence of both NOP Sled and shellcode is determined while monitoring the heap memory of the web browser in real time, a higher accuracy rate can be provided when the heap spray attack is detected.

또한, 본 발명에 따르면, 힙 스프레이 공격 탐지시 쉘코드의 변환을 통해 힙 스프레이 공격을 차단하면서도 사용자는 웹 브라우저의 실행 종료 없이 정상적으로 웹페이지를 방문할 수 있도록 함으로써 사용자가 불편없이 웹 브라우저를 사용할 수 있다. In addition, according to the present invention, while blocking the heap spray attack by converting the shellcode when the heap spray attack is detected, the user can visit the web page normally without ending the execution of the web browser so that the user can use the web browser without inconvenience. have.

도 1은 본 발명의 일 실시예에 따른 힙 메모리 구조 및 힙 스프레이 공격에 의한 힙 메모리 영역의 상태를 나타내는 도면이다.
도 2는 본 발명의 일 실시예에 따른 힙 스프레이 공격의 실시간 탐지 및 차단 시스템의 구성을 개략적으로 나타내는 도면이다.
도 3은 본 발명의 일 실시예에 따른 힙 스프레이 공격을 위한 힙 메모리 기록 패턴을 나타내는 도면이다.
도 4는 본 발명의 일 실시예에 따라 힙 스프레이 차단 방식에 의한 메모리 변경의 일 형태를 나타내는 도면이다.
도 5는 본 발명의 일 실시예에 따라, 힙 스프레이 공격의 탐지 방식의 일 형태를 나타내는 도면이다.
도 6은 본 발명의 일 실시예에 따른 동작 흐름도이다.
1 is a diagram illustrating a heap memory structure and a state of a heap memory area due to a heap spray attack according to an embodiment of the present invention.
2 is a view schematically showing the configuration of a real-time detection and blocking system of a heap spray attack according to an embodiment of the present invention.
3 illustrates a heap memory write pattern for a heap spray attack according to an embodiment of the present invention.
4 is a diagram illustrating a form of memory change by a heap spray blocking method according to an embodiment of the present invention.
5 is a diagram illustrating one embodiment of a heap spray attack detection method according to an embodiment of the present invention.
6 is an operation flowchart according to an embodiment of the present invention.

후술하는 본 발명에 대한 상세한 설명은, 본 발명이 실시될 수 있는 특정 실시예를 예시로서 도시하는 첨부 도면을 참조한다. 이들 실시예는 당업자가 본 발명을 실시할 수 있기에 충분하도록 상세히 설명된다. 본 발명의 다양한 실시예는 서로 다르지만 상호 배타적일 필요는 없음이 이해되어야 한다. 예를 들어, 여기에 기재되어 있는 특정 형상, 구조 및 특성은 일 실시예에 관련하여 본 발명의 정신 및 범위를 벗어나지 않으면서 다른 실시예로 구현될 수 있다. 또한, 각각의 개시된 실시예 내의 개별 구성요소의 위치 또는 배치는 본 발명의 정신 및 범위를 벗어나지 않으면서 변경될 수 있음이 이해되어야 한다. 따라서, 후술하는 상세한 설명은 한정적인 의미로서 취하려는 것이 아니며, 본 발명의 범위는 적절하게 설명된다면 그 청구항들이 주장하는 것과 균등한 모든 범위와 더불어 첨부된 청구항에 의해서만 한정된다. 도면에서 유사한 참조부호는 여러 측면에 걸쳐서 동일하거나 유사한 기능을 지칭한다. DETAILED DESCRIPTION The following detailed description of the invention refers to the accompanying drawings that show, by way of illustration, specific embodiments in which the invention may be practiced. These embodiments are described in sufficient detail to enable those skilled in the art to practice the invention. It should be understood that the various embodiments of the present invention are different, but need not be mutually exclusive. For example, certain features, structures, and characteristics described herein may be implemented in other embodiments without departing from the spirit and scope of the invention in connection with an embodiment. It is also to be understood that the position or arrangement of the individual components within each disclosed embodiment may be varied without departing from the spirit and scope of the invention. Accordingly, the following detailed description is not to be taken in a limiting sense, and the scope of the present invention is defined only by the appended claims, along with the full range of equivalents to which such claims are entitled. In the drawings, like reference numerals refer to the same or similar functions throughout the several views.

이하, 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자가 본 발명을 용이하게 실시할 수 있도록 하기 위하여, 본 발명의 바람직한 실시예들에 관하여 첨부된 도면을 참조하여 상세히 설명하기로 한다. Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings, so that those skilled in the art can easily carry out the present invention.

[본 발명의 바람직한 실시예] [Preferred Embodiment of the Present Invention]

본 발명의 실시예에서, 용어 "웹페이지"는 인터넷 익스플로러 등의 웹브라우저 프로그램을 직접적으로, 또는 간접적으로 이용하여 월드와이드웹(World Wide Web)을 통하여 열람하거나 로드할 수 있는 수동 또는 능동적인 문서 형식 또는 객체를 모두 포함하는 광의의 의미로 해석되어야 하며, 웹페이지의 파일 형식(file format)으로서 주로 HTML(HyperText Markup Language)이 사용되나, 반드시 이에 한정되지 않고 웹브라우저 프로그램을 이용하여 직접적으로 또는 간접적으로(플러그인이나 기타 별도의 프로그램과 연결되는 경우도 포함) 열람할 수 있는 문서 형식 또는 웹 브라우저에서 로드가 가능한 객체인 경우 모두 웹페이지에 해당될 수 있다. 웹브라우저 프로그램을 이용하여 웹페이지를 열람하기 위해서는 일반적으로 웹문서가 위치하고 있는 주소를 URL로 입력하며, 그 주소 형식으로서 HTTP(HyperText Transfer Protocol)가 많이 사용되나 반드시 이에 한정되는 것은 아니다. 바람직하게는 웹페이지는 자바 스크립트 등의 스크립트 언어를 소스 코드 내에 직접적으로, 또는 파일 포함(include) 등의 형식으로 간접적으로 포함할 수 있으며, 이 경우 사용자가 웹 브라우저를 이용하여 해당 웹페이지에 접속하는 경우 웹 브라우저는 전송받는 웹페이지의 소스 코드 내에 직접 또는 간접적으로 포함된 스크립트 언어를 실행하게 된다. In an embodiment of the present invention, the term "web page" refers to a passive or active document that can be viewed or loaded through the World Wide Web, directly or indirectly, using a web browser program such as Internet Explorer. It should be interpreted in a broad sense that includes both the format or the object, and HTML (HyperText Markup Language) is mainly used as a file format of a web page, but is not limited thereto, either directly or through a web browser program. Any document type that can be viewed indirectly (including when connected to a plug-in or other separate program) or an object that can be loaded in a web browser can be a web page. In order to browse a web page using a web browser program, an address in which a web document is located is generally input as a URL, and HTTP (HyperText Transfer Protocol) is widely used as the address format, but is not limited thereto. Preferably, the web page may include a scripting language such as Javascript directly in the source code or indirectly in the form of file include, in which case the user accesses the webpage using a web browser. In this case, the web browser executes a script language included directly or indirectly in the source code of the received web page.

전체 시스템 구성Complete system configuration

도 2는 본 발명의 일 실시예에 따른 힙 스프레이 공격의 실시간 탐지 및 차단 시스템의 구성을 개략적으로 나타내는 도면이다. 2 is a view schematically showing the configuration of a real-time detection and blocking system of a heap spray attack according to an embodiment of the present invention.

도 2에서 도시된 바와 같이 본 발명의 일 실시예에 따른 시스템은 힙 메모리 감시부(110), 힙 메모리 분석부(120) 및 힙 스프레이 공격 차단부(130)를 포함하고 있다. As illustrated in FIG. 2, the system includes a heap memory monitor 110, a heap memory analyzer 120, and a heap spray attack blocker 130.

먼저, 본 발명의 일 실시예에 따르면, 힙 메모리 감시부(110)는 웹 브라우저 실행시 웹 브라우저의 프로세스 내에서 함께 동작할 수 있으며, 웹 브라우저의 힙 메모리 영역을 실시간으로 감시한다. 보다 구체적으로, 힙 메모리 감시부(110)는 웹 브라우저가 특정 웹페이지를 방문한 경우 웹 브라우저로 전송되는 특정 웹페이지에 직간접적으로 포함된 스크립트 코드를 분석하여, 힙 메모리의 소정 영역에 특정 내용을 기록하는 명령이 실행되는지 여부를 판단한다. 이 경우, 힙 메모리 감시부(110)는 스크립트 코드를 입력 받아 분석할 수 있는 스크립트 엔진 분석부(미도시)를 더 포함할 수 있다. 힙 메모리 감시부(110)의 분석 결과, 스크립트 코드가 특정 데이터를 힙 메모리에 기록하는 것을 판단한 경우 힙 메모리 분석부(120)에 그 사실을 통지한다. 힙 메모리 감시부(110)는 사실 통지와 함께 스크립트 코드가 특정 데이터를 기록한 힙 메모리 영역의 주소도 함께 힙 메모리 분석부(120)로 전송할 수 있다. First, according to an embodiment of the present invention, the heap memory monitoring unit 110 may operate together in the process of the web browser when the web browser is executed, and monitors the heap memory area of the web browser in real time. More specifically, the heap memory monitoring unit 110 analyzes the script code directly or indirectly included in a specific web page transmitted to the web browser when the web browser visits a specific web page, and transmits specific content to a predetermined region of the heap memory. Determines whether the command to record is executed. In this case, the heap memory monitoring unit 110 may further include a script engine analyzer (not shown) that may receive and analyze the script code. As a result of the analysis of the heap memory monitoring unit 110, when the script code determines that the specific data is written to the heap memory, the heap memory analyzing unit 120 notifies the fact. The heap memory monitor 110 may transmit the address of the heap memory region in which the script code records the specific data together with the fact notification to the heap memory analyzer 120.

또한, 본 발명의 일 실시예에 따르면, 힙 메모리 분석부(120)는 힙 메모리 감시부(110)로부터 스크립트 코드의 특정 데이터 기록 사실을 통지 받은 경우, 힙 메모리에 기록된 데이터가 힙 스프레이 공격을 목적으로 하는 것인지, 즉 도 3에 도시되는 바와 같이 힙 메모리가 일련의 NOP Sled 영역이 먼저 나타나고 그 뒤에 쉘코드가 나타나는 결합 패턴으로 구성된 것인지 여부를 판단한다. 힙 메모리에 기록된 데이터가 힙 스프레이 공격을 목적으로 한 NOP Sled 및 쉘코드의 결합 패턴으로 기록된 것인지 여부를 식별하는 것은 어느 특정한 실시예에 한정되지 않으며, 식별 방법의 구체적인 예들은 후술하도록 한다. 판단 결과 힙 메모리에 기록된 데이터가 힙 스프레이 공격을 목적으로 기록된 경우, 힙 스프레이 공격 차단부(130)로 탐지된 힙 스프레이 공격 경고를 전송한다. In addition, according to an embodiment of the present invention, when the heap memory analyzer 120 is notified from the heap memory monitoring unit 110 of the fact that the specific data recording of the script code, the data recorded in the heap memory is subjected to a heap spray attack 3, it is determined whether the heap memory consists of a coupling pattern in which a series of NOP Sled regions appear first, followed by shellcode, as shown in FIG. It is not limited to any particular embodiment to identify whether the data recorded in the heap memory is recorded as a combined pattern of NOP Sled and shellcode for the purpose of the heap spray attack, and specific examples of the identification method will be described later. As a result of the determination, when the data recorded in the heap memory is recorded for the purpose of the heap spray attack, the heap spray attack warning detected by the heap spray attack blocking unit 130 is transmitted.

본 발명의 일 실시예에 따르면, 힙 스프레이 공격 차단부(130)는 앞선 힙 메모리 분석부(120)로부터 힙 스프레이 공격 경고를 수신한 경우, 힙 메모리에 기록된 데이터 중 쉘코드를 변환시키는 방식으로 힙 스프레이 공격 가능성을 차단한다. 쉘코드 변환 방식의 일 예에 대해 도 4를 참조하여 설명하면, 도 4a의 힙 메모리 영역 A는 스크립트 코드에 의해 기록된 영역이며 힙 메모리 분석부(120)에 의해 힙 스프레이 공격을 목적으로 NOP Sled 영역 및 쉘코드 영역의 결합 패턴으로 구성된 것은 이미 판단되어 있는 상태이다. 이 경우 힙 스프레이 공격 차단부(130)는 시스템을 공격할 수 있는 쉘코드 영역을 무해한 다른 OP CODE로 변환하여 기록함으로써 실행의 흐름이 힙 메모리 영역 A로 분기된 경우라 할 지라도 기존의 쉘코드는 무력화되었으므로 변환된 OP CODE의 실행에 그쳐 힙 스프레이 공격의 피해를 입지 않을 수 있다. 무해한 OP CODE의 일 예로서, 도 4b와 같이 기존의 쉘코드 영역을 NOP로 변환할 수 있으며, 여기서 실행의 흐름이 스크립트 코드에 의해 기록된 영역 A를 벗어나서 B와 같이 다른 영역으로 이동하는 것을 막기 위해, 예를 들어 영역 A의 끝에 루프(loop) 반복을 수행하는 OP CODE로 대체하는 방법을 이용하여 실행의 흐름이 영역 A를 벗어나지 않게 한다. 이렇게 쉘코드를 탐지시 미리 무해한 OP CODE로 변환함으로써, 사용자가 웹 브라우저를 이용하여 웹페이지들을 방문하는 도중에 실행의 흐름이 분기되어 힙 스프레이 공격이 실행된다 할 지라도, 사용자는 브라우저 실행이 종료되는 등의 문제 없이 사용자가 방문한 웹페이지의 기능을 정상적으로 사용할 수 있다는 장점을 갖게 된다. According to an embodiment of the present invention, when the heap spray attack blocking unit 130 receives the heap spray attack warning from the previous heap memory analyzer 120, the heap spray attack blocking unit 130 converts the shellcode among the data recorded in the heap memory. Blocks possible heap spray attacks. An example of a shellcode conversion method will be described with reference to FIG. 4, and the heap memory area A of FIG. 4A is an area recorded by the script code and is NOP Sled by the heap memory analyzer 120 for the purpose of a heap spray attack. It is already determined that the combination pattern of the region and the shellcode region is constituted. In this case, the heap spray attack blocking unit 130 converts and writes a shellcode area capable of attacking the system to another harmless OP CODE, so that even if the flow of execution is branched to the heap memory area A, the existing shellcode is Since it is incapacitated, it is only possible to execute the converted OP CODE and not be affected by the heap spray attack. As an example of a harmless OP CODE, an existing shellcode region can be converted to NOP as shown in FIG. 4B, where the flow of execution is prevented from moving out of region A recorded by the script code to another region such as B. For example, the flow of execution does not leave the region A by using an alternative to an OP CODE that performs a loop iteration at the end of the region A. By converting the shellcode into a harmless OP CODE before detection, even if the flow of execution diverges while the user visits the web pages using the web browser, the user may end the browser execution even if the heap spray attack is executed. This has the advantage that the user can use the functions of the visited webpage normally without any problem.

이하에서는, 본 발명의 일 실시예에 따라 힙 메모리 분석부(120)에서 힙 메모리에 기록된 데이터가 힙 스프레이 공격을 목적으로 기록되었는지, 즉 힙 스프레이 공격의 탐지를 위한 식별 방법에 대해 더욱 상세히 설명한다.Hereinafter, according to an embodiment of the present invention, the data recorded in the heap memory in the heap memory analyzer 120 is recorded for the purpose of the heap spray attack, that is, the identification method for detecting the heap spray attack will be described in more detail. do.

NOPNOP SledSled 식별 방안 Identification method

힙 스프레이 공격의 탐지를 위한 식별 방법의 그 첫번째 단계로서, 힙 메모리 분석부(120)는 힙 메모리에 기록된 데이터가 NOP Sled를 포함하고 있는지 여부를 식별하는바 그 구체적인 단계는 다음과 같다. As the first step of the identification method for detecting the heap spray attack, the heap memory analyzer 120 identifies whether the data recorded in the heap memory includes NOP Sled, and the specific steps are as follows.

먼저 힙 메모리 분석부(120)는 스크립트 코드가 힙 메모리에 기록한 데이터, 즉 해당 메모리 영역의 데이터가 유효한 OP CODE(Operation CODE)인지 검사한다(제1단계). 여기서 OP CODE란 컴퓨터의 CPU(Central Processing Unit)이 직접 해독하고 실행할 수 있는 기계어의 일부로서, 수행할 명령어를 지정하는 역할을 하는 코드를 의미한다. OP CODE에 대한 규격과 형식은 CPU에 따라 상이할 수 있으며 프로세서가 실행할 수 있는 모든 명령들의 집합인 명령어 집합(Instruction Set)에 나와 있으므로, 힙 메모리 분석부(120)는 명령어 집합을 참조하여 해당 메모리 영역의 데이터가 명령어 집합에 포함되어 있는 유효한 OP CODE인지 아닌지 여부를 확인할 수 있다. First, the heap memory analyzer 120 checks whether data written by the script code in the heap memory, that is, data in the corresponding memory area is a valid OP CODE (Operation Code) (step 1). In this case, the OP CODE is a part of a machine language that can be directly decoded and executed by a central processing unit (CPU) of a computer, and means a code that designates an instruction to be executed. Since the specifications and format of the OP CODE may differ depending on the CPU and are shown in the instruction set, which is a set of all instructions that can be executed by the processor, the heap memory analyzer 120 may refer to the instruction set to refer to the corresponding memory. You can check whether the data in the area is a valid OP CODE included in the instruction set.

앞선 제1단계에서 유효한 OP CODE로 판단된 경우, 힙 메모리 분석부(120)는 해당 메모리 영역의 데이터가 NOP로 사용될 수 있는 OP CODE의 연속적인 배열을 포함하는지 여부를 검사한다(제2단계). 앞서 배경 기술에서 살펴본 바와 같이 NOP Sled는 실질적으로 아무런 기능도 하지 않는 No-operation의 연속된 배열을 의미하므로, NOP 로 사용될 수 있는 OP CODE인지 여부를 검사하기 위해서 힙 메모리 분석부(120)는 미리 알려진 NOP인지 여부를 바로 확인할 수도 있고 - 예를 들어, 인텔사의 x86 CPU 기종에 있어서 0x90과 같은 OP CODE는 NOP로 바로 확인할 수 있다. -또는 OP CODE의 실행 결과 아무런 기능을 하지 않는지 여부를 판단하기 위해 해당 메모리 영역의 OP CODE들을 에뮬레이션(Emulation)하여 그 결과를 통해서 판단할 수 있다. 분석 결과 NOP로 사용될 수 있는 OP CODE들이 연속적으로 힙 메모리상에 배열된 경우 힙 메모리 분석부(120)는 해당 메모리 영역의 데이터가 NOP Sled를 포함하고 있다고 판단할 수 있다. If it is determined that the OP code is valid in the first step, the heap memory analyzer 120 checks whether the data in the corresponding memory area includes a continuous array of OP codes that can be used as the NOP (step 2). . As described in the background art above, since NOP Sled means a continuous array of no-operations that do not function substantially, the heap memory analyzer 120 determines whether the OPP code can be used as a NOP in advance. You can also check whether it is a known NOP or not-For example, for Intel x86 CPUs, OP CODE such as 0x90 can be directly checked with NOP. Alternatively, in order to determine whether no function is performed as a result of the execution of the OP CODE, the OP CODEs of the corresponding memory area may be emulated to determine the result. As a result of the analysis, when OP codes that may be used as NOPs are continuously arranged on the heap memory, the heap memory analyzer 120 may determine that data in the corresponding memory area includes NOP Sled.

제2단계를 통해서 해당 메모리 영역의 데이터가 NOP Sled를 포함하고 있다고 판단되는 경우, 힙 메모리 분석부(120)는 해당 메모리 영역의 OP CODE를 에뮬레이션하여 쉘코드 영역으로 실행의 흐름이 전달되는지 여부를 판단한다(제3단계). 힙 스프레이 공격의 목표는 실행의 흐름이 최종적으로 쉘코드 영역으로 분기하여 쉘코드를 실행하는 것이기 때문에 해당 메모리 영역에 NOP Sled가 존재한다 할 지라도 쉘코드 영역으로 실행의 흐름이 전달되지 않는 경우 힙 스프레이 공격을 위한 목적이 아니라 정상적인 프로세스에 따른 힙 메모리 기록으로 볼 수 있다. If it is determined through the second step that the data of the memory area includes the NOP Sled, the heap memory analyzer 120 emulates the OP CODE of the memory area to determine whether the flow of execution is delivered to the shellcode area. Determine (step 3). The goal of a heap spray attack is to execute a shellcode by finally branching to a shellcode region, so even if NOP Sled exists in that memory region, a heap spray is not delivered to the shellcode region. It is not intended to be an attack, but rather a record of heap memory following a normal process.

또한 힙 메모리 분석부(120)는 해당 메모리 영역의 데이터가 실행을 위한 임의의 시작점을 지원하는지 여부를 판단할 수 있다(제4단계). 도 5를 참조하여 구체적으로 설명하면, 도 5에 도시된 메모리 영역은 a부터 f까지의 NOP 를 갖는 NOP Sled 영역 및 쉘코드에 해당하는 OP CODE를 갖는 g의 결합 패턴인바 임의의 시작점, 예를 들면 시작점 ①, ②, ③ 중 어느 한 위치,으로 분기되어 실행의 흐름이 시작된다 할 지라도 앞선 제1단계 내지 제3단계를 만족하는지 여부를 확인하여 보다 정확하게 해당 메모리 영역이 힙 스프레이 공격을 목적으로 기록되었는지 여부를 판단할 수 있다. In addition, the heap memory analyzer 120 may determine whether data of the corresponding memory area supports an arbitrary starting point for execution (step 4). Specifically, referring to FIG. 5, the memory area illustrated in FIG. 5 is a NOP sled area having NOPs from a to f and a coupling pattern of g having an OP CODE corresponding to a shellcode. For example, even if the flow of execution starts by branching to any one of the starting points ①, ②, and ③, it is determined whether the first to third stages are satisfied, so that the memory area is more precisely for the purpose of the heap spray attack. It can be determined whether it has been recorded.

쉘코드Shellcode 식별 방안 Identification method

힙 스프레이 공격의 탐지를 위한 식별 방법의 그 두번째 단계로서, 힙 메모리 분석부(120)는 힙 메모리에 기록된 데이터에서 쉘코드로 의심가는 영역이 힙 스프레이 공격을 위한 쉘코드인지 여부를 식별하는바 그 구체적인 방법의 일 실시예는 다음과 같다. As the second step of the identification method for the detection of the heap spray attack, the heap memory analyzer 120 identifies whether the area suspected of being shellcode in the data recorded in the heap memory is the shellcode for the heap spray attack. One embodiment of the specific method is as follows.

힙 메모리 분석부(120)는 쉘코드 영역으로 의심가는 영역이 유효한 OP CODE인지 검사할 수 있으며(제5단계), 제5단계에 따른 검사는 앞서 살펴본 NOP Sled 중 제1단계와 유사한 방식으로 수행될 수 있다. The heap memory analyzer 120 may check whether an area suspected of as a shellcode area is a valid OP CODE (step 5), and the test according to step 5 is performed in a similar manner to the first step of the above-described NOP sled. Can be.

상기 제5단계에 의해 쉘코드 영역으로 의심되는 영역이 유효한 OP CODE라고 판단된 경우, 힙 메모리 분석부(120)는 쉘코드 영역으로 의심되는 영역에 기재된 OP CODE가 힙 스프레이 공격에 사용될 수 있는 쉘코드인지 판단한다(제6단계). 힙 스프레이 공격에 사용되기 위해서는 시스템에 접근해야 하므로 이러한 쉘코드의 예로서 외부 통신용 소켓을 만드는 것과 같이 시스템 API를 호출하는지 여부를 확인하여 판단할 수 있다. If it is determined by the fifth step that the area suspected of being a shellcode area is a valid OP CODE, the heap memory analyzer 120 may determine that a shell in which the OP CODE described in the area suspected of being a shellcode area may be used for a heap spray attack. Determine if the code (step 6). The shellcode requires access to the system, so an example of such shellcode can be determined by checking whether the system API is called, such as creating a socket for external communication.

앞서 살펴본 여러 단계에 걸친 NOP Sled 식별 방안 및 쉘코드 식별 방안은 힙 메모리 분석부(120)에서 사용될 수 있는 실질적인 예시에 불과하며, 해당 분야의 기술 수준 및 당업자의 기술 상식에 따라 다양한 방법에 의해 상기 단계들의 예들을 일부 또는 전체 수행하거나, 동일 또는 유사한 기능을 수행할 수 있도록 변형하여 수행할 수 있다는 것은 인지되어야 한다. The above-described NOP Sled identification scheme and shellcode identification scheme over several steps are merely practical examples that can be used in the heap memory analyzer 120, and may be described by various methods according to the technical level of the related art and technical common knowledge of those skilled in the art. It should be appreciated that examples of the steps may be performed in part or in whole, or may be modified to perform the same or similar functions.

힙 스프레이 공격 탐지 및 차단 방법How to detect and block heap spray attacks

다음으로, 도 6을 참조하여 본 발명의 일 실시예에 따른 힙 스프레이 공격 탐지 및 차단 방법에 대해 설명하도록 한다. Next, a heap spray attack detection and blocking method according to an embodiment of the present invention will be described with reference to FIG. 6.

도 6에 예시된 일 실시예에 따르면, 사용자가 웹 브라우저를 가동하여 URL을 직접 입력하거나 즐겨 찾기 선택 또는 하이퍼링크(Hyperlink)의 클릭 등을 통하여 특정 웹페이지에 접속하는 경우 웹 브라우저는 접속하는 웹페이지의 소스 코드를 수신한다(S100). According to an exemplary embodiment illustrated in FIG. 6, when a user accesses a specific web page through a web browser by directly inputting a URL, selecting a bookmark, or clicking a hyperlink, the web browser may access the web. The source code of the page is received (S100).

웹 브라우저의 소스 코드 수신시, 소스 코드 내부에 직접적으로 또는 파일 포함(include)의 형식 등으로 간접적으로 스크립트 코드가 포함되어 있는 경우 해당 스크립트 코드가 웹브라우저에 의해서 실행되게 된다(S110). When the source code of the web browser is received, if the script code is directly included in the source code or indirectly in the form of a file include, the corresponding script code is executed by the web browser (S110).

스프레이 공격의 실시간 탐지 및 차단 시스템의 힙 메모리 감시부(110)는, 스크립트 코드의 웹브라우저에 의한 실행인 단계 S110을 감지한 경우, 또는 사용자의 웹 브라우저 가동과 함께 웹 브라우저가 사용할 수 있는 힙 메모리 영역을 실시간으로 감시하기 시작하며 스크립트 코드에 의해 힙 메모리의 소정 영역에 특정 데이터를 기록하는 것을 감지한 경우 힙 메모리 분석부(120)에 그 사실을 통지한다(S120). 힙 메모리 감시부(110)는 추가적으로 스크립트 코드에 의해 힙 메모리가 특정 데이터를 기록한 영역의 주소를 힙 메모리 분석부(120)로 전송할 수 있다. The heap memory monitoring unit 110 of the real-time detection and blocking system of the spray attack detects the step S110, which is the execution of the script code by the web browser, or the heap memory which can be used by the web browser when the user starts the web browser. When the area is monitored in real time and the script code detects that the specific data is recorded in the predetermined area of the heap memory, the heap memory analyzer 120 notifies the fact (S120). The heap memory monitor 110 may additionally transmit the address of the region where the heap memory records specific data to the heap memory analyzer 120 by script code.

힙 메모리 분석부(120)는 힙 메모리 감시부(110)로부터 통지를 수신한 경우 단계 S130 및 S140에 걸쳐서 힙 메모리에 기록된 특정 데이터가 힙 스프레이 공격을 위해 적재된 NOP Sled 및 쉘코드의 결합 패턴인 것인지 판단한다. When the heap memory analyzing unit 120 receives a notification from the heap memory monitoring unit 110, a combination pattern of NOP sled and shellcode in which specific data written to the heap memory is loaded for a heap spray attack in steps S130 and S140. Determine if it is

먼저 단계 S130에서, 힙 메모리에 기록된 특정 데이터가 NOP Sled를 포함하고 있는지 여부를 판단한다. NOP Sled를 포함하고 있는지 여부를 판단하는 방식의 일 실시예로서 앞서 설명한 NOP Sled 식별 방안의 제1단계 내지 제4단계 중 적어도 하나 이상이 수행될 수 있으며, 그 식별 방안을 수행하는 순서에 구애되지 않는다는 것은 당업자에게 있어 자명하다. First, in step S130, it is determined whether the specific data recorded in the heap memory includes NOP Sled. As an embodiment of a method of determining whether a NOP sled is included, at least one or more of the first to fourth steps of the above-described NOP sled identification scheme may be performed, regardless of the order in which the identification scheme is performed. It will be apparent to those skilled in the art.

힙 메모리 분석부(120)는 단계 S130을 통해서 힙 메모리에 기록된 특정 데이터가 NOP Sled를 포함하고 있는 것을 확인한 경우, 이어서 힙 메모리에 기록된 특정 데이터가 쉘코드도 포함하고 있는지 여부를 판단한다(S140). 쉘코드를 포함하고 있는지 여부를 판단하는 방식의 일 실시예로서 앞서 설명한 쉘코드 식별 방안의 제5단계 내지 제6단계 중 적어도 하나 이상이 수행될 수 있으며, 그 식별 방안을 수행하는 순서에 구애되지 않는다는 것은 당업자에게 있어 자명하다. When the heap memory analyzer 120 confirms that the specific data recorded in the heap memory includes NOP Sled through step S130, the heap memory analyzer 120 determines whether the specific data recorded in the heap memory also includes shellcode (S130). S140). As an embodiment of a method of determining whether a shellcode is included, at least one or more of the fifth to sixth steps of the above-described shellcode identification scheme may be performed, regardless of the order of performing the identification scheme. It will be apparent to those skilled in the art.

힙 메모리 분석부(120)는 단계 S130 내지 S140에 걸쳐서 힙 메모리에 기록된 특정 데이터가 힙 스프레이 공격을 위해 기록된 NOP Sled 및 쉘코드의 결합 패턴이라고 확인한 경우 힙 스프레이 공격 차단부(130)로 탐지된 힙 스프레이 공격 경고를 전송한다(S150). 경고 전송과 동시에 힙 메모리 분석부(120)는 추가적으로 힙 스프레이 공격을 위해 NOP Sled 및 쉘코드의 결합 패턴이 기록된 메모리 영역의 주소를 힙 스프레이 공격 차단부(130)로 전송할 수 있다. The heap memory analyzer 120 detects the heap spray attack blocking unit 130 when the specific data recorded in the heap memory is a combined pattern of NOP sled and shellcode recorded for the heap spray attack in steps S130 through S140. The transmitted heap spray attack warning (S150). Simultaneously with the alert transmission, the heap memory analyzer 120 may additionally transmit the address of the memory region in which the combination pattern of NOP Sled and the shellcode is recorded, to the heap spray attack blocking unit 130 for the heap spray attack.

힙 스프레이 공격 차단부(130)는 힙 메모리 분석부(120)로부터 힙 스프레이 공격 경고를 수신시, NOP Sled 및 쉘코드의 결합이 기록된 메모리 영역 중 쉘코드를 변환하는 방식으로 힙 스프레이 공격을 차단하며, 쉘코드를 변환하는 방식의 일 실시예로 앞서 설명한 바와 같이 쉘코드를 NOP 등의 무해한 OP CODE로 변환하는 방식을 사용할 수 있다. When the heap spray attack blocking unit 130 receives the heap spray attack warning from the heap memory analyzer 120, the heap spray attack blocking unit 130 blocks the heap spray attack by converting the shellcode among memory regions in which a combination of NOP Sled and shellcode is recorded. As an example of a method of converting a shell code, a method of converting a shell code into a harmless OP code such as a NOP may be used as described above.

한편, 도 6에 도시된 일 실시예는 웹 브라우저를 이용한 특정 웹페이지 방문시 발생할 수 있는 1개의 프로세스에 대응하는 것으로 사용자의 특정 웹페이지 방문시마다 도 6에 개시된 실시예는 반복될 수 있다. Meanwhile, the embodiment illustrated in FIG. 6 corresponds to one process that may occur when a specific web page is visited using a web browser. The embodiment disclosed in FIG. 6 may be repeated every time a user visits a specific web page.

본 발명에 따른 실시예들은 다양한 컴퓨터 수단을 통하여 수행될 수 있는 프로그램 명령 형태로 구현되어 컴퓨터 판독 가능 매체에 기록될 수 있다. 상기 컴퓨터 판독 가능 매체는 프로그램 명령, 데이터 파일, 데이터 구조 등을 단독으로 또는 조합하여 포함할 수 있다. 상기 매체에 기록되는 프로그램 명령은 본 발명을 위하여 특별히 설계되고 구성된 것들이거나 컴퓨터 소프트웨어 당업자에게 공지되어 사용 가능한 것일 수도 있다. 컴퓨터 판독 가능 기록 매체의 예에는 하드 디스크, 플로피 디스크 및 자기 테이프와 같은 자기 매체(magnetic media), CD-ROM, DVD와 같은 광기록 매체(optical media), 플롭티컬 디스크(Floptical disk)와 같은 자기-광 매체(megneto-optical media) 및 롬(ROM), 램(RAM), 플래시 메모리 등과 같은 프로그램 명령을 저장하고 수행하도록 특별히 구성된 하드웨어 장치가 포함된다. 프로그램 명령의 예에는 컴파일러에 의해 만들어지는 것과 같은 기계어 코드뿐만 아니라 인터프리터 등을 사용해서 컴퓨터에 의해서 실행될 수 있는 고급 언어 코드를 포함한다. 상기된 하드웨어 장치는 본 발명의 동작을 수행하기 위해 하나 이상의 소프트웨어 모듈로서 작동되도록 구성될 수 있으며, 그 역도 마찬가지다. Embodiments according to the present invention may be implemented in the form of program instructions that can be executed through various computer means and recorded in a computer-readable medium. The computer readable medium may include program instructions, data files, data structures, etc. alone or in combination. The program instructions recorded on the medium may be those specially designed and constructed for the present invention or may be available to those skilled in the art of computer software. Examples of the computer-readable recording medium include magnetic media such as a hard disk, a floppy disk, and a magnetic tape; optical media such as CD-ROM and DVD; magnetic recording media such as a floppy disk; Includes hardware devices specifically configured to store and perform program instructions such as megneto-optical media and ROM, RAM, flash memory, and the like. Examples of program instructions include not only machine code generated by a compiler, but also high-level language code that can be executed by a computer using an interpreter or the like. The hardware devices described above may be configured to operate as one or more software modules to perform the operations of the present invention, and vice versa.

이상과 같이 본 발명에서는 구체적인 구성 요소 등과 같은 특정 사항들과 한정된 실시예 및 도면에 의해 설명되었으나 이는 본 발명의 보다 전반적인 이해를 돕기 위해서 제공된 것일 뿐, 본 발명은 상기의 실시예에 한정되는 것은 아니며, 본 발명이 속하는 분야에서 통상적인 지식을 가진 자라면 이러한 기재로부터 다양한 수정 및 변형이 가능하다. In the present invention as described above has been described by the specific embodiments, such as specific components and limited embodiments and drawings, but this is provided to help a more general understanding of the present invention, the present invention is not limited to the above embodiments. For those skilled in the art, various modifications and variations are possible from these descriptions.

따라서, 본 발명의 사상은 설명된 실시예에 국한되어 정해져서는 아니되며, 후술하는 특허청구범위뿐 아니라 이 특허청구범위와 균등하거나 등가적 변형이 있는 모든 것들은 본 발명 사상의 범주에 속한다고 할 것이다.
Accordingly, the spirit of the present invention should not be construed as being limited to the embodiments described, and all of the equivalents or equivalents of the claims, as well as the following claims, belong to the scope of the present invention .

Claims (19)

힙 스프레이 공격(Heap Spray Attack)의 실시간 탐지 및 차단 방법에 있어서,
힙 스프레이 공격의 실시간 탐지 및 차단 시스템에 의해 수행되는 각 단계는,
힙 메모리가 변경되는지 여부를 감시하는 감시 단계와,
상기 힙 메모리의 변경이 감지되는 경우 변경된 상기 힙 메모리의 영역이 NOP Sled를 포함하는지 판단하는 제1 분석 단계와,
상기 힙 메모리의 변경이 감지되는 경우 변경된 상기 힙 메모리의 영역이 쉘코드를 포함하는지 판단하는 제2 분석 단계와,
상기 제1 분석 단계 및 제2 분석 단계 모두를 통과한 경우 변경된 상기 힙 메모리의 영역을 변환하여 기록하는 공격 차단 단계를 포함하는 탐지 및 차단 방법.
In the real-time detection and blocking method of the heap spray attack,
Each step performed by a real-time detection and blocking system of heap spray attacks,
A watch step that monitors whether heap memory has changed,
A first analysis step of determining whether a changed region of the heap memory includes NOP Sled when a change of the heap memory is detected;
A second analysis step of determining whether a changed region of the heap memory includes shellcode when a change of the heap memory is detected;
And an attack blocking step of converting and recording the changed area of the heap memory when both the first analysis step and the second analysis step have passed.
청구항 1에 있어서,
상기 제1 분석 단계는,
상기 변경된 힙 메모리의 영역이 유효한 OP CODE인지 검사하는 단계; 및
상기 변경된 힙 메모리의 영역이 NOP로 사용될 수 있는 OP CODE의 연속적인 배열을 포함하는지 검사하는 단계를 더 포함하는 것을 특징으로 하는 탐지 및 차단 방법.
The method according to claim 1,
The first analysis step,
Checking whether the changed heap memory area is a valid OP CODE; And
Detecting whether the changed heap memory area comprises a contiguous array of OP CODEs that can be used as NOP.
청구항 2에 있어서,
상기 제1 분석 단계는,
상기 변경된 힙 메모리 영역의 OP CODE를 에뮬레이션하여 쉘코드 영역으로 실행의 흐름이 전달되는지를 판단하는 단계를 더 포함하는 것을 특징으로 하는 탐지 및 차단 방법.
The method according to claim 2,
The first analysis step,
And emulating the OP CODE of the changed heap memory area to determine whether a flow of execution is delivered to a shellcode area.
청구항 2 또는 3에 있어서,
상기 제1 분석 단계는,
상기 변경된 힙 메모리 영역이 실행을 위한 임의의 시작점을 지원하는지를 판단하는 단계를 더 포함하는 것을 특징으로 하는 탐지 및 차단 방법.
The method according to claim 2 or 3,
The first analysis step,
Determining whether the modified heap memory region supports any starting point for execution.
청구항 1에 있어서,
상기 제2 분석 단계는,
상기 변경된 힙 메모리의 영역 중 쉘코드 영역으로 의심되는 영역이 유효한 OP CODE인지 검사하는 단계를 더 포함하는 것을 특징으로 하는 탐지 및 차단 방법.
The method according to claim 1,
The second analysis step,
And checking whether a region suspected to be a shellcode region among the changed heap memory regions is a valid OP CODE.
청구항 5에 있어서,
상기 제2 분석 단계는,
상기 변경된 힙 메모리의 영역 중 쉘코드 영역으로 의심되는 영역의 OP CODE가 힙 스프레이 공격에 사용될 수 있는 쉘코드인지 판단하는 단계를 더 포함하는 것을 특징으로 하는 탐지 및 차단 방법.
The method according to claim 5,
The second analysis step,
And determining whether an OP CODE of a region suspected of being a shellcode region among the changed heap memory regions is a shellcode that can be used for a heap spray attack.
청구항 6에 있어서,
상기 힙 스프레이 공격에 사용될 수 있는 쉘코드는 시스템 API를 호출하는 OP CODE를 포함하는 것을 특징으로 하는 탐지 및 차단 방법.
The method of claim 6,
The shellcode that may be used for the heap spray attack includes an OP CODE that calls a system API.
청구항 1에 있어서,
상기 공격 차단 단계는,
변경된 상기 힙 메모리의 영역 중 쉘코드 영역을 NOP로 변환하여 기록하는 단계인 것을 특징으로 하는 탐지 및 차단 방법.
The method according to claim 1,
The attack blocking step,
And converting the shellcode region into the NOP of the changed region of the heap memory and recording the same.
청구항 8에 있어서,
상기 공격 차단 단계는,
변환된 NOP 중 적어도 하나를 변경된 상기 힙 메모리의 영역 내로 이동하는 루프(loop) OP CODE로 변환하여 기록하는 단계를 더 포함하는 것을 특징으로 하는 탐지 및 차단 방법.
The method according to claim 8,
The attack blocking step,
And converting and recording at least one of the converted NOPs into a loop OP CODE for moving into an area of the changed heap memory.
힙 스프레이 공격(Heap Spray Attack)의 실시간 탐지 및 차단 시스템에 있어서,
힙 메모리가 변경되는지 여부를 감시하는 힙 메모리 감시부와,
상기 힙 메모리의 변경이 감지되는 경우 변경된 상기 힙 메모리의 영역이 NOP Sled를 포함하는지 판단하는 제1 분석 모듈 및 상기 힙 메모리의 변경이 감지되는 경우 변경된 상기 힙 메모리의 영역이 쉘코드를 포함하는지 판단하는 제2 분석 모듈을 포함하는 힙 메모리 분석부와,
상기 제1 분석 단계 및 제2 분석 단계 모두를 통과한 경우 변경된 상기 힙 메모리의 영역을 변환하여 기록하는 힙 스프레이 공격 차단부를 포함하는 탐지 및 차단 시스템.
In the real-time detection and blocking system of the heap spray attack,
A heap memory monitor that monitors whether heap memory has changed,
A first analysis module that determines whether the changed heap memory area includes NOP Sled when a change of the heap memory is detected, and determines whether the changed heap memory area includes shellcode when a change of the heap memory is detected A heap memory analysis unit including a second analysis module to perform
And a heap spray attack blocker for converting and recording the changed area of the heap memory when both the first analysis step and the second analysis step have passed.
청구항 10에 있어서,
상기 제1 분석 모듈은,
상기 변경된 힙 메모리의 영역이 유효한 OP CODE인지 검사하는 제1 분석부 및 상기 변경된 힙 메모리의 영역이 NOP로 사용될 수 있는 OP CODE의 연속적인 배열을 포함하는지 검사하는 제2 분석부를 더 포함하는 것을 특징으로 하는 탐지 및 차단 시스템.
The method of claim 10,
The first analysis module,
And a first analyzer to check whether the region of the changed heap memory is a valid OP CODE, and a second analyzer to check whether the region of the changed heap memory includes a continuous array of OP CODEs that can be used as a NOP. Detection and blocking systems.
청구항 11에 있어서,
상기 제1 분석 모듈은,
상기 변경된 힙 메모리 영역의 OP CODE를 에뮬레이션하여 쉘코드 영역으로 실행의 흐름이 전달되는지를 판단하는 제3 분석부를 더 포함하는 것을 특징으로 하는 탐지 및 차단 시스템.
The method of claim 11,
The first analysis module,
And a third analyzer configured to determine whether a flow of execution is delivered to a shellcode region by emulating the OP CODE of the changed heap memory region.
청구항 11 또는 12에 있어서,
상기 제1 분석 모듈은,
상기 변경된 힙 메모리 영역이 실행을 위한 임의의 시작점을 지원하는지를 판단하는 제4 분석부를 더 포함하는 것을 특징으로 하는 탐지 및 차단 시스템.
12. The method according to claim 11 or 12,
The first analysis module,
And a fourth analyzer configured to determine whether the changed heap memory area supports an arbitrary starting point for execution.
청구항 10에 있어서,
상기 제2 분석 모듈은,
상기 변경된 힙 메모리의 영역 중 쉘코드 영역으로 의심되는 영역이 유효한 OP CODE인지 검사하는 제5 분석부를 더 포함하는 것을 특징으로 하는 탐지 및 차단 시스템.
The method of claim 10,
The second analysis module,
And a fifth analyzing unit that checks whether a region suspected of being a shellcode region among the changed heap memory regions is a valid OP CODE.
청구항 14에 있어서,
상기 제2 분석 모듈은,
상기 변경된 힙 메모리의 영역 중 쉘코드 영역으로 의심되는 영역의 OP CODE가 힙 스프레이 공격에 사용될 수 있는 쉘코드인지 판단하는 제6 분석부를 더 포함하는 것을 특징으로 하는 탐지 및 차단 시스템.
The method according to claim 14,
The second analysis module,
And a sixth analyzer configured to determine whether the OP CODE of the suspected shellcode region of the changed heap memory region is a shellcode that can be used for a heap spray attack.
청구항 15에 있어서,
상기 힙 스프레이 공격에 사용될 수 있는 쉘코드는 시스템 API를 호출하는 OP CODE를 포함하는 것을 특징으로 하는 탐지 및 차단 시스템.
The method according to claim 15,
The shellcode that can be used for the heap spray attack includes an OP CODE that calls a system API.
청구항 10에 있어서,
상기 힙 스프레이 공격 차단부는,
변경된 상기 힙 메모리의 영역 중 쉘코드 영역을 NOP로 변환하여 기록하는 것을 특징으로 하는 탐지 및 차단 시스템.
The method of claim 10,
The hip spray attack blocking unit,
Detection and blocking system, characterized in that for converting the shell code area of the changed area of the heap memory to NOP.
청구항 17에 있어서,
상기 힙 스프레이 공격 차단부는,
변환된 NOP 중 적어도 하나를 변경된 상기 힙 메모리의 영역 내로 이동하는 루프(loop) OP CODE로 변환하여 기록하는 것을 더 포함하는 것을 특징으로 하는 탐지 및 차단 시스템.
18. The method of claim 17,
The hip spray attack blocking unit,
And converting and recording at least one of the converted NOPs into a loop OP CODE that moves into the changed area of the heap memory.
청구항 제1항 내지 제9항 중 어느 한 항에 기재된 방법의 각 단계를 컴퓨터 상에서 수행하기 위한 프로그램을 기록한 컴퓨터 판독 가능한 기록매체.A computer-readable recording medium having recorded thereon a program for performing each step of the method according to claim 1 on a computer.
KR1020100117185A 2010-11-24 2010-11-24 Method and system to detect and intercept heap spray attack based on realtime KR101217546B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020100117185A KR101217546B1 (en) 2010-11-24 2010-11-24 Method and system to detect and intercept heap spray attack based on realtime

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020100117185A KR101217546B1 (en) 2010-11-24 2010-11-24 Method and system to detect and intercept heap spray attack based on realtime

Publications (2)

Publication Number Publication Date
KR20120055790A KR20120055790A (en) 2012-06-01
KR101217546B1 true KR101217546B1 (en) 2013-01-21

Family

ID=46608090

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020100117185A KR101217546B1 (en) 2010-11-24 2010-11-24 Method and system to detect and intercept heap spray attack based on realtime

Country Status (1)

Country Link
KR (1) KR101217546B1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016204758A1 (en) * 2015-06-18 2016-12-22 Hewlett Packard Enterprise Development Lp Randomized heap allocation

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101368949B1 (en) * 2012-07-20 2014-03-03 주식회사 안랩 Exploit-code execution pre-protection method and device thereof
KR101367992B1 (en) * 2012-09-10 2014-02-27 주식회사 인프라웨어테크놀러지 Method of blocking heap spray hacking using nop sled, and computer-readable recording medium with anti-heap spray program for the same
JP6317646B2 (en) * 2014-08-19 2018-04-25 杉中 順子 Information processing apparatus, illegal program execution prevention method, program, and recording medium
CN106681781B (en) * 2015-11-05 2020-04-24 腾讯科技(深圳)有限公司 Method and system for realizing real-time computing service

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20090114012A (en) * 2008-04-29 2009-11-03 주식회사 안철수연구소 Inventing system for handling of memory
US20090300764A1 (en) 2008-05-28 2009-12-03 International Business Machines Corporation System and method for identification and blocking of malicious code for web browser script engines
KR100976961B1 (en) 2008-01-23 2010-08-23 주식회사 안철수연구소 Security system for internet site and method thereof

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100976961B1 (en) 2008-01-23 2010-08-23 주식회사 안철수연구소 Security system for internet site and method thereof
KR20090114012A (en) * 2008-04-29 2009-11-03 주식회사 안철수연구소 Inventing system for handling of memory
US20090300764A1 (en) 2008-05-28 2009-12-03 International Business Machines Corporation System and method for identification and blocking of malicious code for web browser script engines

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016204758A1 (en) * 2015-06-18 2016-12-22 Hewlett Packard Enterprise Development Lp Randomized heap allocation
US10528737B2 (en) 2015-06-18 2020-01-07 Trend Micro Incorporated Randomized heap allocation

Also Published As

Publication number Publication date
KR20120055790A (en) 2012-06-01

Similar Documents

Publication Publication Date Title
Cheng et al. Orpheus: Enforcing cyber-physical execution semantics to defend against data-oriented attacks
CN109002721B (en) Mining analysis method for information security vulnerability
US8789178B2 (en) Method for detecting malicious javascript
CN101356535B (en) A method and apparatus for detecting and preventing unsafe behavior of javascript programs
US9218254B2 (en) Systems, methods, and media for recovering an application from a fault or attack
US20110030060A1 (en) Method for detecting malicious javascript
US20100299754A1 (en) Identifying Security Breaches Caused by Web-Enabled Software Applications
CN101964026A (en) Method and system for detecting web page horse hanging
KR101217546B1 (en) Method and system to detect and intercept heap spray attack based on realtime
US9507933B2 (en) Program execution apparatus and program analysis apparatus
Hsu et al. Browserguard: A behavior-based solution to drive-by-download attacks
US11568052B2 (en) Undetectable sandbox for malware
CN102831339A (en) Method, device and browser for protecting webpage against malicious attack
Wressnegger et al. Comprehensive analysis and detection of flash-based malware
US20100037033A1 (en) Exploit nonspecific host intrusion prevention/detection methods and systems and smart filters therefor
KR101625129B1 (en) Method and system for indirectness branch monitoring of program
Kollenda et al. Towards automated discovery of crash-resistant primitives in binary executables
US20120222116A1 (en) System and method for detecting web browser attacks
Qiu et al. A framework for understanding dynamic anti-analysis defenses
Yadegari et al. Analysis of exception-based control transfers
Dai et al. Holography: a behavior‐based profiler for malware analysis
KR102393795B1 (en) Apparatus and method for detecting maliciousness of non-pe file through change of execution flow of application
Hauser et al. Sleak: Automating address space layout derandomization
Al-Saleh et al. On information flow for intrusion detection: What if accurate full-system dynamic information flow tracking was possible?
Lim et al. Survey of Dynamic Anti-Analysis Schemes for Mobile Malware.

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: 20151127

Year of fee payment: 4

FPAY Annual fee payment

Payment date: 20161013

Year of fee payment: 5

FPAY Annual fee payment

Payment date: 20171012

Year of fee payment: 6

FPAY Annual fee payment

Payment date: 20191010

Year of fee payment: 8