KR102325291B1 - Method, device, computer-readable storage medium and computer program for tracking task - Google Patents

Method, device, computer-readable storage medium and computer program for tracking task Download PDF

Info

Publication number
KR102325291B1
KR102325291B1 KR1020190176918A KR20190176918A KR102325291B1 KR 102325291 B1 KR102325291 B1 KR 102325291B1 KR 1020190176918 A KR1020190176918 A KR 1020190176918A KR 20190176918 A KR20190176918 A KR 20190176918A KR 102325291 B1 KR102325291 B1 KR 102325291B1
Authority
KR
South Korea
Prior art keywords
task
processes
ptrace
tracer
kernel
Prior art date
Application number
KR1020190176918A
Other languages
Korean (ko)
Other versions
KR20210084029A (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 KR1020190176918A priority Critical patent/KR102325291B1/en
Publication of KR20210084029A publication Critical patent/KR20210084029A/en
Application granted granted Critical
Publication of KR102325291B1 publication Critical patent/KR102325291B1/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3636Software debugging by tracing the execution of the program

Abstract

다양한 실시 예에 따르면, 커널에 의한 테스크 추적을 하기 위한 방법에 있어서, 실행 중인 하나 이상의 프로세스를 확인하는 동작; ptrace(process trace)를 이용하여, 상기 하나 이상의 프로세스에서 추적 대상인 테스크(task)의 생성을 확인하는 동작; 상기 생성된 테스크에 대응하는 정보를 확인하는 동작; 및 상기 확인된 정보를 지정된 엔진으로 전달하는 동작을 포함할 수 있다.According to various embodiments, there is provided a method for tracking a task by a kernel, the method comprising: checking one or more running processes; confirming generation of a task to be traced in the one or more processes using ptrace (process trace); checking information corresponding to the generated task; and transmitting the checked information to a designated engine.

Description

테스크 추적을 하기 위한 방법, 장치, 컴퓨터 판독 가능한 기록 매체 및 컴퓨터 프로그램{METHOD, DEVICE, COMPUTER-READABLE STORAGE MEDIUM AND COMPUTER PROGRAM FOR TRACKING TASK}Method, device, computer readable recording medium and computer program for tracing tasks

본 발명은 테스크 추적을 하기 위한 방법, 장치, 컴퓨터 판독 가능한 기록 매체 및 컴퓨터 프로그램에 관한 것이다.The present invention relates to a method, an apparatus, a computer-readable recording medium and a computer program for tracking a task.

최근, 운영 체제(OS; operating system)의 보안을 강화하기 위한 다양한 기술 개발이 이루어지고 있다. 상기 운영 체제의 보안 강화를 위한 Anti-Virus 기능은 입출력(I/O)의 주체인 테스크(task)의 시작 시점의 파악에 기초하여 수행될 수 있다. 상기 테스크의 시작은, 프로세스 및/또는 스레드의 생성(발생)부터일 수 있으며, 이에 따라, 상기 프로세스 및/또는 스레드의 생성 시점의 파악에 기초하여 상기 Anti-Virus 기능이 상기 테스크에 대한 악성 코드 감염 여부를 판단할 수 있다. 이에 따라, 운영 체제상에서 보안 강화를 위한 Anti-virus 기능이 수행되도록 하기 위해, 자식 프로세스 및/또는 스레드의 추적 및 제어 기술이 요구될 수 있다.Recently, various technologies have been developed to enhance the security of an operating system (OS). The anti-virus function for enhancing the security of the operating system may be performed based on the identification of the start time of a task that is the subject of input/output (I/O). The start of the task may be from the creation (generation) of a process and/or thread, and accordingly, the anti-virus function determines whether a malicious code for the task infection can be determined. Accordingly, in order to perform an anti-virus function for security enhancement on the operating system, a technology for tracking and controlling child processes and/or threads may be required.

한편, 운영체제의 한 종류인 리눅스의 리눅스 커널에서는 다양한 방식으로 필터링 기능을 제공하고 있다. 그러나, 종래의 리눅스 커널에서 제공하는 필터링 기능은 특정 커널 컴파일 옵션에 좌우되는 경향이 있다. 이러한 경향은 예를 들어, 보안 강화 리눅스(SELinux; Security-Enhanced Linux)의 리눅스 커널, kprobe 및/또는 ktrace를 사용할 수 있도록 컴파일 된 리눅스 커널 등에서 나타날 수 있다.Meanwhile, the Linux kernel of Linux, which is a type of operating system, provides filtering functions in various ways. However, the filtering function provided by the conventional Linux kernel tends to depend on specific kernel compilation options. This trend can be seen, for example, in a Linux kernel of Security-Enhanced Linux (SELinux), a Linux kernel compiled to use kprobe and/or ktrace, and the like.

대한민국공개특허 10-2019-0109524, 2019.09.25 공개Korean Patent Publication No. 10-2019-0109524, published on September 25, 2019

본 발명의 실시 예는, 리눅스 운영 체제에서, 일반적으로 유저 레벨(user level)에서의 디버거 구현을 가능하게 하는 기술인 ptrace(process trace)를 커널 레벨에서 이용하여, 자식 프로세스 및/또는 스레드를 추적하여 제어 할 수 있도록 하기 위한, 테스크 추적을 하기 위한 방법, 장치, 컴퓨터 판독 가능한 기록 매체 및 컴퓨터 프로그램을 제공할 수 있다.In an embodiment of the present invention, in a Linux operating system, ptrace (process trace), a technology that enables a debugger to be implemented at a user level in general, is used at the kernel level to trace child processes and/or threads. It is possible to provide a method, an apparatus, a computer-readable recording medium, and a computer program for tracking a task so as to be able to control it.

일 실시 예에 따르면, 커널에 의한 테스크 추적을 하기 위한 방법에 있어서, 실행 중인 하나 이상의 프로세스를 확인하는 동작; ptrace(process trace)를 이용하여, 상기 하나 이상의 프로세스에서 추적 대상인 테스크(task)의 생성을 확인하는 동작; 상기 생성된 테스크에 대응하는 정보를 확인하는 동작; 및 상기 확인된 정보를 지정된 엔진으로 전달하는 동작을 포함할 수 있다.According to one embodiment, there is provided a method for tracking a task by a kernel, the method comprising: checking one or more running processes; confirming generation of a task to be traced in the one or more processes using ptrace (process trace); checking information corresponding to the generated task; and transmitting the checked information to a designated engine.

일 실시 예에 따르면, 컴퓨터 프로그램을 저장하고 있는 컴퓨터 판독 가능 기록매체로서, 실행 중인 하나 이상의 프로세스를 확인하는 동작; ptrace(process trace)를 이용하여, 상기 하나 이상의 프로세스에서 추적 대상인 테스크(task)의 생성을 확인하는 동작; 상기 생성된 테스크에 대응하는 정보를 확인하는 동작; 및 상기 확인된 정보를 지정된 엔진으로 전달하는 동작을 포함하는 방법을 프로세서가 수행하도록 하기 위한 명령어를 포함할 수 있다.According to an embodiment, there is provided a computer-readable recording medium storing a computer program, the method comprising: identifying one or more processes being executed; confirming generation of a task to be traced in the one or more processes using ptrace (process trace); checking information corresponding to the generated task; and instructions for causing the processor to perform a method including an operation of transmitting the checked information to a designated engine.

일 실시 예에 따르면, 컴퓨터 판독 가능한 기록매체에 저장되어 있는 컴퓨터 프로그램으로서, 실행 중인 하나 이상의 프로세스를 확인하는 동작; ptrace(process trace)를 이용하여, 상기 하나 이상의 프로세스에서 추적 대상인 테스크(task)의 생성을 확인하는 동작; 상기 생성된 테스크에 대응하는 정보를 확인하는 동작; 및 상기 확인된 정보를 지정된 엔진으로 전달하는 동작을 포함하는 방법을 프로세서가 수행하도록 하기 위한 명령어를 포함할 수 있다.According to an embodiment, as a computer program stored in a computer-readable recording medium, the operation of checking one or more processes being executed; confirming generation of a task to be traced in the one or more processes using ptrace (process trace); checking information corresponding to the generated task; and instructions for causing the processor to perform a method including an operation of transmitting the checked information to a designated engine.

일 실시 예에 따르면, 테스크 추적을 하기 위한 장치에 있어서, 프로세서; 및 상기 프로세서과 전기적으로 연결되며, 상기 프로세서에 의해 실행되는 메모리를 포함하며, 상기 메모리는 운영체제 및 하나 이상의 어플리케이션을 저장하도록 구성되며, 상기 운영체제에 포함된 커널이, 상기 하나 이상의 어플리케이션에서 실행 중인 하나 이상의 프로세스를 확인하며, ptrace(process trace)를 이용하여, 상기 하나 이상의 프로세스에서 추적 대상인 테스크(task)의 생성을 확인하며, 상기 생성된 테스크에 대응하는 정보를 확인하며, 상기 확인된 정보를 지정된 엔진으로 전달하도록 하는 명령을 포함할 수 있다.According to one embodiment, there is provided an apparatus for tracking a task, comprising: a processor; and a memory electrically connected to the processor and executed by the processor, wherein the memory is configured to store an operating system and one or more applications, wherein a kernel included in the operating system is one or more executing in the one or more applications Check the process, check the creation of a task to be traced in the one or more processes using ptrace (process trace), check information corresponding to the created task, and transfer the checked information to a designated engine It may include a command to pass it to .

따라서, 본 발명의 실시 예에 따른 테스크 추적을 하기 위한 방법, 장치, 컴퓨터 판독 가능한 기록 매체 및 컴퓨터 프로그램은, 리눅스 커널에서, 일반적으로 유저 레벨(user level)에서의 디버거 구현을 가능하게 하는 기술인 ptrace(process trace)를 커널 레벨에서 이용하여, 자식 프로세스 및/또는 스레드를 추적하여 제어할 수 있다.Accordingly, the method, apparatus, computer-readable recording medium, and computer program for tracing a task according to an embodiment of the present invention are ptrace, which is a technology that enables a debugger to be implemented at a user level in a Linux kernel in general. (process trace) can be used at the kernel level to trace and control child processes and/or threads.

예를 들어, 본 발명의 실시 예에 따르면, 입출력(I/O)을 시작하는 최초의 주체를 필터링하고 제어할 수 있는 기술을 제공할 수 있다. 또한, 상기 기술을 유저 레벨의 어플리케이션의 기반 기술에 적용시킬 수 있다.For example, according to an embodiment of the present invention, it is possible to provide a technology for filtering and controlling the initial subject that starts input/output (I/O). In addition, the above technology may be applied to a basic technology of a user-level application.

도 1은 본 발명의 일 실시 예에 따른 테스크 추적을 하기 위한 장치의 블록도이다.
도 2는 본 발명의 일 실시 예에 따른 프로세스의 자식 프로세스 및/또는 스레드 추적을 하기 위한 동작의 흐름도이다.
도 3은 본 발명의 일 실시 예에 따른 프로세스의 자식 프로세스 및/또는 스레드 추적을 하기 위한 동작을 설명하기 위한 도면이다.
도 4는 본 발명의 일 실시 예에 따른 테스크 추적을 하기 위한 동작의 흐름도이다.
1 is a block diagram of an apparatus for tracking a task according to an embodiment of the present invention.
2 is a flowchart of an operation for tracking a child process and/or a thread of a process according to an embodiment of the present invention.
3 is a diagram for explaining an operation for tracking a child process and/or a thread of a process according to an embodiment of the present invention.
4 is a flowchart of an operation for tracking a task according to an embodiment of the present invention.

먼저, 본 발명의 장점 및 특징, 그리고 그것들을 달성하는 방법은 첨부되는 도면과 함께 상세하게 후술되는 실시 예들을 참조하면 명확해질 것이다. 여기에서, 본 발명은 이하에서 개시되는 실시 예들에 한정되는 것이 아니라 서로 다른 다양한 형태로 구현될 수 있으며, 단지 본 실시 예들은 본 발명의 개시가 완전하도록 하고, 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자가 발명의 범주를 명확하게 이해할 수 있도록 하기 위해 예시적으로 제공되는 것이므로, 본 발명의 기술적 범위는 청구항들에 의해 정의되어야 할 것이다.First, the advantages and features of the present invention, and a method for achieving them will become clear with reference to the embodiments described below in detail in conjunction with the accompanying drawings. Here, the present invention is not limited to the embodiments disclosed below, but may be implemented in a variety of different forms, and only these embodiments allow the disclosure of the present invention to be complete, and are common in the technical field to which the present invention pertains. The technical scope of the present invention should be defined by the claims since it is provided by way of example so that those with knowledge can clearly understand the scope of the invention.

아울러, 아래의 본 발명을 설명함에 있어서 공지 기능 또는 구성 등에 대한 구체적인 설명이 본 발명의 요지를 불필요하게 흐릴 수 있다고 판단되는 경우에는 그 상세한 설명을 생략할 것이다. 그리고, 후술되는 용어들은 본 발명에서의 기능을 고려하여 정의된 용어들인 것으로, 이는 사용자, 운용자 등의 의도 또는 관례 등에 따라 달라질 수 있음은 물론이다. 그러므로, 그 정의는 본 명세서의 전반에 걸쳐 기술되는 기술사상을 토대로 이루어져야 할 것이다.In addition, in the following description of the present invention, if it is determined that a detailed description of a well-known function or configuration may unnecessarily obscure the gist of the present invention, the detailed description thereof will be omitted. And, the terms to be described later are terms defined in consideration of functions in the present invention, which may vary depending on the intentions or customs of users, operators, etc., of course. Therefore, the definition should be made based on the technical idea described throughout this specification.

이하, 첨부된 도면을 참조하여 본 발명의 바람직한 실시 예에 대하여 상세하게 설명한다.Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings.

도 1은 본 발명의 일 실시 예에 따른 테스크 추적을 하기 위한 장치(100)의 블록도이다.1 is a block diagram of an apparatus 100 for tracking a task according to an embodiment of the present invention.

도 1을 참조하면, 상기 장치(100)는 프로세서(101) 및 메모리(111)를 포함할 수 있다.Referring to FIG. 1 , the device 100 may include a processor 101 and a memory 111 .

일 실시 예에 따르면, 프로세서(101)는 예를 들면, 소프트웨어(예: 프로그램(121))를 구동하여 프로세서(101)에 연결된 장치(100)의 적어도 하나의 다른 구성요소(예: 하드웨어 또는 소프트웨어 구성요소)를 제어할 수 있고, 다양한 데이터 처리 및 연산을 수행할 수 있다.According to an embodiment, the processor 101 drives, for example, software (eg, the program 121 ) to run at least one other component (eg, hardware or software) of the device 100 connected to the processor 101 . component) and can perform various data processing and operations.

