KR101064164B1 - Kernel integrity inspection and the recovery method on linux kernel based smart platform - Google Patents

Kernel integrity inspection and the recovery method on linux kernel based smart platform Download PDF

Info

Publication number
KR101064164B1
KR101064164B1 KR1020110018467A KR20110018467A KR101064164B1 KR 101064164 B1 KR101064164 B1 KR 101064164B1 KR 1020110018467 A KR1020110018467 A KR 1020110018467A KR 20110018467 A KR20110018467 A KR 20110018467A KR 101064164 B1 KR101064164 B1 KR 101064164B1
Authority
KR
South Korea
Prior art keywords
kernel
memory
data
original
image
Prior art date
Application number
KR1020110018467A
Other languages
Korean (ko)
Inventor
유동훈
Original Assignee
(주)아이넷캅
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by (주)아이넷캅 filed Critical (주)아이넷캅
Priority to KR1020110018467A priority Critical patent/KR101064164B1/en
Application granted granted Critical
Publication of KR101064164B1 publication Critical patent/KR101064164B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1004Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's to protect a block of data words, e.g. CRC or checksum
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3013Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system is an embedded system, i.e. a combination of hardware and software dedicated to perform a certain function in mobile devices, printers, automotive or aircraft systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3037Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a memory, e.g. virtual memory, cache
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/16Protection against loss of memory contents
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Quality & Reliability (AREA)
  • Mathematical Physics (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Storage Device Security (AREA)

Abstract

본 발명은 리눅스 커널 기반 스마트 플랫폼 내에서의 커널 무결성 검사 및 변조된 커널 데이터 복구 방법에 관한 것으로; ROM 파티션 영역의 압축된 원본 커널 이미지의 변조 여부를 md5 hash checksum을 통해 검사하는 제1단계; 상기 제1단계를 수행하여 원본 커널 이미지가 변조되지 않았으면 ROM 파티션 내에 저장된 원본 커널 이미지의 압축을 해제하여 디스크에 저장하는 제2단계; 상기 제2단계 후, 커널 가상 메모리 맵핑 파일인 /dev/kmem 디바이스를 통해 실행중인 커널 메모리내의 데이터에 접근하는 제3단계; 상기 제3단계 후, 실행중인 커널 메모리의 내용과 상기 원본 커널 이미지의 내용을 비교하여 메모리 변조 여부를 검사하는 제4단계; 상기 제4단계를 통해 상기 커널 메모리가 변조된 것으로 판단되면 상기 커널 메모리를 원본 커널 이미지와 동일한 데이터로 복구하는 제5단계;로 구성되는 것을 특징으로 한다. 본 발명에 따르면, 가상 메모리 매핑 파일인 kmem 디바이스 접근을 통해 일반 관리자 권한 하에서 동적적재가능커널모듈을 통한 시스템 콜 후킹 과정 없이도 커널에 설치된 루트킷을 완벽하게 탐지할 수 있다. 또한, 본 발명에 따르면 ROM 파티션 영역에 압축된 형태로 저장된 원본 커널 이미지의 경우 펌웨어 업데이트를 제외하고는 루트킷에 의한 변조가 어려운 영역이므로 1차적으로 원본 커널 이미지의 md5 hash checksum 값을 검사하여 원본 커널 이미지의 무결성을 검사한 후 무결성이 보장된 원본 커널 이미지와 비교하여 커널 원본 데이터베이스를 따로 구축할 필요 없이 변조된 커널 메모리를 탐지하고 복구할 수 있다. The present invention relates to a kernel integrity check and a modulated kernel data recovery method in a Linux kernel based smart platform; A first step of checking whether the compressed original kernel image of the ROM partition area is modified through an md5 hash checksum; A second step of decompressing and storing the original kernel image stored in the ROM partition if the original kernel image is not modified by performing the first step; A third step of accessing data in kernel memory running through the / dev / kmem device, which is a kernel virtual memory mapping file, after the second step; A fourth step of checking whether the memory has been tampered with by comparing the contents of the running kernel memory with the contents of the original kernel image after the third step; And a fifth step of restoring the kernel memory to the same data as the original kernel image if it is determined that the kernel memory is modulated through the fourth step. According to the present invention, through the virtual memory mapping file kmem device access, it is possible to detect the rootkit installed in the kernel perfectly without the system call hooking process through the dynamic loadable kernel module under the general administrator authority. In addition, according to the present invention, since the original kernel image stored in the ROM partition area in a compressed form is an area difficult to be tampered by the rootkit except for firmware update, the original kernel image is first examined by checking the md5 hash checksum value of the original kernel image. After inspecting the integrity of the image, it can be compared with the original kernel image with guaranteed integrity to detect and recover tampered kernel memory without having to build a separate kernel source database.

Description

리눅스 커널 기반 스마트 플랫폼 내에서의 커널 무결성 검사 및 변조된 커널 데이터 복구 방법 { Kernel integrity inspection and the recovery method on Linux kernel based smart platform }Kernel integrity inspection and the recovery method on Linux kernel based smart platform}

본 발명은 리눅스 커널 기반 스마트 플랫폼 내에서의 커널 무결성 검사 및 변조된 커널 데이터 복구 방법에 관한 것으로서, 좀더 상세하게는 리눅스 커널(Linux kernel)을 기반으로 한 스마트폰, 태블릿 PC와 같은 스마트 플랫폼 내의 커널 기반 루트킷 방지 기술에 관련된 것으로 특히 스마트 플랫폼 커널 내에 동적적재가능커널모듈 형태로 설치된 악성 루트킷(Rootkit)을 사전 또는 사후에 커널 모듈 드라이버 설치 과정 없이도 탐지하고 루트킷에 의해 변조된 커널 데이터를 복구할 수 있는 방법에 관한 것이다.
The present invention relates to a kernel integrity check and a modified kernel data recovery method in a Linux kernel-based smart platform, and more particularly, a kernel in a smart platform such as a smartphone or a tablet PC based on the Linux kernel. Based on the rootkit prevention technology, it is possible to detect malicious rootkit installed in the form of dynamically loadable kernel module in smart platform kernel without any kernel module driver installation process before and after and recover kernel data modulated by rootkit. It is about a method.

최근 10년간 발생했던 리눅스 시스템에 대한 공격 패러다임을 분석해 본바, 어플리케이션 레벨에서 바이너리를 교체하는 등의 Trojan 루트킷이 유행하였으나 96년경부터 동적적재가능커널모듈(LKM)을 이용한 커널 기반 루트킷이 사용되기 시작했다. After analyzing the attack paradigm on Linux systems that occurred in the last decade, Trojan rootkits such as binary replacement at the application level became popular, but around 96, kernel-based rootkits using the Dynamic Loadable Kernel Module (LKM) began to be used. .

이러한 리눅스 커널 기반 루트킷은 런타임 커널에 동적으로 모듈 드라이버를 적재하는 방식으로 동작하고 있으며 정상적인 시스템 콜(system call)을 가로채어 공격자의 시스템 콜 함수가 호출되도록 만든다고 하여 시스템 콜 후킹 또는 시스템 콜 랩핑(wrapping)이라 부르기도 한다. These Linux kernel-based rootkits operate by dynamically loading module drivers into the runtime kernel, intercepting normal system calls and causing the attacker's system call functions to be called, thus making system call hooking or system call wrapping. Also called).

이러한 커널 기반 루트킷이 설치된 리눅스 시스템은 공격자가 쉽게 관리자 권한으로 상승할 수 있으며 특정 프로세스 및 파일을 감추거나 관련 로그 데이터를 조작할 수 있으므로 어플리케이션 레벨의 명령을 사용하는 시스템 분석 방법만으로는 탐지가 불가능한 문제점이 존재한다.Linux systems with these kernel-based rootkits can be easily attacked by an attacker and can hide specific processes and files, or manipulate relevant log data, which cannot be detected using system-level analysis using application-level commands. exist.

따라서 상기 커널 기반 루트킷으로 인해 발생하는 사고를 방지하기 위해 고안된 것이 커널 기반 루트킷 탐지 기술이다. Therefore, the kernel-based rootkit detection technology is designed to prevent accidents caused by the kernel-based rootkit.

