KR102469399B1 - Attack detection system of can network, attack detection method of can network and computer program stored in a recording medium to execute the method - Google Patents

Attack detection system of can network, attack detection method of can network and computer program stored in a recording medium to execute the method Download PDF

Info

Publication number
KR102469399B1
KR102469399B1 KR1020210120951A KR20210120951A KR102469399B1 KR 102469399 B1 KR102469399 B1 KR 102469399B1 KR 1020210120951 A KR1020210120951 A KR 1020210120951A KR 20210120951 A KR20210120951 A KR 20210120951A KR 102469399 B1 KR102469399 B1 KR 102469399B1
Authority
KR
South Korea
Prior art keywords
packet
packets
analysis target
network
attack
Prior art date
Application number
KR1020210120951A
Other languages
Korean (ko)
Inventor
조효진
신지우
김형훈
Original Assignee
숭실대학교산학협력단
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 숭실대학교산학협력단 filed Critical 숭실대학교산학협력단
Priority to KR1020210120951A priority Critical patent/KR102469399B1/en
Application granted granted Critical
Publication of KR102469399B1 publication Critical patent/KR102469399B1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1408Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic by monitoring network traffic
    • H04L63/1416Event detection, e.g. attack signature detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/40052High-speed IEEE 1394 serial bus
    • H04L12/40104Security; Encryption; Content protection
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/04Processing captured monitoring data, e.g. for logfile generation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40215Controller Area Network CAN

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Artificial Intelligence (AREA)
  • Physics & Mathematics (AREA)
  • Medical Informatics (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Evolutionary Computation (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computer Hardware Design (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

A disclosed attack detection system of a CAN network controlled through a CAN method according to one embodiment of the present invention comprises a processor configured to determine whether or not an attack is performed in units of CAN packets based on CAN packets of the CAN network. The processor is configured to determine a predetermined number of CAN packets from among the plurality of CAN packets as analysis target packets based on the order of generation of the CAN packets; determine an analysis target time based on a difference between a generation time of the first generated analysis target packet and a generation time of the latest generated analysis target packet; determine one or more analysis target packets including the same data among the analysis target packets as the same data packets; and determine whether or not an attack is performed in units of the CAN packets for the CAN network based on the analysis target time and the number of the same data packets. Accordingly, the present invention can contribute to the detection of hacking attacks.

Description

CAN 네트워크의 공격 탐지 시스템, CAN 네트워크의 공격 탐지 방법 및 CAN 네트워크의 공격 탐지 방법을 실행시키도록 기록매체에 저장된 컴퓨터 프로그램{ATTACK DETECTION SYSTEM OF CAN NETWORK, ATTACK DETECTION METHOD OF CAN NETWORK AND COMPUTER PROGRAM STORED IN A RECORDING MEDIUM TO EXECUTE THE METHOD}A computer program stored in a recording medium to execute an attack detection system of a CAN network, a method of detecting an attack of a CAN network, and a method of detecting an attack of a CAN network RECORDING MEDIUM TO EXECUTE THE METHOD}

본 발명은 CAN 네트워크에 대한 공격을 탐지하는 시스템 및 방법에 관한 발명으로, 상세하게는 복수의 CAN 패킷 중에서 특정한 CAN 패킷이 CAN 네트워크에 대한 공격에 이용된 패킷인지 여부를 탐지할 수 있는 공격 탐지 시스템 및 공격 탐지 방법에 관한 것이다.The present invention relates to a system and method for detecting an attack on a CAN network, and more specifically, an attack detection system capable of detecting whether a specific CAN packet among a plurality of CAN packets is a packet used for an attack on a CAN network. and an attack detection method.

차량 내 전자 장치들은 차량용 통신 네트워크를 통해 데이터를 송수신할 수 있다. 최근 차량에 다양한 옵션이 적용되고 그에 따라 차량 내에 설치되는 전장 부품과 통신 네트워크의 복잡도가 증가하고 있다.In-vehicle electronic devices may transmit and receive data through an in-vehicle communication network. Recently, various options are applied to vehicles, and accordingly, the complexity of electric parts and communication networks installed in vehicles is increasing.

일반적으로, 차량 내 전자 장치들의 제어기(ECU; Electronic Control Unit)들은 CAN(Controller Area Network)를 이용하여 서로 통신한다. 즉, 차량의 전자 장치들은 CAN 버스를 통해서 서로 간에 데이터를 주고받음으로써 다양한 기능을 수행한다.In general, electronic control units (ECUs) of electronic devices in a vehicle communicate with each other using a controller area network (CAN). That is, the electronic devices of the vehicle perform various functions by exchanging data with each other through the CAN bus.

CAN은 데이터 프레임 내에 데이터에 대한 암호화 적용 부재와 송신하는 대상에 대한 인증 필드 부재로 인해 패킷 삽입 공격에 취약하다. 이러한 공격에 대응하기 위해 많은 침입 탐지 시스템(Intrusion Detection System; IDS)이 개발되고 있다. 현재까지 개발된 침입 탐지 시스템은 Datalink layer 기반 IDS와 Physical layer 기반 IDS로 나뉘어진다.CAN is vulnerable to packet injection attacks due to the absence of encryption applied to data within data frames and the absence of authentication fields for transmission targets. To counter these attacks, many Intrusion Detection Systems (IDS) are being developed. Intrusion detection systems developed so far are divided into Datalink layer based IDS and Physical layer based IDS.

Physical layer 기반 IDS는 하드웨어 기반 IDS이며 연구는 아날로그 신호 입력 채널이 있는 오실로스코프 장비를 사용하는데 이는 측정 시 자동차의 운행 환경(e.g. 온도, 습도 등)에 영향을 받는다는 한계가 존재한다.Physical layer-based IDS is a hardware-based IDS, and the research uses oscilloscope equipment with analog signal input channels, which has limitations in that it is affected by the vehicle's operating environment (e.g. temperature, humidity, etc.) during measurement.

Datalink layer 기반 IDS는 CAN 메시지 기반 IDS이며 기존 연구에서는 네트워크 패킷 주기만을 이용하여 침입 여부를 탐지하는데 이는 실제 차량에선 정상인 패킷 주기가 일정하지 않은 경우가 빈번하여 오탐율이 높다는 문제가 있다.Datalink layer-based IDS is CAN message-based IDS, and in previous studies, it detects intrusion using only the network packet period. This has a problem in that the false positive rate is high because the packet period, which is normal in real vehicles, is not constant.

따라서, CAN 방식을 통해 제어되는 CAN 네트워크에 대한 공격을 보다 더 정확하게 탐지할 수 있는 기술이 필요하다.Therefore, a technique capable of more accurately detecting an attack on a CAN network controlled through a CAN scheme is required.

본 발명은 CAN 네트워크의 CAN 패킷들에 포함된 정보를 분석하고, 해당 CAN 패킷의 상태가 정상인지 여부를 판단하여 CAN 패킷 단위에 대한 공격이 있는지 여부를 알아낼 수 있어서 안전한 차량의 운행을 가능하게 하는 공격 탐지 시스템 및 공격 탐지 방법을 제공하기 위한 것이다.The present invention analyzes information included in CAN packets of a CAN network, determines whether the state of the corresponding CAN packet is normal, and finds out whether there is an attack on the CAN packet unit, thereby enabling safe vehicle operation. It is to provide an attack detection system and an attack detection method.

또한, 본 발명은 특히 CAN 네트워크에서 특정 기능을 수행하는 Arbitration ID를 대상으로 공격자가 원하는 기능을 수행하도록 CAN 메시지를 생성해 주입하는 공격인 Spoofing Attack의 공격 패킷을 탐지할 수 있어서 해킹 공격의 탐지에 기여할 수 있는 공격 탐지 시스템 및 공격 탐지 방법을 제공하기 위한 것이다.In addition, the present invention can detect attack packets of spoofing attack, which is an attack in which a CAN message is generated and injected to perform a function desired by an attacker targeting an arbitration ID performing a specific function in a CAN network. It is to provide an attack detection system and an attack detection method that can contribute.

개시된 발명의 일 측면에 따른 CAN 방식을 통해 제어되는 CAN 네트워크의 공격 탐지 시스템은, 상기 CAN 네트워크의 CAN 패킷을 기초로 CAN 패킷 단위의 공격 여부를 판단하도록 구성되는 프로세서;를 포함하고, 상기 프로세서는: 상기 CAN 패킷의 생성 순서를 기준으로, 복수의 상기 CAN 패킷 중에서 미리 설정된 개수의 CAN 패킷을 분석 대상 패킷으로 결정하고; 가장 먼저 생성된 상기 분석 대상 패킷의 생성 시간과 가장 늦게 생성된 상기 분석 대상 패킷의 생성 시간 간의 차이를 기초로 분석 대상 시간을 결정하고; 상기 분석 대상 패킷 중에서 동일한 데이터를 포함하는 하나 이상의 분석 대상 패킷을 동일 데이터 패킷으로 결정하고; 그리고 상기 분석 대상 시간 및 상기 동일 데이터 패킷의 개수를 기초로, 상기 CAN 네트워크에 대한 CAN 패킷 단위의 공격 여부를 판단하도록 구성될 수 있다.An attack detection system of a CAN network controlled through a CAN method according to an aspect of the disclosed invention includes a processor configured to determine whether or not an attack is performed in units of CAN packets based on CAN packets of the CAN network, wherein the processor comprises: : Based on the order of generation of the CAN packets, determining a preset number of CAN packets among the plurality of CAN packets as analysis target packets; determining an analysis target time based on a difference between a creation time of the first generated packet to be analyzed and a creation time of the latest generated packet to be analyzed; determining one or more analysis target packets including the same data among the analysis target packets as the same data packet; And based on the analysis target time and the number of the same data packets, it may be configured to determine whether or not an attack is performed in units of CAN packets to the CAN network.

또한, 상기 프로세서는, 복수의 상기 CAN 패킷 중에서 생성 순서를 기준으로 서로 인접한 복수의 CAN 패킷을 상기 미리 설정된 개수의 분석 대상 패킷으로 결정하도록 구성될 수 있다.In addition, the processor may be configured to determine a plurality of CAN packets adjacent to each other based on a generation order among the plurality of CAN packets as the predetermined number of analysis target packets.

또한, 상기 프로세서는: 상기 동일 데이터 패킷의 개수를 상기 분석 대상 시간으로 나눈 값을 동일 데이터 비율 정보로 결정하고; 그리고 상기 동일 데이터 비율 정보를 기초로 상기 CAN 패킷 단위의 공격 여부를 판단하도록 구성될 수 있다.In addition, the processor: determines a value obtained by dividing the number of identical data packets by the analysis target time as identical data rate information; And based on the same data rate information, it may be configured to determine whether or not an attack is performed in units of the CAN packet.

또한, 학습용 CAN 패킷을 기초로 결정된 학습용 CAN 패킷의 동일 데이터 비율 정보를 입력 변수로 하고, 상기 학습용 CAN 패킷의 정상 여부 정보를 출력 변수로 설정하여 기계 학습 방식을 통해 기계 학습 모델을 생성하도록 구성되는 기계학습부;를 더 포함하고, 상기 프로세서는, 상기 동일 데이터 비율 정보를 기초로 상기 기계 학습 모델에 의해 상기 CAN 패킷 단위의 공격 여부를 판단하도록 구성될 수 있다.In addition, the same data rate information of the learning CAN packet determined based on the learning CAN packet is set as an input variable, and the normality information of the learning CAN packet is set as an output variable to generate a machine learning model through a machine learning method. It may further include a machine learning unit; and the processor may be configured to determine whether the CAN packet unit is attacked by the machine learning model based on the same data rate information.

또한, 상기 프로세서는: 상기 기계 학습 모델에 기초하여 기준 동일 데이터 비율을 결정하고; 그리고 상기 동일 데이터 비율 정보 및 상기 기준 동일 데이터 비율을 비교하여 상기 CAN 패킷 단위의 공격 여부를 판단하도록 구성될 수 있다.Further, the processor: determines a reference equal data rate based on the machine learning model; And it may be configured to determine whether the CAN packet unit is attacked by comparing the same data rate information and the reference same data rate.

또한, 상기 프로세서는: 복수의 상기 CAN 패킷 중에서 기준 패킷을 결정하고; 상기 분석 대상 패킷 중에서 상기 기준 패킷의 데이터와 동일한 데이터를 포함하는 하나 이상의 분석 대상 패킷을 상기 동일 데이터 패킷으로 결정하고; 그리고 상기 분석 대상 시간 및 상기 동일 데이터 패킷의 개수를 기초로, 상기 기준 패킷이 상기 CAN 네트워크에 대한 공격 패킷인지 여부를 판단하도록 구성될 수 있다.Further, the processor: determines a reference packet from among a plurality of the CAN packets; determining one or more analysis target packets including data identical to data of the reference packet among the analysis target packets as the same data packet; And based on the analysis target time and the number of the same data packets, it may be configured to determine whether the reference packet is an attack packet for the CAN network.

또한, 상기 프로세서는, 상기 CAN 패킷의 생성 순서를 기준으로, 상기 기준 패킷에 미리 설정된 개수 범위 내에 있는 CAN 패킷을 상기 분석 대상 패킷으로 결정하도록 구성될 수 있다.In addition, the processor may be configured to determine a CAN packet within a preset number range of the reference packet as the analysis target packet based on the generation order of the CAN packet.

또한, 상기 프로세서는, 상기 CAN 패킷의 생성 순서를 기준으로, 상기 기준 패킷보다 미리 설정된 숫자만큼 먼저 생성된 CAN 패킷과 상기 기준 패킷보다 상기 미리 설정된 숫자만큼 나중에 생성된 CAN 패킷 사이에 포함되는 CAN 패킷을 상기 분석 대상 패킷으로 결정하도록 구성될 수 있다.In addition, the processor, based on the order of generation of the CAN packet, a CAN packet included between a CAN packet generated earlier by a preset number than the reference packet and a CAN packet generated later by the preset number than the reference packet It may be configured to determine as the analysis target packet.

또한, 상기 프로세서는: 복수의 상기 CAN 패킷 중에서 기준 패킷을 결정하고; 상기 CAN 패킷의 생성 순서를 기준으로, 상기 기준 패킷에 미리 설정된 개수 범위 내에 있는 CAN 패킷을 상기 분석 대상 패킷으로 결정하고; 상기 분석 대상 패킷 중에서 상기 기준 패킷의 데이터와 동일한 데이터를 포함하는 하나 이상의 분석 대상 패킷을 상기 동일 데이터 패킷으로 결정하고; 상기 동일 데이터 패킷의 개수를 상기 분석 대상 시간으로 나눈 값을 동일 데이터 비율 정보로 결정하고; 그리고 상기 동일 데이터 비율 정보를 기초로 상기 기준 패킷이 상기 CAN 네트워크에 대한 공격 패킷인지 여부를 판단하도록 구성될 수 있다.Further, the processor: determines a reference packet from among a plurality of the CAN packets; Based on the order of generation of the CAN packets, determining CAN packets within a preset number range of the reference packets as the analysis target packets; determining one or more analysis target packets including data identical to data of the reference packet among the analysis target packets as the same data packet; determining a value obtained by dividing the number of identical data packets by the analysis target time as identical data rate information; And it may be configured to determine whether the reference packet is an attack packet for the CAN network based on the same data rate information.

개시된 발명의 일 측면에 따른 프로세서에 의해 CAN 방식을 통해 제어되는 CAN 네트워크의 CAN 패킷을 기초로 CAN 패킷 단위의 공격 여부를 판단하는 공격 탐지 방법은, 상기 CAN 패킷의 생성 순서를 기준으로, 복수의 상기 CAN 패킷 중에서 미리 설정된 개수의 CAN 패킷을 분석 대상 패킷으로 결정하는 단계; 가장 먼저 생성된 상기 분석 대상 패킷의 생성 시간과 가장 늦게 생성된 상기 분석 대상 패킷의 생성 시간 간의 차이를 기초로 분석 대상 시간을 결정하는 단계; 상기 분석 대상 패킷 중에서 동일한 데이터를 포함하는 하나 이상의 분석 대상 패킷을 동일 데이터 패킷으로 결정하는 단계; 및 상기 분석 대상 시간 및 상기 동일 데이터 패킷의 개수를 기초로, 상기 CAN 네트워크에 대한 CAN 패킷 단위의 공격 여부를 판단하는 단계;를 포함할 수 있다.An attack detection method for determining whether a CAN packet unit is attacked based on a CAN packet of a CAN network controlled by a processor through a CAN method according to an aspect of the disclosed invention, based on the order in which the CAN packets are generated, a plurality of Determining a preset number of CAN packets among the CAN packets as analysis target packets; determining an analysis target time based on a difference between a generation time of the first analysis target packet and a latest generation time of the analysis target packet; determining one or more analysis target packets including the same data among the analysis target packets as the same data packet; and determining whether or not an attack is performed in units of CAN packets on the CAN network based on the analysis target time and the number of identical data packets.

또한, 복수의 상기 CAN 패킷 중에서 기준 패킷을 결정하는 단계;를 더 포함하고, 상기 미리 설정된 개수의 CAN 패킷을 분석 대상 패킷으로 결정하는 단계는, 상기 CAN 패킷의 생성 순서를 기준으로, 상기 기준 패킷에 미리 설정된 개수 범위 내에 있는 CAN 패킷을 상기 분석 대상 패킷으로 결정하는 단계;를 포함하고, 상기 동일 데이터 패킷으로 결정하는 단계는, 상기 분석 대상 패킷 중에서 상기 기준 패킷의 데이터와 동일한 데이터를 포함하는 하나 이상의 분석 대상 패킷을 상기 동일 데이터 패킷으로 결정하는 단계;를 포함하고, 상기 동일 데이터 패킷의 개수를 상기 분석 대상 시간으로 나눈 값을 동일 데이터 비율 정보로 결정하는 단계;를 더 포함하고, 상기 CAN 패킷 단위의 공격 여부를 판단하는 단계는, 상기 동일 데이터 비율 정보를 기초로 상기 기준 패킷이 상기 CAN 네트워크에 대한 공격 패킷인지 여부를 판단하는 단계;를 포함할 수 있다.In addition, determining a reference packet from among the plurality of CAN packets; and determining the predetermined number of CAN packets as analysis target packets, based on the generation order of the CAN packets, the reference packet Determining a CAN packet within a preset number range as the analysis target packet; wherein the determining as the same data packet includes one of the analysis target packets including the same data as the data of the reference packet. Determining the above analysis target packets as the same data packet; and determining a value obtained by dividing the number of identical data packets by the analysis target time as the same data rate information; further comprising, the CAN packet The step of determining whether the unit is attacked may include determining whether the reference packet is an attack packet for the CAN network based on the same data rate information.

개시된 발명의 일 측면에 따른 컴퓨터 프로그램은, 상기 프로세서에 의해 CAN 방식을 통해 제어되는 CAN 네트워크의 CAN 패킷을 기초로 CAN 패킷 단위의 공격 여부를 판단하는 공격 탐지 방법을 실행시키도록 컴퓨터로 판독 가능한 기록매체에 저장될 수 있다.A computer program according to an aspect of the disclosed invention is a computer-readable record to execute an attack detection method for determining whether or not an attack is performed in units of CAN packets based on CAN packets of a CAN network controlled by the processor through a CAN method. can be stored on media.

개시된 발명의 일 측면에 따르면, CAN 네트워크의 CAN 패킷들에 포함된 정보를 분석하고, 해당 CAN 패킷의 상태가 정상인지 여부를 판단하여 CAN 패킷 단위에 대한 공격이 있는지 여부를 알아낼 수 있어서 안전한 차량의 운행을 가능하게 할 수 있다.According to one aspect of the disclosed invention, it is possible to analyze information included in CAN packets of a CAN network and determine whether the state of the corresponding CAN packet is normal to find out whether there is an attack on a CAN packet unit, thereby providing a safe vehicle. driving can be made possible.

또한, 본 발명의 실시예에 의하면, 특히 CAN 네트워크에서 특정 기능을 수행하는 Arbitration ID를 대상으로 공격자가 원하는 기능을 수행하도록 CAN 메시지를 생성해 주입하는 공격인 Spoofing Attack의 공격 패킷을 탐지할 수 있어서 해킹 공격의 탐지에 기여할 수 있다.In addition, according to an embodiment of the present invention, it is possible to detect attack packets of spoofing attack, an attack in which a CAN message is generated and injected to perform a function desired by an attacker targeting an arbitration ID performing a specific function in a CAN network. It can contribute to the detection of hacking attacks.

도 1은 일 실시예에 따른 공격 탐지 시스템의 구성도이다.
도 2는 일 실시예에 따른 공격 탐지 알고리즘을 설명하기 위한 도면이다.
도 3은 일 실시예에 따른 CAN 패킷을 도시한 도면이다.
도 4는 일 실시예에 따른 분석 대상 패킷을 도시한 도면이다.
도 5는 일 실시예에 따라 동일 데이터 비율 정보를 결정하는 것을 설명하기 위한 도면이다.
도 6은 일 실시예에 따라 각 기준 패킷 별 동일 데이터 비율 정보를 정리하는 것을 도시한 도면이다.
도 7은 일 실시예에 따른 공격 탐지 방법의 순서도이다.
도 8은 일 실시예에 따른 정상 상태의 동일 데이터 비율 정보를 나타낸 그래프 및 공격 상태의 동일 데이터 비율 정보를 나타낸 그래프이다.
도 9는 일 실시예에 따른 다양한 CAN ID의 패킷 별 동일 데이터 비율 정보를 나타낸 그래프이다.
1 is a configuration diagram of an attack detection system according to an embodiment.
2 is a diagram for explaining an attack detection algorithm according to an embodiment.
3 is a diagram illustrating a CAN packet according to an embodiment.
4 is a diagram illustrating a packet to be analyzed according to an embodiment.
5 is a diagram for explaining determining equal data rate information according to an exemplary embodiment.
6 is a diagram illustrating arranging the same data rate information for each reference packet according to an embodiment.
7 is a flowchart of an attack detection method according to an embodiment.
8 is a graph showing the same data rate information in a normal state and a graph showing the same data rate information in an attack state according to an embodiment.
9 is a graph showing the same data rate information for each packet of various CAN IDs according to an embodiment.

명세서 전체에 걸쳐 동일 참조 부호는 동일 구성요소를 지칭한다. 본 명세서가 실시예들의 모든 요소들을 설명하는 것은 아니며, 개시된 발명이 속하는 기술분야에서 일반적인 내용 또는 실시예들 간에 중복되는 내용은 생략한다. 명세서에서 사용되는 '~부'라는 용어는 소프트웨어 또는 하드웨어로 구현될 수 있으며, 실시예들에 따라 복수의 '~부'가 하나의 구성요소로 구현되거나, 하나의 '~부'가 복수의 구성요소들을 포함하는 것도 가능하다.Like reference numbers designate like elements throughout the specification. This specification does not describe all elements of the embodiments, and general content or overlapping content between the embodiments in the technical field to which the disclosed invention belongs is omitted. The term '~unit' used in the specification may be implemented in software or hardware, and according to embodiments, a plurality of '~units' may be implemented as one component, or one '~unit' may constitute a plurality of components. It is also possible to include elements.

또한 어떤 부분이 어떤 구성요소를 "포함"한다고 할 때, 이는 특별히 반대되는 기재가 없는 한 다른 구성요소를 제외하는 것이 아니라 다른 구성요소를 더 포함할 수 있는 것을 의미한다.In addition, when a certain component is said to "include", this means that it may further include other components without excluding other components unless otherwise stated.

본 명세서에서 사용되는 '~부'는 적어도 하나의 기능이나 동작을 처리하는 단위로서, 예를 들어 소프트웨어, FPGA 또는 하드웨어 구성요소를 의미할 수 있다. '~부'에서 제공하는 기능은 복수의 구성요소에 의해 분리되어 수행되거나, 다른 추가적인 구성요소와 통합될 수도 있다. 본 명세서의 '~부'는 반드시 소프트웨어 또는 하드웨어에 한정되지 않으며, 어드레싱할 수 있는 저장 매체에 있도록 구성될 수도 있고, 하나 또는 그 이상의 프로세서들을 재생시키도록 구성될 수도 있다.'~ unit' used in this specification is a unit that processes at least one function or operation, and may mean, for example, software, an FPGA, or a hardware component. Functions provided by '~unit' may be performed separately by a plurality of components or may be integrated with other additional components. '~unit' in this specification is not necessarily limited to software or hardware, and may be configured to be in an addressable storage medium or configured to reproduce one or more processors.

단수의 표현은 문맥상 명백하게 예외가 있지 않는 한, 복수의 표현을 포함한다.Expressions in the singular number include plural expressions unless the context clearly dictates otherwise.

각 단계들에 있어 식별부호는 설명의 편의를 위하여 사용되는 것으로 식별부호는 각 단계들의 순서를 설명하는 것이 아니며, 각 단계들은 문맥상 명백하게 특정 순서를 기재하지 않는 이상 명기된 순서와 다르게 실시될 수 있다.In each step, the identification code is used for convenience of description, and the identification code does not explain the order of each step, and each step may be performed in a different order from the specified order unless a specific order is clearly described in context. have.

이하 첨부된 도면들을 참고하여 개시된 발명의 작용 원리 및 실시예들에 대해 설명한다.Hereinafter, the working principle and embodiments of the disclosed invention will be described with reference to the accompanying drawings.

도 1은 일 실시예에 따른 공격 탐지 시스템의 구성도이다.1 is a configuration diagram of an attack detection system according to an embodiment.

도 1을 참조하면, 본 발명의 실시예에 따른 CAN(Controller Area Network) 방식을 통해 제어되는 CAN 네트워크의 공격 탐지 시스템(100)은 프로세서(110), 기계학습부(120), 메모리(130)를 포함할 수 있다.Referring to FIG. 1 , an attack detection system 100 of a CAN network controlled through a controller area network (CAN) method according to an embodiment of the present invention includes a processor 110, a machine learning unit 120, and a memory 130. can include

CAN은 차량의 도어, 창문, 조명, 악셀, 브레이크 등등의 각종 디바이스들을 전자적으로 제어하기 위한 차량용 네트워크이며, 자율주행차량이나 커넥티드 카에서도 채용되고 있다.CAN is a vehicle network for electronically controlling various devices such as doors, windows, lights, accelerators, brakes, etc., and is also used in autonomous vehicles and connected cars.

CAN은 통상적으로 차량의 각 디바이스 제어를 위한 전자제어유닛(ECU, Electronic Control Unit)들이 CAN 버스를 통해 연결된 구조를 가진다. CAN 버스에는 일반적으로 사용자 조작에 의해 차량에 마련된 입력부를 통하여 사용자 명령이 입력되어 CAN의 데이터로서 전달된다.CAN typically has a structure in which electronic control units (ECUs) for controlling each device of a vehicle are connected through a CAN bus. In general, a user command is input to the CAN bus through an input unit provided in a vehicle by user manipulation and transmitted as CAN data.

프로세서(110)는 차량 CAN 네트워크의 CAN 패킷(200)을 획득할 수 있다. 이때, 프로세서(110)는 복수의 CAN 패킷(200)들을 획득할 수 있다.The processor 110 may obtain the CAN packet 200 of the vehicle CAN network. At this time, the processor 110 may obtain a plurality of CAN packets (200).

프로세서(110)는 획득한 CAN 패킷(200)을 기초로 CAN 패킷 단위의 공격 여부를 판단할 수 있다.The processor 110 may determine whether or not an attack is performed in units of CAN packets based on the obtained CAN packets 200 .

기계학습부(120)는 학습용 CAN 패킷(400)을 기초로 기계 학습 방식을 통해 기계 학습 모델(131)을 생성할 수 있다. 한편, 기계 학습 모델(131)은 메모리(130)에 저장될 수 있다.The machine learning unit 120 may generate the machine learning model 131 through a machine learning method based on the CAN packet 400 for learning. Meanwhile, the machine learning model 131 may be stored in the memory 130 .

프로세서(110)는 기계 학습 모델(131)을 기초로 CAN 패킷 단위의 공격 여부를 판단할 수 있다.The processor 110 may determine whether there is an attack in units of CAN packets based on the machine learning model 131 .

프로세서(110)는 차량의 CAN 네트워크에 대한 공격의 신속한 탐지를 위하여 차량 내부에 마련될 수 있다. 구체적으로, 프로세서(110)는 하나의 ECU일 수 있고, CAN 방식을 통해 제어되는 차량 네트워크에서 게이트웨이 내부에 설치될 수도 있으며, 독립된 개체로 버스에 연결되어 게이트웨이와 통신할 수도 있다.The processor 110 may be provided inside the vehicle for rapid detection of an attack on the vehicle's CAN network. Specifically, the processor 110 may be one ECU, may be installed inside a gateway in a vehicle network controlled through a CAN method, or may be connected to a bus as an independent entity to communicate with the gateway.

전술한 바와 같이 프로세서(110) 및 메모리(130)는 차량에 마련될 수 있으나, 반드시 프로세서(110) 및 메모리(130)가 차량에 마련되어야 하는 것은 아니며, CAN 방식을 통해 제어되는 차량의 CAN 네트워크에 대한 공격을 탐지할 수 있다면, 프로세서(110) 및 메모리(130)가 어떠한 방식으로 구현되더라도 상관없다.As described above, the processor 110 and the memory 130 may be provided in the vehicle, but the processor 110 and the memory 130 do not necessarily have to be provided in the vehicle, and the CAN network of the vehicle controlled through the CAN method. It does not matter how the processor 110 and the memory 130 are implemented, as long as an attack on the can be detected.

예를 들어, 프로세서(110) 및 메모리(130)는 서버에 마련되어, 메모리(130)에 저장된 기계 학습 모델(131) 및 차량의 통신부로부터 수신한 CAN 패킷(200)에 기초하여 차량의 CAN 네트워크에 대한 공격을 탐지할 수도 있다.For example, the processor 110 and the memory 130 are provided in the server, and the CAN network of the vehicle is configured based on the machine learning model 131 stored in the memory 130 and the CAN packet 200 received from the communication unit of the vehicle. attacks can be detected.

기계학습부(120)는 공격 탐지 시스템(100)에 포함된 복수개의 프로세서 중 어느 하나의 프로세서를 포함할 수 있다. 또한, 지금까지 설명된 본 발명의 실시예 및 앞으로 설명할 실시예에 따른 공격 탐지 방법은, 프로세서(110)에 의해 구동될 수 있는 프로그램의 형태로 구현될 수 있다.The machine learning unit 120 may include any one processor among a plurality of processors included in the attack detection system 100 . In addition, the attack detection method according to the embodiments of the present invention described so far and the embodiments to be described in the future may be implemented in the form of a program that can be driven by the processor 110 .

여기서 프로그램은, 프로그램 명령, 데이터 파일 및 데이터 구조 등을 단독으로 또는 조합하여 포함할 수 있다. 프로그램은 기계어 코드나 고급 언어 코드를 이용하여 설계 및 제작된 것일 수 있다. 프로그램은 상술한 부호 수정을 위한 방법을 구현하기 위하여 특별히 설계된 것일 수도 있고, 컴퓨터 소프트웨어 분야에서 통상의 기술자에게 기 공지되어 사용 가능한 각종 함수나 정의를 이용하여 구현된 것일 수도 있다. 전술한 정보 표시 방법을 구현하기 위한 프로그램은, 프로세서(110)에 의해 판독 가능한 기록매체에 기록될 수 있다. 이때, 기록매체는 메모리(130)일 수 있다.Here, the program may include program commands, data files, and data structures alone or in combination. The program may be designed and manufactured using machine language codes or high-level language codes. The program may be specially designed to implement the above-described code correction method, or may be implemented using various functions or definitions that are known and usable to those skilled in the art in the field of computer software. A program for implementing the above information display method may be recorded on a recording medium readable by the processor 110 . At this time, the recording medium may be the memory 130 .

메모리(130)는 전술한 동작 및 후술하는 동작을 수행하는 프로그램을 저장할 수 있으며, 메모리(130)는 저장된 프로그램을 실행시킬 수 있다. 프로세서(110)와 메모리(130)가 복수인 경우에, 이들이 하나의 칩에 집적되는 것도 가능하고, 물리적으로 분리된 위치에 마련되는 것도 가능하다. 메모리(130)는 데이터를 일시적으로 기억하기 위한 S램(Static Random Access Memory, S-RAM), D랩(Dynamic Random Access Memory) 등의 휘발성 메모리를 포함할 수 있다. 또한, 메모리(130)는 제어 프로그램 및 제어 데이터를 장기간 저장하기 위한 롬(Read Only Memory), 이피롬(Erasable Programmable Read Only Memory: EPROM), 이이피롬(Electrically Erasable Programmable Read Only Memory: EEPROM) 등의 비휘발성 메모리를 포함할 수 있다.The memory 130 may store a program for performing the above-described operation and an operation to be described later, and the memory 130 may execute the stored program. When the processor 110 and the memory 130 are plural, they may be integrated on a single chip or may be provided in physically separate locations. The memory 130 may include volatile memory such as static random access memory (S-RAM) and dynamic random access memory (D-lab) for temporarily storing data. In addition, the memory 130 may include a read only memory (ROM), an erasable programmable read only memory (EPROM), and an electrically erasable programmable read only memory (EEPROM) for long-term storage of control programs and control data. It may contain non-volatile memory.

프로세서(110)는 각종 논리 회로와 연산 회로를 포함할 수 있으며, 메모리(130)로부터 제공된 프로그램에 따라 데이터를 처리하고, 처리 결과에 따라 제어 신호를 생성할 수 있다.The processor 110 may include various logic circuits and arithmetic circuits, process data according to programs provided from the memory 130, and generate control signals according to processing results.

도 2는 일 실시예에 따른 공격 탐지 알고리즘을 설명하기 위한 도면이다.2 is a diagram for explaining an attack detection algorithm according to an embodiment.

도 2를 참조하면, 주어진 CAN 패킷(200)이 CAN 네트워크에 대한 공격 패킷인지 여부를 판단하는 방법은 주어진 CAN 패킷(200)의 특징을 추출하는 단계, 기계 학습의 방법으로 기계 학습 모델(131)을 학습하는 단계, 기타 다른 규칙을 반영하는 단계, 기계 학습 모델(131) 및 기타 다른 규칙에 따라 주어진 CAN 패킷(200)이 공격 패킷인지 판단하는 단계를 포함할 수 있다.Referring to FIG. 2, a method of determining whether a given CAN packet 200 is an attack packet for a CAN network is a method of extracting features of a given CAN packet 200, a machine learning model 131 as a machine learning method It may include a step of learning, a step of reflecting other rules, and a step of determining whether a given CAN packet 200 is an attack packet according to the machine learning model 131 and other rules.

본 발명의 CAN 네트워크에 대한 공격 탐지 방법은 주로 CAN 패킷(200)의 특징을 추출하는 단계에 관한 것이다.The attack detection method for the CAN network of the present invention mainly relates to the step of extracting the characteristics of the CAN packet (200).

구체적으로 본 발명의 공격 탐지 방법은 차량에서 발생하는 CAN 패킷(200)의 Timestamp(해당 CAN 메시지가 생성되는 시간), DLC(Data Field의 바이트 수), Arbitration_ID(CAN ID), Data Field를 이용하여 동일한 데이터를 가지는 CAN 패킷(200)들의 밀집도를 계산해 정상 트래픽 밀집도와 공격 트래픽 밀집도를 비교하여 공격 여부를 구분할 수 있다.Specifically, the attack detection method of the present invention uses Timestamp (time when the corresponding CAN message is generated), DLC (number of bytes of Data Field), Arbitration_ID (CAN ID), and Data Field of the CAN packet 200 generated in the vehicle. By calculating the density of the CAN packets 200 having the same data and comparing the normal traffic density and the attack traffic density, it is possible to determine whether or not an attack occurs.

특히 본 발명의 공격 탐지 방법은 량에서 특정 기능을 수행하는 Arbitration ID를 대 상으로 공격자가 원하는 기능을 수행하도록 CAN 메시지를 생성해 주 입하는 공격인 Spoofing attack의 발생 여부를 정확하게 탐지할 수 있다.In particular, the attack detection method of the present invention can accurately detect the occurrence of a spoofing attack, which is an attack in which a CAN message is generated and injected to perform a desired function by an attacker targeting an arbitration ID performing a specific function.

도 3은 일 실시예에 따른 CAN 패킷을 도시한 도면이다.3 is a diagram illustrating a CAN packet according to an embodiment.

도 3을 참조하면, 각 CAN 패킷(200)은 생성된 시간을 나타내는 고유한 생성 시간 값(201)을 포함할 수 있다.Referring to FIG. 3 , each CAN packet 200 may include a unique creation time value 201 indicating the time it was created.

또한, 각 CAN 패킷(200)의 생성 시간 값(201)은 서로 다를 수 있으므로, 복수의 CAN 패킷(200)은 생성된 순서대로 나열될 수 있다.In addition, since the generation time value 201 of each CAN packet 200 may be different, the plurality of CAN packets 200 may be listed in the order in which they are generated.

각 CAN의 패킷은 'CAN ID'와 '명령'을 포함하는 형태로 구성될 수 있다. 해당 명령이 목적하는 타겟 디바이스를 제어하는 ECU는, CAN 버스를 통해 방송되고 있는 CAN의 데이터 내 CAN ID(202)를 식별하여 명령을 수신하고 그에 의해 타겟 디바이스를 제어할 수 있다. CAN 방식을 통해 제어되는 차량 네트워크는 프레임이라는 패킷의 형태로 CAN 데이터(203)를 전송할 수 있다.A packet of each CAN may be configured in a form including 'CAN ID' and 'command'. The ECU that controls the target device for which the corresponding command is intended can receive the command by identifying the CAN ID 202 in the CAN data being broadcast over the CAN bus and thereby control the target device. A vehicle network controlled through the CAN method may transmit CAN data 203 in the form of a packet called a frame.

도 4는 일 실시예에 따른 분석 대상 패킷을 도시한 도면이다.4 is a diagram illustrating a packet to be analyzed according to an embodiment.

도 4를 참조하면, 프로세서(110)는 CAN 패킷(200)의 생성 순서를 기준으로, 복수의 CAN 패킷(200) 중에서 미리 설정된 개수의 CAN 패킷(200)을 분석 대상 패킷(210)으로 결정할 수 있다.Referring to FIG. 4 , the processor 110 may determine a predetermined number of CAN packets 200 among a plurality of CAN packets 200 as the analysis target packet 210 based on the order of generation of the CAN packets 200. have.

분석 대상 패킷(210)은 어느 검사 대상인 CAN 패킷(200)이 CAN 네트워크에 대한 공격 패킷인지를 판단하기 위하여 해당 검사 대상인 CAN 패킷(200)을 포함하는 복수의 CAN 패킷(200)일 수 있다.The packet to be analyzed 210 may be a plurality of CAN packets 200 including the CAN packet 200 to be inspected in order to determine which CAN packet 200 to be inspected is an attack packet for the CAN network.

프로세서(110)는 복수의 CAN 패킷(200) 중에서 생성 순서를 기준으로 서로 인접한 복수의 CAN 패킷(200)을 미리 설정된 개수의 분석 대상 패킷(210)으로 결정할 수 있다.The processor 110 may determine a plurality of CAN packets 200 adjacent to each other based on the generation order among the plurality of CAN packets 200 as the preset number of analysis target packets 210 .

예를 들어, 도 4에 도시된 분석 대상 패킷(210)들은 9.580(ms) 부터 35.260(ms) 사이에 생성된 모든 CAN 패킷(200)일 수 있다.For example, the analysis target packets 210 shown in FIG. 4 may be all CAN packets 200 generated between 9.580 (ms) and 35.260 (ms).

프로세서(110)는 가장 먼저 생성된 분석 대상 패킷(210)의 생성 시간과 가장 늦게 생성된 분석 대상 패킷(210)의 생성 시간 간의 차이를 기초로 분석 대상 시간을 결정할 수 있다.The processor 110 may determine the analysis target time based on the difference between the generation time of the first analysis target packet 210 and the latest generation of the analysis target packet 210 .

예를 들어, 프로세서(110)는 분석 대상 패킷(210) 중에서 가장 먼저 생성된 CAN 패킷(200)의 생성 시간이 9.580(ms)이고, 가장 늦게 생성된 CAN 패킷(200)의 생성 시간이 35.260(ms)이면, 분석 대상 시간은 두 생성 시간 값(201)의 차이인 25.680(ms)로 결정할 수 있다.For example, in the processor 110, the generation time of the first CAN packet 200 among the analysis target packets 210 is 9.580 (ms), and the generation time of the latest CAN packet 200 is 35.260 (ms). ms), the analysis target time can be determined as 25.680 (ms), which is the difference between the two generation time values 201.

프로세서(110)는 분석 대상 패킷(210) 중에서 동일한 데이터를 포함하는 하나 이상의 분석 대상 패킷(210)을 동일 데이터 패킷(211)으로 결정할 수 있다.The processor 110 may determine one or more analysis target packets 210 including the same data among the analysis target packets 210 as the same data packet 211 .

예를 들어, 프로세서(110)는 분석 대상 패킷(210) 중에서 CAN 데이터(203)가 '1C 04 B6 C0 00 16 38 80'인 CAN 패킷(200)을 동일 데이터 패킷(211)으로 결정할 수 있다.For example, the processor 110 may determine a CAN packet 200 whose CAN data 203 is '1C 04 B6 C0 00 16 38 80' among the packets to be analyzed 210 as the same data packet 211 .

프로세서(110)는 분석 대상 시간 및 동일 데이터 패킷(211)의 개수를 기초로, CAN 네트워크에 대한 CAN 패킷 단위의 공격 여부를 판단할 수 있다.The processor 110 may determine whether the CAN network is attacked in units of CAN packets based on the time to be analyzed and the number of identical data packets 211 .

예를 들어, 도 4에 도시된 분석 대상 패킷(210)을 이용할 경우, 프로세서(110)는 분석 대상 시간인 25.680(ms)와 동일 데이터 패킷(211)의 개수인 8을 기초로 CAN 패킷 단위의 공격 여부를 판단할 수 있다.For example, when using the analysis target packet 210 shown in FIG. 4, the processor 110 analyzes the CAN packet unit based on the analysis target time of 25.680 (ms) and the same number of data packets 211 as 8. attack can be determined.

프로세서(110)는 동일 데이터 패킷(211)의 개수를 분석 대상 시간으로 나눈 값을 동일 데이터 비율 정보(Equal Data Rate; EDR)(300)로 결정할 수 있다.The processor 110 may determine a value obtained by dividing the number of equal data packets 211 by the time to be analyzed as equal data rate information (EDR) 300 .

예를 들어, 동일 데이터 패킷(211)의 개수가 8이고, 분석 대상 시간인 25.680(ms)이면, 8/25.680 = 0.311 이므로 0.311을 동일 데이터 비율 정보(300)로 결정할 수 있다.For example, if the number of identical data packets 211 is 8 and the analysis target time is 25.680 (ms), 8/25.680 = 0.311, so 0.311 can be determined as the identical data rate information 300.

만약 CAN 네트워크에 대해서 특정한 데이터를 가지는 CAN 패킷(200)을 반복적으로 주입시키는 공격이 있다면, 짧은 시간에 동일한 데이터를 가지는 CAN 패킷(200)이 많이 생성된 것으로 보일 수 있다.If there is an attack that repeatedly injects CAN packets 200 having specific data into a CAN network, it may seem that many CAN packets 200 having the same data are generated in a short time.

따라서, 프로세서(110)는 동일 데이터 비율 정보(300)를 기초로 CAN 패킷 단위의 공격 여부를 판단할 수 있다.Accordingly, the processor 110 may determine whether or not an attack is performed in units of CAN packets based on the same data rate information 300 .

예를 들어, 프로세서(110)는 동일 데이터 비율 정보(300) 및 기준 동일 데이터 비율을 비교하여 CAN 패킷 단위의 공격 여부를 판단할 수 있다.For example, the processor 110 may compare the same data rate information 300 and the reference same data rate to determine whether there is an attack in units of CAN packets.

기준 동일 데이터 비율은 산출된 동일 데이터 비율 정보(300)가 정상적인 CAN 패킷(200)의 동일 데이터 비율 정보(300)의 값인지, 공격에 이용된 CAN 패킷(200)의 동일 데이터 비율 정보(300)의 값인지 여부를 결정하는데 기준이 되는 값일 수 있다.The reference same data rate is whether the calculated same data rate information 300 is the value of the same data rate information 300 of the normal CAN packet 200, or the same data rate information 300 of the CAN packet 200 used in the attack. It may be a value that serves as a criterion for determining whether it is a value of .

예를 들어, 프로세서(110)는 동일 데이터 비율 정보(300)의 값이 기준 동일 데이터 비율 이상이면 분석한 CAN 패킷(200)에 대해 CAN 패킷 단위의 공격이 있었다고 판단할 수 있다.For example, if the value of the same data rate information 300 is greater than or equal to the reference same data rate, the processor 110 may determine that there is an attack in units of CAN packets with respect to the analyzed CAN packet 200 .

한편, 기준 동일 데이터 비율은 기계 학습을 통하여 정해질 수도 있다.Meanwhile, the reference same data ratio may be determined through machine learning.

기계학습부(120)는 학습용 CAN 패킷(400)을 획득할 수 있다.The machine learning unit 120 may acquire the CAN packet 400 for learning.

기계학습부(120)는 학습용 CAN 패킷(400)을 기초로 결정된 학습용 CAN 패킷(400)의 동일 데이터 비율 정보(300)를 입력 변수로 하고, 학습용 CAN 패킷(400)의 정상 여부 정보를 출력 변수로 설정하여 기계 학습 방식을 통해 기계 학습 모델(131)을 생성할 수 있다.The machine learning unit 120 uses the same data rate information 300 of the learning CAN packet 400 determined based on the learning CAN packet 400 as an input variable, and the normality information of the learning CAN packet 400 as an output variable. By setting to , the machine learning model 131 can be generated through the machine learning method.

학습용 CAN 패킷(400)을 기초로 학습용 CAN 패킷(400)의 동일 데이터 비율 정보(300)를 결정하는 방식은 일반적인 CAN 패킷(200)을 기초로 동일 데이터 비율 정보(300)를 결정하는 방식과 동일할 수 있다.The method of determining the same data rate information 300 of the CAN packet 400 for learning based on the CAN packet 400 for learning is the same as the method of determining the same data rate information 300 based on the general CAN packet 200 can do.

기계 학습 모델(131)은 학습용 CAN 패킷(400)으로부터 추출된 정보를 입력 변수로 하고, 학습용 CAN 패킷(400)의 정상 여부 정보를 출력 변수로 설정한 모델일 수 있다.The machine learning model 131 may be a model in which information extracted from the CAN packet 400 for learning is used as an input variable and information on whether the CAN packet 400 for learning is normal is set as an output variable.

기계 학습 모델(131)은 메모리(130)에 저장될 수 있으며, 프로세서(110)는 메모리(130)에 저장된 기계 학습 모델(131)의 데이터 및 실제로 획득한 CAN 패킷(200)에 포함된 정보를 이용하여 획득한 CAN 패킷(200)에 대한 CAN 공격 여부를 탐지할 수 있다.The machine learning model 131 may be stored in the memory 130, and the processor 110 converts data of the machine learning model 131 stored in the memory 130 and information included in the CAN packet 200 actually obtained. It is possible to detect whether or not a CAN attack on the CAN packet 200 obtained by using.

프로세서(110)는 동일 데이터 비율 정보(300)를 기초로 기계 학습 모델(131)에 의해 CAN 패킷 단위의 공격 여부를 판단할 수 있다.The processor 110 may determine whether there is an attack in units of CAN packets by the machine learning model 131 based on the same data rate information 300 .

구체적으로, 프로세서(110)는 기계 학습 모델(131)에 기초하여 기준 동일 데이터 비율을 결정할 수 있다.Specifically, the processor 110 may determine the reference equal data rate based on the machine learning model 131 .

프로세서(110)는 획득한 CAN 패킷(200)을 기초로 결정된 동일 데이터 비율 정보(300)와 기계 학습 모델(131)에 기초하여 결정된 기준 동일 데이터 비율을 비교하여 CAN 패킷 단위의 공격이 있었는지 여부를 판단할 수 있다.The processor 110 compares the same data rate information 300 determined based on the obtained CAN packet 200 and the reference same data rate determined based on the machine learning model 131 to determine whether there is an attack in units of CAN packets. can judge

예를 들어, 기계 학습 모델(131)에 기초하여 결정된 기준 동일 데이터 비율이 0.2이면, 도 4의 경우 동일 데이터 비율 정보(300)의 값은 0.311 이다. 이때, 기준 데이터 비율보다 동일 데이터 비율 정보(300)의 값이 더 크므로, 프로세서(110)는 CAN 패킷 단위의 공격이 있었다고 판단할 수 있다.For example, if the reference same data ratio determined based on the machine learning model 131 is 0.2, in the case of FIG. 4 , the value of the same data ratio information 300 is 0.311. At this time, since the value of the same data rate information 300 is greater than the reference data rate, the processor 110 may determine that there is an attack in units of CAN packets.

기계 학습이란 다수의 파라미터로 구성된 모델을 이용하며, 주어진 데이터로 파라미터를 최적화하는 것을 의미할 수 있다. 기계 학습은 학습 문제의 형태에 따라 지도 학습(supervised learning), 비지도 학습(unsupervised learning) 및 강화 학습(reinforcement learning)을 포함할 수 있다. 지도 학습(supervised learning)은 입력과 출력 사이의 매핑을 학습하는 것이며, 입력과 출력 쌍이 데이터로 주어지는 경우에 적용할 수 있다. 비지도 학습(unsupervised learning)은 입력만 있고 출력은 없는 경우에 적용하며, 입력 사이의 규칙성 등을 찾아낼 수 있다.Machine learning may mean using a model composed of multiple parameters and optimizing the parameters with given data. Machine learning may include supervised learning, unsupervised learning, and reinforcement learning depending on the form of a learning problem. Supervised learning is to learn the mapping between inputs and outputs, and can be applied when input and output pairs are given as data. Unsupervised learning is applied when there are only inputs and no outputs, and regularities between inputs can be found.

본 발명의 실시예에 따른 기계학습부(120)는 각각의 학습용 CAN 패킷(400)의 정보 및 각각의 학습용 CAN 패킷(400)의 정상 여부 정보를 랜덤 포레스트(Random Forest) 기반으로 학습하여 기계 학습 모델(131)을 생성할 수 있다. 즉, 본 발명의 기계 학습 모델(131)은 랜덤 포레스트 모델을 포함할 수 있다.The machine learning unit 120 according to an embodiment of the present invention learns the information of each learning CAN packet 400 and the normality information of each learning CAN packet 400 based on a random forest to perform machine learning. A model 131 may be created. That is, the machine learning model 131 of the present invention may include a random forest model.

구체적으로, 기계학습부(120)는 학습용 CAN 패킷(400)의 동일 데이터 비율 정보(300)를 입력 변수로 하고, 각 학습용 CAN 패킷(400)의 정상 여부 정보를 출력 변수로 설정하여 랜덤 포레스트 모델을 생성할 수 있다.Specifically, the machine learning unit 120 sets the same data rate information 300 of the learning CAN packet 400 as an input variable, and sets the normality information of each learning CAN packet 400 as an output variable to model a random forest. can create

프로세서(110)는 기계 학습 방식뿐만 아니라 딥 러닝 방식을 통해서도 차량 네트워크에 대한 공격을 탐지할 수 있으며, 다양한 방식으로 CAN 네트워크에 대한 공격을 탐지할 수 있다.The processor 110 may detect an attack on the vehicle network through a deep learning method as well as a machine learning method, and may detect an attack on the CAN network in various ways.

도 5는 일 실시예에 따라 동일 데이터 비율 정보를 결정하는 것을 설명하기 위한 도면이다.5 is a diagram for explaining determining equal data rate information according to an exemplary embodiment.

도 5를 참조하면, 프로세서(110)는 복수의 CAN 패킷(200) 중에서 기준 패킷(212)을 결정할 수 있다.Referring to FIG. 5 , the processor 110 may determine a reference packet 212 from among a plurality of CAN packets 200 .

CAN 네트워크의 공격 탐지 시스템(100)은 전달받은 복수개의 CAN 패킷(200) 전체에 대해서 CAN 공격이 있었는지 여부를 판단할 수도 있으나, 전달받은 CAN 패킷(200)들 중에서 특정한 CAN 패킷(200)이 공격에 이용된 패킷인지 여부도 판단할 수 있다.The attack detection system 100 of the CAN network may determine whether there is a CAN attack for all of the plurality of CAN packets 200 received, but a specific CAN packet 200 among the received CAN packets 200 It may also be determined whether the packet is used for an attack.

프로세서(110)는 복수의 CAN 패킷(200) 중에서 공격에 이용된 패킷인지 확인하고자 하는 CAN 패킷(200)을 기준 패킷(212)으로 결정할 수 있다.The processor 110 may determine, as the reference packet 212 , a CAN packet 200 to be checked whether it is a packet used in an attack from among a plurality of CAN packets 200 .

프로세서(110)는 분석 대상 패킷(210) 중에서 기준 패킷(212)의 데이터와 동일한 데이터를 포함하는 하나 이상의 분석 대상 패킷(210)을 동일 데이터 패킷(211)으로 결정할 수 있다.The processor 110 may determine one or more analysis target packets 210 including the same data as the data of the reference packet 212 among the analysis target packets 210 as the same data packet 211 .

예를 들어, 도 5의 (a)를 참조하면, 64.59012(ms)에 생성된 CAN 패킷(200)이 기준 패킷(212)으로 결정된 경우, 분석 대상 패킷(210) 중에서 기준 패킷(212)의 데이터인 '00 01 19 02 01 00 80 00'의 CAN 데이터(203)를 포함하는 CAN 패킷(200)들을 동일 데이터 패킷(211)으로 결정할 수 있다.For example, referring to (a) of FIG. 5, when the CAN packet 200 generated at 64.59012 (ms) is determined to be the reference packet 212, the data of the reference packet 212 among the analysis target packets 210 CAN packets 200 including CAN data 203 of '00 01 19 02 01 00 80 00' may be determined as the same data packet 211.

이때, 분석 대상 패킷(210)의 CAN 데이터(203)가 모두 동일하면 분석 대상 패킷(210) 전부가 동일 데이터 패킷(211)으로 결정될 수도 있다. 또한, 기준 패킷(212)을 제외한 나머지 분석 대상 패킷(210)의 CAN 데이터(203)들이 전부 기준 패킷(212)의 CAN 데이터(203)와 다르면 오직 기준 패킷(212) 하나만이 동일 데이터 패킷(211)으로 결정될 수도 있다.In this case, if all of the CAN data 203 of the analysis target packets 210 are the same, all of the analysis target packets 210 may be determined as the same data packet 211 . In addition, if all of the CAN data 203 of the analysis target packet 210 other than the reference packet 212 are different from the CAN data 203 of the reference packet 212, only one reference packet 212 is the same data packet 211 ) may be determined.