일 실시 예에 따르면, 메모리(111)는 장치(100)의 적어도 하나의 구성요소(프로세서(101))에 의해 사용되는 다양한 데이터, 예를 들어, 소프트웨어(예: 프로그램(121)) 및, 이와 관련된 명령에 대한 입력 데이터 또는 출력 데이터를 저장할 수 있다. 메모리(111)는, 휘발성 메모리 또는 비휘발성 메모리를 포함할 수 있다.According to an embodiment, the memory 111 includes various data used by at least one component of the device 100 (the processor 101 ), for example, software (eg, the program 121 ), and It can store input data or output data for related commands. The memory 111 may include a volatile memory or a non-volatile memory.

일 실시 예에 따르면, 프로그램(121)은 상기 메모리(111)에 저장되는 소프트웨어로서, 예를 들면, 운영 체제(130) 및/또는 어플리케이션(140)(어플리케이션 프로세스 또는 어플리케이션 프로그램이라고도 함)을 포함할 수 있다.According to an embodiment, the program 121 is software stored in the memory 111 , and may include, for example, an operating system 130 and/or an application 140 (also referred to as an application process or an application program). can

상기 운영 체제(130)는 상기 장치(100)의 하나 이상의 리소스(예: 프로세서(101) 및 메모리(111))를 제어할 수 있다. 상기 운영 체제(130)는 커널(131)을 포함할 수 있으며, 상기 커널(131)은, 예를 들면, 프로그램들(예: 어플리케이션(140))에 구현된 동작 또는 기능을 실행하는 데 사용되는 하나 이상의 리소스를 제어 또는 관리할 수 있다.The operating system 130 may control one or more resources (eg, the processor 101 and the memory 111 ) of the device 100 . The operating system 130 may include a kernel 131, which is used to execute an operation or function implemented in, for example, programs (eg, the application 140). One or more resources may be controlled or managed.