이와 같은 커널 기반 루트킷 탐지 기술들로서 등록특허 제10-0456512호 '커널 백도어 탐지 시스템, 이를 이용한 커널 백도어 탐지방법 및 커널 데이터 복구 방법'과, 공개특허 제 10-2004-0003221호 '유닉스 커널 모드에서의 커널 백도어 탐지 및 대응 장치 및 그 방법'과, 등록특허 제10-0745640호 '커널 메모리를 보호하는 방법 및 그 장치'가 제시된 바 있다.As such kernel-based rootkit detection techniques, Patent Registration No. 10-0456512, 'Kernel Backdoor Detection System, Kernel Backdoor Detection Method and Kernel Data Recovery Method', and Patent Publication No. 10-2004-0003221 'Unix Kernel Mode. Kernel backdoor detection and countermeasure apparatus and method thereof 'and Patent No. 10-0745640' Method and apparatus for protecting kernel memory 'have been presented.

이때, 상술한 종래의 커널 기반 루트킷 탐지 기술들은 커널 내에 원본 데이터베이스를 마련해두고 설치를 허용할 모듈 드라이버 명과 커널 원본 데이터를 조기에 백업해두는 방식을 사용하고 있다. 따라서, 보안 모듈 드라이버 설치 후에는 루트킷이 설치되는 행위를 차단하기 위해 모듈 드라이버 설치 관련 함수를 후킹 하여 허가한 모듈 드라이버 이외에 설치를 금지시켜 악의적인 커널 기반 루트킷이 설치되는 행위를 차단한다.At this time, the conventional kernel-based rootkit detection techniques described above use a method of preparing an original database in the kernel and backing up the module driver name and kernel original data to allow installation. Therefore, after the installation of the security module driver, in order to block the installation of the rootkit, the module driver installation related function is blocked and the installation of the malicious kernel-based rootkit is blocked by prohibiting installation other than the authorized module driver.

그런데 이상과 같은 종래 커널 기반 루트킷 탐지 기술은 아래와 같은 여러 가지 단점이 있어 응용된 루트킷 기술을 차단할 수 없는 문제점이 있다. However, the conventional kernel-based rootkit detection technology as described above has various disadvantages as described below, and thus there is a problem that the applied rootkit technology cannot be blocked.

먼저, 커널 모듈 드라이버 설치 관련 함수를 후킹(hooking)하여 허가한 모듈 드라이버 이외의 설치를 금지하는 방지 기술의 경우 허용하고 있는 모듈 드라이버 명으로 악의적인 루트킷의 이름을 변경하여 설치하는 우회 공격에 대해 차단하기 어렵다는 단점이 존재한다. 즉, 관리자 권한을 획득한 공격자는 현재 시스템상에 로드된 모듈 드라이버의 정보를 쉽게 얻을 수 있으므로 악의적인 루트킷을 허가된 이름으로 변경함으로써 우회 설치할 수 있는 문제점이 있다.First, in case of prevention technology that hooks kernel module driver installation related function and prohibits installation other than authorized module driver, it blocks the bypass attack that installs by changing the name of malicious rootkit with the module driver name which is allowed. The disadvantage is that it is difficult to do. In other words, an attacker who has obtained administrator privileges can easily obtain the information of the module driver currently loaded on the system, and there is a problem of bypass installation by changing the malicious rootkit to an authorized name.

또한, 종래의 커널 기반 루트킷 탐지 기술은 공통적으로 커널 원본 데이터베이스 구축을 통해 안전 상태의 원본 커널 메모리 값을 데이터베이스 내에 저장해야 하는 동작 과정을 필수적으로 수행하므로 이미 루트킷이 설치된 시스템의 경우 변조된 커널 메모리에 대한 탐지와 메모리 복구가 불가능하다는 기술적 허점이 존재한다. 이는 커널 기반 루트킷이 이미 공격자에 의해 설치되었을 경우를 가정해야 하므로 공격자에 의해 변조된 데이터 정보가 커널 원본 데이터베이스에 저장될 수 있다고 가정해야 한다. 따라서 이미 루트킷이 설치된 시스템에서는 조작된 커널 메모리를 탐지하거나 변조된 시스템 콜 테이블(sys_call_table), 예외 벡터 테이블(exception vector table)을 원본 데이터 값으로 복구하기 어려울 뿐만 아니라, 커널의 전체 원본 데이터를 저장할 수 없는 데이터 저장 공간의 제약이 존재하므로 데이터베이스 내에 저장된 원본 데이터 이외의 코드나 데이터 정보가 변조되었을 경우 복구할 수 있는 방법이 전무하다.In addition, the conventional kernel-based rootkit detection technology commonly performs an operation of storing the original kernel memory value in a safe state by building a kernel source database. There is a technical loophole that detection and memory recovery are impossible. Since this assumes that a kernel-based rootkit has already been installed by an attacker, it must assume that data information modified by the attacker can be stored in the kernel source database. Therefore, in a system with rootkits already installed, it is not only difficult to detect manipulated kernel memory or recover tampered system call table (sys_call_table) or exception vector table to original data values, but also to store the entire original data of the kernel. Since there is no data storage space limitation, there is no way to recover the code or data information other than the original data stored in the database.

또한, 기존의 커널 기반 루트킷 탐지 기술들은 리눅스와 유닉스, 윈도우즈 등과 같은 범용 운영체제를 대상으로 개발되었기 때문에 각각의 제조사마다 다른 커널 버전을 제공하고 있는 스마트 플랫폼의 경우 기술 적용이 어려운 근본적인 문제점도 있다. 즉, 종래 리눅스 커널 기반 루트킷 탐지 기술은 커널 모듈 드라이버가 컴파일 된 커널 환경에 의존적이고 커널 버전에 종속적으로 동작하기 때문에 다른 환경에서 컴파일된 모듈 드라이버를 범용적인 서버 환경에 적용하기 어려운 문제점이 있다. 특히 다양한 커널 버전을 사용 중인 스마트 플랫폼 환경의 경우 설치 시 각 제조사별 커널 버전에 알맞게 컴파일된 모듈 드라이버를 따로 배포해야 하는 기술적 한계점이 존재한다.
In addition, since the existing kernel-based rootkit detection technologies were developed for general-purpose operating systems such as Linux, Unix, and Windows, there is a fundamental problem that it is difficult to apply the technology to the smart platform that provides different kernel versions for each manufacturer. That is, the conventional Linux kernel-based rootkit detection technology has a problem that it is difficult to apply a module driver compiled in another environment to a general-purpose server environment because the kernel module driver depends on the compiled kernel environment and operates depending on the kernel version. In particular, in the case of smart platform environment using various kernel versions, there is a technical limitation that the module driver compiled for each manufacturer's kernel version must be distributed separately during installation.

따라서, 본 발명은 이러한 점들에 착안하여 종래 커널 기반 루트킷 탐지 기술들의 문제점을 해결하고 새로운 스마트 플랫폼에 알맞게 발명된 것으로서 동적적재가능커널모듈의 설치 과정 및 시스템 콜 호출을 가로채는 후킹 과정 없이도 커널에 접근할 수 있는 리눅스 커널 기반 스마트 플랫폼 내에서의 커널 무결성 검사 및 변조된 커널 데이터 복구 방법을 제공함에 그 목적이 있다.Therefore, the present invention solves the problems of the conventional kernel-based rootkit detection techniques in view of these points, and was invented for the new smart platform to access the kernel without the installation process of the dynamic loadable kernel module and the hooking process to intercept system call calls. Its purpose is to provide a kernel integrity check and a modified kernel data recovery method within Linux kernel-based smart platform.

또한, 본 발명은 리눅스 커널 내에 신규 모듈을 설치하거나 커널 메모리 내용을 변경하지 않고서도 리눅스 커널의 검사를 진행할 수 있는 커널 무결성 검사 및 변조된 커널 데이터 복구 방법을 제공함에도 그 목적이 있다.It is also an object of the present invention to provide a kernel integrity check and a modulated kernel data recovery method capable of inspecting the Linux kernel without installing new modules or changing kernel memory contents.

아울러, 본 발명은 커널 원본 데이터베이스를 구축하는 과정 없이도 스마트 플랫폼 내의 ROM(Read Only Memory) 파티션 영역에 압축된 형태로 저장된 원본 커널 이미지를 활용하여 커널 기반 루트킷의 존재 유무를 탐지할 수 있어 커널 루트킷이 설치된 이후에 검사를 수행하더라도 변조된 메모리의 위치를 정확하게 탐지할 수 있으며 변조된 데이터가 존재하는 경우 정상적인 코드와 원본 데이터로 복구할 수 있는 리눅스 커널 기반 스마트 플랫폼 내에서의 커널 무결성 검사 및 변조된 커널 데이터 복구 방법을 제공하는데에도 그 목적이 있다.
In addition, the present invention can detect the presence or absence of a kernel-based rootkit by utilizing the original kernel image stored in a compressed form in a ROM (Read Only Memory) partition area in a smart platform without building a kernel source database. Even after the installation is performed, the kernel integrity check and tampered kernel within the Linux kernel-based smart platform can accurately detect the location of the tampered memory and recover the normal code and original data if the tampered data is present. Its purpose is to provide a data recovery method.