도 5의 (a)의 경우 분석 대상 패킷(210)의 CAN 데이터(203)가 모두 동일해서 분석 대상 패킷(210) 전부가 동일 데이터 패킷(211)으로 결정된 경우의 예시이다.In the case of FIG. 5 (a), all of the CAN data 203 of the analysis target packets 210 are the same, and thus all of the analysis target packets 210 are determined to be the same data packet 211.

프로세서(110)는 분석 대상 시간 및 동일 데이터 패킷(211)의 개수를 기초로, 기준 패킷(212)이 CAN 네트워크에 대한 공격 패킷인지 여부를 판단할 수 있다.The processor 110 may determine whether the reference packet 212 is an attack packet for the CAN network based on the analysis target time and the number of identical data packets 211 .

프로세서(110)는 CAN 패킷(200)의 생성 순서를 기준으로, 기준 패킷(212)에 미리 설정된 개수 범위 내에 있는 CAN 패킷(200)을 분석 대상 패킷(210)으로 결정할 수 있다.The processor 110 may determine CAN packets 200 within a preset number range of the reference packet 212 as the analysis target packet 210 based on the generation order of the CAN packets 200 .

예를 들어, 프로세서(110)는 CAN 패킷(200)의 생성 순서를 기준으로, 기준 패킷(212)을 포함하여 기준 패킷(212)에 인접한 5개의 CAN 패킷(200)을 분석 대상 패킷(210)으로 결정할 수 있다.For example, the processor 110 converts five CAN packets 200 adjacent to the reference packet 212, including the reference packet 212, into the target packet 210 based on the generation order of the CAN packet 200. can be determined by

