KR102117012B1 - System and Method for Supporting Secure Programming for PLC based on Coding Rule - Google Patents

System and Method for Supporting Secure Programming for PLC based on Coding Rule Download PDF

Info

Publication number
KR102117012B1
KR102117012B1 KR1020180082909A KR20180082909A KR102117012B1 KR 102117012 B1 KR102117012 B1 KR 102117012B1 KR 1020180082909 A KR1020180082909 A KR 1020180082909A KR 20180082909 A KR20180082909 A KR 20180082909A KR 102117012 B1 KR102117012 B1 KR 102117012B1
Authority
KR
South Korea
Prior art keywords
pointer
sanitizer
code
plc
function
Prior art date
Application number
KR1020180082909A
Other languages
Korean (ko)
Other versions
KR20200008799A (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 KR1020180082909A priority Critical patent/KR102117012B1/en
Publication of KR20200008799A publication Critical patent/KR20200008799A/en
Application granted granted Critical
Publication of KR102117012B1 publication Critical patent/KR102117012B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/55Detecting local intrusion or implementing counter-measures
    • G06F21/56Computer malware detection or handling, e.g. anti-virus arrangements
    • G06F21/562Static detection
    • G06F21/563Static detection by source code analysis

Abstract

본 발명은 PLC용 프로그래밍시에 실행 코드(executable code)가 PLC로 다운로드 되기 전, 바이너리 파일을 정적으로 분석하여 PLC 프로그램의 보안성을 강화할 수 있도록 한 코딩 규칙 기반으로 PLC용 안전한 프로그래밍을 지원하기 위한 장치 및 방법에 관한 것으로, 실행 코드로부터 호출 그래프를 생성하고 PLC에 악영향을 줄 수 있는 표준 라이브러리 함수나 코딩규칙 매뉴얼에서 허용하지 않는 함수들을 탐지하는 함수 새니타이저;실행코드를 역어셈블(disassemble)한 후 포인터 변수에 대한 이상 연산(anomaly operation) 패턴을 탐지하고, 소스코드와 심볼 정보를 이용하여 보안 및 안전에 위협이 될 수 있는 메모리 값 설정이나 변경을 탐지는 포인터 새니타이저;상기 함수 새니타이저와 포인터 새니타이저를 포함하고 실행코드 새니타이저가 구성되어, 상기 실행코드 새니타이저는 통합개발환경(IDE)에서 실행 코드(executable code)를 PLC로 다운로드하기 전에 정적으로 분석하여, 상기 함수 새니타이저가 탐지한 PLC에 악영향을 줄 수 있는 표준 라이브러리 함수 및 코딩규칙 매뉴얼에서 허용하지 않는 함수들, 상기 포인터 새니타이저가 탐지한 보안 및 안전에 위협이 될 수 있는 메모리 값 설정이나 변경을 식별하여 제거할 수 있도록 하는 것이다.The present invention is to support secure programming for PLC based on coding rules that can enhance the security of the PLC program by statically analyzing binary files before the executable code is downloaded to the PLC when programming for the PLC. Regarding devices and methods, a function sanitizer that generates call graphs from executable code and detects functions that are not allowed in the coding rules manual or standard library functions that can adversely affect the PLC; disassemble the executable code After that, it detects the anomaly operation pattern for the pointer variable and uses the source code and symbol information to detect or set the memory value that can be a threat to security and safety. Pointer sanitizer; It includes a timer and a pointer sanitizer, and an executable code sanitizer is configured. The executable code sanitizer is statically analyzed before downloading the executable code from the integrated development environment (IDE) to the PLC, and the function By identifying standard library functions that can adversely affect the PLC detected by the sanitizer and functions that are not allowed in the coding rules manual, and setting or changing the memory values that may threaten the security and safety detected by the pointer sanitizer. To be removed.

Description

코딩 규칙 기반으로 PLC용 안전한 프로그래밍을 지원하기 위한 장치 및 방법{System and Method for Supporting Secure Programming for PLC based on Coding Rule}{System and Method for Supporting Secure Programming for PLC based on Coding Rule}

본 발명은 PLC용 프로그래밍에 관한 것으로, 구체적으로 기계어 코드(machine code, 실행코드)가 PLC로 다운로드 되기 전, 바이너리 파일을 정적으로 분석하여 PLC 프로그램의 보안성을 강화할 수 있도록 한 코딩 규칙 기반으로 PLC용 안전한 프로그래밍을 지원하기 위한 장치 및 방법에 관한 것이다.The present invention relates to programming for the PLC, specifically, a PLC based on a coding rule that enables the security of a PLC program to be enhanced by statically analyzing binary files before the machine code (machine code, executable code) is downloaded to the PLC. And a method and apparatus for supporting secure programming.

PLC(Programmable Logic Controller)는 실시간 요구조건을 가지며 높은 신뢰성을 요구하는 제어 공정(control process)에 사용되는 컴퓨터 기반의 단일 프로세서 장치이다.PLC (Programmable Logic Controller) is a computer-based single processor device used in a control process that requires high reliability with real-time requirements.

이러한 PLC는 산업 자동 시스템의 주요 부분으로서, 대표적으로 공정제어, SCADA(Supervisory Control and Data Acquisition) 시스템, 원자력 발전소 등 산업 제어 시스템 등에 적용되고 있다.The PLC is a major part of the industrial automation system, and is typically applied to industrial control systems such as process control, supervisory control and data acquisition (SCADA) systems, and nuclear power plants.

표준 ICS3-1978에 기술되어 있는 정의에 따르면 PLC는 "디지털 또는 아날로그 입출력 모듈을 통해 로직(logic), 시퀀싱(sequencing), 타이밍, 카운팅, 연산과 같은 특수한 기능을 수행하기 위해 프로그램이 가능한 메모리를 사용하고 다양한 종류의 기계나 프로세서를 제어하는 디지털 동작 수행 전자 장치"를 의미한다.According to the definitions described in the standard ICS3-1978, PLCs use "programmable memory to perform special functions such as logic, sequencing, timing, counting, and computation through digital or analog input / output modules. And electronic devices that perform digital operations to control various types of machines or processors.

프로그래밍이 가능한 PLC가 기존의 전자회로로 구성된(hard-wired) 제어장치에 비해 더 높은 유연성을 제공함에 따라, 산업 시스템의 로직을 실행하는 대부분의 제어 요소(control element)들이 PLC로 대체되고 있다.As programmable PLCs offer more flexibility than traditional hard-wired controls, most of the control elements that implement the logic of industrial systems are being replaced by PLCs.

산업 제어 시스템에서 PLC는 입출력장치(예: 밸브, 스위치, 센서) 또는 다른 PLC에 연결되어, 공정에 따른 입력과 출력을 모니터링한다. In industrial control systems, PLCs are connected to input / output devices (eg valves, switches, sensors) or other PLCs to monitor inputs and outputs according to the process.

최근 IoT 기술의 발전에 따라 PLC는 모터 제어, 펌핑 시스템(pumping system), 시스템 모니터링 등과 같은 애플리케이션에도 널리 사용되고 있다. With the recent development of IoT technology, PLC is widely used in applications such as motor control, pumping system, and system monitoring.

Siemens S7 시리즈를 포함한 최근의 PLC제품들은 인터넷으로 연결되어 원격으로 접근될 수도 있다. 인터넷에 연결된 PLC가 산업 제어 시스템 등의 주요 하부구조(critical infrastructures)에서 중요한 역할을 수행함에 따라 점차적으로 사이버 공격의 주요 대상이 되고 있다.Recent PLC products, including the Siemens S7 series, can also be accessed remotely via an Internet connection. As PLC connected to the Internet plays an important role in critical infrastructures such as industrial control systems, it is gradually becoming a main target of cyber attacks.

2010년 이란 원자력시설 우라늄 원심분리기 가동을 중단시킨 스턱스넷(Stuxnet)을 시작으로 2011년 제어시스템 정보 수집 및 유출을 목적으로 한 두큐(Duqu), 2012년 중동 국가의 전력제어시스템을 손상시킨 플레임(Flame) 등의 악성코드가 그 대표적인 사례이다.Starting with Stuxnet, which stopped operating uranium centrifuges in Iran's nuclear facilities in 2010, Duqu, which aimed at collecting and leaking control system information in 2011, flames that damaged power control systems in Middle Eastern countries in 2012 ( Flame) and other malicious codes are typical examples.

스턱스넷의 경우 원전 원심분리기를 제어하는 PLC의 통합 관리 도구를 대상으로 한 공격이었으며, 이를 통해 악성 명령을 PLC에 전달하였다. In the case of Stuxnet, it was an attack on the PLC's integrated management tool that controls the nuclear power centrifuge, and through this, a malicious command was transmitted to the PLC.

PLC용 운영체제로는 VxWorks, Microware OS-9, QNX Neutrino, Linux, Windows CE, uC/OS 등의 임베디드 실시간 운영체제(Real-Time Operating System: RTOS)를 사용한다.As the operating system for PLC, embedded real-time operating system (RTOS) such as VxWorks, Microware OS-9, QNX Neutrino, Linux, Windows CE, uC / OS is used.

그러나 이러한 PLC 운영체제들이 취약점을 가지고 있으며, 이러한 취약점을 제거 또는 완화할 필요가 있다.However, these PLC operating systems have vulnerabilities, and it is necessary to eliminate or mitigate these vulnerabilities.

산업 제어 시스템의 PLC를 대상으로 한 사이버 공격으로 인한 산업시설의 가동중단 및 오작동은 공공의 안전 및 환경을 위협하는 심각한 결과를 야기할 수 있다.Shutdown and malfunction of industrial facilities due to cyber attacks against PLCs in industrial control systems can have serious consequences that threaten public safety and the environment.

종래 기술에서의 산업 제어 시스템의 PLC를 대상으로 한 사이버 공격을 방어하기 위한 기술들을 설명하면 다음과 같다.The techniques for preventing cyber attacks against PLCs of industrial control systems in the prior art will be described as follows.

먼저, 어드레스 새니타이제이션(Address sanitization) 기술이 있다.First, there is Address sanitization technology.

AddressSanitizer(ASan) 프레임워크는 개발자가 작성한 소스코드와 함께 주요 메모리 영역을 표시하는 stub코드를 넣고 컴파일하여 동적으로 프로그램의 취약성을 점검하는 프레임워크이다.The AddressSanitizer (ASan) framework is a framework that dynamically checks the vulnerability of programs by inserting and compiling the stub code that indicates the main memory area along with the source code written by the developer.

ASan 프레임워크의 핵심 프로세스는 소스코드를 컴파일 할 때 컴파일러 레벨에서 중요 메모리 구역을 표시하는 stub 코드를 삽입하는 것이다.The core process of the ASan framework is to insert stub code that marks critical memory areas at the compiler level when compiling the source code.

컴파일된 프로그램은 실행 시에 Memory shadowing과 Redzone 기법을 통해 메모리 위/변조를 탐지 및 차단하는 방식으로 동작한다. 이 기법을 통해 메모리의 주요 영역(heap, stack, 전역변수)의 잘못된 접근 및 use-after-free, use-after-return 등의 주요 메모리 공격에 대해 공격의 원인을 파악하고 잘못된 접근을 차단한다.The compiled program operates by detecting and blocking memory forgery / modulation through memory shadowing and redzone techniques at execution time. Through this technique, the cause of the attack is identified and the wrong access is blocked for major memory attacks such as use-after-free and use-after-return, as well as incorrect access to main areas of memory (heap, stack, global variables).

이 기법은 모든 메모리 영역을 관리하는 것이 아니기 때문에 제시한 메모리 영역 외에서 발생하는 취약성에 대해서는 한계점이 존재한다.Since this technique does not manage all memory areas, there are limitations to vulnerabilities that occur outside the proposed memory area.

또한, 프로세스의 메모리 영역을 shadow memory 및 Redzone기법을 통해 관리하여, ulimit이나 정적 라이브러리 사용 등의 프로세스 관리 기법을 사용할 수 없고 기존 프로그램 대비 12.5% 이상의 메모리가 소비된다.In addition, the memory area of the process is managed through the shadow memory and redzone techniques, so process management techniques such as ulimit or static library cannot be used, and more than 12.5% of memory is consumed compared to the existing program.

이러한 한계점으로 인해 ASan 기법은 저전력 또는 low-end 시스템을 지향하는 임베디드 환경에서는 적합하지 않다.Because of these limitations, the ASan technique is not suitable in embedded environments that are oriented towards low-power or low-end systems.

그리고 종래 기술의 다른 하나로, 임베디드 실행파일의 코딩표준 준수 여부 분석하는 방법이 있다.And as another part of the prior art, there is a method of analyzing whether an embedded executable file complies with the coding standards.

Venkitaraman 등은 임베디드 환경의 실행파일이 어셈블리 레벨에서 코딩 규칙을 준수했는지 확인하는 연구를 하였다. 이 방법에서는 임베디드 실행파일을 역어셈블(disassemble)하여 함수 단위의 흐름 그래프(flow-graph based on function)로 표현하고, 작성된 흐름 그래프를 이용하여 코딩 표준 규칙을 준수하는지 및 하드코딩(hard-coded)된 포인터 변수가 존재하는지 검토한다.Venkitaraman et al. Conducted a study to check whether the executable file of the embedded environment conformed to the coding rules at the assembly level. In this method, the embedded executable is disassembled and expressed as a function-based flow graph, and the written flow graph complies with the coding standard rules and hard-coded. Check if the pointer variable is present.

하드 코딩된 포인터 변수는 소스 코드에서 고정된 메모리 주소를 할당한 변수로 소스코드 상에서 메모리에 직접 접근할 수 있는데, 대부분의 저성능 임베디드 장치 또는 uC/OS 운영체제는 단일 주소체계로 구성되어 있기 때문에 이러한 포인터변수는 Pointer alias 등의 안전성 또는 보안에 취약한 문제를 일으킬 수 있다. A hard coded pointer variable is a variable that allocates a fixed memory address in the source code and can access memory directly in the source code. Most low-performance embedded devices or uC / OS operating systems consist of a single address system. Pointer variables can cause security or security vulnerabilities such as pointer aliases.

PLC제어 프로세서 개발사에서 제공하는 코딩표준 가이드에 따르면, 이러한 포인터 변수의 사용은 지양되어야 한다.According to the coding standard guide provided by PLC control processor developers, the use of such pointer variables should be avoided.

코딩표준 준수 여부 확인 기법은 코딩 표준규칙을 대상으로 검토하므로, 보안 취약점을 가진 함수에 대한 접근은 고려하지 않는다.Since the method for checking the compliance with coding standards is reviewed for the coding standard rules, access to functions with security vulnerabilities is not considered.

따라서, 이 방법은 하드코딩 된 포인터 변수를 탐지하지만 보안 측면보다는 안전 측면에 중점을 둔다고 볼 수 있다. Therefore, this method detects hard-coded pointer variables, but can be considered to focus on safety rather than security.

종래 기술의 또 다른 방법의 하나는 uC/OS 운영체제 방어 기술이 있다.Another method of the prior art is uC / OS operating system defense technology.

Sikiligiri의 연구는 uC/OS 운영체제에서 스택 버퍼 오버플로 공격이 가능한 것을 보였으며, 이를 방어할 수 있는 시스템을 제시한다.Sikiligiri's research showed that a stack buffer overflow attack is possible in the uC / OS operating system, and suggests a system that can defend it.

시스템은 함수 콜스택을 별도의 영역에 저장함으로써, 공격자가 스택 주소를 알 수 없도록 설계한다. 공격자가 스택 주소를 알 수 없기 때문에, 코드 주입 등의 공격을 효과적으로 방어한다.The system is designed so that the attacker does not know the stack address by storing the function call stack in a separate area. Since the attacker cannot know the stack address, it effectively prevents attacks such as code injection.

하지만, 이 시스템을 사용하기 위해서는 함수 콜스택을 저장하기 위한 별도의 하드웨어 지원이 필요하다.However, to use this system, separate hardware support is needed to store the function call stack.

또한, PLC 등 단일 주소 공간으로 구성되어 있는 시스템의 경우 별도 콜스택으로 구성된 메모리 영역도 공격자가 접근이 가능하여 버퍼 오버플로를 유발할 수 있는 함수에 대한 원천적인 차단이 필요하다.In addition, in the case of a system composed of a single address space such as a PLC, the memory area composed of a separate call stack is also accessible to an attacker, and it is necessary to block the function that can cause a buffer overflow.

따라서, 이와 같은 종래 기술들의 문제를 해결하고 제어시스템에서 PLC 자체에 존재하는 취약점뿐만 아니라 이를 관리하는 도구에서 PLC로 전송하는 명령 또는 다운로드하는 프로그램에 대한 보안성을 강화하기 위한 새로운 기술의 개발이 요구되고 있다.Therefore, there is a need to develop a new technology to solve the problems of the related arts and to strengthen the security of commands or download programs that are transmitted to the PLC from the tools that manage them as well as the vulnerabilities existing in the PLC itself in the control system. Is becoming.

대한민국 공개특허번호 제10-2016-0082644호Republic of Korea Patent No. 10-2016-0082644 대한민국 등록특허번호 제10-1479516호Republic of Korea Patent No. 10-1479516 대한민국 공개특허번호 제10-2018-0010053호Republic of Korea Patent No. 10-2018-0010053

본 발명은 종래 기술의 PLC용 프로그래밍 기술의 문제점을 해결하기 위한 것으로, 기계어 코드(machine code, 실행코드)가 PLC로 다운로드 되기 전, 바이너리 파일을 정적으로 분석하여 PLC 프로그램의 보안성을 강화할 수 있도록 한 코딩 규칙 기반으로 PLC용 안전한 프로그래밍을 지원하기 위한 장치 및 방법을 제공하는데 그 목적이 있다.The present invention is to solve the problems of the programming technology for the PLC of the prior art, before the machine code (machine code, executable code) is downloaded to the PLC, by statically analyzing the binary file to enhance the security of the PLC program The purpose is to provide a device and method for supporting secure programming for PLC based on one coding rule.

본 발명은 PLC를 동작시키기 위한 어플리케이션 작성 후 컴파일 된 기계코드와 필요한 경우 소스코드를 분석하여 매뉴얼에 기재된 함수 이외에 불필요한 표준 라이브러리 함수 사용과 하드코딩된 포인터 사용을 탐지하여 보안상 취약한 버그를 제거할 수 있도록 한 코딩 규칙 기반으로 PLC용 안전한 프로그래밍을 지원하기 위한 장치 및 방법을 제공하는데 그 목적이 있다.The present invention analyzes compiled machine code and source code, if necessary, after writing an application to operate the PLC, and can detect unnecessary use of standard library functions and use of hard-coded pointers in addition to the functions described in the manual to eliminate security-vulnerable bugs. The aim is to provide a device and method for supporting secure programming for PLC based on the coding rules.

본 발명은 PLC로 직접 다운로드 될 실행 코드를 검사하여 프로그램 코드 개발자가 의도하지 않은 취약한 라이브러리 함수와 포인터 연산을 탐지하여 PLC의 보안성을 강화할 수 있도록 한 코딩 규칙 기반으로 PLC용 안전한 프로그래밍을 지원하기 위한 장치 및 방법을 제공하는데 그 목적이 있다.The present invention is intended to support secure programming for PLC based on coding rules that enable program code developers to detect unintended vulnerable library functions and pointer operations by inspecting executable code to be directly downloaded to the PLC, thereby enhancing the security of the PLC. The purpose is to provide an apparatus and method.

본 발명은 실행 코드를 사용하여 포인터 변수의 이상 연산(anomaly operation) 여부를 탐지하기 위해서 바이너리 코드를 역어셈블하여, 어셈블리 수준에서 포인터 변수의 이상 사용 패턴을 확인하는 코딩 규칙 기반으로 PLC용 안전한 프로그래밍을 지원하기 위한 장치 및 방법을 제공하는데 그 목적이 있다.The present invention provides safe programming for PLC based on coding rules that assemble binary code to detect whether an anomaly operation of a pointer variable is executed using execution code, and check an abnormal usage pattern of a pointer variable at an assembly level. The purpose is to provide a device and method for supporting.

본 발명은 포인터 새니타이저의 유효성과 정확도를 개선하기 위해 소스코드와 심볼 정보를 통해 각 태스크의 스택의 범위를 계산하고 각 태스크에 할당된 주소 범위를 벗어난 포인터 연산을 탐지하는 코딩 규칙 기반으로 PLC용 안전한 프로그래밍을 지원하기 위한 장치 및 방법을 제공하는데 그 목적이 있다.In order to improve the validity and accuracy of the pointer sanitizer, the present invention is based on a coding rule for calculating a range of a stack of each task through source code and symbol information and detecting a pointer operation outside the address range assigned to each task. The aim is to provide a device and method for supporting secure programming.

본 발명의 다른 목적들은 이상에서 언급한 목적으로 제한되지 않으며, 언급되지 않은 또 다른 목적들은 아래의 기재로부터 당업자에게 명확하게 이해될 수 있을 것이다.Other objects of the present invention are not limited to those mentioned above, and other objects not mentioned will be clearly understood by those skilled in the art from the following description.

상기와 같은 목적을 달성하기 위한 본 발명에 따른 코딩 규칙 기반으로 PLC용 안전한 프로그래밍을 지원하기 위한 장치는 실행 코드로부터 호출 그래프를 생성하고 PLC에 악영향을 줄 수 있는 표준 라이브러리 함수나 코딩규칙 매뉴얼에서 허용하지 않는 함수들을 탐지하는 함수 새니타이저;실행코드를 역어셈블(disassemble)한 후 포인터 변수에 대한 이상 연산(anomaly operation) 패턴을 탐지하고, 소스코드와 심볼 정보를 이용하여 보안 및 안전에 위협이 될 수 있는 메모리 값 설정이나 변경을 탐지는 포인터 새니타이저;상기 함수 새니타이저와 포인터 새니타이저를 포함하고 실행코드 새니타이저가 구성되어, 상기 실행코드 새니타이저는 통합개발환경(IDE)에서 실행 코드(executable code)를 PLC로 다운로드하기 전에 정적으로 분석하여, 상기 함수 새니타이저가 탐지한 PLC에 악영향을 줄 수 있는 표준 라이브러리 함수 및 코딩규칙 매뉴얼에서 허용하지 않는 함수들, 상기 포인터 새니타이저가 탐지한 보안 및 안전에 위협이 될 수 있는 메모리 값 설정이나 변경을 식별하여 제거할 수 있도록 하는 것을 특징으로 한다.The apparatus for supporting safe programming for PLC based on the coding rule according to the present invention for achieving the above object is allowed in a standard library function or coding rule manual that can generate a call graph from execution code and adversely affect the PLC. A function sanitizer that detects non-functional functions; after disassembles the execution code, detects anomaly operation patterns on pointer variables, and uses source code and symbol information to pose a security and security threat. Pointer sanitizer to detect possible memory value setting or change; includes the function sanitizer and pointer sanitizer, and the executable code sanitizer is configured, and the executable code sanitizer is configured in an integrated development environment (IDE). Standard library functions and functions that are not allowed in the coding rules manual that can affect the PLC detected by the function sanitizer by statically analyzing the executable code before downloading to the PLC, the pointer sanitizer It is characterized by identifying and removing memory value settings or changes that can threaten the detected security and safety.

여기서, 상기 함수 새니타이저는,프로그램 코드 개발자가 개발한 실행 코드로 표현되는 태스크의 함수 리스트를 시그니처 DB(Database)와 비교를 하고, 태스크의 함수 리스트는 상기 실행코드로부터 생성된 호출 그래프를 통하여 추출된 함수 명을 포함하는 것을 특징으로 한다.Here, the function sanitizer compares the function list of the task represented by the execution code developed by the program code developer with the signature DB (Database), and the function list of the task is extracted through the call graph generated from the execution code It is characterized by including the function name.

그리고 시그니처 DB는 개발 매뉴얼에서 허용하지 않는 표준 함수나 보안 관점에서 취약한 표준 함수 명을 시그니처로 관리하는 것을 특징으로 한다.In addition, the signature DB is characterized by managing standard function names that are not allowed in the development manual or weak standard function names as signatures.

그리고 상기 함수 새니타이저에서의 보안 및 안전에 악영향을 줄 수 있는 함수 리스트는 'Buffer Overflow 취약 함수'와 'Memory 취약성 관련 함수'로 구성되고, Buffer Overflow 취약 함수로 'trcat()',trcpy()’, ‘strncpy()’, ‘sprintf()’, ‘vsprintf()’, ‘gets()’, ‘fscanf()’, ‘scanf()’를 포함하고, memory 취약성 관련 함수로 ‘calloc()’, ‘free()’, ‘malloc()’, ‘realloc()’, ‘memcpy()’, ‘memset()’, ‘memmove()’를 포함하는 것을 특징으로 한다.And the function list that can adversely affect the security and safety in the function sanitizer is composed of 'Buffer Overflow vulnerable function' and 'Memory vulnerability related function', and Buffer Overflow vulnerable function is ' trcat () ', trcpy ( ) ',' strncpy () ',' sprintf () ',' vsprintf () ',' gets () ',' fscanf () ',' scanf () ' and ' calloc () ) ',' free () ',' malloc () ',' realloc () ',' memcpy () ',' memset () ', and' memmove () ' .