일 실시 예에 따르면, 상기 프로세서(101)에 의해, 상기 운영 체제(130)에 포함된 커널(131)은, 상기 어플리케이션(140)에서 실행 중인 하나 이상의 프로세스를 확인하며, ptrace(process trace)를 이용하여, 상기 하나 이상의 프로세스의 테스크(task)의 생성을 확인하며, 상기 생성된 테스크에 대응하는 정보를 확인하며, 상기 확인된 정보를 지정된 엔진으로 전달하도록 할 수 있다.According to an embodiment, by the processor 101 , the kernel 131 included in the operating system 130 checks one or more processes running in the application 140 , and generates a ptrace (process trace). By using this, it is possible to confirm creation of a task of the one or more processes, check information corresponding to the created task, and transmit the checked information to a designated engine.

예를 들어, 상기 커널(131)은, 상기 하나 이상의 프로세스의 테스크의 생성 시점을 추적할 수 있다.For example, the kernel 131 may track the creation time of the task of the one or more processes.

예를 들어, 상기 하나 이상의 프로세스의 상기 테스크의 생성 시점의 추적에 기초하여, 상기 생성된 테스크의 상태가 대기 상태가 되도록 설정될 수 있다.For example, based on the tracking of the creation time of the task of the one or more processes, the state of the created task may be set to be a standby state.

예를 들어, 상기 커널(131)은, 상기 확인된 정보의 전달에 응답하여, 상기 ptrace를 이용하여, 상기 지정된 엔진으로부터 상기 생성된 테스크의 제어에 대응하는 시그널을 전달받아 메모리(111)에 저장하고, 상기 메모리(111)에 저장된 시그널에 기초하여, 상기 생성된 테스크의 제어에 대응하도록 상기 생성된 테스크를 처리할 수 있다.For example, the kernel 131 receives a signal corresponding to control of the generated task from the designated engine and stores it in the memory 111 using the ptrace in response to the delivery of the checked information. and, based on the signal stored in the memory 111 , the generated task may be processed to correspond to control of the generated task.

예를 들어, 상기 테스크의 제어에 대응하는 시그널은, 상기 대기 상태의 상기 테스크가 제거되도록 하는 제어 시그널 또는 상기 대기 상태의 상기 테스크의 대기 상태가 해제되도록 하는 제어 시그널을 포함할 수 있다.For example, the signal corresponding to the control of the task may include a control signal for removing the task in the standby state or a control signal for releasing the standby state of the task in the standby state.

예를 들어, 상기 커널(131)은, 상기 테스크의 생성 확인에 기초하여 상기 ptrace를 이용한 메모리에 저장된 식별 정보에 기초하여, 상기 생성된 테스크가 자식 프로세스인지 스레드인지를 확인할 수 있다. 상기 자식 프로세스는, 프로그램의 실행 중에 특정 프로세스(예: 부모 프로세스라고도 함)가 만들어낸(상기 특정 프로세스에서 포크(fork)하여 생긴) 또 다른 프로세스를 의미한다.For example, the kernel 131 may determine whether the created task is a child process or a thread based on identification information stored in the memory using the ptrace based on the task creation confirmation. The child process refers to another process created (forked from the specific process) by a specific process (eg, also referred to as a parent process) during program execution.

도 2는 본 발명의 일 실시 예에 따른 프로세스의 자식 프로세스 및/또는 스레드 추적을 하기 위한 동작의 흐름도이다.2 is a flowchart of an operation for tracking a child process and/or a thread of a process according to an embodiment of the present invention.

201 동작에서, 커널(예: 커널(121))은 하나 이상의 트레이서(tracer)(커널 스레드 트레이서(kernel thread tracer)라고도 함)를 생성할 수 있다.In operation 201 , the kernel (eg, the kernel 121 ) may generate one or more tracers (also referred to as kernel thread tracers).

일 실시 예에 따르면, 운영 체제(예: 운영 체제(120))의 시작에 기초하여, 상기 커널이 동작할 수 있으며, 상기 커널은 상기 하나 이상의 트레이서를 생성할 수 있다. 예를 들어, 상기 커널은, 상기 운영 체제의 상태, CPU 상태(예: CPU 개수) 등에 기초하여 상기 생성할 트레이서의 개수를 결정할 수 있으며, 상기 결정된 개수에 따라, 상기 하나 이상의 트레이서를 생성할 수 있다. 이렇게 커널 레벨에서 트레이서가 생성되기 때문에, 유저 레벨에서 생성되는 하나 이상의 프로세서를 그 생성 시점부터 트레이서를 통해 확인할 수 있다.According to an embodiment, based on the start of an operating system (eg, the operating system 120 ), the kernel may operate, and the kernel may generate the one or more tracers. For example, the kernel may determine the number of tracers to be generated based on the operating system state, CPU state (eg, number of CPUs), etc., and may generate the one or more tracers according to the determined number. have. Since the tracer is created at the kernel level in this way, one or more processors created at the user level can be checked through the tracer from the time of creation.

203 동작에서, 상기 커널은 유저 레벨에서 장치(예: 장치(101))(시스템이라고도 함)에 의해 생성 및 현재 동작(실행) 중인 하나 이상의 프로세스를 확인할 수 있다.In operation 203, the kernel may identify one or more processes that are created and currently operating (running) by a device (eg, device 101) (also referred to as a system) at the user level.

일 실시 예에 따르면, 상기 커널은 상기 장치에서 현재 동작 중인 모든 프로세스들의 정보를 수집하여 현재 동작 중인 모든 프로세스들을 확인할 수 있다.According to an embodiment, the kernel may collect information on all processes currently running in the device to check all processes currently running.