프로세서(110)는, CAN 패킷(200)의 생성 순서를 기준으로, 기준 패킷(212)보다 미리 설정된 숫자만큼 먼저 생성된 CAN 패킷(200)과 기준 패킷(212)보다 미리 설정된 숫자만큼 나중에 생성된 CAN 패킷(200) 사이에 포함되는 CAN 패킷(200)을 분석 대상 패킷(210)으로 결정할 수 있다.The processor 110, based on the order of generation of the CAN packets 200, the CAN packets 200 generated earlier by a preset number than the reference packet 212 and the CAN packets 200 generated later by a preset number than the reference packet 212 The CAN packet 200 included between the CAN packets 200 may be determined as the analysis target packet 210 .

예를 들어, 미리 설정된 숫자가 2이면, 프로세서(110)는 CAN 패킷(200)의 생성 순서를 기준으로, 기준 패킷(212) 바로 전에 생성된 2개의 CAN 패킷(200)과 기준 패킷(212) 바로 뒤에 생성된 2개의 CAN 패킷(200)을 분석 대상 패킷(210)으로 결정할 수 있다.For example, if the preset number is 2, the processor 110 generates two CAN packets 200 and the reference packet 212 generated immediately before the reference packet 212 based on the order of generation of the CAN packet 200. Two CAN packets 200 generated immediately after may be determined as analysis target packets 210 .