그리고 상기 함수 새니타이저는,상기 실행 코드(executable code)로부터 호출 그래프를 생성하고, 생성된 호출 그래프로부터 시스템 및 프로그램 코드 개발자가 사용하는 함수 명 및 함수 간 호출 관계를 분석하고,프로그램 코드 개발자가 개발한 실행 코드로 표현되는 태스크의 함수 리스트를 시그니처 DB(Database)와 비교를 하여 PLC에 악영향을 줄 수 있는 표준 라이브러리 함수나 코딩규칙 매뉴얼에서 허용하지 않는 함수들을 탐지한 이후, 호출 그래프를 통해 어느 위치에 어떤 함수가 사용되었는지 함수 새니타이저가 파악을 하여, 함수 새니타이저에서 파악한 결과와 소스코드를 비교하여 프로그램 코드 개발자에 의해 PLC에 악영향을 줄 수 있는 표준 라이브러리 함수나 코딩규칙 매뉴얼에서 허용하지 않는 함수들이 포함되었는지 판단하는 것을 특징으로 한다.In addition, the function sanitizer generates a call graph from the executable code, analyzes function names and call relationships between functions used by system and program code developers from the generated call graph, and is developed by program code developers. After comparing the function list of the task represented by one execution code with the signature DB (Database), after detecting the standard library functions that can adversely affect the PLC or functions that are not allowed in the coding rules manual, any position through the call graph It is not allowed in the standard library function or coding rules manual that the function sanitizer understands which function is used in the function, compares the result obtained by the function sanitizer with the source code, and can adversely affect the PLC by the program code developer. It is characterized by determining whether functions are included.