일 실시 예에 따르면, 상기 장치의 메모리(예: 메모리(111))의 run-queue 상에 상기 현재 동작(실행) 중인 모든 프로세스들의 정보(모든 프로세스들의 리스트)가 저장되어 있으며, 상기 run-queue의 전체 순회를 통해, 상기 현재 동작 중인 모든 프로세스들을 확인할 수 있다. 예를 들어, 상기 커널은, ptrace를 통해, 상기 run-queue를 확인하여, 프로세스 및/또는 스레드의 생성을 추적할 수 있다.According to an embodiment, information (a list of all processes) of all processes currently in operation (execution) is stored on a run-queue of the memory (eg, memory 111) of the device, and the run-queue Through the entire traversal of , it is possible to check all the currently operating processes. For example, the kernel may track the creation of a process and/or a thread by checking the run-queue through ptrace.

205 동작에서 상기 커널은 상기 확인된 하나 이상의 프로세스 중 ptrace 추적 동작을 시작할 적어도 하나의 프로세스를 결정할 수 있다.In operation 205, the kernel may determine at least one process from which a ptrace tracing operation is to start among the one or more identified processes.

일 실시 예에 따르면, 상기 커널은, 상기 확인된 하나 이상의 프로세스에서 ptrace 추적 동작이 적용되지 않도록 기 설정된 프로세스를 제외하여, ptrace를 이용한 상기 ptrace 추적 동작을 시작할 적어도 하나의 프로세스를 결정할 수 있다. 상기 기 설정된 프로세스는, 상기 운영 체제의 기본 기능에 대응하는 프로세스, ptrace 추적 동작의 적용이 제외되어야 할 중요 프로세스, 안정성이 확인된 프로세스, 및/또는 악성 코드 감염 여부를 판단할 필요가 없는 프로세스를 포함할 수 있다.According to an embodiment, the kernel may determine at least one process to start the ptrace tracing operation using ptrace by excluding a process preset so that the ptrace tracing operation is not applied to the one or more identified processes. The preset process includes a process corresponding to the basic function of the operating system, an important process that should be excluded from application of the ptrace trace operation, a process whose stability has been confirmed, and/or a process that does not need to determine whether or not a malicious code is infected. may include

일 실시 예에 따르면, 상기 커널은, 상기 205 동작의 상기의 결정에 기초하여, 상기 트레이서가 대기 상태가 되도록 할 수 있다.According to an embodiment, the kernel may cause the tracer to enter a standby state based on the determination of operation 205 .

207 동작에서, 상기 커널은 상기 확인된 하나 이상의 프로세스의 테스크(task)가 생성되었는지를 확인할 수 있다.In operation 207, the kernel may determine whether tasks of the identified one or more processes have been created.

일 실시 예에 따르면, 상기 테스크 생성은 자식 프로세스의 생성 및/또는 스레드의 생성을 포함할 수 있다.According to an embodiment, the task creation may include creation of a child process and/or creation of a thread.

일 실시 예에 따르면, 상기 확인된 하나 이상의 프로세스는, clone 시스템 콜을 통해, 자식 프로세스 및/또는 스레드를 생성을 할 수 있으며, 현재의 상태(자식 프로세스 및/또는 스레드의 생성 상태)에서 동작을 정지(stop), 예를 들어, 상기 생성된 자식 프로세스 및/또는 스레드가 대기 상태가 되도록 할 수 있다. 상기 clone 시스템 콜이 발생하면, 상기 ptrace를 통해, 대응하는 시그널(signal)이 하나 이상의 트레이서 각각의 시그널 큐로 전달될 수 있다. 예를 들어, 상기 확인된 하나 이상의 프로세스는, 어플리케이션의 프로세스일 수 있다. 예를 들어, 상기 clone 시스템 콜은, fork, pthread_create와 같은 명령어 입력에 기초하여 발생될 수 있다. According to an embodiment, the identified one or more processes may create a child process and/or a thread through the clone system call, and perform an operation in the current state (the child process and/or thread creation state). A stop, for example, may cause the created child process and/or thread to be put into a waiting state. When the clone system call occurs, a corresponding signal may be delivered to a signal queue of each of one or more tracers through the ptrace. For example, the at least one identified process may be an application process. For example, the clone system call may be generated based on input of commands such as fork and pthread_create.

일 실시 예에 따르면, 상기 커널은, ptrace를 이용한 ptrace 추적 동작에 기초하여, 상기 테스크가 생성되었는지를 확인할 수 있다. 예를 들어, 상기 커널은 ptrace 추적 동작에 기초하여, 상기 하나 이상의 트레이서의 대기 상태가 해제되도록 하여, 상기 하나 이상의 트레이서가, 대응하는 시그널 큐로 전달된 시그널을 확인하도록 할 수 있다. 예를 들어, 상기 하나 이상의 트레이서는, 상기 시그널 큐로 전달되어 확인된 시그널에 기초하여, 상기 테스크가 생성된 것으로 확인할 수 있다. According to an embodiment, the kernel may check whether the task has been created based on a ptrace tracking operation using ptrace. For example, the kernel may release the waiting state of the one or more tracers based on a ptrace trace operation, so that the one or more tracers may check a signal delivered to a corresponding signal queue. For example, the one or more tracers may determine that the task has been generated based on a signal transmitted to the signal queue and confirmed.

209 동작에서, 상기 커널은 상기 생성된 테스크에 대응하는 정보를 확인할 수 있다.In operation 209, the kernel may check information corresponding to the generated task.

일 실시 예에 따르면, 상기 하나 이상의 트레이서는, 상기 ptrace를 통해 상기 시그널 큐로 전달되어 확인된 시그널에 포함된 식별 정보에 기초하여, 상기 테스크에 대응하는 정보를 확인할 수 있다. According to an embodiment, the one or more tracers may identify information corresponding to the task based on identification information included in a signal transmitted to the signal queue through the ptrace and confirmed.

예를 들어, 상기 테스크에 대응하는 정보는, 상기 생성된 테스크가 자식 프로세스의 생성인지 또는 스레드의 생성인지에 대한 정보와, 상기 생성된 테스크와 이전에 생성된 테스크 간의 관계에 대한 정보를 포함할 수 있다. For example, the information corresponding to the task may include information on whether the created task is a child process creation or a thread creation, and information on a relationship between the created task and a previously created task. can

예를 들어, 상기 시그널에 포함된 식별 정보는, 예를 들어, tgid(thread group identification(ID)) 및 pid(process ID)를 포함할 수 있다. For example, the identification information included in the signal may include, for example, tgid (thread group identification (ID)) and pid (process ID).

예를 들어, 최초로 스레드가 생성되면 상기 최초로 생성된 스레드의 tgid 및 pid는 동일하게 생성되어 부여되며, 두 번째로 스레드가 생성되면 두 번째로 생성된 스레드의 tgid는 상기 최초로 생성된 tgid와 동일하고 상기 두 번째로 생성된 스레드의 pid는 상기 최초로 생성된 스레드의 pid와 상이하게 생성되어 부여될 수 있다.For example, when a thread is first created, the tgid and pid of the first created thread are identically created and given, and when a second thread is created, the tgid of the second created thread is the same as the first created tgid, The pid of the second generated thread may be generated and assigned to be different from the pid of the first generated thread.