또한, 도 4의 실시예는 미리 설정된 숫자가 5여서 CAN 패킷(200)의 생성 순서를 기준으로, 기준 패킷(212) 바로 전에 생성된 5개의 CAN 패킷(200)과 기준 패킷(212) 바로 뒤에 생성된 5개의 CAN 패킷(200)이 분석 대상 패킷(210)으로 결정된 것일 수 있다.In addition, in the embodiment of FIG. 4, since the preset number is 5, based on the order of generation of the CAN packets 200, five CAN packets 200 generated immediately before the reference packet 212 and immediately after the reference packet 212 The generated five CAN packets 200 may be determined as analysis target packets 210 .

프로세서(110)는 동일 데이터 비율 정보(300)를 기초로 기준 패킷(212)이 CAN 네트워크에 대한 공격 패킷인지 여부를 판단할 수 있다.The processor 110 may determine whether the reference packet 212 is an attack packet for the CAN network based on the same data rate information 300 .

구체적으로, 프로세서(110)는 동일 데이터 비율 정보(300) 및 기준 동일 데이터 비율을 비교하여 기준 패킷(212)이 공격 패킷인지 판단할 수 있다.Specifically, the processor 110 may determine whether the reference packet 212 is an attack packet by comparing the same data rate information 300 and the reference same data rate.