이와 같은 기술적 과제를 해결하기 위해 본 발명은; The present invention to solve this technical problem;

ROM 파티션 영역의 압축된 원본 커널 이미지의 변조 여부를 md5 hash checksum을 통해 검사하는 제1단계; 상기 제1단계를 수행하여 원본 커널 이미지가 변조되지 않았으면 ROM 파티션 내에 저장된 원본 커널 이미지의 압축을 해제하여 디스크에 저장하는 제2단계; 상기 제2단계 후, 커널 가상 메모리 맵핑 파일인 /dev/kmem 디바이스를 통해 실행중인 커널 메모리내의 데이터에 접근하는 제3단계; 상기 제3단계 후, 실행중인 커널 메모리의 내용과 상기 원본 커널 이미지의 내용을 비교하여 메모리 변조 여부를 검사하는 제4단계; 상기 제4단계를 통해 상기 커널 메모리가 변조된 것으로 판단되면 상기 커널 메모리를 원본 커널 이미지와 동일한 데이터로 복구하는 제5단계;로 구성되는 것을 특징으로 하는 리눅스 커널 기반 스마트 플랫폼 내에서의 커널 무결성 검사 및 변조된 커널 데이터 복구 방법을 제공한다.A first step of checking whether the compressed original kernel image of the ROM partition area is modified through an md5 hash checksum; A second step of decompressing and storing the original kernel image stored in the ROM partition if the original kernel image is not modified by performing the first step; A third step of accessing data in kernel memory running through the / dev / kmem device, which is a kernel virtual memory mapping file, after the second step; A fourth step of checking whether the memory has been tampered with by comparing the contents of the running kernel memory with the contents of the original kernel image after the third step; A fifth step of restoring the kernel memory to the same data as the original kernel image if it is determined that the kernel memory is tampered with the fourth step; kernel integrity check in the Linux kernel-based smart platform And a modulated kernel data recovery method.

이때, 상기 제1단계를 통해 원본 커널 이미지의 변조 여부를 검사하여 펌웨어가 해킹되어 ROM 파티션 영역이 변조되었으면 경고 로그를 기록하는 제 6단계;를 더 포함하는 것을 특징으로 한다.In this case, a sixth step of checking whether the original kernel image has been modified through the first step and recording a warning log when the firmware has been hacked and the ROM partition area has been tampered with is further included.

그리고, 상기 제2단계를 수행중에 원본 커널 이미지의 압축 해제가 실패하면 에러 로그를 기록하고 프로그램을 종료하는 제 7단계;를 더 포함하는 것을 특징으로 한다.The method may further include a seventh step of recording an error log and terminating the program if decompression of the original kernel image fails while the second step is performed.

또한, 상기 제4단계는, 상기 커널 메모리의 데이터를 검사하는 데이터 무결성 검사 모듈과, 상기 커널 메모리의 코드를 검사하는 코드 무결성 검사 모듈로 검사하되, 상기 데이터 무결성 검사 모듈을 통해 인터럽트 구현부의 예외 벡터 테이블의 무결성 검사를 수행하는 4_1단계; 상기 코드 무결성 검사 모듈을 통해 예외 핸들러인 vector_swi 함수 코드의 변조 여부를 검사하는 4_2단계; 상기 데이터 무결성 검사 모듈을 통해 시스템 콜 테이블 주소가 변조되었는지 점검하는 4_3단계; 상기 코드 무결성 검사 모듈을 통해 시스템 콜 처리 함수 코드에 대한 무결성을 검사하는 4_4단계; 상기 데이터 무결성 검사 모듈과 코드 무결성 검사 모듈을 통한 네트워크 프로토콜 핸들러의 검사 과정에서 변조된 코드나 데이터가 탐지하는 4_5단계;로 구성되는 것을 특징으로 한다.The fourth step may include a data integrity check module that checks data of the kernel memory and a code integrity check module that checks a code of the kernel memory, but an exception vector of an interrupt implementation unit through the data integrity check module. Step 4_1 of performing integrity check of the table; 4_2 step of checking whether the code handler vector_swi function code is modified through the code integrity check module; Checking whether a system call table address has been modified through the data integrity check module; 4_4 checking the integrity of a system call processing function code through the code integrity checking module; And a step 4_5 of detecting the modulated code or data during the inspection of the network protocol handler through the data integrity check module and the code integrity check module.

또한, 상기 제5단계는, 상기 원본 커널 이미지의 물리 주소 위치에 있는 코드와 데이터를 저장해두었던 안전한 메모리 장소로부터 원본 커널 이미지를 불러와 변조된 커널 메모리의 가상 주소 위치에 1byte 데이터 단위로 복원하는 단계인 것을 특징으로 한다.
In the fifth step, the original kernel image is retrieved from a secure memory location in which the code and data at the physical address location of the original kernel image are stored, and the original kernel image is restored to the virtual address location of the modulated kernel memory by 1 byte data unit. It is characterized by that.

본 발명에 따르면, 가상 메모리 매핑 파일인 kmem 디바이스 접근을 통해 일반 관리자 권한 하에서 동적적재가능커널모듈을 통한 시스템 콜 후킹 과정 없이도 커널에 설치된 루트킷을 완벽하게 탐지할 수 있다.According to the present invention, through the virtual memory mapping file kmem device access, it is possible to detect the rootkit installed in the kernel perfectly without the system call hooking process through the dynamic loadable kernel module under the general administrator authority.

또한, 본 발명에 따르면 ROM 파티션 영역에 압축된 형태로 저장된 원본 커널 이미지의 경우 펌웨어 업데이트를 제외하고는 루트킷에 의한 변조가 어려운 영역이므로 1차적으로 원본 커널 이미지의 md5 hash checksum 값을 검사하여 원본 커널 이미지의 무결성을 검사한 후 무결성이 보장된 원본 커널 이미지와 비교하여 커널 원본 데이터베이스를 따로 구축할 필요 없이 변조된 커널 메모리를 탐지하고 복구할 수 있다. In addition, according to the present invention, since the original kernel image stored in the ROM partition area in a compressed form is an area difficult to be tampered by the rootkit except for firmware update, the original kernel image is first examined by checking the md5 hash checksum value of the original kernel image. After inspecting the integrity of the image, it can be compared with the original kernel image with guaranteed integrity to detect and recover tampered kernel memory without having to build a separate kernel source database.

뿐만 아니라, 다섯 가지 단계로 나뉘는 커널 메모리 무결성 탐지 모듈과 복구 모듈을 이용해 좀더 정교하게 커널의 변조 유무를 탐지할 수 있고, 커널 내의 메모리를 변경하거나 각각의 제조사가 제공하는 커널 버전에 맞게 컴파일된 모듈 드라이버를 별도로 설치하여 운영 중인 커널에 부담을 주는 작업이 일체 필요하지 않으므로 보다 안정적으로 루트킷을 탐지할 수 있는 장점도 있다.In addition, the kernel memory integrity detection module and recovery module, which are divided into five stages, can be used to detect kernel tampering, change the memory in the kernel, or compile modules for each kernel version provided by each manufacturer. There is an advantage in that the rootkit can be detected more reliably because there is no need to burden the operating kernel by installing the driver separately.

그리고, 본 발명은 스마트폰, 태블릿 PC, IP TV와 같은 스마트 플랫폼의 경우에만 국한하여 커널 무결성 검사 및 변조된 커널 데이터 복구되지 않으며, 리눅스 커널을 기반으로 한 모든 운영체제 플랫폼에서 적용 가능함은 물론이며, 해당 기술을 응용한 획기적인 보안 솔루션 개발이 가능하다.
In addition, the present invention is not limited to only the smart platform such as smart phones, tablet PCs, IP TV, kernel integrity check and modulated kernel data recovery, and is applicable to all operating system platforms based on the Linux kernel. It is possible to develop innovative security solutions that apply the technology.

도 1은 본 발명에 따른 커널 기반 루트킷 탐지 시스템 구성도이다.
도 2는 본 발명에 따른 커널 기반 루트킷 탐지 과정을 도시한 흐름도이다.
도 3는 본 발명에 따른 커널 메모리 무결성 검사 모듈의 실행 과정을 도시한 흐름도이다.
도 4는 본 발명에 따른 커널 메모리 무결성 검사 모듈에서 변조된 시스템 콜 테이블을 탐지한 모습을 도시한 도면이다.
도 5은 본 발명에 따른 커널 메모리 무결성 검사 모듈에서 변조된 시스템 콜 함수를 탐지한 모습을 도시한 도면이다.
1 is a block diagram of a kernel-based rootkit detection system according to the present invention.
2 is a flowchart illustrating a kernel-based rootkit detection process according to the present invention.
3 is a flowchart illustrating an execution process of a kernel memory integrity check module according to the present invention.
4 is a diagram illustrating the detection of a modulated system call table in the kernel memory integrity check module according to the present invention.
5 is a diagram illustrating the detection of a modulated system call function in the kernel memory integrity check module according to the present invention.