예를 들어, 최초로 프로세스가 생성되면, 상기 최초로 생성된 프로세스의 tgid 및 pid는 동일하게 부여되고, 상기 최초로 생성된 프로세스의 자식 프로세스가 생성되면, 상기 자식 프로세스의 tgid 및 pid는 동일하되, 상기 최초로 생성된 프로세스의 tgid 및 pid와는 상이하게 생성되어 부여될 수 있다.For example, when a process is first created, the tgid and pid of the first created process are the same, and when a child process of the first created process is created, the tgid and pid of the child process are the same, but the first It can be created and assigned differently from the tgid and pid of the created process.

예를 들어, 상기 tgid 및 상기 pid에 기초하여, 스레드가 생성되었는지 자식 프로세스가 생성되었는지를 확인할 수 있다. 예를 들어, 상기 tgid에 기초하여, 스레드의 생성 시 상기 생성된 스레드가 포함되는 그룹을 확인할 수 있으며, 자식 프로세스의 생성 시 상기 생성된 자식 프로세스의 부모 프로세스를 확인할 수 있다.For example, based on the tgid and the pid, it may be checked whether a thread is created or a child process is created. For example, based on the tgid, a group including the created thread may be identified when a thread is created, and a parent process of the created child process may be identified when a child process is created.

211 동작에서, 상기 커널은, 상기 생성된 테스크에 대응하는 정보를, 지정된 엔진으로 전달 할 수 있다. In operation 211, the kernel may transmit information corresponding to the generated task to a designated engine.

일 실시 예에 따르면, 상기 테스크 생성의 확인 시, 상기 테스크의 상태는 대기 상태가 되어, 상기 테스크는 정지(stop)될 수 있다. According to an embodiment, when the task creation is confirmed, the state of the task may be a standby state, and the task may be stopped.

일 실시 예에 따르면, 상기 지정된 엔진은, 테스크에 대응하는 정보를 이용, 예를 들어, 상기 전달된 테스크에 대응하는 정보에 기초하여, 상기 테스크에 대한 제어를 설정할 수 있다.According to an embodiment, the designated engine may set control for the task using information corresponding to the task, for example, based on information corresponding to the transmitted task.

예를 들어, 상기 지정된 엔진이, 악성 코드에 감염되었는지 여부를 모니터링하는 엔진인 경우, 상기 엔진은 상기 전달된 테스크에 대응하는 정보에 기초하여, 상기 테스크에 대한 악성 코드의 감염 여부를 결정할 수 있으며, 상기 감염 여부에 기초하여, 상기 테스크에 대한 제어를 설정할 수 있다. 예를 들어, 상기 제어는, 상기 테스크가 수행되지 않도록(상기 테스크가 실패되도록) 하기 위한 실패 제어(kill 또는 제거 제어라고도 함) 또는 상기 테스크가 수행되도록 하기 위한(상기 테스크가 통과되도록 하기 위한) 성공 제어일 수 있다. For example, if the designated engine is an engine that monitors whether or not a malicious code is infected, the engine may determine whether the task is infected with a malicious code based on information corresponding to the transmitted task, , based on the presence of the infection, it is possible to set the control for the task. For example, the control may be a failure control (also called kill or kill control) to prevent the task from being performed (to cause the task to fail) or a failure control to cause the task to be performed (to allow the task to pass). It can be a success control.

예를 들어, 상기 생성된 테스크에 대응하는 정보의 전달에 응답하여, 상기 커널은, 상기의 테스크 생성 시(상기 테스크 생성의 확인 시)의 정지된 상기 테스크의 상태를, ptrace를 통해, 변경할 수 있다. 예를 들어, 상기 커널은 상기 테스크의 제어에 대응하는 시그널을 ptrace를 통해 수신하여, 상기의 테스크 생성 시(상기 테스크 생성의 확인 시)의 정지 상태의 상기 테스크의 상태를 변경할 수 있다. 상기 테스크의 상태 변경은, 상기 성공 제어에 대응하는 상기 정지된 테스크가 다시 동작되도록(running되도록) 하는 변경, 상기 실패 제어에 대응하는 상기 정지된 테스크가 제거되도록(kill되도록 또는 삭제되도록)하는 변경을 포함할 수 있다. 상기 동작의 상태 변경에 기초하여, 상기 정지된 테스트가 다시 동작되거나 또는 제거될 수 있다. 예를 들어, 상기 커널은 상기 테스크의 제거에 대응하는 시그널을 ptrace를 통해 수신하여, 메모리 상에 상기 제거된 테스크 관련 정보를 제거할 수 있다.For example, in response to the transmission of information corresponding to the created task, the kernel may change the state of the stopped task when the task is created (when the task creation is confirmed) through ptrace. have. For example, the kernel may receive a signal corresponding to the control of the task through ptrace, and change the state of the task in a stopped state when the task is created (when the task creation is confirmed). The status change of the task may include a change such that the suspended task corresponding to the success control is made to run again (running), a change such that the stopped task corresponding to the failure control is removed (killed or deleted). may include. Based on the change in the state of the operation, the suspended test may be reactivated or eliminated. For example, the kernel may receive a signal corresponding to the removal of the task through ptrace, and remove the removed task-related information from the memory.

다른 실시 예에 따르면, 상기 지정된 엔진은, 상기 테스크에 대응하는 정보를 모니터링(확인)할 수 있다. 예를 들어, 상기 엔진이 상기 테스크에 대응하는 정보를 확인하는 동작만 수행할 수 있다.According to another embodiment, the designated engine may monitor (confirm) information corresponding to the task. For example, the engine may only perform an operation of confirming information corresponding to the task.

상술한 도 2의 실시 예에서, 추가로, 추가 자식 프로세스 및/또는 추가 스레드가 생성될 수 있으며, 상기 추가 자식 프로세스 및/또는 추가 스레드의 생성 시, 상기 커널은 상술한 도 2의 실시 예의 동작과 대응되는 동작을 수행할 수 있다.In the above-described embodiment of FIG. 2 , additionally, an additional child process and/or an additional thread may be created, and when the additional child process and/or the additional thread are created, the kernel performs the operation of the above-described embodiment of FIG. 2 . An operation corresponding to .

도 3은 본 발명의 일 실시 예에 따른 프로세스의 자식 프로세스 및/또는 스레드 추적을 하기 위한 동작을 설명하기 위한 도면이다.3 is a diagram for explaining an operation for tracking a child process and/or a thread of a process according to an embodiment of the present invention.

도 3을 참조하면, 커널 레벨(301)의 커널(121)이, 하나 이상의 트레이서, 예를 들어, 제1 트레이서(302), 제2 트레이서(304) 및 제3 트레이서(306)를 생성할 수 있다. 상기 제1 트레이서(302), 상기 제2 트레이서(304) 및 상기 제3 트레이서(306) 각각은, 메모리의 대응하는 시그널 큐를 통해, 예를 들어, 시그널 큐(312), 시그널 큐(314) 및 시그널 큐(316) 각각을 통해 유저 레벨(321)의 하나 이상의 프로세스(예: 어플리케이션 프로세스(140))로 시그널(signal)을 전송 및/또는 수신할 수 있다. 예를 들어, 상기 제1 트레이서(302), 상기 제2 트레이서(304) 및 상기 제3 트레이서(306) 각각이 ptrace 추적을 시작할 경우, 상기 제1 트레이서(302), 상기 제2 트레이서(304) 및 상기 제3 트레이서(306) 각각은, ptrace 추적 시작에 대응하는 시그널(signal)을 시그널 큐(312), 시그널 큐(314) 및 시그널 큐(316) 각각에 전달할 수 있다.Referring to FIG. 3 , the kernel 121 of the kernel level 301 may generate one or more tracers, for example, a first tracer 302 , a second tracer 304 , and a third tracer 306 . have. Each of the first tracer 302 , the second tracer 304 and the third tracer 306 , via a corresponding signal queue in memory, for example, a signal queue 312 , a signal queue 314 . and one or more processes (eg, the application process 140) of the user level 321 through each of the signal queues 316 to transmit and/or receive a signal. For example, when each of the first tracer 302 , the second tracer 304 and the third tracer 306 starts ptrace tracing, the first tracer 302 , the second tracer 304 , and each of the third tracers 306 may deliver a signal corresponding to the start of ptrace trace to each of the signal queue 312 , the signal queue 314 , and the signal queue 316 .