프로세서(110)는 어떤 특정 기준 패킷(212)에 대응되는 동일 데이터 비율 정보(300)의 값이 기준 동일 데이터 비율 이상이면 해당 기준 패킷(212)을 공격 패킷이라고 판단할 수 있다.The processor 110 may determine that the corresponding standard packet 212 is an attack packet when the value of the same data rate information 300 corresponding to a specific standard packet 212 is greater than or equal to the standard same data rate.

예를 들어, 도 5의 (a)의 실시예를 참조하면, 프로세서(110)는 생성 시간이 64.59012(ms)인 CAN 패킷(200)을 기준 패킷(212)으로 정하고, 기준 패킷(212) 바로 전에 생성된 2개의 CAN 패킷(200)과 기준 패킷(212) 바로 뒤에 생성된 2개의 CAN 패킷(200)을 분석 대상 패킷(210)으로 결정할 수 있다.For example, referring to the embodiment of (a) of FIG. 5, the processor 110 determines the CAN packet 200 having a generation time of 64.59012 (ms) as the reference packet 212, and the reference packet 212 is immediately Two CAN packets 200 generated before and two CAN packets 200 generated immediately after the reference packet 212 may be determined as the target packet 210 for analysis.

또한, 프로세서(110)는 분석 대상 패킷(210) 중에서 CAN 데이터(203)가 기준 패킷(212)의 데이터와 동일한 '00 01 19 02 01 00 80 00'인 5개의 CAN 패킷(200)을 동일 데이터 패킷(211)으로 결정할 수 있다.In addition, the processor 110 converts five CAN packets 200 of which the CAN data 203 is the same as the data of the reference packet 212 from among the packets to be analyzed 210 to '00 01 19 02 01 00 80 00' as the same data. packet 211.