그리고 상기 포인터 새니타이저는, 실행코드를 대상으로 포인터 변수에 대한 이상 연산(anomaly operation) 패턴 탐지 동작을 수행하고, 실행코드를 대상으로 한 이상 연산(anomaly operation) 패턴 탐지가 어려운 경우 소스 코드 분석을 통해 이상 연산(anomaly operation) 패턴 탐지에 필요한 정보를 추출하고, 포인터 변수에 직접 주소를 하드코딩하여 특정 값을 설정하는 명령 패턴을 탐지하는 것을 특징으로 한다.In addition, the pointer sanitizer performs anomaly operation pattern detection operation on the pointer variable targeting the execution code, and analyzes the source code when it is difficult to detect anomaly operation pattern targeting the execution code. It is characterized by extracting the information necessary for anomaly operation pattern detection, and detecting a command pattern that sets a specific value by hardcoding the address directly into a pointer variable.

그리고 상기 포인터 새니타이저는, 소스코드와 심볼 정보를 통해 프로그램 코드 개발자가 개발한 실행 코드로 표현되는 각 태스크의 스택의 범위를, 태스크 코드의 시작점을 가리키는 포인터인 인자(App_Task2), 태스크 스택의 시작위치를 가리키는 포인터인 인자(App_TaskPostStk[])를 이용하여, App_TaskPostStk[]가 가리키는 위치는 심볼 정보를 통해 메모리 주소를 확인하고, 스택의 크기를 지정하는 인자(APP_CFG_TASK_STK_SIZE)의 값을 사용하여 태스크의 스택 범위를 확인하여 계산하고, 각 태스크에 할당된 주소 범위를 벗어난 포인터 연산을 탐지하여 유효성과 정확도를 개선하는 것을 특징으로 한다.In addition, the pointer sanitizer, the source code and symbol information, the range of each task stack represented by the execution code developed by the program code developer, the argument indicating the starting point of the task code (App_Task2), the start of the task stack Using the argument (App_TaskPostStk []), which is a pointer to the location, the location indicated by App_TaskPostStk [] checks the memory address through symbol information and uses the value of the argument (APP_CFG_TASK_STK_SIZE) to specify the size of the stack. It is characterized by improving the validity and accuracy by checking and calculating the range, and detecting pointer operation outside the address range assigned to each task.

그리고 상기 포인터 새니타이저는, 포인터 변수 연산을 탐지하는데 필요한 코드 패턴을 관리하는 패턴 DB를 포함하고, 패턴 DB에 유지할 시그니처를 생성하기 위해 적용 대상 PLC의 CPU용 어셈블리 사용 패턴을 분석하는 것을 특징으로 한다.In addition, the pointer sanitizer includes a pattern DB that manages a code pattern necessary to detect pointer variable operation, and analyzes the assembly usage pattern of the CPU of the target PLC to generate a signature to be maintained in the pattern DB. .

그리고 상기 포인터 새니타이저에서 탐지하고자 하는 패턴은, 포인터 변수에 하드코딩된 주소 값을 할당하는 명령들과 포인터 변수가 가리키는 주소번지의 값을 변경하는 명령들로 구성되는 것을 특징으로 한다.In addition, the pattern to be detected by the pointer sanitizer is composed of instructions for assigning a hardcoded address value to the pointer variable and instructions for changing the value of the address address indicated by the pointer variable.

그리고 상기 포인터 새니타이저는, 기계어 코드를 대상으로 한 포인터 새니타이저를 적용하기 위해 기계어 코드를 역어셈블하여 어셈블리 코드 분석을 하고,포인터 변수에 대한 이상 연산(anomaly operation) 패턴 탐지 동작 수행시에, 어셈블리 코드만을 사용해서 하드코딩된 메모리 주소 값을 식별하거나, 소스코드를 분석하여 하드코딩된 메모리 주소 값을 식별하는 것을 특징으로 한다.Then, the pointer sanitizer performs assembly code analysis by disassembled the machine code to apply the pointer sanitizer targeting the machine code, and performs anomaly operation pattern detection operation on the pointer variable, It is characterized by identifying hard-coded memory address values using only assembly code or identifying hard-coded memory address values by analyzing the source code.

삭제delete

다른 목적을 달성하기 위한 본 발명에 따른 코딩 규칙 기반으로 PLC용 안전한 프로그래밍을 지원하기 위한 방법은 통합개발환경(IDE)에서 실행 코드(executable code)를 PLC로 다운로드하기 전에 정적으로 분석하여, 함수 새니타이저가 탐지한 PLC에 악영향을 줄 수 있는 표준 라이브러리 함수나 코딩규칙 매뉴얼에서 허용하지 않는 함수을 식별하여 제거할 수 있도록 하기 위하여,함수 새니타이저가 실행 코드(executable code)로부터 호출 그래프를 생성하는 단계;생성된 호출 그래프로부터 시스템 및 프로그램 코드 개발자가 사용하는 함수 명 및 함수 간 호출 관계를 분석하는 단계;프로그램 코드 개발자가 개발한 실행 코드로 표현되는 태스크의 함수 리스트를 시그니처 DB(Database)와 비교를 하는 단계;PLC에 악영향을 줄 수 있는 표준 라이브러리 함수나 코딩규칙 매뉴얼에서 허용하지 않는 함수들을 탐지하고, 호출 그래프를 통해 어느 위치에 어떤 함수가 사용되었는지 함수 새니타이저가 파악을 하는 단계;함수 새니타이저에서 파악한 결과와 소스코드를 비교하여 프로그램 코드 개발자에 의해 PLC에 악영향을 줄 수 있는 표준 라이브러리 함수나 코딩규칙 매뉴얼에서 허용하지 않는 함수들이 포함되었는지 판단하는 단계;를 수행하는 것을 특징으로 한다.The method for supporting secure programming for PLC based on the coding rule according to the present invention for achieving another object is statically analyzed before downloading the executable code from the integrated development environment (IDE) to the PLC, and function function Generating a call graph from the executable code by the function sanitizer in order to identify and remove standard library functions or functions that are not allowed in the coding rule manual, which may adversely affect the PLC detected by the timer; Analyzing function names and call relationships between functions used by system and program code developers from the generated call graph; comparing the function list of tasks represented by execution code developed by program code developers with signature DB (Database) Step; detecting standard library functions that can adversely affect the PLC or functions that are not allowed in the coding rules manual, and using the call graph to determine which function is used in which position and function sanitizer; function sanitizer It is characterized by performing; comparing the result identified in the above with the source code to determine whether a standard library function that can adversely affect the PLC by a program code developer or a function not allowed in a coding rule manual is included.

여기서, 시그니처 DB는 개발 매뉴얼에서 허용하지 않는 표준 함수나 보안 관점에서 취약한 표준 함수 명을 시그니처로 관리하는 것을 특징으로 한다.Here, the signature DB is characterized by managing a standard function that is not allowed in the development manual or a weak standard function name as a signature.

그리고 상기 함수 새니타이저에서의 보안 및 안전에 악영향을 줄 수 있는 함수 리스트는 'Buffer Overflow 취약 함수'와 'Memory 취약성 관련 함수'로 구성되고,Buffer Overflow 취약 함수로 'trcat()',trcpy()’, ‘strncpy()’, ‘sprintf()’, ‘vsprintf()’, ‘gets()’, ‘fscanf()’, ‘scanf()’를 포함하고, memory 취약성 관련 함수로 ‘calloc()’, ‘free()’, ‘malloc()’, ‘realloc()’, ‘memcpy()’, ‘memset()’, ‘memmove()’를 포함하는 것을 특징으로 한다.In addition, the function list that can adversely affect security and safety in the function sanitizer is composed of 'Buffer Overflow vulnerable function' and 'Memory vulnerability related function', and ' trcat () ', trcpy ( ) ',' strncpy () ',' sprintf () ',' vsprintf () ',' gets () ',' fscanf () ',' scanf () ' and ' calloc () ) ',' free () ',' malloc () ',' realloc () ',' memcpy () ',' memset () ', and' memmove () ' .

또 다른 목적을 달성하기 위한 본 발명에 따른 코딩 규칙 기반으로 PLC용 안전한 프로그래밍을 지원하기 위한 방법은 통합개발환경(IDE)에서 실행 코드(executable code)를 PLC로 다운로드하기 전에 정적으로 분석하여 포인터 새니타이저가 탐지한 보안 및 안전에 위협이 될 수 있는 메모리 값 설정이나 변경을 식별하여 제거할 수 있도록 하기 위하여, 포인터 새니타이저가 소스코드와 심볼 정보를 통해 프로그램 코드 개발자가 개발한 실행 코드로 표현되는 각 태스크의 스택의 범위를, 태스크 코드의 시작점을 가리키는 포인터인 인자(App_Task2), 태스크 스택의 시작위치를 가리키는 포인터인 인자(App_TaskPostStk[])를 이용하여, App_TaskPostStk[]가 가리키는 위치는 심볼 정보를 통해 메모리 주소를 확인하고, 스택의 크기를 지정하는 인자(APP_CFG_TASK_STK_SIZE)의 값을 사용하여 태스크의 스택 범위를 확인하여 계산하는 단계;태스크의 소스코드 내부에 포인터 변수가 있는지를 확인하고, 포인터 변수에 메모리 주소를 하드코딩 하는지 확인하는 단계;포인터 변수에 입력되는 주소 값이 해당 태스크의 스택 범위를 벗어나는 경우 이를 탐지하는 단계;를 포함하는 것을 특징으로 한다.The method for supporting safe programming for PLC based on the coding rule according to the present invention for achieving another object is statically analyzed before downloading the executable code from the integrated development environment (IDE) to the PLC, and the pointer Pointer sanitizer is expressed as executable code developed by program code developers through source code and symbol information to identify and remove memory value settings or changes that could threaten security and safety detected by Taiger The location of App_TaskPostStk [] indicates the symbol information using the range of each task stack, the argument (App_Task2) as a pointer to the starting point of the task code, and the argument (App_TaskPostStk []) as a pointer to the starting position of the task stack. Checking the memory address through, and calculating by checking the stack range of the task using the value of the argument (APP_CFG_TASK_STK_SIZE) that specifies the size of the stack; check if there is a pointer variable in the source code of the task, and check the pointer variable It characterized in that it comprises a step of: checking whether the memory address is hard-coded; detecting an address value input to a pointer variable when it is out of a stack range of a corresponding task.

그리고 상기 포인터 새니타이저는, 실행코드를 대상으로 포인터 변수에 대한 이상 연산(anomaly operation) 패턴 탐지 동작을 수행하고, 실행코드를 대상으로 한 이상 연산(anomaly operation) 패턴 탐지가 어려운 경우 소스 코드 분석을 통해 이상 연산(anomaly operation) 패턴 탐지에 필요한 정보를 추출하고, 포인터 변수에 직접 주소를 하드코딩하여 특정 값을 설정하는 명령 패턴을 탐지하는 것을 특징으로 한다.In addition, the pointer sanitizer performs anomaly operation pattern detection operation on the pointer variable targeting the execution code, and analyzes the source code when it is difficult to detect anomaly operation pattern targeting the execution code. It is characterized by extracting the information necessary for anomaly operation pattern detection, and detecting a command pattern that sets a specific value by hardcoding the address directly into a pointer variable.

그리고 상기 포인터 새니타이저는, 포인터 변수 연산을 탐지하는데 필요한 코드 패턴을 관리하는 패턴 DB를 포함하고,패턴 DB에 유지할 시그니처를 생성하기 위해 적용 대상 PLC의 CPU용 어셈블리 사용 패턴을 분석하는 것을 특징으로 한다.In addition, the pointer sanitizer includes a pattern DB that manages a code pattern necessary to detect pointer variable operation, and analyzes the assembly usage pattern of the CPU of the applicable PLC to generate a signature to be maintained in the pattern DB. .

