From 064f8f5bcc6ff7e47ad4cc7848c9b37c61a5a665 Mon Sep 17 00:00:00 2001 From: Kim HyeonSeong <101382350+KimHyeonSeong99@users.noreply.github.com> Date: Thu, 1 May 2025 12:04:14 +0900 Subject: [PATCH 01/26] Create Readme.md --- Attack Scenarios/Readme.md | 117 +++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 Attack Scenarios/Readme.md diff --git a/Attack Scenarios/Readme.md b/Attack Scenarios/Readme.md new file mode 100644 index 0000000..2f9a5dd --- /dev/null +++ b/Attack Scenarios/Readme.md @@ -0,0 +1,117 @@ +# Attack Scenarios + +## Secure OTA + +--- + +## 1. Supply Chain Attack + +### 공격 시나리오 1: 정식 OTA 파일 업로드 웹페이지를 통해 악성 코드 업데이트 + +- 공격자는 정식 OTA 파일 업로드 웹페이지를 통해 악성코드를 포함한 .bin 파일을 업로드함 +- 보안이 적용되지 않은 OTA 시스템에서는 해당 악성코드가 차량 ECU에 설치됨 + +#### 공격 시나리오 수행 방법 +1. 공격자는 타겟 ECU에 맞는 .bin 파일을 제작 +2. OTA 업로드 웹사이트에 해당 파일 업로드 +3. 인증이 없는 차량은 해당 악성 파일을 설치하게 됨 + +#### 보안 솔루션 +- 관리자 계정 인증을 통해 업로드 기능 제한 +- 관리자 장비의 서명을 서버에서 인증하여, 인증된 파일만 설치 +- 별도 서명 툴을 통해 파일 업로드 전 전자서명을 생성하고 서버/차량에서 검증 + +--- + +### 공격 시나리오 2: MQTT broker에 악성 코드 혹은 URL publishing + +- 공격자는 MQTT broker에 접근하여 악성 코드나 URL을 publish +- 차량은 subscribe된 메시지를 통해 인증 없이 해당 파일을 설치함 + +#### 공격 시나리오 수행 방법 +1. 인증된 차량 해킹 후 MQTT broker의 IP 확인 +2. broker에 악성 파일이나 다운로드 URL을 publish +3. 차량은 인증 없이 해당 파일을 설치 + +#### 보안 솔루션 +- MQTT broker에서 ID/PW 설정을 통해 접근 제한 +- EMQX 등의 MQTT 어플리케이션으로 IP 기반 접근 제어 +- publish된 메시지에 서명을 포함하고 차량에서 이를 인증 + +--- + +## 2. Man-in-the-middle Attack + +### 공격 시나리오 1: OTA 웹페이지를 캡처하여 파일 유출 및 변조 + +#### 공격 시나리오 수행 방법 +1. 관리자 장비의 프록시를 공격자의 것으로 설정 +2. 파일 업로드 시 burp 등의 MITM 툴로 패킷 캡처 및 유출 +3. 유출된 파일을 변조하여 서버에 재전달 +4. 차량은 해당 파일을 설치하게 됨 + +#### 보안 솔루션 +- 서버 전송 시 업로드 데이터 암호화 +- 전자 서명을 통해 변조 여부 검증 +- 프록시 고정 등을 통해 지정 장비에서만 업로드 허용 + +--- + +### 공격 시나리오 2: 프록시 조작으로 가짜 서버 연결 (예린님 작성) + +#### 공격 시나리오 수행 방법 +1. 공격자가 OTA 도메인의 IP를 위조하여 자신의 서버로 유도 +2. 차량은 가짜 OTA 서버에 접속하여 악성 파일 다운로드 +3. 유사한 형식의 OTA 패키지를 받아 악성코드 포함 소프트웨어로 업데이트됨 + +#### 보안 솔루션 +- HTTPS 기반 통신과 인증서 검증 강화 +- OTA 파일에 전자 서명 및 무결성 검증 적용 + +--- + +### 공격 시나리오 3: DNS Spoofing을 통해 가짜 OTA 서버 연결 (정우님 작성) + +#### 공격 시나리오 수행 방법 +1. Bettercap, dnsmasq를 사용하여 DNS 요청을 공격자의 IP로 리디렉션 +2. Self-signed 인증서로 HTTPS 통신 위장 +3. 인증서 검증 미흡 시 차량은 공격자의 서버를 신뢰 +4. 악성 OTA 파일과 서명, 해시 전달 → 차량 설치 + +#### 보안 솔루션 +- 서버 측: HTTPS(SSL/TLS) 통신 +- 차량 측: Root CA 검증, 전자 서명 및 해시 검증 + +--- + +### 공격 시나리오 4: 프록시 조작을 통한 전송 패킷 가로채기 + +#### 공격 시나리오 수행 방법 +1. 정상 관리자 파일 업로드 +2. 서버에서 broker로 publish +3. 프록시 조작을 통해 파일이 공격자에게 전달됨 +4. 변조된 파일을 정상적인 IP를 위장해 다시 전송 +5. 차량은 무결성 검증 없이 설치 진행 + +#### 보안 솔루션 +- 파일 전송 시 암호화 적용 +- 전자 서명 및 무결성 검증 필수 + +--- + +## 3. Replay Attack + +### 공격 시나리오: 과거 업데이트 패킷 재사용 + +#### 공격 시나리오 수행 방법 +1. 과거 OTA 패킷을 캡처 및 보관 +2. 최신 버전의 취약점을 공략하기 위해 과거 버전 전송 +3. 차량은 메시지 신선도 검증 미흡으로 해당 패킷 설치 +4. 이후 알려진 취약점을 통해 공격 수행 + +#### 보안 솔루션 +- OTA 패킷에 버전 정보 포함 및 버전 체크 수행 +- 타임스탬프를 통한 신선도 검증 +- 업데이트마다 변화하는 테이블 값으로 고유성 확보 + +--- From 70cf1966d07ce27e9f4767f918b9d11eccbf0c60 Mon Sep 17 00:00:00 2001 From: Kim HyeonSeong <101382350+KimHyeonSeong99@users.noreply.github.com> Date: Thu, 1 May 2025 12:06:25 +0900 Subject: [PATCH 02/26] Rename Readme.md to README.md --- Attack Scenarios/Readme.md => attack_scenarios/README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Attack Scenarios/Readme.md => attack_scenarios/README.md (100%) diff --git a/Attack Scenarios/Readme.md b/attack_scenarios/README.md similarity index 100% rename from Attack Scenarios/Readme.md rename to attack_scenarios/README.md From cfdfd29ac5c6360678466fcb877d46263b8bbffc Mon Sep 17 00:00:00 2001 From: Kim HyeonSeong <101382350+KimHyeonSeong99@users.noreply.github.com> Date: Thu, 1 May 2025 13:47:31 +0900 Subject: [PATCH 03/26] Update README.md --- attack_scenarios/README.md | 122 +++++++++++++------------------------ 1 file changed, 43 insertions(+), 79 deletions(-) diff --git a/attack_scenarios/README.md b/attack_scenarios/README.md index 2f9a5dd..8e65ff2 100644 --- a/attack_scenarios/README.md +++ b/attack_scenarios/README.md @@ -1,117 +1,81 @@ # Attack Scenarios -## Secure OTA - --- +## Attack Proposol +- 공격자는 악성 코드를 주입하여 **차량의 사고를 유발하고나 제어 권한을 얻는 것**을 목표로 함 +- 공격자는 정식 OTA를 방해하여 **차량이 보안 혹은 기능적으로 취약한 상태를 유지하는 것**을 목표로 함 + ## 1. Supply Chain Attack -### 공격 시나리오 1: 정식 OTA 파일 업로드 웹페이지를 통해 악성 코드 업데이트 +### 공격 시나리오 1: 정식 OTA 파일 업로드 웹페이지를 통해 악성 코드 업데이트 [Level 1] -- 공격자는 정식 OTA 파일 업로드 웹페이지를 통해 악성코드를 포함한 .bin 파일을 업로드함 -- 보안이 적용되지 않은 OTA 시스템에서는 해당 악성코드가 차량 ECU에 설치됨 +#### 공격 시나리오 전제 조건 +파일을 업로드하는 웹사이트의 URL IP 주소값(혹은 도메인)을 공격자가 획득한 것으로 가정한다. #### 공격 시나리오 수행 방법 -1. 공격자는 타겟 ECU에 맞는 .bin 파일을 제작 -2. OTA 업로드 웹사이트에 해당 파일 업로드 -3. 인증이 없는 차량은 해당 악성 파일을 설치하게 됨 - -#### 보안 솔루션 -- 관리자 계정 인증을 통해 업로드 기능 제한 -- 관리자 장비의 서명을 서버에서 인증하여, 인증된 파일만 설치 -- 별도 서명 툴을 통해 파일 업로드 전 전자서명을 생성하고 서버/차량에서 검증 - +1. 공격자는 타겟 ECU에 주입할 악성 펌웨어/소프트웨어에 해당하는 .bin 파일을 생성한다. +2. OTA 파일을 업로드하는 정식 웹사이트를 통해 .bin 파일을 업로드한다. +3. 인증이 없는 차량은 해당 악성 파일을 설치한다. --- -### 공격 시나리오 2: MQTT broker에 악성 코드 혹은 URL publishing +### 공격 시나리오 2: MQTT broker에 악성 코드 혹은 URL publishing [Level 1] -- 공격자는 MQTT broker에 접근하여 악성 코드나 URL을 publish -- 차량은 subscribe된 메시지를 통해 인증 없이 해당 파일을 설치함 +#### 공격 시나리오 전제 조건 +인증된 차량 해킹 하여 OEM에서 활용 중인 MQTT Broker의 IP를 획득한 것으로 가정한다. #### 공격 시나리오 수행 방법 -1. 인증된 차량 해킹 후 MQTT broker의 IP 확인 -2. broker에 악성 파일이나 다운로드 URL을 publish -3. 차량은 인증 없이 해당 파일을 설치 - -#### 보안 솔루션 -- MQTT broker에서 ID/PW 설정을 통해 접근 제한 -- EMQX 등의 MQTT 어플리케이션으로 IP 기반 접근 제어 -- publish된 메시지에 서명을 포함하고 차량에서 이를 인증 - +1. MQTT broker에 악성 파일 혹은 펌웨어/소프트웨어 다운로드 URL을 publish 한다. +2. Broker는 해당 정보를 topic이 일치하는 차량 전체에 방송한다. +3. 인증이 없는 차량은 해당 악성 파일을 설치한다. --- ## 2. Man-in-the-middle Attack ### 공격 시나리오 1: OTA 웹페이지를 캡처하여 파일 유출 및 변조 -#### 공격 시나리오 수행 방법 -1. 관리자 장비의 프록시를 공격자의 것으로 설정 -2. 파일 업로드 시 burp 등의 MITM 툴로 패킷 캡처 및 유출 -3. 유출된 파일을 변조하여 서버에 재전달 -4. 차량은 해당 파일을 설치하게 됨 - -#### 보안 솔루션 -- 서버 전송 시 업로드 데이터 암호화 -- 전자 서명을 통해 변조 여부 검증 -- 프록시 고정 등을 통해 지정 장비에서만 업로드 허용 - ---- - -### 공격 시나리오 2: 프록시 조작으로 가짜 서버 연결 (예린님 작성) +#### 공격 시나리오 전제 조건 +해킹을 통해 관리자가 펌웨어를 업로드 하기 위해 사용하는 컴퓨터(장비)의 지정 프록시 서버를를 공격자의 프록시 서버로 변경한 것으로 가정한다. #### 공격 시나리오 수행 방법 -1. 공격자가 OTA 도메인의 IP를 위조하여 자신의 서버로 유도 -2. 차량은 가짜 OTA 서버에 접속하여 악성 파일 다운로드 -3. 유사한 형식의 OTA 패키지를 받아 악성코드 포함 소프트웨어로 업데이트됨 - -#### 보안 솔루션 -- HTTPS 기반 통신과 인증서 검증 강화 -- OTA 파일에 전자 서명 및 무결성 검증 적용 - +1. 업데이트를 파일 업로드를 수행할 컴퓨터의 프록시 서버 IP 주소를 공격자의 IP 주소로 할당한다. +2. burf 등의 툴을 이용하여 Web에서 파일 업로드를 수행할 때 서버로 전송되는 패킷을 캡처한다. +3. 캡처된 패킷에서 암호화 되지 않은 파일 내용을 변조하여 전송한다. +4. 인증이 없는 차량은 해당 악성 파일을 설치한다. --- -### 공격 시나리오 3: DNS Spoofing을 통해 가짜 OTA 서버 연결 (정우님 작성) +### 공격 시나리오 2: 서버 IP 주소 요청의 응답을 변조하여 가짜 서버 연결 -#### 공격 시나리오 수행 방법 -1. Bettercap, dnsmasq를 사용하여 DNS 요청을 공격자의 IP로 리디렉션 -2. Self-signed 인증서로 HTTPS 통신 위장 -3. 인증서 검증 미흡 시 차량은 공격자의 서버를 신뢰 -4. 악성 OTA 파일과 서명, 해시 전달 → 차량 설치 +#### 공격 시나리오 전제 조건 +해킹을 통해 프록시 서버 혹은 DNS 서버를 장악하여 IP 주소에 대한 리스폰스를 변조할 수 있다고 가정한다. -#### 보안 솔루션 -- 서버 측: HTTPS(SSL/TLS) 통신 -- 차량 측: Root CA 검증, 전자 서명 및 해시 검증 +#### 공격 시나리오 수행 방법 +1. 공격자가 리스폰스된 IP 주소를 위조하였다고 가정하고 차량에 해당하는 직접 Client를 가짜 MQTT 브로커 혹은 OTA 서버에 연결한다. +2. 공격자는 차량의 연결 및 업데이트 요청이 확인되면 해당 차량 OTA 포멧에 맞게 악성 코드 패킷을 생성한다. +3. 생성된 악성 패킷을 차량으로 전송한다. +4. 인증이 없는 차량은 해당 악성 파일을 설치한다. --- +### 공격 시나리오 3: 차량으로 전송되는 업데이트 패킷 변조 -### 공격 시나리오 4: 프록시 조작을 통한 전송 패킷 가로채기 +#### 공격 시나리오 전제 조건 +해킹을 통해 무선 통신을 중계하는 라우터를 장악하여 IP 주소에 대한 리스폰스를 변조할 수 있다고 가정한다. #### 공격 시나리오 수행 방법 -1. 정상 관리자 파일 업로드 -2. 서버에서 broker로 publish -3. 프록시 조작을 통해 파일이 공격자에게 전달됨 -4. 변조된 파일을 정상적인 IP를 위장해 다시 전송 -5. 차량은 무결성 검증 없이 설치 진행 - -#### 보안 솔루션 -- 파일 전송 시 암호화 적용 -- 전자 서명 및 무결성 검증 필수 - ---- +1. 업데이트 파일을 정상 OTA 경로를 통해 업로드 한다. +2. 업데이트 패킷을 차량으로 전송 중 라우터에 의해 강제로 공격자의 IP로 패킷이 경유하게 한것으로 가정하고 공격자 IP로 파일 전송 +3. 공격자의 IP를 업데이트 서버로 위장한 것으로 가정하고 차량에 변조된 패킷을 전송한다. +4. 인증이 없는 차량은 해당 악성 파일을 설치한다. ## 3. Replay Attack ### 공격 시나리오: 과거 업데이트 패킷 재사용 -#### 공격 시나리오 수행 방법 -1. 과거 OTA 패킷을 캡처 및 보관 -2. 최신 버전의 취약점을 공략하기 위해 과거 버전 전송 -3. 차량은 메시지 신선도 검증 미흡으로 해당 패킷 설치 -4. 이후 알려진 취약점을 통해 공격 수행 - -#### 보안 솔루션 -- OTA 패킷에 버전 정보 포함 및 버전 체크 수행 -- 타임스탬프를 통한 신선도 검증 -- 업데이트마다 변화하는 테이블 값으로 고유성 확보 +#### 공격 시나리오 전제 조건 +가짜 MQTT broker에 차량이 연결하도록 하여 공격자가 원하는 시점에 업데이트를 시도할 수 있다고 가정한다. +#### 공격 시나리오 수행 방법 +1. 정상 업데이트에 전송되는 패킷을 다른 OTA 타겟을 통해 캡처 및 보관한다. +2. 과거 버전에 취약점이 새로운 버전에 의해 보완된 것으로 가정하고 과거 버전의 파일의 업데이트를 가짜 MQTT broker를 통해 시도한다. +3. 차량은 메시지 신선도 검증 미흡으로 해당 패킷 설치한다. --- From 50e5998310cf8aca1fc749c58a2ce1c63754dd42 Mon Sep 17 00:00:00 2001 From: Kim HyeonSeong <101382350+KimHyeonSeong99@users.noreply.github.com> Date: Thu, 1 May 2025 13:55:10 +0900 Subject: [PATCH 04/26] Create README. md --- .../Man-in-the-middle_attack/README. md | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 attack_scenarios/Man-in-the-middle_attack/README. md diff --git a/attack_scenarios/Man-in-the-middle_attack/README. md b/attack_scenarios/Man-in-the-middle_attack/README. md new file mode 100644 index 0000000..78eefc3 --- /dev/null +++ b/attack_scenarios/Man-in-the-middle_attack/README. md @@ -0,0 +1,49 @@ +## 2. Man-in-the-middle Attack + +### 공격 시나리오 1: OTA 웹페이지를 캡처하여 파일 유출 및 변조 + +#### 공격 시나리오 전제 조건 +해킹을 통해 관리자가 펌웨어를 업로드 하기 위해 사용하는 컴퓨터(장비)의 지정 프록시 서버를를 공격자의 프록시 서버로 변경한 것으로 가정한다. + +#### 공격 시나리오 수행 방법 +1. 업데이트를 파일 업로드를 수행할 컴퓨터의 프록시 서버 IP 주소를 공격자의 IP 주소로 할당한다. +2. burf 등의 툴을 이용하여 Web에서 파일 업로드를 수행할 때 서버로 전송되는 패킷을 캡처한다. +3. 캡처된 패킷에서 암호화 되지 않은 파일 내용을 변조하여 전송한다. +4. 인증이 없는 차량은 해당 악성 파일을 설치한다. +--- + +### 공격 시나리오 2: 서버 IP 주소 요청의 응답을 변조하여 가짜 서버 연결 + +#### 공격 시나리오 전제 조건 +해킹을 통해 프록시 서버 혹은 DNS 서버를 장악하여 IP 주소에 대한 리스폰스를 변조할 수 있다고 가정한다. + +#### 공격 시나리오 수행 방법 +1. 공격자가 리스폰스된 IP 주소를 위조하였다고 가정하고 차량에 해당하는 직접 Client를 가짜 MQTT 브로커 혹은 OTA 서버에 연결한다. +2. 공격자는 차량의 연결 및 업데이트 요청이 확인되면 해당 차량 OTA 포멧에 맞게 악성 코드 패킷을 생성한다. +3. 생성된 악성 패킷을 차량으로 전송한다. +4. 인증이 없는 차량은 해당 악성 파일을 설치한다. + +#### 보안 요소 추가 시나리오 +##### 1. 서버 측: HTTPS(SSL/TLS) 통신 +=> 차량을 해킹하여 가짜 CA 파일을 주입한 후 해당 공격을 수행한다. +=> 공격 시나리오 수행을 위해 차량에 해당하는 Client에 가짜 서버와 동일한 CA 파일을 추가하여 시나리오를 수행한다. + +##### 2. 차량 측: 전자서명 검증 +=> 차량을 해킹하여 서버의 공개키가 아닌 공격자의 공개키를 사용하도록 변경한 후 해당 공격을 수행한다. +=> 공격 시나리오 수행을 위해 차량에 해당하는 Client에 공격자의 공개키를 주입하여 시나리오를 수행한다. (이때, 서버의 공개키와 동일한 이름으로 주입하여 대체하도록 한다.) +--- + +--- + + +### 공격 시나리오 3: 차량으로 전송되는 업데이트 패킷 변조 + +#### 공격 시나리오 전제 조건 +해킹을 통해 무선 통신을 중계하는 라우터를 장악하여 IP 주소에 대한 리스폰스를 변조할 수 있다고 가정한다. + +#### 공격 시나리오 수행 방법 +1. 업데이트 파일을 정상 OTA 경로를 통해 업로드 한다. +2. 업데이트 패킷을 차량으로 전송 중 라우터에 의해 강제로 공격자의 IP로 패킷이 경유하게 한것으로 가정하고 공격자 IP로 파일 전송 +3. 공격자의 IP를 업데이트 서버로 위장한 것으로 가정하고 차량에 변조된 패킷을 전송한다. +4. 인증이 없는 차량은 해당 악성 파일을 설치한다. +--- From 7dd563c1ffead096d5ad9d409f84c9af1f6e411b Mon Sep 17 00:00:00 2001 From: Kim HyeonSeong <101382350+KimHyeonSeong99@users.noreply.github.com> Date: Thu, 1 May 2025 13:55:49 +0900 Subject: [PATCH 05/26] Update README. md --- .../Man-in-the-middle_attack/README. md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/attack_scenarios/Man-in-the-middle_attack/README. md b/attack_scenarios/Man-in-the-middle_attack/README. md index 78eefc3..de1016c 100644 --- a/attack_scenarios/Man-in-the-middle_attack/README. md +++ b/attack_scenarios/Man-in-the-middle_attack/README. md @@ -1,34 +1,34 @@ -## 2. Man-in-the-middle Attack +# 2. Man-in-the-middle Attack -### 공격 시나리오 1: OTA 웹페이지를 캡처하여 파일 유출 및 변조 +## 공격 시나리오 1: OTA 웹페이지를 캡처하여 파일 유출 및 변조 -#### 공격 시나리오 전제 조건 +### 공격 시나리오 전제 조건 해킹을 통해 관리자가 펌웨어를 업로드 하기 위해 사용하는 컴퓨터(장비)의 지정 프록시 서버를를 공격자의 프록시 서버로 변경한 것으로 가정한다. -#### 공격 시나리오 수행 방법 +### 공격 시나리오 수행 방법 1. 업데이트를 파일 업로드를 수행할 컴퓨터의 프록시 서버 IP 주소를 공격자의 IP 주소로 할당한다. 2. burf 등의 툴을 이용하여 Web에서 파일 업로드를 수행할 때 서버로 전송되는 패킷을 캡처한다. 3. 캡처된 패킷에서 암호화 되지 않은 파일 내용을 변조하여 전송한다. 4. 인증이 없는 차량은 해당 악성 파일을 설치한다. --- -### 공격 시나리오 2: 서버 IP 주소 요청의 응답을 변조하여 가짜 서버 연결 +## 공격 시나리오 2: 서버 IP 주소 요청의 응답을 변조하여 가짜 서버 연결 -#### 공격 시나리오 전제 조건 +### 공격 시나리오 전제 조건 해킹을 통해 프록시 서버 혹은 DNS 서버를 장악하여 IP 주소에 대한 리스폰스를 변조할 수 있다고 가정한다. -#### 공격 시나리오 수행 방법 +### 공격 시나리오 수행 방법 1. 공격자가 리스폰스된 IP 주소를 위조하였다고 가정하고 차량에 해당하는 직접 Client를 가짜 MQTT 브로커 혹은 OTA 서버에 연결한다. 2. 공격자는 차량의 연결 및 업데이트 요청이 확인되면 해당 차량 OTA 포멧에 맞게 악성 코드 패킷을 생성한다. 3. 생성된 악성 패킷을 차량으로 전송한다. 4. 인증이 없는 차량은 해당 악성 파일을 설치한다. -#### 보안 요소 추가 시나리오 -##### 1. 서버 측: HTTPS(SSL/TLS) 통신 +### 보안 요소 추가 시나리오 +#### 1. 서버 측: HTTPS(SSL/TLS) 통신 => 차량을 해킹하여 가짜 CA 파일을 주입한 후 해당 공격을 수행한다. => 공격 시나리오 수행을 위해 차량에 해당하는 Client에 가짜 서버와 동일한 CA 파일을 추가하여 시나리오를 수행한다. -##### 2. 차량 측: 전자서명 검증 +#### 2. 차량 측: 전자서명 검증 => 차량을 해킹하여 서버의 공개키가 아닌 공격자의 공개키를 사용하도록 변경한 후 해당 공격을 수행한다. => 공격 시나리오 수행을 위해 차량에 해당하는 Client에 공격자의 공개키를 주입하여 시나리오를 수행한다. (이때, 서버의 공개키와 동일한 이름으로 주입하여 대체하도록 한다.) --- @@ -36,12 +36,12 @@ --- -### 공격 시나리오 3: 차량으로 전송되는 업데이트 패킷 변조 +## 공격 시나리오 3: 차량으로 전송되는 업데이트 패킷 변조 -#### 공격 시나리오 전제 조건 +### 공격 시나리오 전제 조건 해킹을 통해 무선 통신을 중계하는 라우터를 장악하여 IP 주소에 대한 리스폰스를 변조할 수 있다고 가정한다. -#### 공격 시나리오 수행 방법 +### 공격 시나리오 수행 방법 1. 업데이트 파일을 정상 OTA 경로를 통해 업로드 한다. 2. 업데이트 패킷을 차량으로 전송 중 라우터에 의해 강제로 공격자의 IP로 패킷이 경유하게 한것으로 가정하고 공격자 IP로 파일 전송 3. 공격자의 IP를 업데이트 서버로 위장한 것으로 가정하고 차량에 변조된 패킷을 전송한다. From d9e5c269db94983915ca44a20b7c55783ee20a10 Mon Sep 17 00:00:00 2001 From: Kim HyeonSeong <101382350+KimHyeonSeong99@users.noreply.github.com> Date: Thu, 1 May 2025 13:58:42 +0900 Subject: [PATCH 06/26] Update README. md --- attack_scenarios/Man-in-the-middle_attack/README. md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/attack_scenarios/Man-in-the-middle_attack/README. md b/attack_scenarios/Man-in-the-middle_attack/README. md index de1016c..3e0dd99 100644 --- a/attack_scenarios/Man-in-the-middle_attack/README. md +++ b/attack_scenarios/Man-in-the-middle_attack/README. md @@ -3,11 +3,11 @@ ## 공격 시나리오 1: OTA 웹페이지를 캡처하여 파일 유출 및 변조 ### 공격 시나리오 전제 조건 -해킹을 통해 관리자가 펌웨어를 업로드 하기 위해 사용하는 컴퓨터(장비)의 지정 프록시 서버를를 공격자의 프록시 서버로 변경한 것으로 가정한다. +해킹을 통해 관리자가 펌웨어를 업로드할 때 사용하는 컴퓨터(장비)의 프록시 서버를 공격자의 프록시 서버로 변경한 것으로 가정한다. ### 공격 시나리오 수행 방법 1. 업데이트를 파일 업로드를 수행할 컴퓨터의 프록시 서버 IP 주소를 공격자의 IP 주소로 할당한다. -2. burf 등의 툴을 이용하여 Web에서 파일 업로드를 수행할 때 서버로 전송되는 패킷을 캡처한다. +2. Burp 등의 툴을 이용하여 Web에서 파일 업로드를 수행할 때 서버로 전송되는 패킷을 캡처한다. 3. 캡처된 패킷에서 암호화 되지 않은 파일 내용을 변조하여 전송한다. 4. 인증이 없는 차량은 해당 악성 파일을 설치한다. --- @@ -18,7 +18,7 @@ 해킹을 통해 프록시 서버 혹은 DNS 서버를 장악하여 IP 주소에 대한 리스폰스를 변조할 수 있다고 가정한다. ### 공격 시나리오 수행 방법 -1. 공격자가 리스폰스된 IP 주소를 위조하였다고 가정하고 차량에 해당하는 직접 Client를 가짜 MQTT 브로커 혹은 OTA 서버에 연결한다. +1. 공격자가 응답된 IP 주소를 위조하였다고 가정하고 차량에 해당하는 직접 Client를 가짜 MQTT 브로커 혹은 OTA 서버에 연결한다. 2. 공격자는 차량의 연결 및 업데이트 요청이 확인되면 해당 차량 OTA 포멧에 맞게 악성 코드 패킷을 생성한다. 3. 생성된 악성 패킷을 차량으로 전송한다. 4. 인증이 없는 차량은 해당 악성 파일을 설치한다. @@ -27,15 +27,12 @@ #### 1. 서버 측: HTTPS(SSL/TLS) 통신 => 차량을 해킹하여 가짜 CA 파일을 주입한 후 해당 공격을 수행한다. => 공격 시나리오 수행을 위해 차량에 해당하는 Client에 가짜 서버와 동일한 CA 파일을 추가하여 시나리오를 수행한다. - + #### 2. 차량 측: 전자서명 검증 => 차량을 해킹하여 서버의 공개키가 아닌 공격자의 공개키를 사용하도록 변경한 후 해당 공격을 수행한다. => 공격 시나리오 수행을 위해 차량에 해당하는 Client에 공격자의 공개키를 주입하여 시나리오를 수행한다. (이때, 서버의 공개키와 동일한 이름으로 주입하여 대체하도록 한다.) --- ---- - - ## 공격 시나리오 3: 차량으로 전송되는 업데이트 패킷 변조 ### 공격 시나리오 전제 조건 From 0c83ae24642790d28ca768d21ecbaff31ce88a40 Mon Sep 17 00:00:00 2001 From: Kim HyeonSeong <101382350+KimHyeonSeong99@users.noreply.github.com> Date: Thu, 1 May 2025 14:00:41 +0900 Subject: [PATCH 07/26] Rename README. md to README.md --- .../Man-in-the-middle_attack/{README. md => README.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename attack_scenarios/Man-in-the-middle_attack/{README. md => README.md} (100%) diff --git a/attack_scenarios/Man-in-the-middle_attack/README. md b/attack_scenarios/Man-in-the-middle_attack/README.md similarity index 100% rename from attack_scenarios/Man-in-the-middle_attack/README. md rename to attack_scenarios/Man-in-the-middle_attack/README.md From dcf02b73f7f349fc465bcfc683e85978275ef2e6 Mon Sep 17 00:00:00 2001 From: Kim HyeonSeong <101382350+KimHyeonSeong99@users.noreply.github.com> Date: Thu, 1 May 2025 14:02:10 +0900 Subject: [PATCH 08/26] Update README.md --- attack_scenarios/Man-in-the-middle_attack/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/attack_scenarios/Man-in-the-middle_attack/README.md b/attack_scenarios/Man-in-the-middle_attack/README.md index 3e0dd99..8c5529f 100644 --- a/attack_scenarios/Man-in-the-middle_attack/README.md +++ b/attack_scenarios/Man-in-the-middle_attack/README.md @@ -24,13 +24,15 @@ 4. 인증이 없는 차량은 해당 악성 파일을 설치한다. ### 보안 요소 추가 시나리오 + #### 1. 서버 측: HTTPS(SSL/TLS) 통신 => 차량을 해킹하여 가짜 CA 파일을 주입한 후 해당 공격을 수행한다. => 공격 시나리오 수행을 위해 차량에 해당하는 Client에 가짜 서버와 동일한 CA 파일을 추가하여 시나리오를 수행한다. - + #### 2. 차량 측: 전자서명 검증 => 차량을 해킹하여 서버의 공개키가 아닌 공격자의 공개키를 사용하도록 변경한 후 해당 공격을 수행한다. => 공격 시나리오 수행을 위해 차량에 해당하는 Client에 공격자의 공개키를 주입하여 시나리오를 수행한다. (이때, 서버의 공개키와 동일한 이름으로 주입하여 대체하도록 한다.) + --- ## 공격 시나리오 3: 차량으로 전송되는 업데이트 패킷 변조 From b0e4ea4f016dce06beaa774a52c453988b08e141 Mon Sep 17 00:00:00 2001 From: Kim HyeonSeong <101382350+KimHyeonSeong99@users.noreply.github.com> Date: Thu, 1 May 2025 14:03:33 +0900 Subject: [PATCH 09/26] Create README.md --- .../supply_chain_attack/README.md | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 attack_scenarios/supply_chain_attack/README.md diff --git a/attack_scenarios/supply_chain_attack/README.md b/attack_scenarios/supply_chain_attack/README.md new file mode 100644 index 0000000..046a119 --- /dev/null +++ b/attack_scenarios/supply_chain_attack/README.md @@ -0,0 +1,23 @@ +# 1. Supply Chain Attack + +## 공격 시나리오 1: 정식 OTA 파일 업로드 웹페이지를 통해 악성 코드 업데이트 [Level 1] + +### 공격 시나리오 전제 조건 +파일을 업로드하는 웹사이트의 URL IP 주소값(혹은 도메인)을 공격자가 획득한 것으로 가정한다. + +### 공격 시나리오 수행 방법 +1. 공격자는 타겟 ECU에 주입할 악성 펌웨어/소프트웨어에 해당하는 .bin 파일을 생성한다. +2. OTA 파일을 업로드하는 정식 웹사이트를 통해 .bin 파일을 업로드한다. +3. 인증이 없는 차량은 해당 악성 파일을 설치한다. +--- + +## 공격 시나리오 2: MQTT broker에 악성 코드 혹은 URL publishing [Level 1] + +### 공격 시나리오 전제 조건 +인증된 차량 해킹 하여 OEM에서 활용 중인 MQTT Broker의 IP를 획득한 것으로 가정한다. + +### 공격 시나리오 수행 방법 +1. MQTT broker에 악성 파일 혹은 펌웨어/소프트웨어 다운로드 URL을 publish 한다. +2. Broker는 해당 정보를 topic이 일치하는 차량 전체에 방송한다. +3. 인증이 없는 차량은 해당 악성 파일을 설치한다. +--- From e3adea418cb860fd89279edfce88b33f3af1b577 Mon Sep 17 00:00:00 2001 From: Kim HyeonSeong <101382350+KimHyeonSeong99@users.noreply.github.com> Date: Thu, 1 May 2025 14:04:22 +0900 Subject: [PATCH 10/26] Create README.md --- attack_scenarios/replay_attack/README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 attack_scenarios/replay_attack/README.md diff --git a/attack_scenarios/replay_attack/README.md b/attack_scenarios/replay_attack/README.md new file mode 100644 index 0000000..db02c3b --- /dev/null +++ b/attack_scenarios/replay_attack/README.md @@ -0,0 +1,12 @@ +# 3. Replay Attack + +## 공격 시나리오: 과거 업데이트 패킷 재사용 + +### 공격 시나리오 전제 조건 +가짜 MQTT broker에 차량이 연결하도록 하여 공격자가 원하는 시점에 업데이트를 시도할 수 있다고 가정한다. + +### 공격 시나리오 수행 방법 +1. 정상 업데이트에 전송되는 패킷을 다른 OTA 타겟을 통해 캡처 및 보관한다. +2. 과거 버전에 취약점이 새로운 버전에 의해 보완된 것으로 가정하고 과거 버전의 파일의 업데이트를 가짜 MQTT broker를 통해 시도한다. +3. 차량은 메시지 신선도 검증 미흡으로 해당 패킷 설치한다. +--- From feb0c0879669603827402a72ab814bb6df09ff1e Mon Sep 17 00:00:00 2001 From: Kim HyeonSeong <101382350+KimHyeonSeong99@users.noreply.github.com> Date: Thu, 1 May 2025 14:08:23 +0900 Subject: [PATCH 11/26] Create README.md --- .../scenario1/README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 attack_scenarios/Man-in-the-middle_attack/scenario1/README.md diff --git a/attack_scenarios/Man-in-the-middle_attack/scenario1/README.md b/attack_scenarios/Man-in-the-middle_attack/scenario1/README.md new file mode 100644 index 0000000..aff7f83 --- /dev/null +++ b/attack_scenarios/Man-in-the-middle_attack/scenario1/README.md @@ -0,0 +1,17 @@ +# 공격 시나리오 1: OTA 웹페이지를 캡처하여 파일 유출 및 변조 + +## 공격 시나리오 전제 조건 +해킹을 통해 관리자가 펌웨어를 업로드 하기 위해 사용하는 컴퓨터(장비)의 지정 프록시 서버를를 공격자의 프록시 서버로 변경한 것으로 가정한다. + +### 공격 시나리오 수행 방법 +1. 업데이트를 파일 업로드를 수행할 컴퓨터의 프록시 서버 IP 주소를 공격자의 IP 주소로 할당한다. + ![Step 1](path/to/image1.png) + +2. burf 등의 툴을 이용하여 Web에서 파일 업로드를 수행할 때 서버로 전송되는 패킷을 캡처한다. + ![Step 2](path/to/image2.png) + +3. 캡처된 패킷에서 암호화 되지 않은 파일 내용을 변조하여 전송한다. + ![Step 3](path/to/image3.png) + +4. 인증이 없는 차량은 해당 악성 파일을 설치한다. + ![Step 4](path/to/image4.png) From 32f135f70d8ac23883bb16342535691b68a87468 Mon Sep 17 00:00:00 2001 From: Kim HyeonSeong <101382350+KimHyeonSeong99@users.noreply.github.com> Date: Thu, 1 May 2025 14:11:17 +0900 Subject: [PATCH 12/26] Update README.md --- .../Man-in-the-middle_attack/scenario1/README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/attack_scenarios/Man-in-the-middle_attack/scenario1/README.md b/attack_scenarios/Man-in-the-middle_attack/scenario1/README.md index aff7f83..d12f773 100644 --- a/attack_scenarios/Man-in-the-middle_attack/scenario1/README.md +++ b/attack_scenarios/Man-in-the-middle_attack/scenario1/README.md @@ -5,13 +5,14 @@ ### 공격 시나리오 수행 방법 1. 업데이트를 파일 업로드를 수행할 컴퓨터의 프록시 서버 IP 주소를 공격자의 IP 주소로 할당한다. - ![Step 1](path/to/image1.png) + ![스크린샷 2025-05-01 123313](https://github.com/user-attachments/assets/d3703274-8741-4da6-a8a5-2a7a4606fa31) 2. burf 등의 툴을 이용하여 Web에서 파일 업로드를 수행할 때 서버로 전송되는 패킷을 캡처한다. - ![Step 2](path/to/image2.png) + ![스크린샷 2025-05-01 123507](https://github.com/user-attachments/assets/930ba93e-8924-4cd4-8327-fa45cc5df02c) 3. 캡처된 패킷에서 암호화 되지 않은 파일 내용을 변조하여 전송한다. - ![Step 3](path/to/image3.png) + ![스크린샷 2025-05-01 123546](https://github.com/user-attachments/assets/e5ada10a-4d60-4428-8153-cecf15f13a24) 4. 인증이 없는 차량은 해당 악성 파일을 설치한다. - ![Step 4](path/to/image4.png) + ![스크린샷 2025-05-01 123714](https://github.com/user-attachments/assets/894f1c63-f3e4-4071-a484-b5f54897da9c) + From d580354cdf457342d8a36da88870f0e39b701b9f Mon Sep 17 00:00:00 2001 From: Kim HyeonSeong <101382350+KimHyeonSeong99@users.noreply.github.com> Date: Thu, 1 May 2025 14:12:26 +0900 Subject: [PATCH 13/26] Update README.md --- attack_scenarios/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/attack_scenarios/README.md b/attack_scenarios/README.md index 8e65ff2..0fe9a71 100644 --- a/attack_scenarios/README.md +++ b/attack_scenarios/README.md @@ -35,7 +35,7 @@ ### 공격 시나리오 1: OTA 웹페이지를 캡처하여 파일 유출 및 변조 #### 공격 시나리오 전제 조건 -해킹을 통해 관리자가 펌웨어를 업로드 하기 위해 사용하는 컴퓨터(장비)의 지정 프록시 서버를를 공격자의 프록시 서버로 변경한 것으로 가정한다. +해킹을 통해 관리자가 펌웨어를 업로드할 때 사용하는 컴퓨터(장비)의 프록시 서버를 공격자의 프록시 서버로 변경한 것으로 가정한다. #### 공격 시나리오 수행 방법 1. 업데이트를 파일 업로드를 수행할 컴퓨터의 프록시 서버 IP 주소를 공격자의 IP 주소로 할당한다. From c120927dc8f69cd938b89b2b43dd784ea7025134 Mon Sep 17 00:00:00 2001 From: Kim HyeonSeong <101382350+KimHyeonSeong99@users.noreply.github.com> Date: Thu, 1 May 2025 15:50:18 +0900 Subject: [PATCH 14/26] Create README.md --- attack_scenarios/Man-in-the-middle_attack/scenario_PYL/README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 attack_scenarios/Man-in-the-middle_attack/scenario_PYL/README.md diff --git a/attack_scenarios/Man-in-the-middle_attack/scenario_PYL/README.md b/attack_scenarios/Man-in-the-middle_attack/scenario_PYL/README.md new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/attack_scenarios/Man-in-the-middle_attack/scenario_PYL/README.md @@ -0,0 +1 @@ + From 88e5670886a8d2b2d0cc82164cc8cbb2dfe17fe0 Mon Sep 17 00:00:00 2001 From: Kim HyeonSeong <101382350+KimHyeonSeong99@users.noreply.github.com> Date: Thu, 1 May 2025 15:50:37 +0900 Subject: [PATCH 15/26] Create README.md --- attack_scenarios/Man-in-the-middle_attack/scenario_PJW/README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 attack_scenarios/Man-in-the-middle_attack/scenario_PJW/README.md diff --git a/attack_scenarios/Man-in-the-middle_attack/scenario_PJW/README.md b/attack_scenarios/Man-in-the-middle_attack/scenario_PJW/README.md new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/attack_scenarios/Man-in-the-middle_attack/scenario_PJW/README.md @@ -0,0 +1 @@ + From 4df348934139396d1a031d322d1f09dc9eeb81bf Mon Sep 17 00:00:00 2001 From: Kim HyeonSeong <101382350+KimHyeonSeong99@users.noreply.github.com> Date: Fri, 2 May 2025 11:10:20 +0900 Subject: [PATCH 16/26] Update README.md --- .../Man-in-the-middle_attack/README.md | 63 ++++++++++--------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/attack_scenarios/Man-in-the-middle_attack/README.md b/attack_scenarios/Man-in-the-middle_attack/README.md index 8c5529f..21b29f1 100644 --- a/attack_scenarios/Man-in-the-middle_attack/README.md +++ b/attack_scenarios/Man-in-the-middle_attack/README.md @@ -1,48 +1,49 @@ # 2. Man-in-the-middle Attack -## 공격 시나리오 1: OTA 웹페이지를 캡처하여 파일 유출 및 변조 +## Attack Scenario 1: Intercept and Tamper The File Uploaded to OTA webpages -### 공격 시나리오 전제 조건 -해킹을 통해 관리자가 펌웨어를 업로드할 때 사용하는 컴퓨터(장비)의 프록시 서버를 공격자의 프록시 서버로 변경한 것으로 가정한다. +### Precondition of Attack Scenario +It is assumed that the attack has successfully changed the proxy server settings of the administrator’s PC (used to upload firmware) to route traffic through the attacker's proxy server. -### 공격 시나리오 수행 방법 -1. 업데이트를 파일 업로드를 수행할 컴퓨터의 프록시 서버 IP 주소를 공격자의 IP 주소로 할당한다. -2. Burp 등의 툴을 이용하여 Web에서 파일 업로드를 수행할 때 서버로 전송되는 패킷을 캡처한다. -3. 캡처된 패킷에서 암호화 되지 않은 파일 내용을 변조하여 전송한다. -4. 인증이 없는 차량은 해당 악성 파일을 설치한다. +### Attack Procdure +1. Assign the proxy server IP address of the administrator’s PC to that of the attacker. +2. Use tools like Burp Suite to intercept the HTTP packet sent when uploading the firmware file to the OTA server. +3. Tamper the captured file and send it to the OTA server +4. Vehicles without authentication mechanisms will download and install the malware. --- -## 공격 시나리오 2: 서버 IP 주소 요청의 응답을 변조하여 가짜 서버 연결 +## Attack Scenario 2: DNS/Proxy Spoofing for Fake Server Redirection -### 공격 시나리오 전제 조건 -해킹을 통해 프록시 서버 혹은 DNS 서버를 장악하여 IP 주소에 대한 리스폰스를 변조할 수 있다고 가정한다. +### Precondition +Assume that an attacker can compromise a proxy server or DNS server and manipulate its responses to IP address queries. -### 공격 시나리오 수행 방법 -1. 공격자가 응답된 IP 주소를 위조하였다고 가정하고 차량에 해당하는 직접 Client를 가짜 MQTT 브로커 혹은 OTA 서버에 연결한다. -2. 공격자는 차량의 연결 및 업데이트 요청이 확인되면 해당 차량 OTA 포멧에 맞게 악성 코드 패킷을 생성한다. -3. 생성된 악성 패킷을 차량으로 전송한다. -4. 인증이 없는 차량은 해당 악성 파일을 설치한다. +### Attack Procedure +1. Assume that the attacker has forged the IP address responded from proxey or DNS, connect the client directly to the fake MQTT broker or OTA server. +2. After comfirm the connection and request from targe vehicle, Generate correct packet for the vehicle. +3. Send the generated malware to the vehicle. +4. Vehicles without authentication mechanisms will download and install the malware. -### 보안 요소 추가 시나리오 +### Additional Scenarios with secure OTA -#### 1. 서버 측: HTTPS(SSL/TLS) 통신 -=> 차량을 해킹하여 가짜 CA 파일을 주입한 후 해당 공격을 수행한다. -=> 공격 시나리오 수행을 위해 차량에 해당하는 Client에 가짜 서버와 동일한 CA 파일을 추가하여 시나리오를 수행한다. +#### 1. On Server: Using HTTPS(SSL/TLS) +=> We will use a fake CA file injectied on the vehicle. +=> We will perform the activity by injecting the same CA file as the fake server to the client corresponding to the vehicle for the attack scenario -#### 2. 차량 측: 전자서명 검증 -=> 차량을 해킹하여 서버의 공개키가 아닌 공격자의 공개키를 사용하도록 변경한 후 해당 공격을 수행한다. -=> 공격 시나리오 수행을 위해 차량에 해당하는 Client에 공격자의 공개키를 주입하여 시나리오를 수행한다. (이때, 서버의 공개키와 동일한 이름으로 주입하여 대체하도록 한다.) +#### 2. On vehicle: Digital sign verification +=> After injecting the vehicle to use the attacker's signature instead of the server's public key +=> To perform the activity, the public key of attacker for the vehicle is performed. --- -## 공격 시나리오 3: 차량으로 전송되는 업데이트 패킷 변조 +## Attack Scenario 3: Packet Interception and Tamperation via Compromised Router -### 공격 시나리오 전제 조건 -해킹을 통해 무선 통신을 중계하는 라우터를 장악하여 IP 주소에 대한 리스폰스를 변조할 수 있다고 가정한다. +### Precondition +Assume the attacker has gained control over a router that relays wireless communication, allowing interception and modification of OTA update packets. + +### Attack Procedure +1. Upload the update file via OTA. +2. Assuming that the router sends packets to the vehicle via the attacker IP, send the file to the attacker IP. +3. Disguise the attacker IP as the server IP and send it to the vehicle. +4. Vehicles without authentication mechanisms will download and install the malware. -### 공격 시나리오 수행 방법 -1. 업데이트 파일을 정상 OTA 경로를 통해 업로드 한다. -2. 업데이트 패킷을 차량으로 전송 중 라우터에 의해 강제로 공격자의 IP로 패킷이 경유하게 한것으로 가정하고 공격자 IP로 파일 전송 -3. 공격자의 IP를 업데이트 서버로 위장한 것으로 가정하고 차량에 변조된 패킷을 전송한다. -4. 인증이 없는 차량은 해당 악성 파일을 설치한다. --- From 4fde6d5f3dcfe07bc675f943b897e74a63a9659e Mon Sep 17 00:00:00 2001 From: Kim HyeonSeong <101382350+KimHyeonSeong99@users.noreply.github.com> Date: Fri, 2 May 2025 11:18:08 +0900 Subject: [PATCH 17/26] Update README.md --- attack_scenarios/replay_attack/README.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/attack_scenarios/replay_attack/README.md b/attack_scenarios/replay_attack/README.md index db02c3b..45c1ced 100644 --- a/attack_scenarios/replay_attack/README.md +++ b/attack_scenarios/replay_attack/README.md @@ -1,12 +1,11 @@ # 3. Replay Attack -## 공격 시나리오: 과거 업데이트 패킷 재사용 +## Attack Scenario 1: Reuse Previous Update Packet -### 공격 시나리오 전제 조건 -가짜 MQTT broker에 차량이 연결하도록 하여 공격자가 원하는 시점에 업데이트를 시도할 수 있다고 가정한다. - -### 공격 시나리오 수행 방법 -1. 정상 업데이트에 전송되는 패킷을 다른 OTA 타겟을 통해 캡처 및 보관한다. -2. 과거 버전에 취약점이 새로운 버전에 의해 보완된 것으로 가정하고 과거 버전의 파일의 업데이트를 가짜 MQTT broker를 통해 시도한다. -3. 차량은 메시지 신선도 검증 미흡으로 해당 패킷 설치한다. +### Precondition +Assume that the vehicle is connected to the fake MQTT broker. So the attacker can try to update malware at anytime +### Attack Prcedure +1. Capture and store normal packets from the another OTA target. +2. Assuming that vulnerabilities in the past version have been fixed by the new version, update the past version of the file through a fake MQTT broker. +3. The vehicle installs the packet due to insufficient message freshness verification. --- From 60b910aa44f75a399e5a2cb5557625639a315f9d Mon Sep 17 00:00:00 2001 From: Kim HyeonSeong <101382350+KimHyeonSeong99@users.noreply.github.com> Date: Fri, 2 May 2025 11:21:40 +0900 Subject: [PATCH 18/26] Update README.md --- .../supply_chain_attack/README.md | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/attack_scenarios/supply_chain_attack/README.md b/attack_scenarios/supply_chain_attack/README.md index 046a119..2088949 100644 --- a/attack_scenarios/supply_chain_attack/README.md +++ b/attack_scenarios/supply_chain_attack/README.md @@ -1,23 +1,23 @@ # 1. Supply Chain Attack -## 공격 시나리오 1: 정식 OTA 파일 업로드 웹페이지를 통해 악성 코드 업데이트 [Level 1] +## Attack Scenario 1: Malware Update via Official OTA File Upload Webpage [Level 1] -### 공격 시나리오 전제 조건 -파일을 업로드하는 웹사이트의 URL IP 주소값(혹은 도메인)을 공격자가 획득한 것으로 가정한다. +### Precondition +Assume that the attacker has obtained the IP address (or domain) of the website where the file is uploaded. -### 공격 시나리오 수행 방법 -1. 공격자는 타겟 ECU에 주입할 악성 펌웨어/소프트웨어에 해당하는 .bin 파일을 생성한다. -2. OTA 파일을 업로드하는 정식 웹사이트를 통해 .bin 파일을 업로드한다. -3. 인증이 없는 차량은 해당 악성 파일을 설치한다. +### Attack Procedure +1. The attacker creates a .bin file corresponding to the malicious firmware/software to be injected into the target ECU. +2. The .bin file is uploaded through the official website that uploads OTA files. +3. Vehicles without authentication install the malicious file. --- -## 공격 시나리오 2: MQTT broker에 악성 코드 혹은 URL publishing [Level 1] +## Attack Scenario 2: Publishing malicious code or URL to MQTT broker [Level 1] -### 공격 시나리오 전제 조건 -인증된 차량 해킹 하여 OEM에서 활용 중인 MQTT Broker의 IP를 획득한 것으로 가정한다. +### Precondition +Assume that an authenticated vehicle has been hacked and the IP of the MQTT Broker used by the OEM has been acquired. -### 공격 시나리오 수행 방법 -1. MQTT broker에 악성 파일 혹은 펌웨어/소프트웨어 다운로드 URL을 publish 한다. -2. Broker는 해당 정보를 topic이 일치하는 차량 전체에 방송한다. -3. 인증이 없는 차량은 해당 악성 파일을 설치한다. +### Attack Procedure +1. Publish a malicious file or firmware/software download URL to the MQTT broker. +2. The broker broadcasts the information to all vehicles with matching topics. +3. Vehicles without authentication install the malicious file. --- From 1e5ac7f4d96cc97b195850602f2fb60408c4cd6f Mon Sep 17 00:00:00 2001 From: Kim HyeonSeong <101382350+KimHyeonSeong99@users.noreply.github.com> Date: Fri, 2 May 2025 11:24:39 +0900 Subject: [PATCH 19/26] Update README.md --- attack_scenarios/README.md | 108 ++++++++++++++++++++----------------- 1 file changed, 60 insertions(+), 48 deletions(-) diff --git a/attack_scenarios/README.md b/attack_scenarios/README.md index 0fe9a71..76c13fc 100644 --- a/attack_scenarios/README.md +++ b/attack_scenarios/README.md @@ -2,80 +2,92 @@ --- ## Attack Proposol -- 공격자는 악성 코드를 주입하여 **차량의 사고를 유발하고나 제어 권한을 얻는 것**을 목표로 함 -- 공격자는 정식 OTA를 방해하여 **차량이 보안 혹은 기능적으로 취약한 상태를 유지하는 것**을 목표로 함 +- The attacker aims to **cause a vehicle accident or gain control of it** by injecting malicious code +- The attacker aims to **keep the vehicle in a secure or functionally vulnerable state** by interfering with the official OTA ## 1. Supply Chain Attack -### 공격 시나리오 1: 정식 OTA 파일 업로드 웹페이지를 통해 악성 코드 업데이트 [Level 1] +### Attack Scenario 1: Malware Update via Official OTA File Upload Webpage [Level 1] -#### 공격 시나리오 전제 조건 -파일을 업로드하는 웹사이트의 URL IP 주소값(혹은 도메인)을 공격자가 획득한 것으로 가정한다. +#### Precondition +Assume that the attacker has obtained the IP address (or domain) of the website where the file is uploaded. -#### 공격 시나리오 수행 방법 -1. 공격자는 타겟 ECU에 주입할 악성 펌웨어/소프트웨어에 해당하는 .bin 파일을 생성한다. -2. OTA 파일을 업로드하는 정식 웹사이트를 통해 .bin 파일을 업로드한다. -3. 인증이 없는 차량은 해당 악성 파일을 설치한다. +#### Attack Procedure +1. The attacker creates a .bin file corresponding to the malicious firmware/software to be injected into the target ECU. +2. The .bin file is uploaded through the official website that uploads OTA files. +3. Vehicles without authentication install the malicious file. --- -### 공격 시나리오 2: MQTT broker에 악성 코드 혹은 URL publishing [Level 1] +### Attack Scenario 2: Publishing malicious code or URL to MQTT broker [Level 1] -#### 공격 시나리오 전제 조건 -인증된 차량 해킹 하여 OEM에서 활용 중인 MQTT Broker의 IP를 획득한 것으로 가정한다. +#### Precondition +Assume that an authenticated vehicle has been hacked and the IP of the MQTT Broker used by the OEM has been acquired. -#### 공격 시나리오 수행 방법 -1. MQTT broker에 악성 파일 혹은 펌웨어/소프트웨어 다운로드 URL을 publish 한다. -2. Broker는 해당 정보를 topic이 일치하는 차량 전체에 방송한다. -3. 인증이 없는 차량은 해당 악성 파일을 설치한다. +#### Attack Procedure +1. Publish a malicious file or firmware/software download URL to the MQTT broker. +2. The broker broadcasts the information to all vehicles with matching topics. +3. Vehicles without authentication install the malicious file. --- ## 2. Man-in-the-middle Attack -### 공격 시나리오 1: OTA 웹페이지를 캡처하여 파일 유출 및 변조 +### Attack Scenario 1: Intercept and Tamper The File Uploaded to OTA webpages -#### 공격 시나리오 전제 조건 -해킹을 통해 관리자가 펌웨어를 업로드할 때 사용하는 컴퓨터(장비)의 프록시 서버를 공격자의 프록시 서버로 변경한 것으로 가정한다. +#### Precondition of Attack Scenario +It is assumed that the attack has successfully changed the proxy server settings of the administrator’s PC (used to upload firmware) to route traffic through the attacker's proxy server. -#### 공격 시나리오 수행 방법 -1. 업데이트를 파일 업로드를 수행할 컴퓨터의 프록시 서버 IP 주소를 공격자의 IP 주소로 할당한다. -2. burf 등의 툴을 이용하여 Web에서 파일 업로드를 수행할 때 서버로 전송되는 패킷을 캡처한다. -3. 캡처된 패킷에서 암호화 되지 않은 파일 내용을 변조하여 전송한다. -4. 인증이 없는 차량은 해당 악성 파일을 설치한다. +#### Attack Procdure +1. Assign the proxy server IP address of the administrator’s PC to that of the attacker. +2. Use tools like Burp Suite to intercept the HTTP packet sent when uploading the firmware file to the OTA server. +3. Tamper the captured file and send it to the OTA server +4. Vehicles without authentication mechanisms will download and install the malware. --- -### 공격 시나리오 2: 서버 IP 주소 요청의 응답을 변조하여 가짜 서버 연결 +### Attack Scenario 2: DNS/Proxy Spoofing for Fake Server Redirection -#### 공격 시나리오 전제 조건 -해킹을 통해 프록시 서버 혹은 DNS 서버를 장악하여 IP 주소에 대한 리스폰스를 변조할 수 있다고 가정한다. +#### Precondition +Assume that an attacker can compromise a proxy server or DNS server and manipulate its responses to IP address queries. -#### 공격 시나리오 수행 방법 -1. 공격자가 리스폰스된 IP 주소를 위조하였다고 가정하고 차량에 해당하는 직접 Client를 가짜 MQTT 브로커 혹은 OTA 서버에 연결한다. -2. 공격자는 차량의 연결 및 업데이트 요청이 확인되면 해당 차량 OTA 포멧에 맞게 악성 코드 패킷을 생성한다. -3. 생성된 악성 패킷을 차량으로 전송한다. -4. 인증이 없는 차량은 해당 악성 파일을 설치한다. +#### Attack Procedure +1. Assume that the attacker has forged the IP address responded from proxey or DNS, connect the client directly to the fake MQTT broker or OTA server. +2. After comfirm the connection and request from targe vehicle, Generate correct packet for the vehicle. +3. Send the generated malware to the vehicle. +4. Vehicles without authentication mechanisms will download and install the malware. + +#### Additional Scenarios with secure OTA + +##### 1. On Server: Using HTTPS(SSL/TLS) +=> We will use a fake CA file injectied on the vehicle. +=> We will perform the activity by injecting the same CA file as the fake server to the client corresponding to the vehicle for the attack scenario + +##### 2. On vehicle: Digital sign verification +=> After injecting the vehicle to use the attacker's signature instead of the server's public key +=> To perform the activity, the public key of attacker for the vehicle is performed. --- -### 공격 시나리오 3: 차량으로 전송되는 업데이트 패킷 변조 -#### 공격 시나리오 전제 조건 -해킹을 통해 무선 통신을 중계하는 라우터를 장악하여 IP 주소에 대한 리스폰스를 변조할 수 있다고 가정한다. +### Attack Scenario 3: Packet Interception and Tamperation via Compromised Router -#### 공격 시나리오 수행 방법 -1. 업데이트 파일을 정상 OTA 경로를 통해 업로드 한다. -2. 업데이트 패킷을 차량으로 전송 중 라우터에 의해 강제로 공격자의 IP로 패킷이 경유하게 한것으로 가정하고 공격자 IP로 파일 전송 -3. 공격자의 IP를 업데이트 서버로 위장한 것으로 가정하고 차량에 변조된 패킷을 전송한다. -4. 인증이 없는 차량은 해당 악성 파일을 설치한다. +#### Precondition +Assume the attacker has gained control over a router that relays wireless communication, allowing interception and modification of OTA update packets. -## 3. Replay Attack +#### Attack Procedure +1. Upload the update file via OTA. +2. Assuming that the router sends packets to the vehicle via the attacker IP, send the file to the attacker IP. +3. Disguise the attacker IP as the server IP and send it to the vehicle. +4. Vehicles without authentication mechanisms will download and install the malware. -### 공격 시나리오: 과거 업데이트 패킷 재사용 +--- + +## 3. Replay Attack -#### 공격 시나리오 전제 조건 -가짜 MQTT broker에 차량이 연결하도록 하여 공격자가 원하는 시점에 업데이트를 시도할 수 있다고 가정한다. +### Attack Scenario 1: Reuse Previous Update Packet -#### 공격 시나리오 수행 방법 -1. 정상 업데이트에 전송되는 패킷을 다른 OTA 타겟을 통해 캡처 및 보관한다. -2. 과거 버전에 취약점이 새로운 버전에 의해 보완된 것으로 가정하고 과거 버전의 파일의 업데이트를 가짜 MQTT broker를 통해 시도한다. -3. 차량은 메시지 신선도 검증 미흡으로 해당 패킷 설치한다. +#### Precondition +Assume that the vehicle is connected to the fake MQTT broker. So the attacker can try to update malware at anytime +#### Attack Prcedure +1. Capture and store normal packets from the another OTA target. +2. Assuming that vulnerabilities in the past version have been fixed by the new version, update the past version of the file through a fake MQTT broker. +3. The vehicle installs the packet due to insufficient message freshness verification. --- From f99ab39cac2235cf9b6c979b71fe7fd4423f0013 Mon Sep 17 00:00:00 2001 From: Kim HyeonSeong <101382350+KimHyeonSeong99@users.noreply.github.com> Date: Fri, 2 May 2025 11:25:10 +0900 Subject: [PATCH 20/26] Update README.md --- .../scenario1/README.md | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/attack_scenarios/Man-in-the-middle_attack/scenario1/README.md b/attack_scenarios/Man-in-the-middle_attack/scenario1/README.md index d12f773..a0fd245 100644 --- a/attack_scenarios/Man-in-the-middle_attack/scenario1/README.md +++ b/attack_scenarios/Man-in-the-middle_attack/scenario1/README.md @@ -1,18 +1,15 @@ -# 공격 시나리오 1: OTA 웹페이지를 캡처하여 파일 유출 및 변조 +# Attack Scenario 1: Capture OTA webpage to leak and tamper with files -## 공격 시나리오 전제 조건 -해킹을 통해 관리자가 펌웨어를 업로드 하기 위해 사용하는 컴퓨터(장비)의 지정 프록시 서버를를 공격자의 프록시 서버로 변경한 것으로 가정한다. +## Attack scenario prerequisites +Assume that the designated proxy server of the computer (device) used by the administrator to upload firmware has been changed to the attacker's proxy server through hacking. -### 공격 시나리오 수행 방법 -1. 업데이트를 파일 업로드를 수행할 컴퓨터의 프록시 서버 IP 주소를 공격자의 IP 주소로 할당한다. - ![스크린샷 2025-05-01 123313](https://github.com/user-attachments/assets/d3703274-8741-4da6-a8a5-2a7a4606fa31) +### How to perform the attack scenario +1. Assign the IP address of the proxy server of the computer that will perform the update file upload to the attacker's IP address. +![Screenshot 2025-05-01 123313](https://github.com/user-attachments/assets/d3703274-8741-4da6-a8a5-2a7a4606fa31) -2. burf 등의 툴을 이용하여 Web에서 파일 업로드를 수행할 때 서버로 전송되는 패킷을 캡처한다. - ![스크린샷 2025-05-01 123507](https://github.com/user-attachments/assets/930ba93e-8924-4cd4-8327-fa45cc5df02c) +2. Capture the packets transmitted to the server when performing a file upload on the web using a tool such as burf. ![Screenshot 2025-05-01 123507](https://github.com/user-attachments/assets/930ba93e-8924-4cd4-8327-fa45cc5df02c) -3. 캡처된 패킷에서 암호화 되지 않은 파일 내용을 변조하여 전송한다. - ![스크린샷 2025-05-01 123546](https://github.com/user-attachments/assets/e5ada10a-4d60-4428-8153-cecf15f13a24) - -4. 인증이 없는 차량은 해당 악성 파일을 설치한다. - ![스크린샷 2025-05-01 123714](https://github.com/user-attachments/assets/894f1c63-f3e4-4071-a484-b5f54897da9c) +3. Transmit the unencrypted file contents from the captured packets by modifying them. +![Screenshot 2025-05-01 123546](https://github.com/user-attachments/assets/e5ada10a-4d60-4428-8153-cecf15f13a24) +4. Install the malicious file on vehicles without authentication. ![Screenshot 2025-05-01 123714](https://github.com/user-attachments/assets/894f1c63-f3e4-4071-a484-b5f54897da9c) From ea7d65fede9c3cece93498d065c3109695575064 Mon Sep 17 00:00:00 2001 From: Kim HyeonSeong <101382350+KimHyeonSeong99@users.noreply.github.com> Date: Fri, 2 May 2025 11:25:42 +0900 Subject: [PATCH 21/26] Update README.md From f3ed4802cbb38a432f96f6831c4a856779e7d8d7 Mon Sep 17 00:00:00 2001 From: Kim HyeonSeong <101382350+KimHyeonSeong99@users.noreply.github.com> Date: Fri, 2 May 2025 11:26:45 +0900 Subject: [PATCH 22/26] Update README.md --- attack_scenarios/Man-in-the-middle_attack/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/attack_scenarios/Man-in-the-middle_attack/README.md b/attack_scenarios/Man-in-the-middle_attack/README.md index 21b29f1..35a14b6 100644 --- a/attack_scenarios/Man-in-the-middle_attack/README.md +++ b/attack_scenarios/Man-in-the-middle_attack/README.md @@ -26,12 +26,12 @@ Assume that an attacker can compromise a proxy server or DNS server and manipula ### Additional Scenarios with secure OTA #### 1. On Server: Using HTTPS(SSL/TLS) -=> We will use a fake CA file injectied on the vehicle. -=> We will perform the activity by injecting the same CA file as the fake server to the client corresponding to the vehicle for the attack scenario +- We will use a fake CA file injectied on the vehicle. +- We will perform the activity by injecting the same CA file as the fake server to the client corresponding to the vehicle for the attack scenario #### 2. On vehicle: Digital sign verification -=> After injecting the vehicle to use the attacker's signature instead of the server's public key -=> To perform the activity, the public key of attacker for the vehicle is performed. +- After injecting the vehicle to use the attacker's signature instead of the server's public key +- To perform the activity, the public key of attacker for the vehicle is performed. --- From 7b974e023e6cafa4cfc46b36ea31d3425c82d4ed Mon Sep 17 00:00:00 2001 From: Kim HyeonSeong <101382350+KimHyeonSeong99@users.noreply.github.com> Date: Fri, 2 May 2025 11:27:24 +0900 Subject: [PATCH 23/26] Update README.md --- attack_scenarios/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/attack_scenarios/README.md b/attack_scenarios/README.md index 76c13fc..b0542f9 100644 --- a/attack_scenarios/README.md +++ b/attack_scenarios/README.md @@ -62,8 +62,8 @@ Assume that an attacker can compromise a proxy server or DNS server and manipula => We will perform the activity by injecting the same CA file as the fake server to the client corresponding to the vehicle for the attack scenario ##### 2. On vehicle: Digital sign verification -=> After injecting the vehicle to use the attacker's signature instead of the server's public key -=> To perform the activity, the public key of attacker for the vehicle is performed. +- After injecting the vehicle to use the attacker's signature instead of the server's public key +- To perform the activity, the public key of attacker for the vehicle is performed. --- From 577d3edb70bf5953ef7096c1ece60e398c538fbd Mon Sep 17 00:00:00 2001 From: Kim HyeonSeong <101382350+KimHyeonSeong99@users.noreply.github.com> Date: Fri, 2 May 2025 11:27:44 +0900 Subject: [PATCH 24/26] Update README.md --- attack_scenarios/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/attack_scenarios/README.md b/attack_scenarios/README.md index b0542f9..50b2fd9 100644 --- a/attack_scenarios/README.md +++ b/attack_scenarios/README.md @@ -58,8 +58,8 @@ Assume that an attacker can compromise a proxy server or DNS server and manipula #### Additional Scenarios with secure OTA ##### 1. On Server: Using HTTPS(SSL/TLS) -=> We will use a fake CA file injectied on the vehicle. -=> We will perform the activity by injecting the same CA file as the fake server to the client corresponding to the vehicle for the attack scenario +- We will use a fake CA file injectied on the vehicle. +- We will perform the activity by injecting the same CA file as the fake server to the client corresponding to the vehicle for the attack scenario ##### 2. On vehicle: Digital sign verification - After injecting the vehicle to use the attacker's signature instead of the server's public key From f1ba2534771e73544e8c1d315f76ce14d1b3d79d Mon Sep 17 00:00:00 2001 From: ppp830 Date: Fri, 2 May 2025 15:37:30 +0900 Subject: [PATCH 25/26] Update README.md --- .../scenario_PYL/README.md | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/attack_scenarios/Man-in-the-middle_attack/scenario_PYL/README.md b/attack_scenarios/Man-in-the-middle_attack/scenario_PYL/README.md index 8b13789..2124b43 100644 --- a/attack_scenarios/Man-in-the-middle_attack/scenario_PYL/README.md +++ b/attack_scenarios/Man-in-the-middle_attack/scenario_PYL/README.md @@ -1 +1,49 @@ +### [Prerequisite: Attacker's perspective] +- The vehicle communication module requests the server address based on the domain name. +- The proxy server is already under the control of the attacker, so it can monitor and modify traffic. +- The response that informs the IP address when the OTA update file is transmitted to the vehicle's communication module can be intercepted and reassigned. +- The OTA server is not secured. +### Step 1 (Assumption): File update to the OTA server +- Upload the firmware file to a normal OTA server. +- The OTA server registers it in a downloadable path. +- It notifies that the update has been made. + +### Step 2 (Assumption): The vehicle communication module sends an OTA request +- The vehicle communication module sends an OTA request to the [ota.com](http://ota.com) domain. +- At this time, the server's IP address must be confirmed to receive the OTA file, so a process of confirming the server address (IP) occurs. +- The attacker intercepts the **response that informs the IP address of the server when requesting OTA** from the proxy server and manipulates the response to send his server IP address to the vehicle. +- The proxy monitors the traffic transmitted in the network layer, and when a request to confirm the server address is detected, it forges the response to respond with the attacker's IP address. + +### Step 3: Attacker operates a fake OTA server +- The attacker provides a fake OTA file from his web server. +- The vehicle communication module receives the malicious file by the attacker. +- It copies the format (size, header, version structure) similar to the actual OTA file and inserts malicious commands/functions in the middle. +- In other words, the vehicle communication module recognizes the OTA update file as a normal file. + +### Step 4: Vehicle communication module downloads the fake OTA file +- The vehicle communication module downloads the OTA file from the server connected to the forged IP. +- It receives the file with a status similar to a normal response. +- The communication module in the vehicle distributes the fake file to the ECU, and the ECU applies the file without separate integrity verification. +- Malicious commands are executed and abnormal behavior is triggered, allowing remote control and subsequent attacks. + +In an environment where OTA server authentication, file signing, and encryption are not applied due to low security level where even integrity verification does not exist, an attacker can easily manipulate the request path and deliver a fake OTA file. + + +```python +# Used to create a web server using a Python tool called Flask. +from flask import Flask, send_file + +# Starting the Flask web server +app = Flask(__name__) + +# When a vehicle makes a request to the '/ota' address, the function below is executed. +@app.route("/ota") +def send_fake_file(): + # 'fake_ota_update.bin'이라는 파일을 다운로드하게 함 + return send_file("fake_ota_update.bin", as_attachment=True) + +# Run the server on port 8000 (so any vehicle can access it) +if __name__ == "__main__": + app.run(host="0.0.0.0", port=8000) +``` From 8c1c1065c589fe74fb2070a9824a21abb283d9ea Mon Sep 17 00:00:00 2001 From: ppp830 Date: Wed, 7 May 2025 21:01:36 +0900 Subject: [PATCH 26/26] Update README.md --- .../scenario_PYL/README.md | 148 +++++++++++++----- 1 file changed, 112 insertions(+), 36 deletions(-) diff --git a/attack_scenarios/Man-in-the-middle_attack/scenario_PYL/README.md b/attack_scenarios/Man-in-the-middle_attack/scenario_PYL/README.md index 2124b43..28e85a2 100644 --- a/attack_scenarios/Man-in-the-middle_attack/scenario_PYL/README.md +++ b/attack_scenarios/Man-in-the-middle_attack/scenario_PYL/README.md @@ -1,49 +1,125 @@ -### [Prerequisite: Attacker's perspective] -- The vehicle communication module requests the server address based on the domain name. -- The proxy server is already under the control of the attacker, so it can monitor and modify traffic. -- The response that informs the IP address when the OTA update file is transmitted to the vehicle's communication module can be intercepted and reassigned. -- The OTA server is not secured. - -### Step 1 (Assumption): File update to the OTA server -- Upload the firmware file to a normal OTA server. -- The OTA server registers it in a downloadable path. -- It notifies that the update has been made. - -### Step 2 (Assumption): The vehicle communication module sends an OTA request -- The vehicle communication module sends an OTA request to the [ota.com](http://ota.com) domain. -- At this time, the server's IP address must be confirmed to receive the OTA file, so a process of confirming the server address (IP) occurs. -- The attacker intercepts the **response that informs the IP address of the server when requesting OTA** from the proxy server and manipulates the response to send his server IP address to the vehicle. -- The proxy monitors the traffic transmitted in the network layer, and when a request to confirm the server address is detected, it forges the response to respond with the attacker's IP address. - -### Step 3: Attacker operates a fake OTA server -- The attacker provides a fake OTA file from his web server. -- The vehicle communication module receives the malicious file by the attacker. -- It copies the format (size, header, version structure) similar to the actual OTA file and inserts malicious commands/functions in the middle. -- In other words, the vehicle communication module recognizes the OTA update file as a normal file. - -### Step 4: Vehicle communication module downloads the fake OTA file -- The vehicle communication module downloads the OTA file from the server connected to the forged IP. -- It receives the file with a status similar to a normal response. -- The communication module in the vehicle distributes the fake file to the ECU, and the ECU applies the file without separate integrity verification. -- Malicious commands are executed and abnormal behavior is triggered, allowing remote control and subsequent attacks. - -In an environment where OTA server authentication, file signing, and encryption are not applied due to low security level where even integrity verification does not exist, an attacker can easily manipulate the request path and deliver a fake OTA file. +# OTA MITM Attack Simulation +This project simulates a Man-In-The-Middle (MITM) attack on an insecure OTA (Over-The-Air) update system. The attacker intercepts and redirects OTA requests, delivering a malicious update file instead of the legitimate one. + +## Assumptions + +- The attacker has already compromised the proxy server. +- The vehicle’s communication module makes OTA requests using domain names (e.g., `ota.com`). +- The proxy server, under the attacker's control, can inspect and modify traffic. +- The OTA server lacks authentication, integrity checks, and encryption. +- The vehicle does not verify signatures or hashes on received files. + +--- + +## Attack Scenario (Attacker’s Perspective) + +### Step 1: Firmware Update Uploaded to OTA Server (Baseline Assumption) +- The legitimate OTA server hosts a new firmware file. +- It is published at a downloadable URL. +- A notice is sent out that an update is available. + +### Step 2: Vehicle Makes OTA Request +- The vehicle's communication module sends an OTA request to `http://ota.com`. +- To fetch the file, it needs to resolve the domain to an IP. +- The attacker intercepts the IP resolution response and replaces it with the attacker’s server IP. +- From the vehicle’s perspective, `ota.com` now points to the attacker-controlled server. + +### Step 3: Attacker Hosts a Fake OTA Server +- The attacker operates a malicious OTA server that mimics the real one. +- The fake server responds with a crafted `fake_ota_update.bin`. +- The file mimics the format of the real update (headers, version, etc.) but contains malicious code. +- Optionally, the attacker recomputes the hash and signature fields to match the file content. +- Alternatively, the attacker may deliver an old vulnerable version (rollback attack). + +### Step 4: Vehicle Downloads Malicious OTA File +- The vehicle downloads the file, assuming it’s legitimate. +- If integrity verification is skipped or bypassed, the malicious update is accepted. +- The update is passed to the ECU, which applies it without further verification. +- The attacker gains the ability to remotely control or disrupt the vehicle. + +--- + +## Additional Attack Variants + +- **Rollback attack**: Serving outdated vulnerable firmware. +- **Hash collision attack**: Reusing the same hash in the OTA package. +- **Fake version metadata**: Tricking version checks by spoofing metadata. +- **Signed-but-malicious file**: When code signing is not enforced. + +--- + +## Step-by-Step Simulation + +### Step 1: Create a Fake OTA Server ```python -# Used to create a web server using a Python tool called Flask. +# fake_ota_server.py + from flask import Flask, send_file -# Starting the Flask web server app = Flask(__name__) -# When a vehicle makes a request to the '/ota' address, the function below is executed. @app.route("/ota") def send_fake_file(): - # 'fake_ota_update.bin'이라는 파일을 다운로드하게 함 - return send_file("fake_ota_update.bin", as_attachment=True) + return send_file("fake_ota_update.bin", as_attachment=True) -# Run the server on port 8000 (so any vehicle can access it) if __name__ == "__main__": app.run(host="0.0.0.0", port=8000) ``` + +#### Explanation + +- A simple Flask server listens on port 8000. +- When /ota is accessed, it returns the fake binary file. +- The .bin file imitates a real OTA update. + +### Step 2: Simulate the Vehicle's Communication Module + +```python +# vehicle_module.py + +import requests + +url = "http://ota.com:8000/ota" + +print("[Vehicle] Sending OTA update request...") + +response = requests.get(url) + +if response.status_code == 200: + with open("downloaded_ota.bin", "wb") as f: + f.write(response.content) + print("[Vehicle] OTA file received! Saved as downloaded_ota.bin") +else: + print("[Vehicle] Failed to download OTA file. Status code:", response.status_code) +``` + +#### Explanation + +- Sends an HTTP GET request to `http://ota.com:8000/ota`. +- If successful, saves the file as `downloaded_ota.bin`. +- Simulates a vehicle blindly trusting the update file. + +## Configuration (for local testing) +### 1. Modify `hosts` file on your machine (Windows only) +To redirect `ota.com` to your local attacker server: +1. Run Notepad as Administrator +2. Open: `C:\Windows\System32\drivers\etc\hosts` +3. Add the following line: +``` +127.0.0.1 ota.com +``` +4. Save and close + +## Disclaimer +This simulation is for educational and research purposes only. Never use these techniques against real vehicles or systems. Always get permission before performing security testing. + +## File Structure +```graphql +. +├── fake_ota_server.py # Fake OTA server (attacker) +├── vehicle_module.py # Simulated vehicle requesting the OTA file +├── fake_ota_update.bin # Malicious binary (crafted by attacker) +└── README.md # This file +``` \ No newline at end of file