본 발명에 따른 리눅스 커널 기반 스마트 플랫폼 내에서의 커널 무결성 검사 및 변조된 커널 데이터 복구 방법을 첨부한 도면을 참고로 하여 이하 상세히 기술되는 실시 예들에 의하여 그 특징들을 이해할 수 있을 것이다.
With reference to the accompanying drawings, a kernel integrity check and a modulated kernel data recovery method in the Linux kernel-based smart platform according to the present invention will be understood by the embodiments described in detail below.

본 발명은 커널 기반 루트킷 방지 기술에 관한 것으로 온라인 뱅킹이나 전자상거래 시 일괄 검사 모드로 자동 수행되거나 데몬 서비스 형태의 백그라운드 프로세스로 실행되어 실시간 감시 모드로 수행될 수 있다.The present invention relates to a kernel-based rootkit prevention technology, which can be performed automatically in a batch check mode during online banking or electronic commerce, or in a real-time monitoring mode by executing as a background process in the form of a daemon service.

이와 같은 본 발명 도 1에 도시된 바와 같이 먼저 각각의 플랫폼 제조사에서 제공하는 ROM 파티션의 원본 커널 이미지의 내용이 변조되었는지 검사하는 펌웨어 검사 모듈(100)과, ROM 파티션 내에 압축 형태로 저장된 원본 커널 이미지를 해제하여 커널의 원본 코드나 데이터의 정보를 얻어오는 원본 커널 이미지 접근 모듈(110)과, 가상 메모리 매핑 파일인 kmem 디바이스를 통해 실행 중인 커널 내의 메모리에 다이렉트로 접근을 시도하는 커널 메모리 접근 모듈(120)과, 이미 공격자의 악의적인 커널 루트킷이 설치되어 있다는 가정하에서도 커널 메모리의 변조 여부를 탐지하는 커널 메모리 무결성 검사 모듈(130)과, 상기 커널 메모리 무결성 검사 모듈(130)을 통한 무결성 검사 진행 중 변조된 메모리 내용이 탐지되면 변조된 메모리의 내용을 원래대로 복원하기 위한 커널 메모리 복구 모듈(140)로 구성된다.As shown in FIG. 1, the present invention first checks whether the contents of an original kernel image of a ROM partition provided by each platform manufacturer are modified, and the original kernel image stored in a compressed form in the ROM partition. Release kernel source access module 110 to obtain the source code or data information of the kernel by releasing, and kernel memory access module that attempts to directly access the memory in the running kernel through the kmem device which is a virtual memory mapping file ( 120), the kernel memory integrity check module 130 for detecting whether the kernel memory has been tampered with, even if the malicious kernel rootkit of the attacker is already installed, and the integrity check proceeds through the kernel memory integrity check module 130. The contents of the tampered memory when it is detected Kernel memory recovery module 140 for.

이때, 상기 커널 메모리 무결성 검사 모듈(130)은 커널 메모리의 변조 여부를 탐지시에 성능과 속도 개선을 위해 검사에 필요한 각 코드와 데이터를 md5 hash checksum (Message Digest - One Way Hash Algorithm)이란 단방향 해쉬 알고리즘을 이용하여 검사하는 빠른 무결성 검사 모듈로 이루어짐이 바람직하다.
At this time, the kernel memory integrity check module 130 detects whether the kernel memory has been tampered with and unidirectional hash of each code and data necessary for the check to improve performance and speed, md5 hash checksum (Message Digest-One Way Hash Algorithm). It is desirable to have a fast integrity check module that checks using an algorithm.

이하, 본 발명에 따른 각각의 구성 모듈들을 좀 더 상세히 설명한다Hereinafter, each configuration module according to the present invention will be described in more detail.

먼저, 커널 루트킷 탐지를 위한 펌웨어 검사 모듈(100)은 각각의 스마트 플랫폼 제조사에서 제공하는 ROM 파티션에서 원본 커널 이미지의 내용을 얻어오므로 압축된 원본 커널 이미지가 변조되지 않았는지 신뢰 여부를 검사한다. First, since the firmware inspection module 100 for detecting the kernel rootkit obtains the contents of the original kernel image from a ROM partition provided by each smart platform manufacturer, it checks whether the compressed original kernel image is not tampered with.

이때, 상기 펌웨어 검사 모듈(100)은 각각의 제조사에서 배포한 커널 버전별 md5 hash checksum 값을 보관하여 올바른 원본 커널 이미지인지 검사하므로 해킹된 펌웨어가 ROM 파티션에 저장되어 있는 경우 변조된 펌웨어를 사용하고 있는 사실을 검출해낼 수 있다. At this time, the firmware check module 100 stores the md5 hash checksum value for each kernel version distributed by each manufacturer and checks whether it is the correct original kernel image. Therefore, when the hacked firmware is stored in the ROM partition, the firmware check module 100 uses the modified firmware. Can detect facts

이와 같은 펌웨어 검사 모듈(100)의 수행을 통해 변조되지 않은 정상적인 펌웨어로 판단된 경우 ROM 파티션 내에 저장되어 있는 압축된 원본 커널 이미지를 해제하는 원본 커널 이미지 접근 모듈(110)을 수행한다.
When it is determined that the normal firmware is not tampered by performing the firmware inspection module 100, the original kernel image access module 110 for releasing the compressed original kernel image stored in the ROM partition is performed.

상기 원본 커널 이미지 접근 모듈(110)은 압축된 원본 커널 이미지를 압축 해제한 후 디스크 상에 저장할 원본 커널 이미지가 변조되는 것을 차단하기 위해 md5 hash checksum 값을 별도로 보관하며 매번 무작위로 변경되는 임시 파일명을 사용하여 디스크에 저장하도록 한다. The original kernel image access module 110 stores a md5 hash checksum value separately to decompress the compressed original kernel image and then decodes the original kernel image to be stored on the disk, and randomly changes a temporary file name every time. To save it to disk.

이 경우 상기 원본 커널 이미지 접근 모듈(110)은 특정 패턴의 데이터에 접근 시 값을 변조하는 특징을 갖는 루트킷에 대응하기 위해 데이터는 각 1byte 단위로 처리함이 바람직하다.
In this case, the original kernel image access module 110 preferably processes data in units of 1 byte in order to correspond to a rootkit having a feature of modulating a value when accessing data of a specific pattern.

한편, 상기 원본 커널 이미지와 비교하기 위해 커널 가상 메모리 매핑 파일인 /dev/kmem 디바이스를 통해 실행 중인 커널의 메모리 데이터를 확보하는 커널 메모리 접근 모듈(120)이 실행된다. Meanwhile, a kernel memory access module 120 is executed to secure memory data of a running kernel through a / dev / kmem device, which is a kernel virtual memory mapping file, to compare with the original kernel image.

상기 커널 메모리 접근 모듈(120)은 읽고 쓰고자 하는 커널 메모리 데이터를 기본 페이지 단위(4096byte)로 임의의 메모리 영역에 공유 메모리 형태로 할당하여 1byte 데이터 단위로 접근하도록 한다. The kernel memory access module 120 allocates kernel memory data to be read and written in an arbitrary memory area in a basic page unit (4096 bytes) and accesses it in 1 byte data units.

특히 상기 커널 메모리 접근 모듈(120)은 동적적재가능커널모듈 형태가 아닌 일반 관리자 권한에서 실행할 수 있는 ELF 포맷 형태의 바이너리로 구성되므로 실행 중인 커널에 특정 모듈 드라이버를 설치하거나 메모리에 변경을 가하지 않고 원하는 크기만큼 커널 메모리 내의 데이터를 얻어올 수 있다.
In particular, the kernel memory access module 120 is composed of an ELF format binary that can be executed in a general administrator authority, not a dynamic loadable kernel module type, so that a specific module driver is not installed in the running kernel or changes are not made to the memory. You can get data in kernel memory by the size.