그리고 상기 포인터 새니타이저에서 탐지하고자 하는 패턴은, 포인터 변수에 하드코딩된 주소 값을 할당하는 명령들과 포인터 변수가 가리키는 주소번지의 값을 변경하는 명령들로 구성되는 것을 특징으로 한다.In addition, the pattern to be detected by the pointer sanitizer is composed of instructions for assigning a hardcoded address value to the pointer variable and instructions for changing the value of the address address indicated by the pointer variable.

그리고 상기 포인터 새니타이저는, 기계어 코드를 대상으로 한 포인터 새니타이저를 적용하기 위해 기계어 코드를 역어셈블하여 어셈블리 코드 분석을 하고, 포인터 변수에 대한 이상 연산(anomaly operation) 패턴 탐지 동작 수행시에, 어셈블리 코드만을 사용해서 하드코딩된 메모리 주소 값을 식별하거나, 소스코드를 분석하여 하드코딩된 메모리 주소 값을 식별하는 것을 특징으로 한다.Then, the pointer sanitizer performs assembly code analysis by assembling the machine code to apply the pointer sanitizer targeting the machine code, and when performing anomaly operation pattern detection operation on the pointer variable, It is characterized by identifying hard-coded memory address values using only assembly code or identifying hard-coded memory address values by analyzing the source code.

이상에서 설명한 바와 같은 본 발명에 따른 코딩 규칙 기반으로 PLC용 안전한 프로그래밍을 지원하기 위한 장치 및 방법은 다음과 같은 효과가 있다.The apparatus and method for supporting secure programming for PLC based on the coding rule according to the present invention as described above has the following effects.

첫째, 기계어 코드(machine code, 실행코드)가 PLC로 다운로드 되기 전, 바이너리 파일을 정적으로 분석하여 PLC 프로그램의 보안성을 강화할 수 있도록 한다.First, before the machine code (machine code, execution code) is downloaded to the PLC, the binary file is statically analyzed to enhance the security of the PLC program.

둘째, PLC를 동작시키기 위한 어플리케이션 작성 후 컴파일 된 기계코드와 필요한 경우 소스코드를 분석하여 매뉴얼에 기재된 함수 이외에 불필요한 표준 라이브러리 함수 사용과 하드코딩된 포인터 사용을 탐지하여 보안상 취약한 버그를 제거할 수 있다.Second, after writing the application to operate the PLC, the compiled machine code and, if necessary, the source code are analyzed to detect unnecessary use of standard library functions and the use of hard-coded pointers in addition to the functions described in the manual, thereby eliminating vulnerable security bugs. .

셋째, PLC로 직접 다운로드 될 실행 코드(executable code)를 검사하여 프로그램 코드 개발자가 의도하지 않은 취약한 라이브러리 함수와 포인터 연산을 탐지하여 PLC의 보안성을 강화할 수 있다.Third, by inspecting the executable code to be downloaded directly to the PLC, it is possible to enhance the security of the PLC by detecting vulnerable library functions and pointer operations not intended by the program code developer.

넷째, 바이너리 코드를 역어셈블하여, 어셈블리 수준에서 포인터 변수의 이상 사용 패턴을 확인하여 포인터 변수의 이상 연산(anomaly operation) 여부를 탐지할 수 있다.Fourth, by assembling the binary code, it is possible to detect anomaly operation of the pointer variable by checking the abnormal usage pattern of the pointer variable at the assembly level.

다섯째, 소스코드와 심볼 정보를 통해 각 태스크의 스택의 범위를 계산하고 각 태스크에 할당된 주소 범위를 벗어난 포인터 연산을 탐지하여 포인터 새니타이저의 유효성과 정확도를 개선할 수 있다.Fifth, it is possible to improve the validity and accuracy of the pointer sanitizer by calculating the range of each task's stack through source code and symbol information, and detecting pointer operations outside the address range assigned to each task.

여섯째, 개발자의 실수로 부적합한 함수와 포인터 연산을 사용하거나, 악성코드에 감염된 IDE가 악성 라이브러리 함수를 임의로 추가하는 경우에도 사전 탐지하여, PLC의 보안성을 강화할 수 있다.Sixth, it is possible to enhance the security of the PLC by detecting in advance even if the developer accidentally uses an inappropriate function and pointer operation, or when the IDE infected with the malicious code randomly adds a malicious library function.

도 1은 본 발명에 따른 코딩 규칙 기반으로 PLC용 안전한 프로그래밍을 지원하기 위한 장치 구성도
도 2는 본 발명에 따른 코딩 규칙 기반으로 PLC용 안전한 프로그래밍을 지원하기 위한 방법을 나타낸 플로우 차트
도 3은 strcpy가 포함 된 uC/OS 코드의 예를 나타낸 구성도
도 4는 포인터 연산을 수행하는 코드의 예를 나타낸 구성도
도 5는 포인터 변수 조작을 통한 메모리 값 변조 결과 구성도
도 6은 uC/OS 태스크의 호출 그래프
도 7은 도 4에 대한 어셈블리 코드 구성도
도 8은 포인터 새니타이저를 위한 코드 패턴의 예를 나타낸 구성도
도 9는 태스크를 생성하는 uC/OS 코드 원형의 예를 나타낸 구성도
도 10은 실행 코드(executable code)에 대한 심볼 정보의 예를 나타낸 구성도
1 is a configuration diagram of a device for supporting secure programming for a PLC based on a coding rule according to the present invention
2 is a flow chart showing a method for supporting secure programming for a PLC based on a coding rule according to the present invention
3 is a block diagram showing an example of uC / OS code including strcpy
4 is a block diagram showing an example of a code for performing a pointer operation
5 is a configuration diagram of a memory value modulation result through pointer variable manipulation
6 is a call graph of uC / OS task
Figure 7 is an assembly code configuration diagram for Figure 4
8 is a block diagram showing an example of a code pattern for a pointer sanitizer
9 is a block diagram showing an example of uC / OS code prototype for generating a task
10 is a block diagram showing an example of symbol information for an executable code

이하, 본 발명에 따른 코딩 규칙 기반으로 PLC용 안전한 프로그래밍을 지원하기 위한 장치 및 방법의 바람직한 실시 예에 관하여 상세히 설명하면 다음과 같다.Hereinafter, a preferred embodiment of an apparatus and method for supporting secure programming for a PLC based on a coding rule according to the present invention will be described in detail as follows.

본 발명에 따른 코딩 규칙 기반으로 PLC용 안전한 프로그래밍을 지원하기 위한 장치 및 방법의 특징 및 이점들은 이하에서의 각 실시 예에 대한 상세한 설명을 통해 명백해질 것이다.Features and advantages of an apparatus and method for supporting secure programming for a PLC based on a coding rule according to the present invention will become apparent through detailed description of each embodiment below.

도 1은 본 발명에 따른 코딩 규칙 기반으로 PLC용 안전한 프로그래밍을 지원하기 위한 장치 구성도이다.1 is a configuration diagram of a device for supporting secure programming for a PLC based on a coding rule according to the present invention.

본 발명은 PLC 시스템의 보안을 향상시키기 위한 '실행코드 새니타이저(executable code sanitizer)'를 포함한다.The present invention includes an 'executable code sanitizer' for improving the security of a PLC system.

본 발명은 실행코드 새니타이저(executable code sanitizer)를 사용하여 PLC 제어 프로그램의 개발 과정 중에 포함될 수 있는 취약한 함수들과 잘못된 메모리 참조를 탐지하고 제거할 수 있다.The present invention can detect and remove vulnerable functions and erroneous memory references that may be included during the development of a PLC control program using an executable code sanitizer.

이를 위해 먼저 취약 함수들의 목록을 취약성 DB로 관리하고, 태스크의 메모리 주소 사상 과정을 파악한다.To this end, first, the list of vulnerable functions is managed by the vulnerability DB, and the memory address mapping process of the task is identified.

다음으로 통합 개발 환경(IDE)에서 개발되어 컴파일된 실행 프로그램이 PLC로 다운로드 되기 전에 실행 프로그램을 분석하여 사용되는 함수 정보와 태스크의 참조 주소 정보를 추출하고, 추출된 정보를 취약성 DB 및 메모리 주소공간과 비교하여 보안 취약점을 탐지 제거한다.Next, before the executable program developed and compiled in the integrated development environment (IDE) is downloaded to the PLC, the function information and reference address information of the task are extracted by analyzing the execution program, and the extracted information is vulnerable DB and memory address space. Compares and detects and eliminates security vulnerabilities.

본 발명의 일 실시 예에서는 uC/OS 기반의 PLC를 대상으로 개발된 실행 코드를 분석하여 PLC의 오작동 및 취약성을 사전에 탐지및 필터링하는 '실행코드 새니타이저(Executable Code Sanitizer)'를 설계하고 구현한다.In one embodiment of the present invention, an execution code developed for a uC / OS based PLC is analyzed to design an 'Executable Code Sanitizer' that detects and filters malfunctions and vulnerabilities of the PLC in advance. Implement it.

Micrium의 uC/OS는 소형 마이크로 커널 RTOS이다. uC/OS는 마이크로프로세서용 우선순위 기반의 멀티태스킹 운영체제로, 주로 C 프로그래밍 언어로 작성되었다.Micrium's uC / OS is a small microkernel RTOS. uC / OS is a priority-based multitasking operating system for microprocessors, mainly written in the C programming language.

현재, uC/OS는 PLC 또는 산업제어시스템의 임베디드 운영체체로 사용되고 있다.Currently, uC / OS is used as embedded operating system of PLC or industrial control system.

본 발명에 따른 코딩 규칙 기반으로 PLC용 안전한 프로그래밍을 지원하기 위한 장치를 구성하는 실행코드 새니타이저는 통합개발환경(IDE)에서 실행 코드(executable code)를 PLC로 다운로드하기 전에 정적으로 분석하여 취약한 함수나 포인터의 사용을 식별하여 제거할 수 있도록 한다.The execution code sanitizer constituting a device for supporting safe programming for PLC based on the coding rule according to the present invention is a function that is vulnerable by statically analyzing the executable code in the integrated development environment (IDE) before downloading it to the PLC B. Identifies the use of pointers so that they can be removed.

실행코드 새니타이저는 도 1에서와 같이, 함수 새니타이저(Function sanitizer)(100)와, 포인터 새니타이저(Pointer sanitizer)(200)의 2개의 모듈로 구성된다.As shown in FIG. 1, the executable code sanitizer is composed of two modules: a function sanitizer 100 and a pointer sanitizer 200.

함수 새니타이저(100)는 실행 코드로부터 호출 그래프를 생성하고 PLC에 악영향을 줄 수 있는 표준 라이브러리 함수나 코딩규칙 매뉴얼에서 허용하지 않는 함수들을 탐지하여 보안성을 강화한다.The function sanitizer 100 enhances security by detecting a function not allowed in a standard library function or a coding rule manual that generates a call graph from execution code and may adversely affect the PLC.

포인터 새니타이저(200)는 실행코드를 역어셈블(disassemble)한 후 포인터 변수에 대한 이상 연산(anomaly operation) 패턴을 탐지하고, 소스코드와 심볼 정보를 이용하여 보안 및 안전에 위협이 될 수 있는 메모리 값 설정이나 변경을 탐지한다.The pointer sanitizer 200 may disassemble the executable code, detect anomaly operation patterns for pointer variables, and use source code and symbol information to become a security and safety threat. Detect or set memory values.

이와 같은 구성을 갖는 본 발명에 따른 코딩 규칙 기반으로 PLC용 안전한 프로그래밍을 지원하기 위한 방법은 다음과 같은 동작을 수행한다.The method for supporting secure programming for PLC based on the coding rule according to the present invention having such a configuration performs the following operations.

도 2는 본 발명에 따른 코딩 규칙 기반으로 PLC용 안전한 프로그래밍을 지원하기 위한 방법을 나타낸 플로우 차트이다.2 is a flow chart showing a method for supporting secure programming for a PLC based on a coding rule according to the present invention.

먼저, 함수 새니타이저(100)가 실행 코드(executable code)로부터 호출 그래프를 생성한다.(S201)First, the function sanitizer 100 generates a call graph from executable code. (S201)

이어, 생성된 호출 그래프로부터 시스템 및 프로그램 코드 개발자가 사용하는 함수 명 및 함수 간 호출 관계를 분석한다.(S202)Then, from the generated call graph, function names and call relationships between functions used by system and program code developers are analyzed (S202).

그리고 프로그램 코드 개발자가 개발한 실제 동작에 관련 된 태스크의 함수 리스트를 시그니처 DB(Database)와 비교를 하여 안정성을 검토한다.(S203)Then, the function list of the task related to the actual operation developed by the program code developer is compared with the signature DB (Database) to examine stability. (S203)

