실제 생활에서의 무선 해킹 - secuinsidesecuinside.com/archive/2017/2017-2-3.pdf · 2017....

27
실제 생활에서의 무선 네트워크 해킹 SECUINSIDE 2017.7.11 이경문(gilgil)

Upload: others

Post on 28-Aug-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 실제 생활에서의 무선 해킹 - SECUINSIDEsecuinside.com/archive/2017/2017-2-3.pdf · 2017. 8. 3. · 802.11 Header TSC(48bit) encrypted data plain text MIC TKIP Mixing 128bit

실제 생활에서의 무선 네트워크 해킹

SECUINSIDE 2017.7.11 이경문(gilgil)

Page 2: 실제 생활에서의 무선 해킹 - SECUINSIDEsecuinside.com/archive/2017/2017-2-3.pdf · 2017. 8. 3. · 802.11 Header TSC(48bit) encrypted data plain text MIC TKIP Mixing 128bit

잠을 깨자● 서영일님잘생긴듯● 이경문님어여쁜듯● 이국현님풀좀주세요말좀붙이게● 신정훈님존경합니다● 심준보님감사합니다● 이기택님감사합니다● 김승주님감사합니다

Page 3: 실제 생활에서의 무선 해킹 - SECUINSIDEsecuinside.com/archive/2017/2017-2-3.pdf · 2017. 8. 3. · 802.11 Header TSC(48bit) encrypted data plain text MIC TKIP Mixing 128bit

용어

● Access Point : a networking hardware device that allows a Wi-Fi device to connect to a wired network

● Station : a device that has the capability to use the 802.11 protocol

http://arduino-esp8266.readthedocs.io/en/latest/esp8266wifi/readme.html

Page 4: 실제 생활에서의 무선 해킹 - SECUINSIDEsecuinside.com/archive/2017/2017-2-3.pdf · 2017. 8. 3. · 802.11 Header TSC(48bit) encrypted data plain text MIC TKIP Mixing 128bit

beacon flooding attack

● 2가지로 나뉜다. − 임의의 SSID를 마구잡이로 전송하는 기법. − 기존에 존재하는 AP와 동일한 SSID를 전송하여 기존 AP에 접속을 하지 못하게 하는 기법(동일 SSID인 경우 신호의 세기가 큰 쪽으로 연결을 시도하게 됨).

Page 5: 실제 생활에서의 무선 해킹 - SECUINSIDEsecuinside.com/archive/2017/2017-2-3.pdf · 2017. 8. 3. · 802.11 Header TSC(48bit) encrypted data plain text MIC TKIP Mixing 128bit

합법인가요? 불법인가요?

● 대상자에게 명시적/암묵적 동의를 얻은 상태에서 교육을 위한 해킹 시연은 합법으로 간주한다.

● 기법에 대한 기술적인 부분이 아닌 명예 훼손의 여부가 합법/불법을 결정지을 수 있는 요소이다.

Page 6: 실제 생활에서의 무선 해킹 - SECUINSIDEsecuinside.com/archive/2017/2017-2-3.pdf · 2017. 8. 3. · 802.11 Header TSC(48bit) encrypted data plain text MIC TKIP Mixing 128bit

무선 해킹이란● 넓게는 wireless의 모든 분야를 포함. ● 좁게는 wifi의 영역으로 제한함.

Page 7: 실제 생활에서의 무선 해킹 - SECUINSIDEsecuinside.com/archive/2017/2017-2-3.pdf · 2017. 8. 3. · 802.11 Header TSC(48bit) encrypted data plain text MIC TKIP Mixing 128bit

암호화에 따른 wifi 환경의 종류● encrypt되어 있지 않은 환경

− OPEN ● encrypt되어 있는 환경

− WEP − WPA / WPA Enterprise − WPA2 / WPA2 Enterprise

Page 8: 실제 생활에서의 무선 해킹 - SECUINSIDEsecuinside.com/archive/2017/2017-2-3.pdf · 2017. 8. 3. · 802.11 Header TSC(48bit) encrypted data plain text MIC TKIP Mixing 128bit

How to decrypt wireless packet(open mode)