그리고, 원본 커널 이미지의 압축을 해제하는 상기 원본 커널 이미지 접근 모듈(110)과 커널 메모리의 데이터를 확보하는 상기 커널 메모리 접근 모듈(120)이 정상적으로 동작하는지 여부가 확인되고 나면 변조된 메모리를 탐지할 수 있는 커널 메모리 무결성 검사 모듈(130)을 실행하게 된다. After detecting whether the original kernel image access module 110 decompressing the original kernel image and the kernel memory access module 120 securing the data of the kernel memory operate normally, the modulated memory may be detected. The kernel memory integrity check module 130 may be executed.

상기 커널 메모리 무결성 검사 모듈(130)은 원본 커널 이미지 내용과 커널 메모리 내용을 비교하여 변조된 메모리를 검출해내는 역할을 수행한다. The kernel memory integrity check module 130 compares the original kernel image contents with the kernel memory contents and detects the modulated memory.

이때, 상기 커널 메모리 무결성 검사 모듈(130)은 커널 메모리의 무결성을 검사하기 위해 인터럽트 발생시 참조되는 예외 벡터 테이블(150)과 시스템 콜 테이블(152)을 참조하여 시스템 콜 함수 호출을 처리하는 vector_swi 함수 코드, 시스템 콜 테이블, 시스템 콜 함수 코드, 네트워크 프로토콜 핸들러 테이블, 핸들러 코드 등의 커널 중요 정보를 검사하여 루트킷이 변조한 코드와 데이터를 탐지한다. In this case, the kernel memory integrity checking module 130 refers to the exception vector table 150 and the system call table 152 that are referenced when an interrupt occurs to check the integrity of the kernel memory, and processes the system call function vector_swi function code. It detects code and data that the rootkit has tampered with by examining kernel critical information such as system call tables, system call function code, network protocol handler tables, and handler code.

이와 같은 상기 커널 메모리 무결성 검사 모듈(130)은 데이터를 검사하는 데이터 무결성 검사 모듈(132)과, 코드를 검사하는 코드 무결성 검사 모듈(134)로 구성된다.The kernel memory integrity check module 130 includes a data integrity check module 132 for checking data and a code integrity check module 134 for checking code.

상기 데이터 무결성 검사 모듈(132)는 커널 메모리 내의 데이터 변조 여부를 검사하는 모듈로써 4byte 단위의 데이터 크기를 갖는 디스크립터 테이블, 예외 벡터 테이블, 시스템 콜 테이블, 네트워크 프로토콜 핸들러 테이블 등을 검사한다.The data integrity check module 132 is a module for checking whether data is modified in kernel memory and checks a descriptor table, an exception vector table, a system call table, a network protocol handler table, and the like having a data size of 4 bytes.

또한, 상기 코드 무결성 검사 모듈(134)는 커널에서 사용하는 심볼들을 관리하는 /proc/kallsyms 커널 심볼 테이블 정보를 기반으로 export 된 심볼 함수의 주소 범위를 계산하여 각 함수의 크기를 구한 후 원본 커널 이미지와 커널 메모리 내의 vector_swi 함수 코드, 시스템 콜 함수 코드, 네트워크 프로토콜 핸들러 코드 등이 변조되었는지 여부를 1byte 단위로 비교하여 검사한다.
In addition, the code integrity check module 134 calculates the address range of the exported symbol functions based on the / proc / kallsyms kernel symbol table information that manages the symbols used in the kernel to obtain the size of each function, and then the original kernel image. And check whether the vector_swi function code, system call function code, network protocol handler code, etc. in kernel memory have been tampered with by 1 byte unit.

또한, 상기 커널 메모리 무결성 검사 모듈(130)을 수행하는 과정에서 변조된 코드와 데이터를 탐지한 경우, 커널 메모리 복구 모듈(140)을 통해 원본 커널 이미지 내에서 변조된 커널 메모리의 원본 데이터에 해당하는 값을 찾아 1byte 단위로 데이터를 복원하는 과정을 수행하게 된다. In addition, when detecting the code and data modulated in the process of performing the kernel memory integrity check module 130, the kernel memory recovery module 140 corresponds to the original data of the kernel memory modulated in the original kernel image It finds the value and restores the data in 1 byte unit.

이때, 원본 커널 이미지의 경우 가상 주소 체계로 이루어진 커널 메모리와 달리 물리 주소 체계를 사용하고 있기 때문에 가상 주소와 0xc0008000 주소 값 만큼의 차이를 갖는 특징이 있기 때문에 커널 메모리 복구 모듈(140)이 동작되면 상기 커널 메모리 무결성 검사 모듈(130)에서 확보해둔 원본 커널 이미지의 데이터 내용을 활용하여 변조된 메모리의 가상 주소 위치에 복원하게 된다.
In this case, since the original kernel image uses a physical address system unlike the kernel memory consisting of the virtual address system, the kernel memory recovery module 140 operates when the kernel memory recovery module 140 operates because the virtual address differs from the virtual address by 0xc0008000. The data of the original kernel image secured by the kernel memory integrity check module 130 is restored to the virtual address location of the modulated memory.

한편, 상기 커널 메모리 무결성 검사 모듈(130)은 데이터 무결성 검사 모듈(132)과 코드 무결성 검사 모듈(134)를 이용해 도 2에 도시된 바와 같은 과정을 순차로 처리하게 된다. 이에 의하면 프로세서(예를 들어 ARM 9 등)의 인터럽트 구현부 검사를 시작으로 총 다섯 가지의 검사 과정을 수행한다. 일반적으로 스마트 플랫폼에서 사용하는 ARM 프로세서의 경우에는 인터럽트나 예외가 발생하면 하드웨어적으로 지정된 예외 벡터 테이블(150)의 주소로 분기(branch)하게 되는데 여기서 예외 벡터 테이블(150)에는 각각의 예외에 해당하는 처리 루틴인 예외 핸들러(exception handler)(151)들이 구현되어 있다. Meanwhile, the kernel memory integrity check module 130 sequentially processes the process as shown in FIG. 2 using the data integrity check module 132 and the code integrity check module 134. According to this, a total of five checks are performed, starting with the interrupt implementation check of the processor (for example, ARM 9). In general, in the case of an ARM processor used in a smart platform, when an interrupt or an exception occurs, the branch to the address of the hardware-specified exception vector table 150 is branched to the exception vector table 150. Exception handlers 151 are implemented.

상기 데이터 무결성 검사 모듈(132)을 통해 인터럽트 구현부의 무결성을 검사하는 과정을 통해 예외 벡터 테이블(150)과 예외 핸들러(151)의 주소가 변조되었는지 여부를 검사한다. 먼저, 예외 벡터 테이블(150)을 검사하기 위해 vector의 위치를 검색하는데 낮은 주소에 구현된 low vector(0x0)를 사용하는지 높은 주소에 구현된 high vector(0xffff0000)를 사용하는지 검사하는 과정을 수행하여 예외 벡터 테이블(150)의 위치를 찾는다. 이후 검색된 예외 벡터 테이블(150)로부터 0x8 오프셋 지점에 위치한 예외 핸들러(151)로 분기하는 4byte 코드를 검사한 후, 소프트웨어(software interrupt)를 처리하는 예외 핸들러(151)인 vector_swi 함수의 주소가 올바른지 검사하여 ARM 프로세서의 인터럽트 구현부에 대한 첫 번째 검사 과정을 완료하게 된다.(S100)The process of checking the integrity of the interrupt implementation unit through the data integrity check module 132 determines whether the addresses of the exception vector table 150 and the exception handler 151 have been tampered with. First, to check the location of the vector to check the exception vector table 150, a process of checking whether a low vector (0x0) implemented at a low address or a high vector (0xffff0000) implemented at a high address is performed. Find the location of the exception vector table 150. After checking the 4-byte code branching from the retrieved exception vector table 150 to the exception handler 151 located at offset 0x8, the address of the vector_swi function, which is the exception handler 151 that handles the software interrupt, is correct. In this case, the first inspection process for the interrupt implementation of the ARM processor is completed.

상기 단계(S100)를 수행한 후, 코드 무결성 검사 모듈(134)을 통한 vector_swi 함수 코드의 무결성 검사를 수행하는데, 해당 함수는 r7 레지스터에 담긴 시스템 콜 번호를 인덱스로 참조하여 시스템 콜 테이블 내에 저장된 시스템 콜 함수를 호출하는 역할을 한다. 이와 같이 인터럽트 구현부 검사 직후 직접적으로 시스템 콜 테이블(152)을 다루는 vector_swi 함수에 대한 검사를 수행함으로써 인터럽트 발생 이후 시스템 콜 테이블(152) 내의 처리 함수를 호출하기 이전까지 구간에 대한 안전성을 보장한다.(S102)After performing the step (S100), the integrity check of the vector_swi function code through the code integrity check module 134, the function is stored in the system call table by referring to the system call number contained in the r7 register as an index It is responsible for calling the call function. As such, by performing a check on the vector_swi function that directly handles the system call table 152 immediately after the interrupt implementation part check, it ensures the safety of the section from the interrupt occurrence until the processing function in the system call table 152 is called. (S102)