이어, 함수 새니타이저(100)를 통해 안전하지 않은 함수 사용을 탐지한 이후, 호출 그래프를 통해 어느 위치에 어떤 함수가 사용되었는지 파악하여 함수 새니타이저(100)의 결과와 소스코드를 비교한다.(S204)Subsequently, after detecting the use of an unsafe function through the function sanitizer 100, the call graph is used to determine which function is used in which position and compares the result of the function sanitizer 100 with the source code. . (S204)

그리고 프로그램 코드 개발자의 실수 혹은 악의적인 행위로 불필요한 함수가 포함되었는지 및 IDE의 감염으로 인해 소스코드에 존재하지 않은 함수가 포함되어있는지 판단한다.(S205)In addition, it is determined whether unnecessary functions are included due to mistakes or malicious actions of the program code developer, and whether functions that do not exist in the source code are included due to infection of the IDE (S205).

이어, 포인터 새니타이저(200)는 uC/OS 소스코드와 심볼 정보를 사용하여 태스크들의 스택 위치와 크기를 계산한다.(S206)Subsequently, the pointer sanitizer 200 calculates the stack position and size of the tasks using the uC / OS source code and symbol information. (S206)

그리고 태스크의 소스코드 내부에 포인터 변수가 있는지를 확인하고, 포인터 변수에 메모리 주소를 하드코딩 하는지 확인한다.(S207)Then, it is checked whether there is a pointer variable in the source code of the task, and whether the memory address is hard-coded in the pointer variable (S207).

이어, 포인터 변수에 입력되는 주소 값이 해당 태스크의 스택 범위를 벗어나는 경우 이를 탐지한다.(S208)Subsequently, if the address value input to the pointer variable is outside the stack range of the corresponding task, it is detected. (S208)

함수 새니타이저(100)는 실행 코드(executable code)로부터 호출 그래프를 생성한다. The function sanitizer 100 generates a call graph from executable code.

생성된 호출 그래프로부터 시스템 및 프로그램 코드 개발자가 사용하는 함수 명 및 함수 간 호출 관계를 파악할 수 있다.From the generated call graph, it is possible to understand the function names used by system and program code developers and the call relationships between functions.

본 발명에서는 프로그램 코드 개발자가 개발한 실제 동작에 관련 된 태스크의 함수 리스트를 시그니처 DB(Database)와 비교를 하여 안정성을 검토한다.In the present invention, the function list of the task related to the actual operation developed by the program code developer is compared with the signature DB (Database) to examine stability.

시그니처 DB는 개발 매뉴얼에서 허용하지 않는 표준 함수나 보안 관점에서 취약한 표준 함수 명을 시그니처로 관리한다.The signature DB manages standard function names that are not allowed in the development manual or vulnerable standard function names as signatures.

표 1은 보안 및 안전에 악영향을 줄 수 있는 함수 리스트로 'Buffer Overflow 취약 함수'와 'Memory 취약성 관련 함수'로 구성되어 있다.Table 1 is a list of functions that can adversely affect security and safety, and consists of 'Buffer Overflow vulnerability function' and 'Memory vulnerability related function'.

Buffer Overflow에 취약한 함수로 'trcat()',trcpy()’, ‘strncpy()’, ‘sprintf()’, ‘vsprintf()’, ‘gets()’, ‘fscanf()’, ‘scanf()’를 제시하고 있다.Functions that are vulnerable to buffer overflow, such as ' trcat () ', trcpy () ',' strncpy () ',' sprintf () ',' vsprintf () ',' gets () ',' fscanf () ',' scanf ( ) ' .

또한, memory 조작과 관련된 함수로 ‘calloc()’, ‘free()’, ‘malloc()’, ‘realloc()’, ‘memcpy()’, ‘memset()’, ‘memmove()’를 포함할 수 있다.Also, 'calloc ()', 'free ()', 'malloc ()', 'realloc ()', 'memcpy ()', 'memset ()', and 'memmove ()' are functions related to memory manipulation. It can contain.

Figure 112018070440862-pat00001
Figure 112018070440862-pat00001

함수 새니타이저(100)를 통해 안전하지 않은 함수 사용을 탐지한 이후, 호출 그래프를 통해 어느 위치에 어떤 함수가 사용되었는지 파악할 수 있다.After detecting the use of an unsafe function through the function sanitizer 100, it is possible to determine which function is used in which position through the call graph.

따라서, 함수 새니타이저(100)의 결과와 소스코드를 손쉽게 비교할 수 있으며, 개발자의 실수 혹은 악의적인 행위로 불필요한 함수가 포함되었는지 및 IDE의 감염으로 인해 소스코드에 존재하지 않은 함수가 포함되어있는지 판단할 수 있는 근거를 제공할 수 있다.Therefore, the result of the function sanitizer 100 can be easily compared with the source code, and whether unnecessary functions are included due to developer mistakes or malicious actions, and whether functions that do not exist in the source code are included due to infection of the IDE. It can provide a basis for judgment.

그리고 포인터 새니타이저(200)를 구체적으로 설명하면 다음과 같다.And the pointer sanitizer 200 in detail as follows.

임베디드 RTOS인 uC/OS의 경우 단일 주소 공간(single address space)으로 구성되어 있어, 포인터 변수에 직접 주소를 입력하고 포인터 연산을 통해 데이터 영역의 메모리 주소 값을 변조할 수 있다.In the case of uC / OS, which is an embedded RTOS, it consists of a single address space, so it is possible to enter the address directly into a pointer variable and modulate the memory address value of the data area through pointer operation.

이와 같은 행위는 일반적으로 임베디드 표준 코딩 규칙이나 PLC 프로그램 매뉴얼에서 제한하고 있는 사항이다.These behaviors are generally restricted by embedded standard coding rules or PLC program manuals.

본 발명에 따른 포인터 새니타이저(200)는 먼저 기계어 코드를 대상으로 수행하고, 필요한 경우 소스 코드 분석을 통해 필요한 정보를 추출하여 수행한다.The pointer sanitizer 200 according to the present invention is first performed on the machine code, and if necessary, extracts and performs necessary information through source code analysis.

포인터 새니타이저(200)에서는 포인터 변수에 직접 주소를 하드코딩하여 할당하는 명령 패턴을 탐지한다.The pointer sanitizer 200 detects a command pattern for hard coded address assignment to a pointer variable.

기계어 코드를 사용하여 포인터 변수의 이상 연산(anomaly operation) 여부를 탐지하기 위해서는 기계어 코드에서 포인터 변수의 사용을 확인할 필요가 있다. In order to detect whether the pointer variable is abnormally operated using the machine code, it is necessary to check the use of the pointer variable in the machine code.

이를 위하여 바이너리 코드를 역어셈블하여, 어셈블리 수준에서 포인터 변수의 이상 사용 패턴을 확인한다.To this end, the binary code is disassembled to check the abnormal usage pattern of the pointer variable at the assembly level.

추가적으로, 포인터 새니타이저(200)의 유효성과 정확도를 개선하기 위해 소스코드와 심볼 정보를 통해 각 태스크의 스택의 범위를 계산하고 각 태스크에 할당된 주소 범위를 벗어난 포인터 연산을 탐지하는 방법도 적용할 수 있다. In addition, to improve the validity and accuracy of the pointer sanitizer 200, a method of calculating the range of each task's stack through source code and symbol information and detecting a pointer operation outside the address range assigned to each task is also applied. can do.

패턴 DB는 포인터 변수 연산을 탐지하는데 필요한 코드 패턴을 관리한다.The pattern DB manages code patterns necessary to detect pointer variable operations.

패턴 DB에 유지할 시그니처를 생성하기 위해 본 발명을 적용하려는 PLC의 CPU용 어셈블리 사용 패턴을 분석한다.In order to generate a signature to be retained in the pattern DB, the assembly usage pattern for the CPU of the PLC to which the present invention is applied is analyzed.

본 발명에서 탐지하고자 하는 패턴은 포인터 변수에 하드코딩된 주소 값을 할당하는 명령(들)과 포인터 변수가 가리키는 주소번지의 값을 변경하는 명령(들)으로 구성된다.The pattern to be detected in the present invention consists of a command (s) for allocating a hardcoded address value to a pointer variable and a command (s) for changing the value of the address address pointed to by the pointer variable.

즉, 포인터 새니타이저(200)는 어셈블리 또는 기계어 코드들의 조합으로 이루어진 패턴을 사용한다.That is, the pointer sanitizer 200 uses a pattern made of a combination of assembly or machine code.

어셈블리 코드만을 사용해서는 하드코딩된 메모리 주소 값을 식별하는 것이 쉽지 않은 경우에는 소스코드를 분석하여 하드코딩된 메모리 주소 값을 식별한다. If it is not easy to identify the hardcoded memory address value using only assembly code, the hardcoded memory address value is identified by analyzing the source code.

포인터 새니타이저(200)는 uC/OS 소스코드와 심볼 정보를 사용하여 태스크들의 스택 위치와 크기를 계산한다.The pointer sanitizer 200 calculates the stack position and size of tasks using uC / OS source code and symbol information.

이후 태스크의 소스코드 내부에 포인터 변수가 있는지를 확인하고, 포인터 변수에 메모리 주소를 하드코딩 하는지 확인한다. 이후 포인터 변수에 입력되는 주소 값이 해당 태스크의 스택 범위를 벗어나는 경우 이를 탐지한다.After that, check if there is a pointer variable inside the source code of the task, and check if the memory address is hard-coded in the pointer variable. Then, it detects when the address value input to the pointer variable is outside the stack range of the task.

이와 같은 구성을 포함하는 본 발명에 따른 코딩 규칙 기반으로 PLC용 안전한 프로그래밍을 지원하기 위한 장치 및 방법의 각 구성 및 동작을 구체적으로 설명하면 다음과 같다.The configuration and operation of the apparatus and method for supporting secure programming for the PLC based on the coding rule according to the present invention including such a configuration will be described in detail as follows.

도 3은 strcpy가 포함 된 uC/OS 코드의 예를 나타낸 구성도이다.3 is a configuration diagram showing an example of uC / OS code including strcpy.

본 발명에 따른 코딩 규칙 기반으로 PLC용 안전한 프로그래밍을 지원하기 위한 장치 및 방법을 적용하기 위하여, 'strcpy()' 함수를 포함하는 간단한 소스코드를 작성하였고, 정상적으로 컴파일 되어 실행 코드가 생성되어 실험용 보드에 다운로드 하였다.Based on the coding rule according to the present invention, in order to apply a device and a method for supporting safe programming for PLC, a simple source code including a 'strcpy ()' function is written, and an execution code is generated and compiled to generate an experimental board. Was downloaded to.

'strcpy()'는 버퍼 오버플로 취약점을 갖는 대표적인 함수로 보안문제 때문에 시큐어 코딩 관점에서도 사용을 자제하도록 권장한다.'strcpy ()' is a typical function that has a buffer overflow vulnerability, and it is recommended to refrain from using it in terms of secure coding because of security problems.

도 3은 'strcpy()'함수가 포함 된 직접 작성한 uC/OS 소스코드 중 일부를 보여준다.Figure 3 shows some of the uC / OS source codes written by hand that include the 'strcpy ()' function.

도 3에서 버퍼 오버플로의 위험이 존재하는 부분은 (1) vul_func 함수 내부의 strcpy() 함수이다.In FIG. 3, the part where the risk of buffer overflow exists (1) is the strcpy () function inside the vul_func function.

(2)부분에서 선언 된 문자열배열 보다 긴 문자열이 strcpy()함수의 두 번째 인자로 들어갈 경우 버퍼 오버플로가 발생하여 개발자가 의도하지 않은 동작이 일어날 수 있다.If a string longer than the string array declared in (2) enters the second argument of the strcpy () function, a buffer overflow occurs, which may cause unintended behavior by the developer.

(1)의 vul_func 함수를 호출하는 (3)부분에서 함수 인자로 매우 긴 문자열을 입력하여 서비스 거부(Denial of Service) 공격이 가능하다.A denial of service attack is possible by entering a very long string as a function argument in (3), which calls the vul_func function in (1).

포인터 연산이 포함된 프로그램에 관하여 설명하면 다음과 같다.The program including the pointer operation is as follows.

도 4는 포인터 연산을 수행하는 코드의 예를 나타낸 구성도이고, 도 5는 포인터 변수 조작을 통한 메모리 값 변조 결과 구성도이다.4 is a block diagram showing an example of a code for performing a pointer operation, and FIG. 5 is a block diagram showing a result of modulating a memory value through manipulation of a pointer variable.

uC/OS의 경우 단일 주소 공간 체계이므로, 포인터 변수를 통해 임의 데이터 영역의 메모리 값을 손쉽게 변조 가능하다.In the case of uC / OS, since it is a single address space system, it is possible to easily modulate the memory value of an arbitrary data area through a pointer variable.

예로, 도 4에서 하나의 태스크(App_Task2)가 다른 태스크(App_Task1)의 함수 포인터 변수를 조작하는 소스코드를 작성하였다.For example, in FIG. 4, source code is written in which one task (App_Task2) manipulates a function pointer variable of another task (App_Task1).