일 실시 예에 따르면, 상기 ptrace 추적 시작에 대응하는 시그널은, 유저 레벨(321)에서의 어떤 이벤트에 대한 메시지를 전달해달라는 정보를 포함할 수 있다. 예를 들어, 상기 커널은, 사용자 입력에 기초하여, 상기 ptrace 추적 시작에 대응하는 시그널이, 스레드의 생성 및/또는 자식 프로세스의 생성에 대응하는 시그널(메시지라고도 함)를 전달해달라는 정보가 포함되도록 설정할 수 있다. 예를 들어, 어플리케이션 프로세스(140)가 스레드(322), 프로세스(324), 및/또는 프로세스(326)의 생성 시, 상기 ptrace의 추적 시작에 기초하여, 상기 ptrace가, 스레드(322), 프로세스(324), 및/또는 프로세스(326)의 생성에 따른 시그널이 대응하는 시그널 큐로 전달되도록 할 수 있다. 상기 커널(121)은 상기 제1 트레이서(302), 제2 트레이서(304) 및 제3 트레이서(306) 각각을 이용하여, 시그널 큐(312), 시그널 큐(314) 및 시그널 큐(316)에 전달되어 저장된 시그널을 확인할 수 있다. 상기 커널(121)은 상기 확인된 시그널에 기초하여, 스레드 생성인지 자식 프로세스 생성인지를 확인할 수 있다.According to an embodiment, the signal corresponding to the start of the ptrace trace may include information requesting that a message about an event at the user level 321 be delivered. For example, the kernel is configured such that, based on a user input, the signal corresponding to the start of the ptrace trace includes information to transmit a signal (also referred to as a message) corresponding to the creation of a thread and/or the creation of a child process. can be set. For example, when the application process 140 creates a thread 322 , a process 324 , and/or a process 326 , based on the start of tracking of the ptrace, the ptrace may become a thread 322 , a process 324 , and/or a signal according to the generation of the process 326 may be delivered to a corresponding signal queue. The kernel 121 uses each of the first tracer 302 , the second tracer 304 , and the third tracer 306 to receive the signal queue 312 , the signal queue 314 , and the signal queue 316 . You can check the transmitted and stored signal. The kernel 121 may determine whether a thread is created or a child process is created based on the identified signal.

일 실시 예에 따르면, 유저 레벨(321)의 하나 이상의 프로세스(예: 어플리케이션 프로세스(140))에서의 스레드의 생성 또는 자식 프로세스의 생성에 기초하여, 상기 커널(121)은 필터링 기능, 즉, 상기 하나 이상의 프로세스가 스레드의 생성을 수행하였는지 자식 프로세스의 생성을 수행하였는지를 특정 엔진에 전달할 수 있다. 예를 들어, 상기 특정 엔진은, 상기 필터링 기능을 이용하여 상기 하나 이상의 프로세스가 악성코드에 감염되었는지 여부를 모니터링하는 구성 등 사용자 설정에 따라 다양할 수 있다.According to an embodiment, based on the creation of a thread or the creation of a child process in one or more processes (eg, the application process 140 ) of the user level 321 , the kernel 121 performs a filtering function, that is, the Whether one or more processes has created a thread or a child process can be transmitted to a specific engine. For example, the specific engine may vary according to user settings, such as a configuration for monitoring whether the one or more processes are infected with a malicious code using the filtering function.

도 4는 본 발명의 일 실시 예에 따른 테스크 추적을 하기 위한 동작의 흐름도이다.4 is a flowchart of an operation for tracking a task according to an embodiment of the present invention.

도 4를 참조하면, 401 동작에서 커널(예: 커널(131))은 실행 중인 하나 이상의 프로세스를 확인할 수 있다.Referring to FIG. 4 , in operation 401 , the kernel (eg, the kernel 131 ) may check one or more running processes.

403 동작에서 상기 커널은 ptrace(process trace)를 이용하여, 상기 하나 이상의 프로세스의 테스크(task)의 생성을 확인할 수 있다.In operation 403 , the kernel may check creation of tasks of the one or more processes using ptrace (process trace).

일 실시 예에 따르면, 상기 커널은, 상기 하나 이상의 프로세스의 테스크의 생성 시점을 추적할 수 있다.According to an embodiment, the kernel may track the creation time of the task of the one or more processes.

예를 들어, 상기 하나 이상의 프로세스의 상기 테스크의 생성 시점의 추적에 기초하여, 상기 생성된 테스크의 상태가 대기 상태가 되도록 설정될 수 있다.For example, based on the tracking of the creation time of the task of the one or more processes, the state of the created task may be set to be a standby state.

405 동작에서 상기 커널은 상기 생성된 테스크에 대응하는 정보를 확인할 수 있다.In operation 405, the kernel may check information corresponding to the generated task.

일 실시 예에 따르면, 상기 커널은, 상기 확인된 정보의 전달에 응답하여, 상기 ptrace를 이용하여, 상기 지정된 엔진으로부터 상기 생성된 테스크의 제어에 대응하는 시그널을 전달받아 메모리에 저장할 수 있다. 또한, 상기 커널은, 상기 메모리에 저장된 시그널에 기초하여, 상기 생성된 테스크의 제어에 대응하도록 상기 생성된 테스크를 처리할 수 있다.According to an embodiment, the kernel may receive a signal corresponding to the control of the generated task from the designated engine using the ptrace in response to the delivery of the checked information and store it in the memory. Also, the kernel may process the generated task to correspond to control of the generated task based on the signal stored in the memory.

예를 들어, 상기 생성된 테스크의 제어에 대응하는 시그널은, 상기 대기 상태의 상기 테스크가 제거되도록 하는 제어 시그널 또는 상기 대기 상태의 상기 테스크의 대기 상태가 해제되도록 하는 제어 시그널을 포함할 수 있다.For example, the signal corresponding to the control of the generated task may include a control signal for removing the task in the standby state or a control signal for releasing the standby state of the task in the standby state.

일 실시 예에 따르면, 상기 커널은, 상기 테스크의 생성 확인에 기초하여 상기 ptrace를 이용한 메모리에 저장된 식별 정보에 기초하여, 상기 생성된 테스크가 자식 프로세스인지 스레드인지를 확인할 수 있다.According to an embodiment, the kernel may determine whether the created task is a child process or a thread based on identification information stored in the memory using the ptrace based on the task creation confirmation.

407 동작에서 상기 커널은 상기 확인된 정보를 지정된 엔진으로 전달할 수 있다.In operation 407, the kernel may transmit the checked information to a designated engine.