상기 단계(S102)를 수행한 후, 상기 데이터 무결성 검사 모듈(132)을 통해 시스템 콜 테이블(152) 내에 저장된 시스템 콜 처리 함수(153)들의 주소 변조 여부를 검사한다. 최근 2.6 커널을 사용 중인 리눅스 커널의 경우 약 320여 개 이상의 시스템 콜 함수가 존재하므로 시스템 콜 함수 개수만큼 테이블 내에 저장된 처리 함수 주소에 대해 검사를 수행하게 된다. 단, ARM 프로세서를 사용하는 스마트 플랫폼의 경우에는 타 프로세서에서 운영되는 리눅스 커널과 달리 일명 비어있는 시스템 콜(empty system call)과 같은 사용하지 않는 시스템 콜 주소가 테이블 내에 다수 포함되는 특징이 있기 때문에 무결성 검사 진행 시 비어있는 시스템 콜의 주소를 미리 구하는 과정을 수행하여 오탐률을 줄이고 검사 속도를 개선할 수 있다.(S104)After performing the step (S102), it is checked through the data integrity check module 132 whether address modification of the system call processing functions 153 stored in the system call table 152. In the Linux kernel using 2.6 kernels, there are more than 320 system call functions. Therefore, the number of system call functions is checked for the processing function addresses stored in the table. However, in case of smart platform using ARM processor, unlike Linux kernel running on other processor, the unused system call address such as empty system call is included in the table. By performing the process of obtaining the address of an empty system call in advance during the inspection, it is possible to reduce the false positive rate and improve the inspection speed.

상기 단계(S104)를 수행하여 검사가 완료되면, 상기 코드 무결성 검사 모듈(134)을 통해 시스템 콜 함수 코드(153)의 무결성 검사를 수행한다. 이때, 상기 코드 무결성 검사 모듈(134)은 부팅 시 맵핑되는 상기 /proc/kallsyms 커널 심볼 테이블 정보를 통해 export 된 심볼 함수의 주소 범위를 계산하거나 함수의 프롤로그와 에필로그 사이의 주소 범위를 계산하여 각 시스템 콜 함수(153)의 크기를 구한 후 원본 커널 이미지의 함수 코드와 커널 메모리 내의 함수 코드를 해당 크기만큼 1byte씩 비교하는 정밀한 검사를 수행하게 된다. 상기 무결성 검사 과정에서 심볼 함수의 크기만큼 원본 커널 이미지 데이터를 확보하므로 차후 커널 메모리 내에서 변조된 메모리 내용이 탐지되었을 경우 신속하게 복구할 수 있다.(S106)When the check is completed by performing the step (S104), the integrity check of the system call function code 153 is performed through the code integrity check module 134. At this time, the code integrity check module 134 calculates the address range of the exported symbol function through the / proc / kallsyms kernel symbol table information mapped at boot or calculates the address range between the prolog and epilog of the function. After obtaining the size of the call function 153, a detailed inspection is performed to compare the function code of the original kernel image with the function code in the kernel memory by 1 byte. Since the original kernel image data is secured by the size of the symbol function in the integrity check process, it is possible to quickly recover the memory contents modified in the kernel memory in the future (S106).

상기 단계(S106)를 수행한 후, 네트워크 프로토콜 핸들러(154)의 무결성을 검사하기 위해 상기 데이터 무결성 검사 모듈(132)과 코드 무결성 검사 모듈(134)을 혼용하여 구조체 내에 위치한 네트워크 프로토콜 핸들러 테이블과 네트워크 프로토콜 핸들러 코드에 대한 무결성 검사를 수행한다.(S108) 상기 데이터 무결성 검사 모듈(132)과 코드 무결성 검사 모듈(134)을 통한 네트워크 프로토콜 핸들러(154)의 검사 과정에서 변조된 코드나 데이터가 탐지되는 경우, 상기 커널 메모리 복구 모듈(140)을 통해 원본 커널 이미지와 동일한 데이터 내용으로 복구를 수행하게 된다.
After performing step S106, the network protocol handler table and the network located in the structure are mixed with the data integrity check module 132 and the code integrity check module 134 to check the integrity of the network protocol handler 154. Integrity check is performed on the protocol handler code (S108). In the process of checking the network protocol handler 154 through the data integrity check module 132 and the code integrity check module 134, the modulated code or data is detected. In this case, the kernel memory recovery module 140 performs recovery with the same data content as the original kernel image.

이하, 도 1 내지 도 5를 참고로 본 발명에 따른 리눅스 커널 기반 스마트 플랫폼 내에서의 커널 무결성 검사 및 변조된 커널 데이터 복구 과정을 설명한다.Hereinafter, a kernel integrity check and a modulated kernel data recovery process in a Linux kernel-based smart platform according to the present invention will be described with reference to FIGS. 1 to 5.

본 발명을 통해 커널 기반 루트킷을 탐지하는 커널 기반 루트킷 탐지 솔루션이 실행되고 나면 가장 먼저 펌웨어 검사 모듈(100)이 실행되어(S10), 각 제조사에서 제공하는 ROM 파티션 영역의 원본 커널 이미지 데이터의 변조 여부를 md5 hash checksum을 통해 검사한다.(S12)After the kernel-based rootkit detection solution that detects the kernel-based rootkit through the present invention is executed, the firmware inspection module 100 is first executed (S10), and whether the original kernel image data of the ROM partition area provided by each manufacturer is modified. Check through the md5 hash checksum (S12).

이때, 상기 단계(S12)를 통해 원본 커널 이미지 데이터의 변조 여부를 검사하는 과정 중 만약 펌웨어가 해킹되어 ROM 파티션 영역이 변조되었을 경우 별도의 경고 로그를 기록하고 검사를 계속 진행한다.(S14)At this time, if the firmware is hacked and the ROM partition area is tampered with during the process of checking whether the original kernel image data has been tampered with (S12), a separate warning log is recorded and the inspection continues.

상기 단계(S12)를 정상적으로 수행하여 원본 커널 이미지 데이터가 변조되지 않은 정상적인 펌웨어로 판단된 경우 원본 커널 이미지 접근 모듈(110)을 통해 ROM 파티션 내에 저장된 원본 커널 이미지의 압축을 해제한다.(S16) If it is determined that the original kernel image data is normal firmware unmodulated by performing the above step S12, the original kernel image stored in the ROM partition is decompressed through the original kernel image access module 110 (S16).

이때, 상기 단계(S16)를 수행시에는 일반적으로 ROM 파티션 내에는 원본 커널 이미지인 zImage와 RAM 파일 시스템인 initramfs가 포함되므로, 만일 원본 커널 이미지 접근 모듈(110)이 압축 해제에 실패한 경우 에러 로그를 기록하고 프로그램을 종료한다. In this case, when performing the step S16, the ROM partition includes the original kernel image zImage and the RAM file system initramfs. Therefore, if the original kernel image access module 110 fails to extract the error log, Record and exit the program.

반면, 상기 단계(S16)를 수행하여 정상적으로 원본 커널 이미지의 압축을 해제하면 커널 메모리 접근 모듈(120)에서 가상 메모리 맵핑 파일인 /dev/kmem 디바이스를 통해 커널 메모리 내의 데이터에 접근 가능한지 여부를 검사한다.(S18)On the other hand, if the normal kernel image is decompressed by performing the step S16, the kernel memory access module 120 checks whether data in the kernel memory is accessible through the / dev / kmem device, which is a virtual memory mapping file. (S18)

상기 단계(S16)를 수행하여 정상 동작하는 것을 확인하여(S20), 디바이스에 접근이 불가능한 경우 에러 로그를 기록하고 프로그램을 종료(S22)하는 반면, 정상 동작하는 것이 확인되면 커널 메모리 무결성 검사 모듈(130)을 실행하여 커널 메모리의 무결성 유무를 검사한다.(S24) By performing the step (S16) to confirm that the normal operation (S20), if the device is not accessible, write an error log and terminate the program (S22), while if it is confirmed that the normal operation of the kernel memory integrity check module ( 130) to check the integrity of the kernel memory (S24).