● just capture the open AP’s packets ● olleh wifi, T wifi zone, other open APs

Page 9: 실제 생활에서의 무선 해킹 - SECUINSIDEsecuinside.com/archive/2017/2017-2-3.pdf · 2017. 8. 3. · 802.11 Header TSC(48bit) encrypted data plain text MIC TKIP Mixing 128bit

How to decrypt wireless packet(wep mode)

● 24bit IV + 40bit or 104bit shared key

802.11 Header IV(24bit) encrypted data

plain text CRC

WEP KeyIVRC4 (xor)

D

E

Page 10: 실제 생활에서의 무선 해킹 - SECUINSIDEsecuinside.com/archive/2017/2017-2-3.pdf · 2017. 8. 3. · 802.11 Header TSC(48bit) encrypted data plain text MIC TKIP Mixing 128bit

wpa/wpa2 key distribution

● IEEE 802.11i - Dynamic key distribution (EAPoL 4Way-HandShaking)

- We need “TK Key” for decryption

Page 11: 실제 생활에서의 무선 해킹 - SECUINSIDEsecuinside.com/archive/2017/2017-2-3.pdf · 2017. 8. 3. · 802.11 Header TSC(48bit) encrypted data plain text MIC TKIP Mixing 128bit

wpa/wpa2 key distribution

● PTK Generation

passphrase

PMK

passphrase

PMK

PTK

PTK, MIC Check

PBKDF2(HMAC−SHA1, passphrase, ssid, 4096, 256)

MIC Check

Key Install

ANonce

SNonce

ANonce

PTK = PRF-512(PMK, "Pair-wise Key Expansion", AP_MAC || STA_MAC || ANonce || SNonce)

Page 12: 실제 생활에서의 무선 해킹 - SECUINSIDEsecuinside.com/archive/2017/2017-2-3.pdf · 2017. 8. 3. · 802.11 Header TSC(48bit) encrypted data plain text MIC TKIP Mixing 128bit

How to decrypt wireless packet(wpa mode)

● WPA/TKIP - TSC(TKIP Sequence Counter), TA(Transmitter address)

802.11 Header TSC(48bit) encrypted data

plain text MIC

TKIPMixing 128bit key

RC4 xor

D

E

TK TSC TA

Page 13: 실제 생활에서의 무선 해킹 - SECUINSIDEsecuinside.com/archive/2017/2017-2-3.pdf · 2017. 8. 3. · 802.11 Header TSC(48bit) encrypted data plain text MIC TKIP Mixing 128bit

How to decrypt wireless packet(wpa2 mode)

● WPA2/CCMP - PN(Packet Number), CTR(Counter)

802.11 Header PN(48bit) encrypted data

plain text CBC-MAC

TK E data

XOR

E

D

AES ECB

flag(1) priority(0) TA PN CTR

Page 14: 실제 생활에서의 무선 해킹 - SECUINSIDEsecuinside.com/archive/2017/2017-2-3.pdf · 2017. 8. 3. · 802.11 Header TSC(48bit) encrypted data plain text MIC TKIP Mixing 128bit

WPA Decrypt Demo

Page 15: 실제 생활에서의 무선 해킹 - SECUINSIDEsecuinside.com/archive/2017/2017-2-3.pdf · 2017. 8. 3. · 802.11 Header TSC(48bit) encrypted data plain text MIC TKIP Mixing 128bit

대응 방안● wireless network를 가급적 사용하지 않습니다.

− 응? ● WPA(2) Enterprise 환경을 사용합니다.

● 암호화를 제공하는 어플리케이션을 이용합니다. − full traffic이 ssl로 구성되어 있는 웹사이트 이용.

● 공공 장소에서 이상한 무선 랜카드를 쓰는 사람을 째려 봅니다. − wireshark 띄워 놓았다면 십중 팔구.

Page 16: 실제 생활에서의 무선 해킹 - SECUINSIDEsecuinside.com/archive/2017/2017-2-3.pdf · 2017. 8. 3. · 802.11 Header TSC(48bit) encrypted data plain text MIC TKIP Mixing 128bit