이러한 상황은 임베디드 표준 코딩 규칙에서 금지하는 연산이며, MS Windows나 Linux와 같은 범용 운영체제에서는 허용되지 않는 연산이다. This situation is an operation prohibited by the embedded standard coding rule, and is not allowed in general-purpose operating systems such as MS Windows and Linux.

일반적으로 하나의 태스크가 다른 태스크의 변수를 읽기/쓰기를 수행하지 말아야하지만, (도 4의 포인터 변수의 (4))에 다른 태스크에서 선언된 함수 포인터 변수(도 4의 (3))의 주소를 하드코딩하여 조작함으로써, 최종적으로 함수 포인터 변수 a의 값을 print_hacked()로 변조시킬 수 있다.In general, one task should not read / write the variable of another task, but the address of the function pointer variable ((3) in Figure 4) declared in another task in (4) of the pointer variable in Figure 4 By hard-coding and manipulating, we can finally modulate the value of the function pointer variable a with print_hacked ().

도 5는 다른 태스크에 의해 변조된 함수 포인터 변수의 호출 결과를 보여준다.5 shows the result of calling a function pointer variable modulated by another task.

이를 통해 함수포인터의 값을 변조하여 의도하지 않은 함수를 호출하거나 임의 영역의 메모리 값을 변조하는 공격이 가능하다.Through this, it is possible to call an unintended function by modulating the value of the function pointer, or an attack that modulates the memory value of an arbitrary area.

새니타이저의 구현에 관하여 설명하면 다음과 같다.The implementation of the sanitizer is as follows.

도 6은 uC/OS 태스크의 호출 그래프, 도 7은 도 4에 대한 어셈블리 코드 구성도이다. FIG. 6 is a call graph of a uC / OS task, and FIG. 7 is an assembly code configuration diagram of FIG. 4.

함수 새니타이저를 구현하기 위한 선행사항으로 호출 그래프를 생성해야 한다.As a prerequisite for implementing a function sanitizer, you need to create a call graph.

본 발명의 일 실시 예에서는 TI사에서 제공하는 기계어 코드를 분석하여 함수 호출 그래프를 출력해주는 도구를 사용하였다.In one embodiment of the present invention, a tool that analyzes machine code provided by TI and outputs a function call graph was used.

도 6은 도 3의 의 소스코드가 포함된 기계어 코드로 출력한 함수 호출 그래프 중 태스크의 호출 순서를 보여준다.FIG. 6 shows a call order of a task in a function call graph output in machine language code including the source code of FIG. 3.

도 6을 확인하면 태스크가 동작하면서 호출하는 모든 함수명을 추출할 수 있다.6, it is possible to extract all function names that are called while the task is operating.

함수 새니타이저는 시그니처 DB와 추출한 함수명들을 문자열 비교하여 버퍼 오버플로에 취약한 'strcpy()'함수가 태스크에 포함 되어있는 것을 탐지하여 프로그램 코드 개발자에게 경고해준다.The function sanitizer detects that the 'strcpy ()' function, which is vulnerable to buffer overflow, is included in the task by comparing the signature DB with the extracted function names as a string, and warns the program code developer.

기계어 코드를 대상으로 한 포인터 새니타이저를 적용하기 위해 기계어 코드를 역어셈블하여 어셈블리 코드를 분석한다.In order to apply pointer sanitizer targeting machine code, we disassemble the machine code and analyze the assembly code.

도 7은 도 4의 태스크 소스코드에 대응되는 어셈블리 코드이다.7 is assembly code corresponding to the task source code of FIG. 4.

XAR은 범용레지스터, SP는 스택포인터를 뜻한다.XAR stands for General Purpose Register, and SP stands for Stack Pointer.

도 7의 (1)과 (2)는 함수포인터 변수 a에 함수명으로 주소를 할당하는 것을 나타낸다. (3)과 (4)는 포인터 변수 ptr에 App_Task1의 변수 a의 주소를 하드코딩을 하는 것을 나타낸다. (5)는 포인터 변수 ptr이 가리키는 메모리 주소의 값을 print_hacked()로 변경하는 것을 나타낸다.7 (1) and (2) show that an address is assigned as a function name to the function pointer variable a. (3) and (4) show that the address of the variable a of App_Task1 is hard-coded in the pointer variable ptr. (5) shows that the value of the memory address pointed to by the pointer variable ptr is changed to print_hacked ().

도 7에 나타난 (3)과 (4)의 어셈블리 코드가 포인터 새니타이저에서 검출하려는 패턴일 수 있다. 그러나 (3)과 (4)의 어셈블리 코드와 유사한 패턴은 전체 어셈블리 코드에서 많이 탐지되어 포인터 새니타이징을 위한 패턴으로 적절하지 않다.The assembly codes of (3) and (4) shown in FIG. 7 may be patterns to be detected by the pointer sanitizer. However, a pattern similar to the assembly code of (3) and (4) is detected in the entire assembly code, and is not suitable as a pattern for pointer sanitizing.

예를 들어 (1)과 (2)의 경우 포인터 변수에 하드코딩을 하는 소스코드는 아니지만 (3)과 (4)의 어셈블리 코드와 유사함을 확인할 수 있다.For example, in (1) and (2), it is not the source code that hardcodes the pointer variable, but it can be confirmed that it is similar to the assembly code of (3) and (4).

따라서, 포인터 변수가 가리키는 메모리 주소의 값을 변경하는 (5)의 어셈블리 코드를 추가하여, (3)~(5)의 패턴을 포인터 새니타이저의 탐지 패턴 DB에 추가하였다. 이 패턴을 이용한 실험에서 해당 코드 패턴을를 탐지하는 것을 확인하였다. Therefore, by adding the assembly code of (5) that changes the value of the memory address indicated by the pointer variable, the patterns of (3) to (5) were added to the detection pattern DB of the pointer sanitizer. In the experiment using this pattern, it was confirmed that the corresponding code pattern was detected.

도 8은 포인터 새니타이저를 위한 코드 패턴의 예를 나타낸 구성도이다.8 is a block diagram showing an example of a code pattern for a pointer sanitizer.

도 8은 포인터 변수를 사용한 메모리 값을 변조하는 패턴을 나타낸 것이다. 8 shows a pattern for modulating a memory value using a pointer variable.

도 8의 (2)와 (3)사이 있는 빈 줄(empty line)은, 포인터 변수에 메모리 주소를 할당하고 나서 포인터 변수가 가리키는 메모리 주소 값을 변조하기 전에, 임의의 어셈블리 코드가 수행되는 상황도 고려하고 있음을 보인다.The empty line between (2) and (3) in FIG. 8 is a situation in which arbitrary assembly code is executed after allocating a memory address to the pointer variable and then modulating the memory address value indicated by the pointer variable. Seems to be considering.

(2)번 명령 다음에 메모리 값을 변조하는 시점에 따라 다른 어셈블리 코드가 삽입될 수 있다.Another assembly code may be inserted depending on the time when the memory value is modulated after the command (2).

(3)의 경우 두 번째 피연산자에 따라 연산자가 MOV, MOVL, MOVB 등으로 변할 수 있다.In the case of (3), the operator can be changed to MOV, MOVL, MOVB, etc. according to the second operand.

도 7 및 도 8의 예에서와 같이, 어셈블리 코드만으로 하드코딩된 주소 값을 식별하는 것은 오탐지(false negative) 가능성이 있다.As in the example of FIGS. 7 and 8, identifying a hardcoded address value with only assembly code has the potential for false negatives.

그러나 도 4의 소소 코드를 분석한다면 App_Task2에서만 하드코딩된 주소 값을 사용한다는 것을 쉽게 파악할 수 있다.However, if the source code of FIG. 4 is analyzed, it can be easily understood that only App_Task2 uses a hard-coded address value.

따라서, 소스코드 분석을 동시에 이용한다면 안전하지 않은 포인터 연산 검출의 정확성을 높일 수 있다.Therefore, if the source code analysis is used at the same time, the accuracy of detecting an unsafe pointer operation can be improved.

소스코드와 심볼 정보를 사용한 포인터 새니타이저를 구현하기 위해서는 각 태스크의 스택의 위치와 크기를 확인하는 것이 필요하다. In order to implement pointer sanitizer using source code and symbol information, it is necessary to check the position and size of each task stack.

도 9는 태스크를 생성하는 uC/OS 코드 원형의 예를 나타낸 구성도이다.9 is a configuration diagram showing an example of a uC / OS code prototype for generating a task.

도 9는 uC/OS코드 중 태스크를 생성하는 함수의 원형이다.9 is a prototype of a function for generating a task among uC / OS codes.

도 9에서 태스크를 생성 시 사용되는 첫 번째 인자(App_Task2)은 태스크 코드의 시작점을 가리키는 포인터이며, 세 번째 인자(App_TaskPostStk[])는 태스크 스택의 시작위치를 가리키는 포인터이다.In FIG. 9, the first argument (App_Task2) used when creating the task is a pointer indicating the starting point of the task code, and the third argument (App_TaskPostStk []) is a pointer indicating the starting position of the task stack.

App_TaskPostStk[] 인자가 가리키는 위치는 심볼 정보를 통해 메모리 주소를 확인할 수 있다.The location indicated by the App_TaskPostStk [] argument can check the memory address through symbol information.

추가로 스택의 크기를 지정하는 인자(APP_CFG_TASK_STK_SIZE)의 값을 사용하면, 태스크의 스택 범위를 확인할 수 있다.In addition, if the value of the argument (APP_CFG_TASK_STK_SIZE) that specifies the size of the stack is used, the stack range of the task can be checked.

도 10은 실행 코드에 대한 심볼 정보의 예를 나타낸 구성도이다.10 is a configuration diagram showing an example of symbol information for executable code.

도 10은 실행 코드(executable code)에 대한 심볼 정보의 일부이다.10 is a part of symbol information for executable code.

이를 통해 태스크 스택의 시작위치를 구해, 스택의 범위를 계산할 수 있다. Through this, the starting position of the task stack can be obtained and the range of the stack can be calculated.

도 10의 정보를 이용하여 App_Task2의 스택 범위는 0xe040 ~ 0xe1c0임을 확인할 수 있다.Using the information in FIG. 10, it can be confirmed that the stack range of App_Task2 is 0xe040 to 0xe1c0.

이 정보를 이용하여 도 4의 App_Task2에서 포인터 변수 ptr에 메모리 주소 값을 직접 하드코딩 하는 경우는 App_Task2의 스택범위가 아니므로 이를 탐지하여 프로그램 코드 개발자에게 경고해준다.If the memory address value is hard-coded directly in the pointer variable ptr in App_Task2 in FIG. 4 using this information, it is not the stack range of App_Task2 and detects this to warn the program code developer.

이상에서 설명한 본 발명에 따른 코딩 규칙 기반으로 PLC용 안전한 프로그래밍을 지원하기 위한 장치 및 방법은 uC/OS를 사용하는 PLC의 보안성을 강화하기 위해, PLC로 직접 다운로드 될 실행 코드(executable code)를 검사하여 프로그램 코드 개발자가 의도하지 않은 취약한 라이브러리 함수와 포인터 연산을 탐지하는 실행코드 새니타이저를 구현한 것이다.An apparatus and method for supporting secure programming for a PLC based on the coding rule according to the present invention described above, in order to enhance security of a PLC using uC / OS, execute code to be downloaded directly to the PLC. It implements an executable code sanitizer that detects and detects vulnerable library functions and pointer operations that are not intended by program code developers.

본 발명에 의해 개발자의 실수로 부적합한 함수와 포인터 연산을 사용하거나, 악성코드에 감염된 IDE가 악성 라이브러리 함수를 임의로 추가하는 경우에도 사전 탐지하여, PLC의 보안성을 강화할 수 있다.According to the present invention, it is possible to enhance the security of the PLC by pre-detecting even when a developer accidentally uses an inappropriate function and pointer operation, or when an IDE infected with malicious code randomly adds a malicious library function.

이상에서의 설명에서와 같이 본 발명의 본질적인 특성에서 벗어나지 않는 범위에서 변형된 형태로 본 발명이 구현되어 있음을 이해할 수 있을 것이다.It will be understood that the present invention is implemented in a modified form without departing from the essential characteristics of the present invention as described above.

그러므로 명시된 실시 예들은 한정적인 관점이 아니라 설명적인 관점에서 고려되어야 하고, 본 발명의 범위는 전술한 설명이 아니라 특허청구 범위에 나타나 있으며, 그와 동등한 범위 내에 있는 모든 차이점은 본 발명에 포함된 것으로 해석되어야 할 것이다.Therefore, the specified embodiments should be considered in terms of explanation rather than limitation, and the scope of the present invention is shown in the claims rather than the foregoing description, and all differences within the equivalent range are included in the present invention. Should be interpreted.

100. 함수 새니타이저
200. 포인터 새니타이저
100. Function sanitizer
200. Pointer Sanitizer

Claims (19)