상기 단계(S24)를 통해 만일 커널 기반 루트킷이 설치되었다고 가정할 경우 공격자는 ARM 프로세서 특성상 존재하는 예외 벡터 테이블(150)의 4byte 코드 값을 조작할 수 있으므로 정상적인 예외 핸들러가 아닌 조작된 예외 핸들러가 호출되도록 만들 수 있다. 또한, 예외 벡터 테이블 부근에 위치한 예외 핸들러 주소를 변조함으로써 상기와 마찬가지로 조작된 예외 핸들러가 호출되도록 유도할 수 있다. If it is assumed in step S24 that the kernel-based rootkit is installed, the attacker can manipulate the 4-byte code value of the exception vector table 150 that exists due to the characteristics of the ARM processor, so that the manipulated exception handler is called instead of the normal exception handler. It can be made as possible. Also, by modifying the exception handler address located near the exception vector table, the manipulated exception handler can be induced to be called.

따라서 상기 커널 메모리 무결성 검사 모듈(130)에서는 데이터 무결성 검사 모듈(132)을 통해 인터럽트 구현부의 예외 벡터 테이블의 무결성 검사를 가장 첫 번째로 수행한다. Therefore, the kernel memory integrity check module 130 performs the integrity check of the exception vector table of the interrupt implementer first through the data integrity check module 132.

이후, 두 번째 검사 과정에서는 코드 무결성 검사 모듈(134)을 통해 예외 핸들러(151)인 vector_swi 함수 코드의 변조 여부를 검사한다. 해당 예외 핸들러 함수는 시스템 콜 테이블(152) 내에 저장된 각 시스템 콜 처리 함수의 호출을 담당하는 함수로써 공격자에 의해 흔하게 변조되는 함수 중 하나이다. Subsequently, in the second checking process, the code integrity check module 134 checks whether the vector_swi function code, which is the exception handler 151, has been tampered with. The exception handler function is a function that is responsible for calling each system call processing function stored in the system call table 152 and is one of functions that are commonly tampered with by an attacker.

상기 두 번째 검사 과정이 완료되고 나면 데이터 무결성 검사 모듈(132)을 통해 시스템 콜 테이블 주소가 변조되었는지 점검하는 세 번째 검사 과정을 수행한다. 참고로, 시스템 콜 처리 함수들의 주소가 저장된 시스템 콜 테이블(152)은 커널 기반 루트킷이 가장 빈번하게 조작하는 데이터로 알려져 있다. After the second check process is completed, a third check process is performed to check whether the system call table address has been modified through the data integrity check module 132. For reference, the system call table 152, which stores addresses of system call processing functions, is known as data that kernel-based rootkits most frequently manipulate.

이후 다음 단계인 네 번째 검사 과정에서는 코드 무결성 검사 모듈(134)을 통해 시스템 콜 처리 함수 코드에 대한 무결성을 검사한다. 과거 공격자들은 시스템 콜 테이블에 대해 보안이 적용된 솔루션을 우회하기 위해 시스템 콜 테이블에 접근하지 않고 시스템 콜 처리 함수의 코드 영역을 직접적으로 수정하는 공격 방법을 개발하여 사용하였다. 이로 인해 공격자는 시스템 콜 테이블을 수정하지 않아도 시스템 콜 후킹이 가능했다.Thereafter, in the fourth step of checking, the code integrity checking module 134 checks the integrity of the system call processing function code. In the past, attackers have developed and used an attack method that directly modifies the code area of the system call processing function without accessing the system call table to bypass the secured solution for the system call table. This made it possible for an attacker to hook a system call without modifying the system call table.

이러한 행위를 탐지하기 위한 네 번째 검사 과정이 완료되고 나면, 마지막 다섯 번째 검사 과정에서 네트워크 프로토콜 핸들러 테이블과 코드에 대한 무결성을 검사하는 것으로 커널 메모리 무결성 검사 모듈(130)의 동작을 완료하게 된다.After the fourth checking process for detecting such an operation is completed, the operation of the kernel memory integrity checking module 130 is completed by checking the integrity of the network protocol handler table and the code in the last fifth checking process.

상기 단계(S24)를 수행하여 변조된 데이터가 있는지를 비교한 바(S26), 변조된 코드나 데이터가 발견되면 커널 메모리 복구 모듈(140)을 통해 원본 커널 이미지와 동일한 데이터 내용으로 복구를 수행하게 된다.(S28) 즉, 원본 커널 이미지의 물리 주소 위치에 있는 코드와 데이터를 저장해두었던 안전한 메모리 장소로부터 원본 커널 이미지 데이터를 불러와 변조된 커널 메모리의 가상 주소 위치에 1byte 데이터 단위로 복원하는 과정을 마지막으로 수행한 후 커널 기반 루트킷 탐지 솔루션을 종료하게 된다.
As a result of comparing the modulated data by performing the step S24 (S26), if the modulated code or data is found, the kernel memory recovery module 140 restores the same data contents as the original kernel image. That is, the process of retrieving the original kernel image data from the secure memory location where the code and data at the physical address location of the original kernel image are stored and restoring the data at the virtual address location of the modulated kernel memory by 1 byte data unit is performed. After the last run, we will terminate the kernel-based rootkit detection solution.

이상과 같이 본 발명의 실시 예에 대하여 상세히 설명하였으나, 본 발명의 권리범위는 이에 한정되지 않으며, 본 발명의 실시 예와 실질적으로 균등의 범위에 있는 것까지 본 발명의 권리범위가 미친다.
While the present invention has been particularly shown and described with reference to exemplary embodiments thereof, it is to be understood that the invention is not limited to the disclosed exemplary embodiments, but, on the contrary,

100: 펌웨어 검사 모듈
110: 원본 커널 이미지 접근 모듈
120: 커널 메모리 접근 모듈
130: 커널 메모리 무결성 검사 모듈
140: 커널 메모리 복구 모듈
100: firmware check module
110: original kernel image access module
120: kernel memory access module
130: kernel memory integrity check module
140: kernel memory recovery module

Claims (5)