이때, 프로세서(110)는 분석 대상 패킷(210) 중에서 가장 먼저 생성된 CAN 패킷(200)의 생성 시간이 64.19009(ms)이고, 가장 늦게 생성된 CAN 패킷(200)의 생성 시간이 64.99019(ms)이면, 도시된 방정식에 따라 6.249를 동일 데이터 비율 정보(300)로 정할 수 있다. 만약 기준 동일 데이터 비율이 10이면, 도 5의 (a)의 기준 패킷(212)의 동일 데이터 비율 정보(300)는 기준 동일 데이터 비율보다 작고, 프로세서(110)는 기준 패킷(212)이 공격 패킷이 아니라고 판단할 수 있다.At this time, the processor 110 has a generation time of the first CAN packet 200 generated among the analysis target packets 210 is 64.19009 (ms), and a generation time of the latest CAN packet 200 is 64.99019 (ms) , 6.249 can be determined as the same data rate information 300 according to the illustrated equation. If the reference equal data rate is 10, the equal data rate information 300 of the reference packet 212 of FIG. It can be judged that this is not the case.

만약, 도 5의 (b)의 실시예를 참조하면, 프로세서(110)는 생성 시간이 67.99299(ms)인 CAN 패킷(200)을 기준 패킷(212)으로 정하고, 기준 패킷(212) 바로 전에 생성된 2개의 CAN 패킷(200)과 기준 패킷(212) 바로 뒤에 생성된 2개의 CAN 패킷(200)을 분석 대상 패킷(210)으로 결정할 수 있다.If referring to the embodiment of FIG. 5 (b), the processor 110 determines the CAN packet 200 whose generation time is 67.99299 (ms) as the reference packet 212 and generates it immediately before the reference packet 212. The two CAN packets 200 and the two CAN packets 200 generated immediately after the reference packet 212 may be determined as the target packet 210 for analysis.

또한, 프로세서(110)는 분석 대상 패킷(210) 중에서 CAN 데이터(203)가 기준 패킷(212)의 데이터와 동일한 '00 00 00 02 01 00 80 00'인 4개의 CAN 패킷(200)을 동일 데이터 패킷(211)으로 결정할 수 있다.In addition, the processor 110 converts four CAN packets 200 of which the CAN data 203 is the same as the data of the reference packet 212, '00 00 00 02 01 00 80 00' among the packets to be analyzed 210 to the same data. packet 211.

이때, 프로세서(110)는 분석 대상 패킷(210) 중에서 가장 먼저 생성된 CAN 패킷(200)의 생성 시간이 67.93011(ms)이고, 가장 늦게 생성된 CAN 패킷(200)의 생성 시간이 68.11188(ms)이면, 도시된 방정식에 따라 22.005를 동일 데이터 비율 정보(300)로 정할 수 있다. 만약 기준 동일 데이터 비율이 10이면, 도 5의 (b)의 기준 패킷(212)의 동일 데이터 비율 정보(300)는 기준 동일 데이터 비율보다 크고, 프로세서(110)는 기준 패킷(212)이 공격 패킷이라고 판단할 수 있다.At this time, the processor 110 has a generation time of the first CAN packet 200 generated among the analysis target packets 210 is 67.93011 (ms), and a generation time of the latest CAN packet 200 is 68.11188 (ms) , 22.005 may be determined as the same data rate information 300 according to the illustrated equation. If the reference equal data rate is 10, the equal data rate information 300 of the reference packet 212 of FIG. can be judged to be

도 6은 일 실시예에 따라 각 기준 패킷 별 동일 데이터 비율 정보를 정리하는 것을 도시한 도면이다.6 is a diagram illustrating arranging the same data rate information for each reference packet according to an embodiment.

도 6을 참조하면, 프로세서(110)는 어느 특정한 CAN ID(202)를 가지는 CAN 패킷(200)들 각각의 동일 데이터 비율 정보(300)를 정리할 수 있다.Referring to FIG. 6 , the processor 110 may organize the same data rate information 300 of each of the CAN packets 200 having a specific CAN ID 202 .

예를 들어, 프로세서(110)는 CAN ID(202)가 553인 CAN 패킷(200)들만 모으고, 그 중에서 기준 패킷(212)을 정하고, 해당 기준 패킷(212)에 대한 동일 데이터 비율 정보(300)를 정할 수 있다.For example, the processor 110 collects only CAN packets 200 having a CAN ID 202 of 553, determines a reference packet 212 from among them, and obtains the same data rate information 300 for the reference packet 212. can be determined.

이때, 프로세서(110)는 순차적으로 CAN ID(202)가 553인 CAN 패킷(200)들을 한번씩 기준 패킷(212)으로 정하여 CAN ID(202)가 553인 모든 CAN 패킷(200)들 각각에 대한 동일 데이터 비율 정보(300)의 값을 결정하고, 이러한 특정 CAN ID(202)의 CAN 패킷(200)의 동일 데이터 비율 정보(300)들을 정리할 수 있다.At this time, the processor 110 sequentially determines the CAN packets 200 having the CAN ID 202 of 553 as the reference packet 212 once, and the CAN ID 202 is the same for each of the CAN packets 200 of 553. A value of the data rate information 300 may be determined, and the same data rate information 300 of the CAN packet 200 of the specific CAN ID 202 may be arranged.

이상에서 설명된 구성요소들의 성능에 대응하여 적어도 하나의 구성요소가 추가되거나 삭제될 수 있다. 또한, 구성요소들의 상호 위치는 시스템의 성능 또는 구조에 대응하여 변경될 수 있다는 것은 당해 기술 분야에서 통상의 지식을 가진 자에게 용이하게 이해될 것이다.At least one component may be added or deleted corresponding to the performance of the components described above. In addition, it will be easily understood by those skilled in the art that the mutual positions of the components can be changed corresponding to the performance or structure of the system.

도 7은 일 실시예에 따른 CAN 네트워크의 공격 탐지 방법의 순서도이다. 이는 본 발명의 목적을 달성하기 위한 바람직한 실시예일 뿐이며, 필요에 따라 일부 구성이 추가되거나 삭제될 수 있음은 물론이다.7 is a flowchart of a method for detecting an attack in a CAN network according to an embodiment. This is only a preferred embodiment for achieving the object of the present invention, and it goes without saying that some components may be added or deleted as needed.

도 7을 참조하면, 프로세서(110)는 CAN 방식을 통해 제어되는 CAN 네트워크의 CAN 패킷(200) 중에서 기준 패킷(212)을 결정할 수 있다(1001).Referring to FIG. 7 , the processor 110 may determine a reference packet 212 from among CAN packets 200 of a CAN network controlled through a CAN scheme (1001).

프로세서(110)는 CAN 패킷(200)의 생성 순서를 기준으로, 복수의 CAN 패킷(200) 중에서 미리 설정된 개수의 CAN 패킷(200)을 분석 대상 패킷(210)으로 결정할 수 있다(1002). 이때, 프로세서(110)는 생성 순서를 기준으로, 기준 패킷(212)에 미리 설정된 개수 범위 내에 있는 CAN 패킷(200)을 분석 대상 패킷(210)으로 결정할 수 있다.The processor 110 may determine a predetermined number of CAN packets 200 among the plurality of CAN packets 200 as the analysis target packet 210 based on the order of generation of the CAN packets 200 (1002). At this time, the processor 110 may determine the CAN packets 200 within a preset number range of the reference packet 212 as the analysis target packet 210 based on the generation order.