본 문서의 다양한 실시예들은 기기(machine)(예: 컴퓨터)로 읽을 수 있는 저장 매체(machine-readable storage media)(예: 메모리(111)(내장 메모리 또는 외장 메모리))에 저장된 명령어를 포함하는 소프트웨어(예: 프로그램)로 구현될 수 있다. 기기는, 저장 매체로부터 저장된 명령어를 호출하고, 호출된 명령어에 따라 동작이 가능한 장치로서, 개시된 실시예들에 따른 전자 장치(예: 장치(100))를 포함할 수 있다. 상기 명령이 프로세서(예: 프로세서(101))에 의해 실행될 경우, 프로세서가 직접, 또는 상기 제어부의 제어하에 다른 구성요소들을 이용하여 상기 명령에 해당하는 기능을 수행할 수 있다. 명령은 컴파일러 또는 인터프리터에 의해 생성 또는 실행되는 코드를 포함할 수 있다. 기기로 읽을 수 있는 저장매체는, 비일시적(non-transitory) 저장매체의 형태로 제공될 수 있다. 여기서, '비일시적'은 저장매체가 신호(signal)를 포함하지 않으며 실재(tangible)한다는 것을 의미할 뿐 데이터가 저장매체에 반영구적 또는 임시적으로 저장됨을 구분하지 않는다.Various embodiments of the present document include instructions stored in a machine-readable storage media (eg, memory 111 (internal memory or external memory)) readable by a machine (eg, a computer). It may be implemented in software (eg, a program). The device is a device capable of calling a stored command from a storage medium and operating according to the called command, and may include an electronic device (eg, the device 100 ) according to the disclosed embodiments. When the instruction is executed by a processor (eg, the processor 101), the processor may directly or use other components under the control of the controller to perform a function corresponding to the instruction. Instructions may include code generated or executed by a compiler or interpreter. The device-readable storage medium may be provided in the form of a non-transitory storage medium. Here, 'non-transitory' means that the storage medium does not include a signal and is tangible, and does not distinguish that data is semi-permanently or temporarily stored in the storage medium.

일시예에 따르면, 본 문서에 개시된 다양한 실시예들에 따른 방법은 컴퓨터 프로그램 제품(computer program product)에 포함되어 제공될 수 있다. According to an example, the method according to various embodiments disclosed in this document may be included and provided in a computer program product.

이상의 설명은 본 발명의 기술사상을 예시적으로 설명한 것에 불과한 것으로서, 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자라면 본 발명의 본질적인 특성에서 벗어나지 않는 범위 내에서 여러 가지 치환, 변형 및 변경 등이 가능함을 쉽게 알 수 있을 것이다. 즉, 본 발명에 개시된 실시 예들은 본 발명의 기술 사상을 한정하기 위한 것이 아니라 설명하기 위한 것으로서, 이러한 실시 예에 의하여 본 발명의 기술 사상의 범위가 한정되는 것은 아니다.The above description is merely illustrative of the technical idea of the present invention, and those of ordinary skill in the art to which the present invention pertains may make various substitutions, modifications, and changes within the scope not departing from the essential characteristics of the present invention. It will be easy to see that this is possible. That is, the embodiments disclosed in the present invention are not intended to limit the technical spirit of the present invention, but to explain, and the scope of the technical spirit of the present invention is not limited by these embodiments.

따라서, 본 발명의 보호 범위는 후술되는 청구범위에 의하여 해석되어야 하며, 그와 동등한 범위 내에 있는 모든 기술사상은 본 발명의 권리범위에 포함되는 것으로 해석되어야 할 것이다.Accordingly, the protection scope of the present invention should be interpreted by the claims described below, and all technical ideas within the scope equivalent thereto should be interpreted as being included in the scope of the present invention.

본 발명의 실시 예는, 리눅스(linux) 어플리케이션(application)의 기능에 적용할 수 있다. 또한 본 발명의 실시 예는 리눅스 EDR(endpoint detection and response)의 기술로 이용할 수 있다.An embodiment of the present invention can be applied to a function of a Linux (linux) application. In addition, an embodiment of the present invention can be used as a technology of Linux endpoint detection and response (EDR).

Claims (9)