무선 해킹에 접근하려면● monitor mode wireless adapter : TL-WN722N ● linux : kali or ubuntu ● 공부 공부 공부!!!

Page 17: 실제 생활에서의 무선 해킹 - SECUINSIDEsecuinside.com/archive/2017/2017-2-3.pdf · 2017. 8. 3. · 802.11 Header TSC(48bit) encrypted data plain text MIC TKIP Mixing 128bit

기존 해킹과 무선 해킹의 차이

기존 해킹(한둘을 타켓으로) 무선 해킹(아무나 걸려라)

Page 18: 실제 생활에서의 무선 해킹 - SECUINSIDEsecuinside.com/archive/2017/2017-2-3.pdf · 2017. 8. 3. · 802.11 Header TSC(48bit) encrypted data plain text MIC TKIP Mixing 128bit

지하철에서

● 무선 패킷을 마구 마구 잡고 싶어요. ● 하지만 노트북으로 패킷을 잡기는...

Page 19: 실제 생활에서의 무선 해킹 - SECUINSIDEsecuinside.com/archive/2017/2017-2-3.pdf · 2017. 8. 3. · 802.11 Header TSC(48bit) encrypted data plain text MIC TKIP Mixing 128bit

소형화가 필요하다● IoT에서는 Raspberry pi ● 스마트폰에서는Kali NetHunter ● 모두 Linux를 지원함.

Page 20: 실제 생활에서의 무선 해킹 - SECUINSIDEsecuinside.com/archive/2017/2017-2-3.pdf · 2017. 8. 3. · 802.11 Header TSC(48bit) encrypted data plain text MIC TKIP Mixing 128bit

이런 장치 제작에 법적 문제는 없나?

Page 21: 실제 생활에서의 무선 해킹 - SECUINSIDEsecuinside.com/archive/2017/2017-2-3.pdf · 2017. 8. 3. · 802.11 Header TSC(48bit) encrypted data plain text MIC TKIP Mixing 128bit

우리나라는 이런 거 만들면 안되나?

http://www.gilgil.net/1816

Page 22: 실제 생활에서의 무선 해킹 - SECUINSIDEsecuinside.com/archive/2017/2017-2-3.pdf · 2017. 8. 3. · 802.11 Header TSC(48bit) encrypted data plain text MIC TKIP Mixing 128bit

HackRF

https://greatscottgadgets.com/hackrf/

Page 23: 실제 생활에서의 무선 해킹 - SECUINSIDEsecuinside.com/archive/2017/2017-2-3.pdf · 2017. 8. 3. · 802.11 Header TSC(48bit) encrypted data plain text MIC TKIP Mixing 128bit

WiFi Pineapple

https://www.wifipineapple.com/

Page 24: 실제 생활에서의 무선 해킹 - SECUINSIDEsecuinside.com/archive/2017/2017-2-3.pdf · 2017. 8. 3. · 802.11 Header TSC(48bit) encrypted data plain text MIC TKIP Mixing 128bit

Tactical Network Injector

http://www.gilgil.net/829875

Page 25: 실제 생활에서의 무선 해킹 - SECUINSIDEsecuinside.com/archive/2017/2017-2-3.pdf · 2017. 8. 3. · 802.11 Header TSC(48bit) encrypted data plain text MIC TKIP Mixing 128bit

shodan.io

Page 26: 실제 생활에서의 무선 해킹 - SECUINSIDEsecuinside.com/archive/2017/2017-2-3.pdf · 2017. 8. 3. · 802.11 Header TSC(48bit) encrypted data plain text MIC TKIP Mixing 128bit

한번 만들어 보자구요● 기존의 분야와 비교해서 무선 해킹은 알려 지지 않은 것들이 많습니다.

● 누구나 제대로 된 제품을 만들 수 있습니다. ● 열공!!!

Page 27: 실제 생활에서의 무선 해킹 - SECUINSIDEsecuinside.com/archive/2017/2017-2-3.pdf · 2017. 8. 3. · 802.11 Header TSC(48bit) encrypted data plain text MIC TKIP Mixing 128bit

감사합니다

● http://gilgil.net ● https://fb.com/gilgil1973