실행 코드로부터 호출 그래프를 생성하고 PLC에 악영향을 줄 수 있는 표준 라이브러리 함수나 코딩규칙 매뉴얼에서 허용하지 않는 함수들을 탐지하는 함수 새니타이저;
실행코드를 역어셈블(disassemble)한 후 포인터 변수에 대한 이상 연산(anomaly operation) 패턴을 탐지하고, 소스코드와 심볼 정보를 이용하여 보안 및 안전에 위협이 될 수 있는 메모리 값 설정이나 변경을 탐지는 포인터 새니타이저;
상기 함수 새니타이저와 포인터 새니타이저를 포함하고 실행코드 새니타이저가 구성되어,
상기 실행코드 새니타이저는 통합개발환경(IDE)에서 실행 코드(executable code)를 PLC로 다운로드하기 전에 정적으로 분석하여, 상기 함수 새니타이저가 탐지한 PLC에 악영향을 줄 수 있는 표준 라이브러리 함수 및 코딩규칙 매뉴얼에서 허용하지 않는 함수들, 상기 포인터 새니타이저가 탐지한 보안 및 안전에 위협이 될 수 있는 메모리 값 설정이나 변경을 식별하여 제거할 수 있도록 하는 것을 특징으로 하는 코딩 규칙 기반으로 PLC용 안전한 프로그래밍을 지원하기 위한 장치.
A function sanitizer that generates call graphs from executable code and detects functions that are not allowed in the standard library functions or coding rules manual that can adversely affect the PLC;
After disassembling the execution code, it detects anomaly operation patterns for pointer variables, and uses source code and symbol information to detect memory value settings or changes that can be a threat to security and safety. Pointer sanitizer;
The function sanitizer and the pointer sanitizer, and the execution code sanitizer is configured,
The executable code sanitizer is statically analyzed before downloading the executable code from the integrated development environment (IDE) to the PLC, and standard library functions and coding rules that can adversely affect the PLC detected by the function sanitizer Secure programming for PLC based on coding rules characterized by allowing functions that are not allowed in the manual to be identified and removed by setting or changing memory values that may threaten security and safety detected by the pointer sanitizer. Device to support.
제 1 항에 있어서, 상기 함수 새니타이저는,
프로그램 코드 개발자가 개발한 실행 코드로 표현되는 태스크의 함수 리스트를 시그니처 DB(Database)와 비교를 하고,
태스크의 함수 리스트는 상기 실행코드로부터 생성된 호출 그래프를 통하여 추출된 함수 명을 포함하는 것을 특징으로 하는 코딩 규칙 기반으로 PLC용 안전한 프로그래밍을 지원하기 위한 장치.
The method of claim 1, wherein the function sanitizer,
Compare the function list of the task represented by the execution code developed by the program code developer with the signature DB (Database),
The function list of the task includes a function name extracted through the call graph generated from the execution code, and is a device for supporting secure programming for PLC based on coding rules.
제 2 항에 있어서, 시그니처 DB는 개발 매뉴얼에서 허용하지 않는 표준 함수나 보안 관점에서 취약한 표준 함수 명을 시그니처로 관리하는 것을 특징으로 하는 코딩 규칙 기반으로 PLC용 안전한 프로그래밍을 지원하기 위한 장치.3. The apparatus of claim 2, wherein the signature DB manages a standard function name that is not allowed in a development manual or a weak standard function name as a signature, and is based on a coding rule. 제 2 항에 있어서, 상기 함수 새니타이저에서의 보안 및 안전에 악영향을 줄 수 있는 함수 리스트는 'Buffer Overflow 취약 함수'와 'Memory 취약성 관련 함수'로 구성되고,
Buffer Overflow 취약 함수로 'trcat()',trcpy()’, ‘strncpy()’, ‘sprintf()’, ‘vsprintf()’, ‘gets()’, ‘fscanf()’, ‘scanf()’를 포함하고,
memory 취약성 관련 함수로 ‘calloc()’, ‘free()’, ‘malloc()’, ‘realloc()’, ‘memcpy()’, ‘memset()’, ‘memmove()’를 포함하는 것을 특징으로 하는 코딩 규칙 기반으로 PLC용 안전한 프로그래밍을 지원하기 위한 장치.
According to claim 2, The function list that can adversely affect the security and safety in the function sanitizer is composed of 'Buffer Overflow vulnerability function' and 'Memory vulnerability related function',
Buffer Overflow vulnerable functions such as ' trcat () ', trcpy () ',' strncpy () ',' sprintf () ',' vsprintf () ',' gets () ',' fscanf () ', and' scanf () '
Memory vulnerability related functions include 'calloc ()', 'free ()', 'malloc ()', 'realloc ()', 'memcpy ()', 'memset ()', and 'memmove ()' Device to support secure programming for PLC based on the coding rule.
제 1 항에 있어서, 상기 함수 새니타이저는,
상기 실행 코드(executable code)로부터 호출 그래프를 생성하고, 생성된 호출 그래프로부터 시스템 및 프로그램 코드 개발자가 사용하는 함수 명 및 함수 간 호출 관계를 분석하고,
프로그램 코드 개발자가 개발한 실행 코드로 표현되는 태스크의 함수 리스트를 시그니처 DB(Database)와 비교를 하여 PLC에 악영향을 줄 수 있는 표준 라이브러리 함수나 코딩규칙 매뉴얼에서 허용하지 않는 함수들을 탐지한 이후, 호출 그래프를 통해 어느 위치에 어떤 함수가 사용되었는지 함수 새니타이저가 파악을 하여,
함수 새니타이저에서 파악한 결과와 소스코드를 비교하여 프로그램 코드 개발자에 의해 PLC에 악영향을 줄 수 있는 표준 라이브러리 함수나 코딩규칙 매뉴얼에서 허용하지 않는 함수들이 포함되었는지 판단하는 것을 특징으로 하는 코딩 규칙 기반으로 PLC용 안전한 프로그래밍을 지원하기 위한 장치.
The method of claim 1, wherein the function sanitizer,
Generate a call graph from the executable code, analyze the function names and call relationships between functions used by system and program code developers from the generated call graph,
After comparing the function list of the task represented by the execution code developed by the program code developer with the signature DB (Database), after detecting the standard library functions that can adversely affect the PLC or functions that are not allowed in the coding rules manual, Through the graph, the function sanitizer determines which function is used at which position,
Based on the coding rule characterized by comparing the results obtained by the function sanitizer with the source code and determining whether standard library functions that can adversely affect the PLC by program code developers or functions that are not allowed in the coding rule manual are included. Device to support secure programming for PLC.
제 1 항에 있어서, 상기 포인터 새니타이저는,
실행코드를 대상으로 포인터 변수에 대한 이상 연산(anomaly operation) 패턴 탐지 동작을 수행하고,
실행코드를 대상으로 한 이상 연산(anomaly operation) 패턴 탐지가 어려운 경우 소스 코드 분석을 통해 이상 연산(anomaly operation) 패턴 탐지에 필요한 정보를 추출하고,
포인터 변수에 직접 주소를 하드코딩하여 특정 값을 설정하는 명령 패턴을 탐지하는 것을 특징으로 하는 코딩 규칙 기반으로 PLC용 안전한 프로그래밍을 지원하기 위한 장치.
According to claim 1, The pointer sanitizer,
Performs anomaly operation pattern detection operation on the pointer variable targeting the execution code,
If it is difficult to detect anomaly operation pattern targeting the execution code, the information necessary for anomaly operation pattern detection is extracted through source code analysis,
A device to support secure programming for PLC based on coding rules, characterized in that it detects a command pattern that sets a specific value by hardcoding an address directly into a pointer variable.
제 6 항에 있어서, 상기 포인터 새니타이저는,
소스코드와 심볼 정보를 통해 프로그램 코드 개발자가 개발한 실행 코드로 표현되는 각 태스크의 스택의 범위를,
태스크 코드의 시작점을 가리키는 포인터인 인자(App_Task2), 태스크 스택의 시작위치를 가리키는 포인터인 인자(App_TaskPostStk[])를 이용하여,
App_TaskPostStk[]가 가리키는 위치는 심볼 정보를 통해 메모리 주소를 확인하고, 스택의 크기를 지정하는 인자(APP_CFG_TASK_STK_SIZE)의 값을 사용하여 태스크의 스택 범위를 확인하여 계산하고,
각 태스크에 할당된 주소 범위를 벗어난 포인터 연산을 탐지하여 유효성과 정확도를 개선하는 것을 특징으로 하는 코딩 규칙 기반으로 PLC용 안전한 프로그래밍을 지원하기 위한 장치.
The method of claim 6, wherein the pointer sanitizer,
Through the source code and symbol information, the scope of each task's stack is expressed as executable code developed by the program code developer.
Using the argument (App_Task2) as a pointer to the starting point of the task code, and the argument (App_TaskPostStk []) as a pointer to the starting position of the task stack,
The location indicated by App_TaskPostStk [] is calculated by checking the stack address of the task using the value of the argument (APP_CFG_TASK_STK_SIZE) that identifies the memory address through symbol information, and
A device for supporting secure programming for PLC based on coding rules, which is characterized by improving the validity and accuracy by detecting pointer operations outside the range of addresses assigned to each task.
제 7 항에 있어서, 상기 포인터 새니타이저는,
포인터 변수 연산을 탐지하는데 필요한 코드 패턴을 관리하는 패턴 DB를 포함하고,
패턴 DB에 유지할 시그니처를 생성하기 위해 적용 대상 PLC의 CPU용 어셈블리 사용 패턴을 분석하는 것을 특징으로 하는 코딩 규칙 기반으로 PLC용 안전한 프로그래밍을 지원하기 위한 장치.
The pointer sanitizer of claim 7,
Includes a pattern DB that manages the code patterns needed to detect pointer variable operations,
Device for supporting secure programming for PLC based on coding rules, characterized by analyzing the assembly usage pattern for the CPU of the target PLC to generate the signature to be maintained in the pattern DB.
제 8 항에 있어서, 상기 포인터 새니타이저에서 탐지하고자 하는 패턴은,
포인터 변수에 하드코딩된 주소 값을 할당하는 명령들과 포인터 변수가 가리키는 주소번지의 값을 변경하는 명령들로 구성되는 것을 특징으로 하는 코딩 규칙 기반으로 PLC용 안전한 프로그래밍을 지원하기 위한 장치.
According to claim 8, The pattern to be detected by the pointer sanitizer,
A device for supporting secure programming for PLC based on coding rules, characterized by consisting of instructions for assigning hardcoded address values to pointer variables and instructions for changing the address address value pointed to by pointer variables.
제 9 항에 있어서, 상기 포인터 새니타이저는,
기계어 코드를 대상으로 한 포인터 새니타이저를 적용하기 위해 기계어 코드를 역어셈블하여 어셈블리 코드 분석을 하고,
포인터 변수에 대한 이상 연산(anomaly operation) 패턴 탐지 동작 수행시에,
어셈블리 코드만을 사용해서 하드코딩된 메모리 주소 값을 식별하거나,
소스코드를 분석하여 하드코딩된 메모리 주소 값을 식별하는 것을 특징으로 하는 코딩 규칙 기반으로 PLC용 안전한 프로그래밍을 지원하기 위한 장치.
The pointer sanitizer of claim 9,
In order to apply pointer sanitizer targeting machine code, we assemble machine code and analyze assembly code.
When performing anomaly operation pattern detection operation on a pointer variable,
Identifies hard-coded memory address values using only assembly code, or
A device for supporting secure programming for PLC based on coding rules, characterized by analyzing the source code and identifying hard-coded memory address values.
삭제delete 통합개발환경(IDE)에서 실행 코드(executable code)를 PLC로 다운로드하기 전에 정적으로 분석하여, 함수 새니타이저가 탐지한 PLC에 악영향을 줄 수 있는 표준 라이브러리 함수나 코딩규칙 매뉴얼에서 허용하지 않는 함수을 식별하여 제거할 수 있도록 하기 위하여,
함수 새니타이저가 실행 코드(executable code)로부터 호출 그래프를 생성하는 단계;
생성된 호출 그래프로부터 시스템 및 프로그램 코드 개발자가 사용하는 함수 명 및 함수 간 호출 관계를 분석하는 단계;
프로그램 코드 개발자가 개발한 실행 코드로 표현되는 태스크의 함수 리스트를 시그니처 DB(Database)와 비교를 하는 단계;
PLC에 악영향을 줄 수 있는 표준 라이브러리 함수나 코딩규칙 매뉴얼에서 허용하지 않는 함수들을 탐지하고, 호출 그래프를 통해 어느 위치에 어떤 함수가 사용되었는지 함수 새니타이저가 파악을 하는 단계;
함수 새니타이저에서 파악한 결과와 소스코드를 비교하여 프로그램 코드 개발자에 의해 PLC에 악영향을 줄 수 있는 표준 라이브러리 함수나 코딩규칙 매뉴얼에서 허용하지 않는 함수들이 포함되었는지 판단하는 단계;를 수행하는 것을 특징으로 하는 코딩 규칙 기반으로 PLC용 안전한 프로그래밍을 지원하기 위한 방법.
By analyzing the executable code in the integrated development environment (IDE) before downloading it to the PLC, it identifies the standard library functions that can adversely affect the PLC detected by the function sanitizer or functions that are not allowed in the coding rules manual. In order to be able to remove it,
A function sanitizer generating a call graph from executable code;
Analyzing function names and call relationships between functions used by system and program code developers from the generated call graph;
Comparing a function list of a task represented by executable code developed by a program code developer with a signature DB (Database);
Detecting standard library functions that may adversely affect the PLC or functions that are not allowed in the coding rule manual, and using a call graph to determine which functions are used at which positions;
And comparing the results obtained by the function sanitizer with the source code to determine whether standard library functions that can adversely affect the PLC by program code developers or functions that are not allowed in the coding rule manual are included. A method to support secure programming for PLC based on coding rules.
제 12 항에 있어서, 시그니처 DB는 개발 매뉴얼에서 허용하지 않는 표준 함수나 보안 관점에서 취약한 표준 함수 명을 시그니처로 관리하는 것을 특징으로 하는 코딩 규칙 기반으로 PLC용 안전한 프로그래밍을 지원하기 위한 방법.13. The method of claim 12, wherein the signature DB manages a standard function name that is not allowed in a development manual or a weak standard function name as a signature based on a coding rule. 제 12 항에 있어서, 상기 함수 새니타이저에서의 보안 및 안전에 악영향을 줄 수 있는 함수 리스트는 'Buffer Overflow 취약 함수'와 'Memory 취약성 관련 함수'로 구성되고,
Buffer Overflow 취약 함수로 'trcat()',trcpy()’, ‘strncpy()’, ‘sprintf()’, ‘vsprintf()’, ‘gets()’, ‘fscanf()’, ‘scanf()’를 포함하고,
memory 취약성 관련 함수로 ‘calloc()’, ‘free()’, ‘malloc()’, ‘realloc()’, ‘memcpy()’, ‘memset()’, ‘memmove()’를 포함하는 것을 특징으로 하는 코딩 규칙 기반으로 PLC용 안전한 프로그래밍을 지원하기 위한 방법.
The function list of claim 12, wherein the function list that can adversely affect security and safety in the function sanitizer is composed of a 'Buffer Overflow vulnerable function' and a 'Memory vulnerability related function'.
Buffer Overflow vulnerable functions such as ' trcat () ', trcpy () ',' strncpy () ',' sprintf () ',' vsprintf () ',' gets () ',' fscanf () ', and' scanf () '
Memory vulnerability related functions include 'calloc ()', 'free ()', 'malloc ()', 'realloc ()', 'memcpy ()', 'memset ()', and 'memmove ()' A method for supporting secure programming for PLC based on the coding rule.
통합개발환경(IDE)에서 실행 코드(executable code)를 PLC로 다운로드하기 전에 정적으로 분석하여 포인터 새니타이저가 탐지한 보안 및 안전에 위협이 될 수 있는 메모리 값 설정이나 변경을 식별하여 제거할 수 있도록 하기 위하여,
포인터 새니타이저가 소스코드와 심볼 정보를 통해 프로그램 코드 개발자가 개발한 실행 코드로 표현되는 각 태스크의 스택의 범위를, 태스크 코드의 시작점을 가리키는 포인터인 인자(App_Task2), 태스크 스택의 시작위치를 가리키는 포인터인 인자(App_TaskPostStk[])를 이용하여, App_TaskPostStk[]가 가리키는 위치는 심볼 정보를 통해 메모리 주소를 확인하고, 스택의 크기를 지정하는 인자(APP_CFG_TASK_STK_SIZE)의 값을 사용하여 태스크의 스택 범위를 확인하여 계산하는 단계;
태스크의 소스코드 내부에 포인터 변수가 있는지를 확인하고, 포인터 변수에 메모리 주소를 하드코딩 하는지 확인하는 단계;
포인터 변수에 입력되는 주소 값이 해당 태스크의 스택 범위를 벗어나는 경우 이를 탐지하는 단계;를 포함하는 것을 특징으로 하는 코딩 규칙 기반으로 PLC용 안전한 프로그래밍을 지원하기 위한 방법.
In the integrated development environment (IDE), the executable code is statically analyzed before being downloaded to the PLC so that the pointer sanitizer can detect and remove the memory value setting or change that may be a threat to security and safety. in order to,
Pointer The range of each task's stack represented by the execution code developed by the program code developer through source code and symbol information through the source code and symbol information, the argument (App_Task2) that points to the starting point of the task code, and the starting position of the task stack. Using the pointer argument (App_TaskPostStk []), the location indicated by App_TaskPostStk [] checks the memory address through symbol information, and the task's stack range is checked using the value of the argument specifying the stack size (APP_CFG_TASK_STK_SIZE). To calculate;
Checking whether a pointer variable exists in the source code of the task, and checking whether a memory address is hard-coded in the pointer variable;
A method for supporting secure programming for a PLC based on a coding rule, comprising: detecting when the address value input to the pointer variable is outside the stack range of the corresponding task.
제 15 항에 있어서, 상기 포인터 새니타이저는,
실행코드를 대상으로 포인터 변수에 대한 이상 연산(anomaly operation) 패턴 탐지 동작을 수행하고,
실행코드를 대상으로 한 이상 연산(anomaly operation) 패턴 탐지가 어려운 경우 소스 코드 분석을 통해 이상 연산(anomaly operation) 패턴 탐지에 필요한 정보를 추출하고,
포인터 변수에 직접 주소를 하드코딩하여 특정 값을 설정하는 명령 패턴을 탐지하는 것을 특징으로 하는 코딩 규칙 기반으로 PLC용 안전한 프로그래밍을 지원하기 위한 방법.
The pointer sanitizer of claim 15,
Performs anomaly operation pattern detection operation on the pointer variable targeting the execution code,
If it is difficult to detect anomaly operation pattern targeting the execution code, the information necessary for anomaly operation pattern detection is extracted through source code analysis,
A method for supporting secure programming for PLC based on coding rules, characterized by detecting a command pattern that sets a specific value by hardcoding an address directly into a pointer variable.
제 16 항에 있어서, 상기 포인터 새니타이저는,
포인터 변수 연산을 탐지하는데 필요한 코드 패턴을 관리하는 패턴 DB를 포함하고,
패턴 DB에 유지할 시그니처를 생성하기 위해 적용 대상 PLC의 CPU용 어셈블리 사용 패턴을 분석하는 것을 특징으로 하는 코딩 규칙 기반으로 PLC용 안전한 프로그래밍을 지원하기 위한 방법.
The pointer sanitizer of claim 16,
Includes a pattern DB that manages the code patterns needed to detect pointer variable operations,
A method for supporting secure programming for PLC based on coding rules, characterized by analyzing the assembly usage pattern for the CPU of the target PLC to generate the signature to be maintained in the pattern DB.
제 16 항에 있어서, 상기 포인터 새니타이저에서 탐지하고자 하는 패턴은,
포인터 변수에 하드코딩된 주소 값을 할당하는 명령들과 포인터 변수가 가리키는 주소번지의 값을 변경하는 명령들로 구성되는 것을 특징으로 하는 코딩 규칙 기반으로 PLC용 안전한 프로그래밍을 지원하기 위한 방법.
The method of claim 16, wherein the pattern to be detected by the pointer sanitizer is:
A method for supporting secure programming for PLC based on coding rules, which consists of instructions for assigning hardcoded address values to pointer variables and instructions for changing the address address value pointed to by pointer variables.
제 16 항에 있어서, 상기 포인터 새니타이저는,
기계어 코드를 대상으로 한 포인터 새니타이저를 적용하기 위해 기계어 코드를 역어셈블하여 어셈블리 코드 분석을 하고,
포인터 변수에 대한 이상 연산(anomaly operation) 패턴 탐지 동작 수행시에,
어셈블리 코드만을 사용해서 하드코딩된 메모리 주소 값을 식별하거나,
소스코드를 분석하여 하드코딩된 메모리 주소 값을 식별하는 것을 특징으로 하는 코딩 규칙 기반으로 PLC용 안전한 프로그래밍을 지원하기 위한 방법.
The pointer sanitizer of claim 16,
In order to apply pointer sanitizer targeting machine code, we assemble machine code and analyze assembly code.
When performing anomaly operation pattern detection operation on a pointer variable,
Identifies hard-coded memory address values using only assembly code, or
A method for supporting secure programming for PLC based on coding rules, characterized by analyzing the source code and identifying hard-coded memory address values.
KR1020180082909A 2018-07-17 2018-07-17 System and Method for Supporting Secure Programming for PLC based on Coding Rule KR102117012B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020180082909A KR102117012B1 (en) 2018-07-17 2018-07-17 System and Method for Supporting Secure Programming for PLC based on Coding Rule

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020180082909A KR102117012B1 (en) 2018-07-17 2018-07-17 System and Method for Supporting Secure Programming for PLC based on Coding Rule