테스크 추적을 하기 위한 장치가 수행하는 커널에 의한 테스크 추적을 하기 위한 방법에 있어서,
커널 레벨에서 ptrace(process trace)를 이용할 수 있는 적어도 하나의 트레이서(tracer)를 생성하는 동작;
유저 레벨에서 생성되는 하나 이상의 프로세스를 상기 트레이서를 통해 확인하는 동작;
상기 하나 이상의 프로세스에서 추적 대상인 테스크(task)를 생성하는 것을 상기 트레이서 및 상기 ptrace를 통해 확인하는 동작;
상기 생성된 테스크에 대응하는 정보를 확인하는 동작; 및
상기 확인된 정보를 지정된 엔진으로 전달하는 동작을 포함하는 테스크 추적을 하기 위한 방법.
In the method for tracing a task by a kernel performed by a device for tracing a task,
generating at least one tracer capable of using ptrace (process trace) at the kernel level;
checking one or more processes generated at the user level through the tracer;
confirming through the tracer and the ptrace that a task to be traced is created in the one or more processes;
checking information corresponding to the generated task; and
and forwarding the identified information to a designated engine.
제 1항에 있어서, 상기 하나 이상의 프로세스의 테스크(task)의 생성을 확인하는 동작은,
상기 하나 이상의 프로세스의 테스크의 생성 시점을 추적하는 동작을 포함하는 테스크 추적을 하기 위한 방법.
The method of claim 1, wherein confirming creation of a task of the one or more processes comprises:
and tracking creation time of the task of the one or more processes.
제 2항에 있어서, 상기 하나 이상의 프로세스의 상기 테스크의 생성 시점의 추적에 기초하여, 상기 생성된 테스크의 상태가 대기 상태가 되도록 설정된 테스크 추적을 하기 위한 방법.3. The method of claim 2, wherein a state of the created task is set to be a waiting state based on the tracking of the creation time of the task of the one or more processes. 제 3항에 있어서,
상기 확인된 정보의 전달에 응답하여, 상기 ptrace를 이용하여, 상기 지정된 엔진으로부터 상기 생성된 테스크의 제어에 대응하는 시그널을 전달받아 메모리에 저장하는 동작, 및
상기 메모리에 저장된 시그널에 기초하여, 상기 생성된 테스크의 제어에 대응하도록 상기 생성된 테스크를 처리하는 동작을 포함하는 테스크 추적을 하기 위한 방법.
4. The method of claim 3,
an operation of receiving a signal corresponding to control of the generated task from the designated engine and storing it in a memory using the ptrace in response to the delivery of the checked information; and
and processing the generated task to correspond to control of the generated task based on the signal stored in the memory.
제 4항에 있어서, 상기 테스크의 제어에 대응하는 시그널은,
상기 대기 상태의 상기 테스크가 제거되도록 하는 제어 시그널 또는 상기 대기 상태의 상기 테스크의 대기 상태가 해제되도록 하는 제어 시그널을 포함하는 테스크 추적을 하기 위한 방법.
According to claim 4, wherein the signal corresponding to the control of the task,
and a control signal for causing the task in the waiting state to be removed or a control signal to causing the task in the waiting state to be released.
제 1항에 있어서, 상기 생성된 테스크에 대응하는 정보를 확인하는 동작은,
상기 테스크의 생성 확인에 기초하여 상기 ptrace를 이용한 메모리에 저장된 식별 정보에 기초하여, 상기 생성된 테스크가 자식 프로세스인지 스레드인지를 확인하는 동작을 포함하는 테스크 추적을 하기 위한 방법.
The method of claim 1, wherein the checking of information corresponding to the generated task comprises:
and determining whether the created task is a child process or a thread based on identification information stored in a memory using the ptrace based on confirmation of the task creation.
컴퓨터 프로그램을 저장하고 있는 컴퓨터 판독 가능 기록매체로서,
커널 레벨에서 ptrace(process trace)를 이용할 수 있는 적어도 하나의 트레이서(tracer)를 생성하는 동작;
유저 레벨에서 생성되는 하나 이상의 프로세스를 상기 트레이서를 통해 확인하는 동작;
상기 하나 이상의 프로세스에서 추적 대상인 테스크(task)를 생성하는 것을 상기 트레이서 및 상기 ptrace를 통해 확인하는 동작;
상기 생성된 테스크에 대응하는 정보를 확인하는 동작; 및
상기 확인된 정보를 지정된 엔진으로 전달하는 동작을 포함하는 방법을 프로세서가 수행하도록 하기 위한 명령어를 포함하는, 컴퓨터 판독 가능한 기록매체.
As a computer-readable recording medium storing a computer program,
generating at least one tracer capable of using ptrace (process trace) at the kernel level;
checking one or more processes generated at the user level through the tracer;
confirming through the tracer and the ptrace that a task to be traced is created in the one or more processes;
checking information corresponding to the generated task; and
A computer-readable recording medium comprising instructions for causing a processor to perform a method including transmitting the identified information to a designated engine.
컴퓨터 판독 가능한 기록매체에 저장되어 있는 컴퓨터 프로그램으로서,
커널 레벨에서 ptrace(process trace)를 이용할 수 있는 적어도 하나의 트레이서(tracer)를 생성하는 동작;
유저 레벨에서 생성되는 하나 이상의 프로세스를 상기 트레이서를 통해 확인하는 동작;
상기 하나 이상의 프로세스에서 추적 대상인 테스크(task)를 생성하는 것을 상기 트레이서 및 상기 ptrace를 통해 확인하는 동작;
상기 생성된 테스크에 대응하는 정보를 확인하는 동작; 및
상기 확인된 정보를 지정된 엔진으로 전달하는 동작을 포함하는 방법을 프로세서가 수행하도록 하기 위한 명령어를 포함하는, 컴퓨터 프로그램.
As a computer program stored in a computer-readable recording medium,
generating at least one tracer capable of using ptrace (process trace) at the kernel level;
checking one or more processes generated at the user level through the tracer;
confirming through the tracer and the ptrace that a task to be traced is created in the one or more processes;
checking information corresponding to the generated task; and
and instructions for causing a processor to perform a method comprising forwarding the identified information to a designated engine.
테스크 추적을 하기 위한 장치에 있어서,
프로세서; 및
상기 프로세서와 전기적으로 연결되며, 상기 프로세서에 의해 실행되는 메모리를 포함하며, 상기 메모리는 운영체제 및 하나 이상의 어플리케이션을 저장하도록 구성되며, 상기 운영체제에 포함된 커널이,
커널 레벨에서 ptrace(process trace)를 이용할 수 있는 적어도 하나의 트레이서(tracer)를 생성하고, 유저 레벨에서 생성되는 하나 이상의 프로세스를 상기 트레이서를 통해 확인하며, 상기 하나 이상의 프로세스에서 추적 대상인 테스크(task)를 생성하는 것을 상기 트레이서 및 상기 ptrace를 통해 확인하고, 상기 생성된 테스크에 대응하는 정보를 확인하며, 상기 확인된 정보를 지정된 엔진으로 전달하는
테스크 추적을 하기 위한 장치.
A device for tracking a task, comprising:
processor; and
It is electrically connected to the processor and includes a memory executed by the processor, wherein the memory is configured to store an operating system and one or more applications, a kernel included in the operating system,
Creates at least one tracer that can use ptrace (process trace) at the kernel level, checks one or more processes created at the user level through the tracer, and a task to be traced in the one or more processes It is confirmed through the tracer and the ptrace to generate
A device for tracking tasks.
KR1020190176918A 2019-12-27 2019-12-27 Method, device, computer-readable storage medium and computer program for tracking task KR102325291B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020190176918A KR102325291B1 (en) 2019-12-27 2019-12-27 Method, device, computer-readable storage medium and computer program for tracking task

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020190176918A KR102325291B1 (en) 2019-12-27 2019-12-27 Method, device, computer-readable storage medium and computer program for tracking task

Publications (2)

Publication Number Publication Date
KR20210084029A KR20210084029A (en) 2021-07-07
KR102325291B1 true KR102325291B1 (en) 2021-11-12

Family

ID=76862547

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020190176918A KR102325291B1 (en) 2019-12-27 2019-12-27 Method, device, computer-readable storage medium and computer program for tracking task

Country Status (1)

Country Link
KR (1) KR102325291B1 (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014182837A (en) 2013-03-19 2014-09-29 Trusteer Ltd Malware discovery method and system
KR101583545B1 (en) 2015-07-22 2016-01-08 주식회사 엔에스에이치씨 Security providing method of improving security of application in mobile device using respective debugging monitoring

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10896253B2 (en) 2017-02-06 2021-01-19 Huawei Technologies Co., Ltd. Processor trace-based enforcement of control flow integrity of a computer system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014182837A (en) 2013-03-19 2014-09-29 Trusteer Ltd Malware discovery method and system
KR101583545B1 (en) 2015-07-22 2016-01-08 주식회사 엔에스에이치씨 Security providing method of improving security of application in mobile device using respective debugging monitoring

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Jurriaan Bremer et al, "Tracy: UNIX system call tracing"(2015.03.)

Also Published As

Publication number Publication date
KR20210084029A (en) 2021-07-07

Similar Documents

Publication Publication Date Title
US8136097B2 (en) Thread debugging device, thread debugging method and information storage medium
KR101519845B1 (en) Method For Anti-Debugging
US8671393B2 (en) Collaborative software debugging in a distributed system with client-specific dynamic breakpoints
US10521329B2 (en) Debugging system
CN100492300C (en) System and method for executing a process on a microprocessor-enabled device
US8656360B2 (en) Collaborative software debugging in a distributed system with execution resumption on consensus
WO2006137356A1 (en) Autonomous operation management system, autonomous operation management method, and program
US10372908B2 (en) System and method for detecting malware in a stream of bytes
US11120124B2 (en) Method for detecting a deviation of a security state of a computing device from a desired security state
TWI678615B (en) Debugging in a data processing apparatus
JP6401235B2 (en) Operating system support for contracts
CN107239698A (en) A kind of anti-debug method and apparatus based on signal transacting mechanism
KR102325291B1 (en) Method, device, computer-readable storage medium and computer program for tracking task
KR101626967B1 (en) Method and apparatus for operating application to prevent hacking
CN106557693A (en) A kind of malice Hook behavioral value method and system
KR101632152B1 (en) Apparatus for preventing dynamic analysis on mobile platform and method thereof
KR20210001057A (en) Method for detecting and blocking ransomware
US20190102541A1 (en) Apparatus and method for defending against unauthorized modification of programs
US20190034259A1 (en) Systems and Methods for Implementing a Thread Trace Log
EP3246821B1 (en) Semiconductor device and its memory access control method
CN111563000B (en) File generation method, intelligent terminal and storage medium
US20160328309A1 (en) Method and apparatus for monitoring a control flow of a computer program
US8925077B2 (en) Mobile devices with inhibited application debugging and methods of operation
JP5663630B2 (en) Computer automatic operation device, automatic operation method, and automatic operation program
US20180196736A1 (en) Controlling debug processing

Legal Events

Date Code Title Description
E701 Decision to grant or registration of patent right