starting point
Open SSL 취약점(Heartbleed, CVE-2014-0160) 본문
정의
비정상적인 SSL heartbeat 요청을 전송하여 서버의 heartbeat 응답 값에 다양한 정보를 포함하여 정보를 탈취하는 취약점
SSL heartbeat
SSL 세션 생성을 위해 handshake 과정을 완료하고, 연결이 유지되고 있는지 확인하기 위한 목적으로 사용됨.
- Content Type: 0x18, handshake, heartbeat 등 어떤 메시지인지 설명
- SSL Version: SSL 버전(SSLv3: 03 00, TLS 1.0: 03 01, TLS 1.1: 03 02, TLS 1.2: 03 03)
- Length Field: heartbeat 요청 메시지의 길이
- 페이로드: 실제 요청값(응답 메시지의 페이로드와 같아야 함)
패킷 예시
18 03 02 00 03
01 40 00
18: heartbeat 메시지임을 명시
03 02: TLS. 1.1 버전임을 명시
00 03: 페이로드 길이(3byte)
01 40 00: 페이로드((start of head)@(null))
SSL heartbleed 공격을 수행하게 되면 위 페이로드 길이를 조작하게 됨. 만약 heartbeat request 요청에 페이로드 길이를 255byte로 설정하여 요청하게 될 경우, 서버는 클라이언트 요청한 페이로드에 추가로 메모리 상에 올라간 데이터를 전송하게 된다.
탐지방안
페이로드 길이가 비정상적으로 큰 값이 포함되어 있는지 확인한다.
heartbeat는 SSL 연결이 살아있지는 확인하는 요청으로 페이로드가 아주 길 필요가 없다.
alert tcp any any <> any 443 (content:"|18 03 00|"; depth: 3; content:"|01|"; distance: 2; within: 1; content:!"|00|"; within: 1; msg: "SSLv3 heartbleed Request"; sid: 1;)
alert tcp any any <> any 443 (content:"|18 03 01|"; depth: 3; content:"|01|"; distance: 2; within: 1; content:!"|00|"; within: 1; msg: "TLSv1 heartbleed Request"; sid: 1;)
alert tcp any any <> any 443 (content:"|18 03 02|"; depth: 3; content:"|01|"; distance: 2; within: 1; content:!"|00|"; within: 1; msg: " TLSv1.1 heartbleed Request"; sid: 1;)
출처: https://blog.alyac.co.kr/76
취약버전
- OpenSSL 1.0.1 ~ 1.0.1f
- OpenSSL 1.0.2-beta, OpenSSL 1.0.2-beta1
참고
TLS1.3에서는 더 이상 heartbeat를 사용하지 않는다.
참고 자료
'네트워크 > 패킷 분석' 카테고리의 다른 글
Fortigate 인증 우회 취약점(CVE-2022-40684) (0) | 2023.12.01 |
---|---|
Shellshock 취약점 (2) | 2023.11.27 |
RDP 터널링 공격(Bypassing Network Restrictions Through RDP Tunneling) (2) | 2023.11.22 |