프로세서(110)는 가장 먼저 생성된 분석 대상 패킷(210)의 생성 시간과 가장 늦게 생성된 분석 대상 패킷(210)의 생성 시간 간의 차이를 기초로 분석 대상 시간을 결정할 수 있다(1003).The processor 110 may determine the analysis target time based on the difference between the creation time of the first analysis target packet 210 and the latest generation analysis target packet 210 (1003).

프로세서(110)는 분석 대상 패킷(210) 중에서 동일한 데이터를 포함하는 하나 이상의 분석 대상 패킷(210)을 동일 데이터 패킷(211)으로 결정할 수 있다(1004). 이때, 프로세서(110)는 분석 대상 패킷(210) 중에서 기준 패킷(212)의 데이터와 동일한 데이터를 포함하는 하나 이상의 분석 대상 패킷(210)을 동일 데이터 패킷(211)으로 결정할 수 있다.The processor 110 may determine one or more analysis target packets 210 including the same data among the analysis target packets 210 as the same data packet 211 (1004). In this case, the processor 110 may determine one or more analysis target packets 210 including the same data as the data of the reference packet 212 among the analysis target packets 210 as the same data packet 211 .

프로세서(110)는 동일 데이터 패킷(211)의 개수를 분석 대상 시간으로 나눈 값을 동일 데이터 비율 정보(300)로 결정할 수 있다(1005).The processor 110 may determine a value obtained by dividing the number of identical data packets 211 by the time to be analyzed as the same data rate information 300 (1005).

프로세서(110)는 동일 데이터 비율 정보(300)를 기초로 기준 패킷(212)이 CAN 네트워크에 대한 공격 패킷인지 여부를 판단할 수 있다(1006). 이때, 프로세서(110)는 기준 패킷(212)의 동일 데이터 비율 정보(300) 및 기준 동일 데이터 비율을 비교하여 기준 패킷(212)이 CAN 네트워크에 대한 공격 패킷인지 여부를 판단할 수 있다.The processor 110 may determine whether the reference packet 212 is an attack packet for the CAN network based on the same data rate information 300 (1006). At this time, the processor 110 may compare the same data rate information 300 of the reference packet 212 and the reference same data rate to determine whether the reference packet 212 is an attack packet for the CAN network.

본 발명의 실시예에 따른 CAN 네트워크의 공격 탐지 방법의 성능을 검증하기 위하여, CAN 패킷 공격 탐지 실험을 진행하였다.In order to verify the performance of the CAN network attack detection method according to an embodiment of the present invention, a CAN packet attack detection experiment was conducted.

도 8은 일 실시예에 따른 정상 상태의 동일 데이터 비율 정보(300)를 나타낸 그래프 및 공격 상태의 동일 데이터 비율 정보(300)를 나타낸 그래프이며, 도 9는 일 실시예에 따른 다양한 CAN ID(202)의 패킷 별 동일 데이터 비율 정보(300)를 나타낸 그래프이다.8 is a graph showing the same data rate information 300 in a normal state and a graph showing the same data rate information 300 in an attack state according to an embodiment, and FIG. 9 is a graph showing various CAN IDs 202 according to an embodiment. ) is a graph showing the same data rate information 300 for each packet.

도 8을 참조하면, 어느 특정한 CAN ID(202)를 가지는 CAN 패킷(200)에 대한 공격 탐지 실험의 분석 결과 그래프를 확인할 수 있다.Referring to FIG. 8 , an analysis result graph of an attack detection experiment for a CAN packet 200 having a specific CAN ID 202 can be confirmed.

CAN ID(202)가 0x553인 CAN 패킷(200)에 대한 패킷 단위의 공격이 없는 경우, 어떠한 생성 시간에 생성된 CAN ID(202)가 0x553인 CAN 패킷(200)의 동일 데이터 비율 정보(300)의 값은 일정하게 유지되는 것을 확인할 수 있었다.If there is no packet-based attack on the CAN packet 200 whose CAN ID 202 is 0x553, the same data rate information 300 of the CAN packet 200 whose CAN ID 202 is 0x553 generated at any generation time It was confirmed that the value of is kept constant.

반면, CAN ID(202)가 0x553인 CAN 패킷(200)에 대한 패킷 단위의 공격이 있는 경우, 특정 생성 시간에 생성된 CAN ID(202)가 0x553인 CAN 패킷(200)의 동일 데이터 비율 정보(300)의 값은 공격을 받지 않은 생성 시간의 동일 데이터 비율 정보(300)의 값보다 크기가 크게 증가하며, 그 값 또한 생성 시간마다 일정하지 않음을 확인할 수 있었다.On the other hand, if there is a packet-based attack on the CAN packet 200 whose CAN ID 202 is 0x553, the same data rate information ( 300) is greatly increased in size compared to the value of the same data rate information 300 at the non-attacked creation time, and it was confirmed that the value is also not constant for each creation time.

도 9를 참조하면, CAN 패킷(200)의 CAN ID(202)가 무엇이든 관계없이 특정한 CAN ID(202)의 CAN 패킷(200)에 대한 패킷 단위의 공격이 있는 경우, 동일 데이터 비율 정보(300)의 값이 공격을 받지 않은 생성 시간의 동일 데이터 비율 정보(300)의 값보다 크기가 크게 증가하며, 그 값 또한 생성 시간마다 일정하지 않음을 확인할 수 있었다.Referring to FIG. 9, regardless of what the CAN ID 202 of the CAN packet 200 is, if there is a packet-based attack on the CAN packet 200 of a specific CAN ID 202, the same data rate information 300 ) is larger in size than the value of the same data rate information 300 at the time of creation without an attack, and it was confirmed that the value is also not constant for each creation time.

이상에서와 같이 첨부된 도면을 참조하여 개시된 실시예들을 설명하였다. 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자는 본 발명의 기술적 사상이나 필수적인 특징을 변경하지 않고도, 개시된 실시예들과 다른 형태로 본 발명이 실시될 수 있음을 이해할 것이다. 개시된 실시예들은 예시적인 것이며, 한정적으로 해석되어서는 안 된다.As above, the disclosed embodiments have been described with reference to the accompanying drawings. Those skilled in the art to which the present invention pertains will understand that the present invention can be implemented in a form different from the disclosed embodiments without changing the technical spirit or essential features of the present invention. The disclosed embodiments are illustrative and should not be construed as limiting.

100: 공격 탐지 시스템
110: 프로세서
120: 기계학습부
130: 메모리
131: 기계 학습 모델
200: CAN 패킷
201: 생성 시간 값
202: CAN ID
203: CAN 데이터
210: 분석 대상 패킷
211: 동일 데이터 패킷
212: 기준 패킷
300: 동일 데이터 비율 정보
400: 학습용 CAN 패킷
100: attack detection system
110: processor
120: machine learning unit
130: memory
131: machine learning model
200: CAN packet
201: creation time value
202 CAN ID
203: CAN data
210: packet to be analyzed
211: identical data packet
212 reference packet
300: equal data rate information
400: CAN packet for learning

Claims (12)

