상세 컨텐츠

본문 제목

WPA2 KRACK Attack 분석

국내외 보안동향

by 알약(Alyac) 2017. 10. 19. 18:01

본문

2017년 10월 16일, WiFi + WPA2 네트워크를 공격할 수 있는 KRACK 취약점 공격방식이 공개되었습니다. 


KRACK은 주로 02.11i중의 4way hand shake 과정 중의 취약점을 이용하여 WiFi 트래픽의 암호화를 복호화 하고 변조할 수 있습니다. 


해당 취약점은 imec-DistriNet의 Mathy Vanhoef와 KU Leuven가 발견하였습니다. 


krackattacks.com과 일부 공유기 제조업체들의 보안공지를 종합해서 분석해본 결과, Linux,Android, Cisco wireless products, OpenBSD, MacOS, Windows, iOS등 다양한 제품과 플랫폼 모두 영향을 받는 것으로 확인되었습니다. 


개요


이번 취약점은 WPA2 프로토콜에 논리적 결함으로 인해 발생하는 취약점으로, Wi-Fi를 지원하는 거의 모든 디바이스들(Android, Linux, Apple, Windows, OpenBSD, MediaTek, Linksys)이 영향을 받습니다. 


해당 취약점을 악용하면 스니핑, 스푸핑 등의 악성행위를 통하여 WiFi 중의 신용카드, 이메일, 계정정보 등 다양한 정보들을 탈취할 수 있습니다. 이러한 공격은 Key Reinstallation Attacks라 명명되었습니다. 


취약점이 발생하는 원인은 802.11 표준 중 4way hand shake중 언제 협상 키를 설정해야 하는지 정의되어 있지 않아, 공격자가 동일한 키를 여러번 설치하여 암호화 프로토콜이 사용하는 난수 및 재생계수를 재설정 할 수 있기 떄문입니다.


KRACK 취약점과 관련된 CVE 번호


CVE-2017-13077: Reinstallation of the pairwise encryption key (PTK-TK) in the 4-way handshake.

CVE-2017-13078: Reinstallation of the group key (GTK) in the 4-way handshake.

CVE-2017-13079: Reinstallation of the integrity group key (IGTK) in the 4-way handshake.

CVE-2017-13080: Reinstallation of the group key (GTK) in the group key handshake.

CVE-2017-13081: Reinstallation of the integrity group key (IGTK) in the group key handshake.

CVE-2017-13082: Accepting a retransmitted Fast BSS Transition (FT) Reassociation Request and reinstalling the pairwise encryption key (PTK-TK) while processing it.

CVE-2017-13084: Reinstallation of the STK key in the PeerKey handshake.

CVE-2017-13086: reinstallation of the Tunneled Direct-Link Setup (TDLS) PeerKey (TPK) key in the TDLS handshake.

CVE-2017-13087: reinstallation of the group key (GTK) when processing a Wireless Network Management (WNM) Sleep Mode Response frame.

CVE-2017-13088: reinstallation of the integrity group key (IGTK) when processing a Wireless Network Management (WNM) Sleep Mode Response frame.



영향받는 버전


Arch Linux

Arista

Aruba

Broadcom

Cisco

DD-WRT

Debian

Extreme Networks

Fedora

FreeBSD

Lenovo

Juniper

Intel Corporation

LineageOS

LXDE

Marvell

Meraki

Microsoft

MikroTik

Mojo Networks

Synology

Turris Omnia

Ubiquiti

Ubuntu

UniFi

VMware

Watchguard Cloud

Windows 10

WPA_supplicant



기술 분석


802.11i 프로토콜은 2가지의 독립적인 매커니즘을 이용하여 데이터의 기밀성을 확보합니다. 


첫번째는 매커니즘은 record 층에서 WiFi 프레임을 암호화 하는 방식을 이용하며, 이를 통하여 스니핑이나 평문을 읽는것을 방지합니다. 해당 암호화 매커니즘은 주로 AED-CCM방식을 이용하는데, 일부는GCM 모드를 사용하기도 하며, 일부는 노후된 RC4-TKIP방식을 사용하기도 합니다. 


고려해야할 것은 AES-CCM(GCM,TKIP포함)은 스트림 암호화 인데, 이는 즉 암호 매개변수 key와 nonce를 재사용 한다는 가정 하에서 공격이 성공할 수 있습니다. 


802.11i는  packet number number 방식을 기반으로 하며,이는 세션이 설정된 후의 초기값이 0이며, 끊임없이 증가합니다(2^48이 되었을 때 Key업데이트 작업을 트리거 합니다). 이렇다면, 만약 packet number number가 재사용되지 않은 상황에서라면, key+nonce 재사용 공격을 방지할 수 있습니다. 


두번째는 매커니즘은 AP와 supplicant 사이 4-way hand shake 과정을 통해서 암호화 키를 협상하는데 있습니다. KRACK 취약점은 4way hand shake 중의 message 3 패킷에 존재합니다. 


<이미지 출처 : https://blog.cryptographyengineering.com/2017/10/16/falling-through-the-kracks/>


4-way hand shake 과정 중 클라이언트는 AP에서 Message3을 수신 후 비밀key를 설치하여 정상 데이터 프레임을 암호화 하는데 사용합니다. 


message가 중간에 소실될 가능성이 있기 때문에, AP는 클라이언트 측에서 잘 수신하였다는 메세지를 받지 못했다면 message3을 다시 전달하게 됩니다. 이렇게 되면 클라이언트는 여러번의 message3을 받을 가능성이 있습니다. 클라이언트는 매번 message를 받을 때 마다 암호 key를 재설정하게 됩니다. 또한 암호화 프로토콜이 사용하는 점점 증가하는 데이터 패킷의 nonce와 수신한 재생 카운터도 다시 재설정합니다. 


공격자는 수집과 재발송된 message3이 강제적으로 재설정한 nonce를 통하여 성공적으로 암호화 프로토콜의 재사용 공격을 할 수 있게되는 것입니다. 



패치방법


자신이 사용하는 클라이언트 확인 후 보안업데이트



참고:

https://www.krackattacks.com 

https://papers.mathyvanhoef.com/ccs2017.pdf 

https://github.com/kristate/krackinfo 

https://blog.cryptographyengineering.com/2017/10/16/falling-through-the-kracks/

https://git.archlinux.org/svntogit/packages.git/commit/trunk?h=packages/wpa_supplicant&id=9c1bda00a846ff3b60e7c4b4f60b28ff4a8f7768 

https://git.archlinux.org/svntogit/community.git/commit/trunk?h=packages/hostapd&id=d31735a09b4c25eaa69fb13b1031910ca3c29ee5 

http://svn.dd-wrt.com/changeset/33525 

https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2017-13080 

https://access.redhat.com/security/cve/cve-2017-13087

관련글 더보기

댓글 영역