Publications (2)

Publication Number Publication Date
KR20200008799A KR20200008799A (en) 2020-01-29
KR102117012B1 true KR102117012B1 (en) 2020-05-29

Family

ID=69322381

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020180082909A KR102117012B1 (en) 2018-07-17 2018-07-17 System and Method for Supporting Secure Programming for PLC based on Coding Rule

Country Status (1)

Country Link
KR (1) KR102117012B1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102337711B1 (en) * 2021-04-16 2021-12-08 유수정 Measurement data extraction device of protocol unknown type measurement equipment using ai including embedded protocol analyzer

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101479516B1 (en) 2014-03-05 2015-01-07 소프트포럼 주식회사 Source code security weakness detection apparatus and method
KR101583932B1 (en) * 2014-05-20 2016-01-11 한양대학교 산학협력단 Signature generation apparatus for generating signature of program and the method, malicious code detection apparatus for detecting malicious code of signature and the method
KR20160082644A (en) 2014-12-30 2016-07-08 충남대학교산학협력단 Method and apparatus for detecting malware by code block classification
KR20150100586A (en) * 2015-08-07 2015-09-02 단국대학교 산학협력단 Appratus for detectiing similarity of software and method thereof
KR20180010053A (en) 2016-07-20 2018-01-30 주식회사 이븐스타 Extraction system and method of risk code for vulnerability analysis

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
김동욱외 3인, 'PLC 기반의 제어시스템 취약점 분석 방법' 정보보호학회지 제25권 제5호, pp.26-36, 2015.10.
손준익 외 3인, 'NuSCPI: 원자력발전소의 디지털 계측보호 소프트웨어를 대상으로 개발된 Safety Case pattern 작성을 위한 Case 연구' 한국정보과학회 2017 한국소프트웨어 종합 학술대회 논문집 pp.545-547, 2017.12.

Also Published As

Publication number Publication date
KR20200008799A (en) 2020-01-29

Similar Documents

Publication Publication Date Title
Peng et al. {X-Force}:{Force-Executing} binary programs for security applications
Abbasi et al. ECFI: Asynchronous control flow integrity for programmable logic controllers
US10055585B2 (en) Hardware and software execution profiling
CN101853200B (en) High-efficiency dynamic software vulnerability exploiting method
Zubair et al. PEM: Remote forensic acquisition of PLC memory in industrial control systems
CN109522235B (en) Privacy disclosure detection method for android dynamic loading
WO2014193523A1 (en) Intra stack frame randomization for protecting applications against code injection attack
Chao et al. An android application vulnerability mining method based on static and dynamic analysis
Shaw et al. Automatically fixing c buffer overflows using program transformations
Arzt et al. The soot-based toolchain for analyzing android apps
KR102117012B1 (en) System and Method for Supporting Secure Programming for PLC based on Coding Rule
Graa et al. Protection against code obfuscation attacks based on control dependencies in android systems
Chekole et al. Enforcing full-stack memory-safety in cyber-physical systems
Hawkins et al. Dynamic canary randomization for improved software security
Bai et al. idea: Static analysis on the security of apple kernel drivers
Situ et al. Vanguard: Detecting missing checks for prognosing potential vulnerabilities
Chen et al. Brick: A binary tool for run-time detecting and locating integer-based vulnerability
CN110717181B (en) Non-control data attack detection method and device based on novel program dependency graph
Coudray et al. PICON: control flow integrity on LLVM IR
Gustafson et al. Shimware: Toward Practical Security Retrofitting for Monolithic Firmware Images
Kwon et al. Static detection of unsafe component loadings
El-Zoghby et al. NG-MVEE: A New Proposed Hybrid Technique for Enhanced Mitigation of Code Re-use Attack
GB2617719A (en) RISC-V mechanism and O-CFI mechanism-based defense method and apparatus for code reuse attacks
Belleville et al. KALD: Detecting direct pointer disclosure vulnerabilities
Shahriar et al. Rule-based source level patching of buffer overflow vulnerabilities

Legal Events

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