CAN 방식을 통해 제어되는 CAN 네트워크의 공격 탐지 시스템에 있어서,
상기 CAN 네트워크의 CAN 패킷을 기초로 CAN 패킷 단위의 공격 여부를 판단하도록 구성되는 프로세서;를 포함하고,
상기 프로세서는:
상기 CAN 패킷의 생성 순서를 기준으로, 복수의 상기 CAN 패킷 중에서 미리 설정된 개수의 CAN 패킷을 분석 대상 패킷으로 결정하고;
가장 먼저 생성된 상기 분석 대상 패킷의 생성 시간과 가장 늦게 생성된 상기 분석 대상 패킷의 생성 시간 간의 차이를 기초로 분석 대상 시간을 결정하고;
상기 분석 대상 패킷 중에서 포함된 CAN 데이터가 동일한지 여부를 기초로, 동일한 데이터를 포함하는 하나 이상의 분석 대상 패킷을 동일 데이터 패킷으로 결정하고;
상기 분석 대상 시간 및 상기 동일 데이터 패킷의 개수를 기초로, 상기 CAN 네트워크에 대한 CAN 패킷 단위의 공격 여부를 판단하고;
상기 동일 데이터 패킷의 개수를 상기 분석 대상 시간으로 나눈 값을 동일 데이터 비율 정보로 결정하고; 그리고
상기 동일 데이터 비율 정보를 기초로 상기 CAN 패킷 단위의 공격 여부를 판단하도록 구성되는, CAN 네트워크의 공격 탐지 시스템.
In the attack detection system of the CAN network controlled through the CAN method,
A processor configured to determine whether or not an attack is performed in units of CAN packets based on CAN packets of the CAN network;
The processor:
Based on the order of generation of the CAN packets, determining a preset number of CAN packets from among the plurality of CAN packets as analysis target packets;
determining an analysis target time based on a difference between a creation time of the first generated packet to be analyzed and a creation time of the latest generated packet to be analyzed;
determining one or more to-be-analyzed packets including the same data as the same data packet, based on whether CAN data included in the to-be-analyzed packets is the same;
Based on the analysis target time and the number of identical data packets, determining whether or not an attack is performed in units of CAN packets on the CAN network;
determining a value obtained by dividing the number of identical data packets by the analysis target time as identical data rate information; and
An attack detection system of a CAN network configured to determine whether the CAN packet unit is attacked based on the same data rate information.
제1항에 있어서,
상기 프로세서는,
복수의 상기 CAN 패킷 중에서 생성 순서를 기준으로 서로 인접한 복수의 CAN 패킷을 상기 미리 설정된 개수의 분석 대상 패킷으로 결정하도록 구성되는, CAN 네트워크의 공격 탐지 시스템.
According to claim 1,
the processor,
An attack detection system of a CAN network configured to determine a plurality of CAN packets adjacent to each other based on a generation order among a plurality of the CAN packets as the preset number of analysis target packets.
삭제delete 제1항에 있어서,
학습용 CAN 패킷을 기초로 결정된 학습용 CAN 패킷의 동일 데이터 비율 정보를 입력 변수로 하고, 상기 학습용 CAN 패킷의 정상 여부 정보를 출력 변수로 설정하여 기계 학습 방식을 통해 기계 학습 모델을 생성하도록 구성되는 기계학습부;를 더 포함하고,
상기 프로세서는,
상기 동일 데이터 비율 정보를 기초로 상기 기계 학습 모델에 의해 상기 CAN 패킷 단위의 공격 여부를 판단하도록 구성되는 CAN 네트워크의 공격 탐지 시스템.
According to claim 1,
Machine learning configured to generate a machine learning model through a machine learning method by setting the same data rate information of the learning CAN packet determined based on the learning CAN packet as an input variable and setting the normality information of the learning CAN packet as an output variable It further includes;
the processor,
An attack detection system of a CAN network configured to determine whether or not an attack is performed in units of the CAN packet by the machine learning model based on the same data rate information.
제4항에 있어서,
상기 프로세서는:
상기 기계 학습 모델에 기초하여 기준 동일 데이터 비율을 결정하고; 그리고
상기 동일 데이터 비율 정보 및 상기 기준 동일 데이터 비율을 비교하여 상기 CAN 패킷 단위의 공격 여부를 판단하도록 구성되는, CAN 네트워크의 공격 탐지 시스템.
According to claim 4,
The processor:
determine a reference equal data rate based on the machine learning model; and
An attack detection system of a CAN network configured to compare the same data rate information and the reference same data rate to determine whether the CAN packet unit is attacked.
제1항에 있어서,
상기 프로세서는:
복수의 상기 CAN 패킷 중에서 기준 패킷을 결정하고;
상기 분석 대상 패킷 중에서 상기 기준 패킷의 데이터와 동일한 데이터를 포함하는 하나 이상의 분석 대상 패킷을 상기 동일 데이터 패킷으로 결정하고; 그리고
상기 분석 대상 시간 및 상기 동일 데이터 패킷의 개수를 기초로, 상기 기준 패킷이 상기 CAN 네트워크에 대한 공격 패킷인지 여부를 판단하도록 구성되는, CAN 네트워크의 공격 탐지 시스템.
According to claim 1,
The processor:
determine a reference packet from among a plurality of the CAN packets;
determining one or more analysis target packets including data identical to data of the reference packet among the analysis target packets as the same data packet; and
An attack detection system of a CAN network configured to determine whether the reference packet is an attack packet for the CAN network based on the analysis target time and the number of identical data packets.
제6항에 있어서,
상기 프로세서는,
상기 CAN 패킷의 생성 순서를 기준으로, 상기 기준 패킷에 미리 설정된 개수 범위 내에 있는 CAN 패킷을 상기 분석 대상 패킷으로 결정하도록 구성되는, CAN 네트워크의 공격 탐지 시스템.
According to claim 6,
the processor,
Based on the order of generation of the CAN packets, the CAN network attack detection system configured to determine a CAN packet within a preset number range of the reference packet as the analysis target packet.
제7항에 있어서,
상기 프로세서는,
상기 CAN 패킷의 생성 순서를 기준으로, 상기 기준 패킷보다 미리 설정된 숫자만큼 먼저 생성된 CAN 패킷과 상기 기준 패킷보다 상기 미리 설정된 숫자만큼 나중에 생성된 CAN 패킷 사이에 포함되는 CAN 패킷을 상기 분석 대상 패킷으로 결정하도록 구성되는 CAN 네트워크의 공격 탐지 시스템.
According to claim 7,
the processor,
Based on the order of generation of the CAN packets, a CAN packet included between a CAN packet generated earlier by a preset number than the reference packet and a CAN packet generated later by the preset number than the reference packet is regarded as the analysis target packet. An attack detection system in a CAN network configured to determine
제1항에 있어서,
상기 프로세서는:
복수의 상기 CAN 패킷 중에서 기준 패킷을 결정하고;
상기 CAN 패킷의 생성 순서를 기준으로, 상기 기준 패킷에 미리 설정된 개수 범위 내에 있는 CAN 패킷을 상기 분석 대상 패킷으로 결정하고;
상기 분석 대상 패킷 중에서 상기 기준 패킷의 데이터와 동일한 데이터를 포함하는 하나 이상의 분석 대상 패킷을 상기 동일 데이터 패킷으로 결정하고;
상기 동일 데이터 패킷의 개수를 상기 분석 대상 시간으로 나눈 값을 동일 데이터 비율 정보로 결정하고; 그리고
상기 동일 데이터 비율 정보를 기초로 상기 기준 패킷이 상기 CAN 네트워크에 대한 공격 패킷인지 여부를 판단하도록 구성되는 CAN 네트워크의 공격 탐지 시스템.
According to claim 1,
The processor:
determine a reference packet from among a plurality of the CAN packets;
Based on the order of generation of the CAN packets, determining CAN packets within a preset number range of the reference packets as the analysis target packets;
determining one or more analysis target packets including data identical to data of the reference packet among the analysis target packets as the same data packet;
determining a value obtained by dividing the number of identical data packets by the analysis target time as identical data rate information; and
An attack detection system of a CAN network configured to determine whether the reference packet is an attack packet for the CAN network based on the same data rate information.
프로세서에 의해 CAN 방식을 통해 제어되는 CAN 네트워크의 CAN 패킷을 기초로 CAN 패킷 단위의 공격 여부를 판단하는 공격 탐지 방법으로서,
상기 CAN 패킷의 생성 순서를 기준으로, 복수의 상기 CAN 패킷 중에서 미리 설정된 개수의 CAN 패킷을 분석 대상 패킷으로 결정하는 단계;
가장 먼저 생성된 상기 분석 대상 패킷의 생성 시간과 가장 늦게 생성된 상기 분석 대상 패킷의 생성 시간 간의 차이를 기초로 분석 대상 시간을 결정하는 단계;
상기 분석 대상 패킷 중에서 포함된 CAN 데이터가 동일한지 여부를 기초로, 동일한 데이터를 포함하는 하나 이상의 분석 대상 패킷을 동일 데이터 패킷으로 결정하는 단계;
상기 분석 대상 시간 및 상기 동일 데이터 패킷의 개수를 기초로, 상기 CAN 네트워크에 대한 CAN 패킷 단위의 공격 여부를 판단하는 단계; 및
상기 동일 데이터 패킷의 개수를 상기 분석 대상 시간으로 나눈 값을 동일 데이터 비율 정보로 결정하는 단계;를 포함하고,
상기 CAN 패킷 단위의 공격 여부를 판단하는 단계는,
상기 동일 데이터 비율 정보를 기초로 상기 CAN 패킷 단위의 공격 여부를 판단하는 단계;를 포함하는 CAN 네트워크의 공격 탐지 방법.
An attack detection method for determining whether a CAN packet unit is attacked based on a CAN packet of a CAN network controlled by a processor through a CAN method,
Based on the order of generation of the CAN packets, determining a preset number of CAN packets from among the plurality of CAN packets as analysis target packets;
determining an analysis target time based on a difference between a generation time of the first analysis target packet and a latest generation time of the analysis target packet;
determining one or more analysis target packets including the same data as the same data packet, based on whether CAN data included in the analysis target packets is the same;
determining whether or not the CAN network is attacked in units of CAN packets based on the analysis target time and the number of identical data packets; and
Determining a value obtained by dividing the number of identical data packets by the analysis target time as the same data rate information;
The step of determining whether the CAN packet unit is attacked is
A method for detecting an attack in a CAN network comprising: determining whether or not an attack occurs in units of the CAN packet based on the same data rate information.
제10항에 있어서,
복수의 상기 CAN 패킷 중에서 기준 패킷을 결정하는 단계;를 더 포함하고,
상기 미리 설정된 개수의 CAN 패킷을 분석 대상 패킷으로 결정하는 단계는,
상기 CAN 패킷의 생성 순서를 기준으로, 상기 기준 패킷에 미리 설정된 개수 범위 내에 있는 CAN 패킷을 상기 분석 대상 패킷으로 결정하는 단계;를 포함하고,
상기 동일 데이터 패킷으로 결정하는 단계는,
상기 분석 대상 패킷 중에서 상기 기준 패킷의 데이터와 동일한 데이터를 포함하는 하나 이상의 분석 대상 패킷을 상기 동일 데이터 패킷으로 결정하는 단계;를 포함하고,
상기 CAN 패킷 단위의 공격 여부를 판단하는 단계는,
상기 동일 데이터 비율 정보를 기초로 상기 기준 패킷이 상기 CAN 네트워크에 대한 공격 패킷인지 여부를 판단하는 단계;를 포함하는 CAN 네트워크의 공격 탐지 방법.
According to claim 10,
Further comprising: determining a reference packet from among the plurality of CAN packets;
The step of determining the preset number of CAN packets as analysis target packets,
Based on the order of generation of the CAN packets, determining a CAN packet within a preset number range of the reference packet as the analysis target packet; Including,
The step of determining the same data packet,
Determining one or more analysis target packets including data identical to data of the reference packet among the analysis target packets as the same data packet;
The step of determining whether the CAN packet unit is attacked is
and determining whether the reference packet is an attack packet for the CAN network based on the same data rate information.
제10항 내지 제11항 중 어느 한 항의 상기 CAN 네트워크의 공격 탐지 방법을 실행시키도록 컴퓨터로 판독 가능한 기록매체에 저장된 컴퓨터 프로그램.A computer program stored in a computer-readable recording medium to execute the CAN network attack detection method according to any one of claims 10 to 11.
KR1020210120951A 2021-09-10 2021-09-10 Attack detection system of can network, attack detection method of can network and computer program stored in a recording medium to execute the method KR102469399B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020210120951A KR102469399B1 (en) 2021-09-10 2021-09-10 Attack detection system of can network, attack detection method of can network and computer program stored in a recording medium to execute the method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020210120951A KR102469399B1 (en) 2021-09-10 2021-09-10 Attack detection system of can network, attack detection method of can network and computer program stored in a recording medium to execute the method

Publications (1)

Publication Number Publication Date
KR102469399B1 true KR102469399B1 (en) 2022-11-21

Family

ID=84233744

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020210120951A KR102469399B1 (en) 2021-09-10 2021-09-10 Attack detection system of can network, attack detection method of can network and computer program stored in a recording medium to execute the method

Country Status (1)

Country Link
KR (1) KR102469399B1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101371902B1 (en) * 2012-12-12 2014-03-10 현대자동차주식회사 Apparatus for detecting vehicle network attcak and method thereof
KR20140126651A (en) * 2013-04-23 2014-10-31 (주)나루씨큐리티 Apparatus and method for detecting local network attacks
KR20180137306A (en) * 2017-06-16 2018-12-27 주식회사 페스카로 Method and System for detecting hacking attack based on the CAN protocol

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101371902B1 (en) * 2012-12-12 2014-03-10 현대자동차주식회사 Apparatus for detecting vehicle network attcak and method thereof
KR20140126651A (en) * 2013-04-23 2014-10-31 (주)나루씨큐리티 Apparatus and method for detecting local network attacks
KR20180137306A (en) * 2017-06-16 2018-12-27 주식회사 페스카로 Method and System for detecting hacking attack based on the CAN protocol

Similar Documents

Publication Publication Date Title
Wu et al. Sliding window optimized information entropy analysis method for intrusion detection on in-vehicle networks
Young et al. Survey of automotive controller area network intrusion detection systems
US11303661B2 (en) System and method for detection and prevention of attacks on in-vehicle networks
Jo et al. A survey of attacks on controller area networks and corresponding countermeasures
EP3274845B1 (en) Security systems and method for identification of in-vehicle attack originator
US10826684B1 (en) System and method of validating Internet of Things (IOT) devices
US10642715B1 (en) Dynamic authorization of requested actions using adaptive context-based matching
Waszecki et al. Automotive electrical and electronic architecture security via distributed in-vehicle traffic monitoring
Stan et al. Intrusion detection system for the MIL-STD-1553 communication bus
CN110120935B (en) Method and device for identifying anomalies in data flows in a communication network
CN111970229B (en) CAN bus data anomaly detection method aiming at multiple attack modes
CN114374565A (en) Intrusion detection method and device for vehicle CAN network, electronic equipment and medium
Han et al. Event-triggered interval-based anomaly detection and attack identification methods for an in-vehicle network
ben Othmane et al. On the performance of detecting injection of fabricated messages into the can bus
Taylor et al. Probing the limits of anomaly detectors for automobiles with a cyberattack framework
Pawelec et al. Towards a CAN IDS based on a neural network data field predictor
Chockalingam et al. Detecting attacks on the CAN protocol with machine learning
CN113904811A (en) Anomaly detection method and device, computer equipment and storage medium
Francia et al. Applied machine learning to vehicle security
Xu et al. Voltage based authentication for controller area networks with reinforcement learning
KR102469399B1 (en) Attack detection system of can network, attack detection method of can network and computer program stored in a recording medium to execute the method
US20230079725A1 (en) Controller Area Network Fuzzing Apparatus for Vehicle and Method Thereof
Agbaje et al. A Framework for Consistent and Repeatable Controller Area Network IDS Evaluation
KR102526877B1 (en) Attack detection system of can vehicle network, attack detection method of can vehicle network and computer program stored in a recording medium to execute the method thereof
KR20240040554A (en) Attack detection system of can network using graph generated based on can packet

Legal Events

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