ROM 파티션 영역의 압축된 원본 커널 이미지의 변조 여부를 md5 hash checksum을 통해 검사하는 제1단계;
상기 제1단계를 수행하여 원본 커널 이미지가 변조되지 않았으면 ROM 파티션 내에 저장된 원본 커널 이미지의 압축을 해제하여 디스크에 저장하는 제2단계;
상기 제2단계 후, 커널 가상 메모리 맵핑 파일인 /dev/kmem 디바이스를 통해 실행중인 커널 메모리내의 데이터에 접근하는 제3단계;
상기 제3단계 후, 실행중인 커널 메모리의 내용과 상기 원본 커널 이미지의 내용을 비교하여 메모리 변조 여부를 검사하는 제4단계;
상기 제4단계를 통해 상기 커널 메모리가 변조된 것으로 판단되면 상기 커널 메모리를 원본 커널 이미지와 동일한 데이터로 복구하는 제5단계;로 구성되되,
상기 제1단계를 통해 원본 커널 이미지의 변조 여부를 검사하여 펌웨어가 해킹되어 ROM 파티션 영역이 변조되었으면 경고 로그를 기록하는 제 6단계;를 더 포함하는 것을 특징으로 하는 리눅스 커널 기반 스마트 플랫폼 내에서의 커널 무결성 검사 및 변조된 커널 데이터 복구 방법.
A first step of checking whether the compressed original kernel image of the ROM partition area is modified through an md5 hash checksum;
A second step of decompressing and storing the original kernel image stored in the ROM partition if the original kernel image is not modified by performing the first step;
A third step of accessing data in kernel memory running through the / dev / kmem device, which is a kernel virtual memory mapping file, after the second step;
A fourth step of checking whether the memory has been tampered with by comparing the contents of the running kernel memory with the contents of the original kernel image after the third step;
And a fifth step of recovering the kernel memory to the same data as the original kernel image if it is determined that the kernel memory is modulated through the fourth step.
A sixth step of checking whether the original kernel image has been tampered with, and writing a warning log if the firmware has been hacked and the ROM partition area has been tampered with. How to check kernel integrity and recover kernel data that has been tampered with.
제 1항에 있어서,
상기 제2단계를 수행중에 원본 커널 이미지의 압축 해제가 실패하면 에러 로그를 기록하고 프로그램을 종료하는 제 7단계;를 더 포함하는 것을 특징으로 하는 리눅스 커널 기반 스마트 플랫폼 내에서의 커널 무결성 검사 및 변조된 커널 데이터 복구 방법.
The method of claim 1,
A seventh step of recording an error log and terminating the program when the decompression of the original kernel image fails while performing the second step; and kernel integrity checking and tampering in the Linux kernel-based smart platform further comprising: Kernel data recovery method.
제 1항에 있어서, 상기 제4단계는,
상기 커널 메모리의 데이터를 검사하는 데이터 무결성 검사 모듈과, 상기 커널 메모리의 코드를 검사하는 코드 무결성 검사 모듈로 검사하되,
상기 데이터 무결성 검사 모듈을 통해 인터럽트 구현부의 예외 벡터 테이블의 무결성 검사를 수행하는 4_1단계;
상기 코드 무결성 검사 모듈을 통해 예외 핸들러인 vector_swi 함수 코드의 변조 여부를 검사하는 4_2단계;
상기 데이터 무결성 검사 모듈을 통해 시스템 콜 테이블 주소가 변조되었는지 점검하는 4_3단계;
상기 코드 무결성 검사 모듈을 통해 시스템 콜 처리 함수 코드에 대한 무결성을 검사하는 4_4단계;
상기 데이터 무결성 검사 모듈과 코드 무결성 검사 모듈을 통한 네트워크 프로토콜 핸들러의 검사 과정에서 변조된 코드나 데이터가 탐지하는 4_5단계;로 구성되는 것을 특징으로 하는 리눅스 커널 기반 스마트 플랫폼 내에서의 커널 무결성 검사 및 변조된 커널 데이터 복구 방법.
The method of claim 1, wherein the fourth step,
A data integrity check module that checks data of the kernel memory and a code integrity check module that checks code of the kernel memory,
Step 4_1 of performing an integrity check of the exception vector table of the interrupt implementer through the data integrity check module;
4_2 step of checking whether the code handler vector_swi function code is modified through the code integrity check module;
Checking whether a system call table address has been modified through the data integrity check module;
4_4 checking the integrity of a system call processing function code through the code integrity checking module;
Kernel integrity check and modulation within the Linux kernel-based smart platform, characterized in that consisting of; 4_5 step that detects the code or data modulated in the process of the network protocol handler through the data integrity check module and the code integrity check module Kernel data recovery method.
제 1항에 있어서, 상기 제5단계는,
상기 원본 커널 이미지의 물리 주소 위치에 있는 코드와 데이터를 저장해두었던 안전한 메모리 장소로부터 원본 커널 이미지를 불러와 변조된 커널 메모리의 가상 주소 위치에 1byte 데이터 단위로 복원하는 단계인 것을 특징으로 하는 리눅스 커널 기반 스마트 플랫폼 내에서의 커널 무결성 검사 및 변조된 커널 데이터 복구 방법.
The method of claim 1, wherein the fifth step,
Linux kernel-based, characterized in that the step of retrieving the original kernel image from the secure memory location that stores the code and data in the physical address location of the original kernel image in 1 byte data unit at the virtual address location of the modulated kernel memory Kernel Integrity Checking and Modulated Kernel Data Recovery Methods in Smart Platforms.
삭제delete
KR1020110018467A 2011-03-02 2011-03-02 Kernel integrity inspection and the recovery method on linux kernel based smart platform KR101064164B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020110018467A KR101064164B1 (en) 2011-03-02 2011-03-02 Kernel integrity inspection and the recovery method on linux kernel based smart platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020110018467A KR101064164B1 (en) 2011-03-02 2011-03-02 Kernel integrity inspection and the recovery method on linux kernel based smart platform

Publications (1)

Publication Number Publication Date
KR101064164B1 true KR101064164B1 (en) 2011-09-15

Family

ID=44957243

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020110018467A KR101064164B1 (en) 2011-03-02 2011-03-02 Kernel integrity inspection and the recovery method on linux kernel based smart platform

Country Status (1)

Country Link
KR (1) KR101064164B1 (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013048407A1 (en) * 2011-09-29 2013-04-04 Intel Corporation Apparatus, system, and method for providing memory access control
CN103077043A (en) * 2012-11-15 2013-05-01 上海爱数软件有限公司 Method for fast starting and operating Linux
KR101358815B1 (en) 2013-06-04 2014-02-11 서울대학교산학협력단 Snoop-based kernel integrity monitoring apparatus and method thereof
KR20160112757A (en) * 2015-03-20 2016-09-28 한국전자통신연구원 User device and integrity verification method for the same
CN106897166A (en) * 2015-12-17 2017-06-27 联发科技(新加坡)私人有限公司 A kind of mobile terminal and its restorative procedure
KR102111327B1 (en) * 2019-03-11 2020-05-15 단국대학교 산학협력단 Integrity verification system for boot process in linux and update and integrity verification method of managed machine
US11847225B2 (en) 2020-03-06 2023-12-19 Samsung Electronics Co., Ltd. Blocking access to firmware by units of system on chip

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7716494B2 (en) * 2004-07-15 2010-05-11 Sony Corporation Establishing a trusted platform in a digital processing system
US7802300B1 (en) * 2007-02-06 2010-09-21 Trend Micro Incorporated Method and apparatus for detecting and removing kernel rootkits

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7716494B2 (en) * 2004-07-15 2010-05-11 Sony Corporation Establishing a trusted platform in a digital processing system
US7802300B1 (en) * 2007-02-06 2010-09-21 Trend Micro Incorporated Method and apparatus for detecting and removing kernel rootkits

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013048407A1 (en) * 2011-09-29 2013-04-04 Intel Corporation Apparatus, system, and method for providing memory access control
US9235719B2 (en) 2011-09-29 2016-01-12 Intel Corporation Apparatus, system, and method for providing memory access control
CN103077043A (en) * 2012-11-15 2013-05-01 上海爱数软件有限公司 Method for fast starting and operating Linux
CN103077043B (en) * 2012-11-15 2016-02-10 上海爱数软件有限公司 A kind of method of quick Start-up and operating performance Linux
KR101358815B1 (en) 2013-06-04 2014-02-11 서울대학교산학협력단 Snoop-based kernel integrity monitoring apparatus and method thereof
US9542557B2 (en) 2013-06-04 2017-01-10 Snu R&Db Foundation Snoop-based kernel integrity monitoring apparatus and method thereof
KR20160112757A (en) * 2015-03-20 2016-09-28 한국전자통신연구원 User device and integrity verification method for the same
KR102324336B1 (en) * 2015-03-20 2021-11-11 한국전자통신연구원 User device and integrity verification method for the same
CN106897166A (en) * 2015-12-17 2017-06-27 联发科技(新加坡)私人有限公司 A kind of mobile terminal and its restorative procedure
CN106897166B (en) * 2015-12-17 2020-12-15 联发科技(新加坡)私人有限公司 Mobile terminal and repairing method thereof
KR102111327B1 (en) * 2019-03-11 2020-05-15 단국대학교 산학협력단 Integrity verification system for boot process in linux and update and integrity verification method of managed machine
US11847225B2 (en) 2020-03-06 2023-12-19 Samsung Electronics Co., Ltd. Blocking access to firmware by units of system on chip

Similar Documents

Publication Publication Date Title
US11841966B2 (en) Inhibiting memory disclosure attacks using destructive code reads
US9852295B2 (en) Computer security systems and methods using asynchronous introspection exceptions
EP3123311B1 (en) Malicious code protection for computer systems based on process modification
US8856932B2 (en) Rootkit monitoring agent built into an operating system kernel
US9275225B2 (en) Linear address mapping protection
EP3039608B1 (en) Hardware and software execution profiling
KR101064164B1 (en) Kernel integrity inspection and the recovery method on linux kernel based smart platform
CN107066311B (en) Kernel data access control method and system
EP3779745B1 (en) Code pointer authentication for hardware flow control
CN102799817B (en) For the system and method using Intel Virtualization Technology to carry out malware protection
KR20180032566A (en) Systems and methods for tracking malicious behavior across multiple software entities
US10114948B2 (en) Hypervisor-based buffer overflow detection and prevention
US9424427B1 (en) Anti-rootkit systems and methods
KR20090067569A (en) Windows kernel protection system using virtualization
US7620983B1 (en) Behavior profiling
Nadim et al. Characteristic features of the kernel-level rootkit for learning-based detection model training
US11556645B2 (en) Monitoring control-flow integrity
Suzaki et al. Kernel memory protection by an insertable hypervisor which has VM introspection and stealth breakpoints
Zaidenberg et al. Hypervisor memory introspection and hypervisor based malware honeypot

Legal Events

Date Code Title Description
A201 Request for examination
A302 Request for accelerated examination
E902 Notification of reason for refusal
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: 20140918

Year of fee payment: 4

FPAY Annual fee payment

Payment date: 20150930

Year of fee payment: 5

FPAY Annual fee payment

Payment date: 20160928

Year of fee payment: 6

FPAY Annual fee payment

Payment date: 20170918

Year of fee payment: 7

FPAY Annual fee payment

Payment date: 20180927

Year of fee payment: 8

FPAY Annual fee payment

Payment date: 20191001

Year of fee payment: 9