49
Transport-Level Security 2014. 03. 10 강 원 민, 이 정 규 Email:{wkaqhsk0, jungkyu21}@seoultech.ac.kr SeoulTech UCS Lab 2014-1 st Copyright ⓒ 2014 by USC Lab All Rights Reserved. 1

Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

Transport-Level Security

2014. 03. 10

강 원 민, 이 정 규

Email:{wkaqhsk0, jungkyu21}@seoultech.ac.kr

SeoulTech UCS Lab 2014-1st

Copyright ⓒ 2014 by USC Lab All Rights Reserved. 1

Page 2: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

목 차

Ⅰ. 웹 보안의 필요성

Ⅱ.안전 소켓 계층과 전송 계층 보안

Ⅲ. TLS(Transport Layer Security)

Ⅳ. HTTPS(HTTP over SSL )

Ⅴ. SSH(Secure Shell)

2

Page 3: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

Ⅰ. 웹 보안의 필요성

▣ 웹(Web)이란?

◈ 정 의 : WWW, W3 또는 웹(Web)이라고도 불리는 월드와이드웹

(World Wide Web)은 다양한 형태의 데이터와 정보에 접근할 수

있도록 해 주는 인터넷 서비스.

3

Page 4: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

Ⅰ. 웹 보안의 필요성

▣ 웹(Web)의 보안 필요성

◈ 개인/단체 인터넷 및 웹은 보안이 취약.

◈ 기업의 신뢰성, 경제성 손실 우려.

◈ 다양한 보안 공격에 취약한 시스템 사례를 많음.

- 무결성

- 기밀성

- 서비스 거부

- 인증

-> 보안 매커니즘 필요

4

Page 5: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

Ⅰ. 웹 보안의 필요성

▣ 웹(Web)보안 위협

5

구 분 위 협 피해 사항 대응 방법

무결성

· 사용자 데이터의 변경 · 트로이 목마 브라우저 · 메모리의 변경 · 전송 중 메시지 트래픽의 변경

· 정보의 손실 · 기계에 대한 침해 · 다른 위협에 대한 취약성

Hash함수 메시지 인증코드

기밀성

· Net 도청하기 · 서버에서 정보 훔치기 · 클라이언트에서 데이터 훔치기 · 네트워크 구성에 대한 정보 알아내기 · 서버와 통신 중인 클라이언트 알아내기

· 정보의 손실 · 기밀성 침해

암호화, 웹 프록시

서비스 거부

· 사용자 스레드(thread)중단시키기 · 과잉의 가짜 요청을 보내기 · 메모리나 디스크 영역 차지하기 · DNS 공격을 통한 고립화

· 서비스를 불가능하게 함 예방하기 힘듬

인증 · 합법적 사용자로 위장하기 · 데이터 위조

· 사용자에 대한 식별 오류 · 가짜 정보를 진짜로 오인

암호적 기술

Page 6: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

Ⅰ. 웹 보안의 필요성

▣ 웹(Web) 트래픽 보안 방법

6

(a) 네트워크 계층 (b) 전송 계층 (c) 응용 계층

Page 7: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

Ⅱ. 안전 소켓 계층과 전송 계층 보안

▣ SSL 정의 및 구조

7

SSL Protocol Stack

◈ 넷스케이프사에 의해 개발 ◈ 대중의 의견으로 ver.3 설계 ◈ 이후에 TLS(전송계층 보안)로 알려진 인터넷 표준 ◈ 신뢰성 높은 서비스 제공을 하기 위해 TCP사용 ◈ SSL 프로토콜은 2개의 층이 있음.

Page 8: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

Ⅱ. 안전 소켓 계층과 전송 계층 보안

▣ SSL세션과 SSL연결

8

◈ SSL 세션 - 클라이언트와 서버 사이의 연결 - 핸드 셰이크 프로토콜에 의해 생성 - 암호화 매개 변수 집합을 정의 - 여러 SSL 세션연결을 공유 ◈SSL 연결 - 일시적으로 연결 - 모든 연결은 세션과 연관 - Peer-to-Peer 통신링크

Page 9: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

Ⅱ. 안전 소켓 계층과 전송 계층 보안

▣ SSL세션과 SSL연결

9

구분 설 명

세션 식별자 (Session Identifier)

활동 상태나 재시작할 수 있는 세션 상태를 임의의 바이트 열

대등 인증서 (Peer Certificate)

대등의X509.v9 인증서, 이 요소의 상태는 비어(null)있을 수 있다.

압축방법 (Compression method)

암호화 전 압축에 사용하는 알고리즘

암호명세 (Cipher spec)

MAC계산에 사용되는 용량이 큰 데이터에 대한 암호알고리즘 (null,DES등)과 해시알고리즘을 나타냄

마스터 비밀 (Master secret)

클라이언트와 서버가 공유하는 48-바이트 비밀

재시작 여부 (Is resumable)

새 연결을 시작하기 위해서 세션을 사용할 수 있는지 아닌지를 나타내는 플래그

Page 10: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

Ⅱ. 안전 소켓 계층과 전송 계층 보안

▣ SSL세션과 SSL연결

10

구분 설 명

서버와 클라이언트 랜덤 (Server & Client random)

각 연결 에 사용하려고 서버와 클라이언트가 선택하는 바이트 열

서버 기록 MAC 비밀 (Server Write MAC secret)

서버가 보낸 데이터로 MAC을 계산할 때 사용 하는 비밀키

클라이언트 기록 MAC 비밀(Client write MAC secret)

클라이언트가 보낸 데이터로 MAC을 계산할 때 사용하는 비밀 키

서버 기록 키 (Server Write key )

서버가 데이터를 암호화하고 클라이언트가 복호화할 때 사용하는 관용 암호 키

클라이언트 기록 키 (Client write key)

클라이언트가 데이터를 암호화하고 서버가 복호화할 때 사용하는 관용 암호 키

초기화 벡터 (initialization vectors)

CBC모드로 블록 암호를 사용 할때 초기화 벡터가 각키에 대해 유지됨 맨 처음에는 S니 핸드 셰이크 프로토콜이 이필드를 초기화 그 뒤에 각 레코드의 최종 암호문 블록을 최기화 벡터로 사용하기 위해 저장 됨 이때 나오는 레코드도 저장함

순서 번호 (Squence numbers)

각 개체는 각 연결 때마다 전송하고 수신한 메시지에 대해 별도로 순서 번호를 보관 한 개체가 암호 명세 변경메시지를 보내거나 받으면 거기에 적합한 순서번호를 0으로 설정 2^64-1초과 해서는 안됨.

Page 11: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

Ⅱ. 안전 소켓 계층과 전송 계층 보안

▣ SSL 레코드 프로토콜 서비스

11

◈ 기밀성 - 핸드 셰이크 프로토콜에 의해 정의 된 공유 비밀 키와 함께 대칭 암호화 알고리즘을 사용 - AES, IDEA, RC2-40, DES-40, DES, 3DES, 포르테, RC4-40, RC4-128 - 메시지를 암호화하기 전에 압축 ◈ 메시지 무결성 - 공유 비밀 키와 MAC를 사용 - HMAC와 비슷하지만 다른 패딩

Page 12: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

Ⅱ. 안전 소켓 계층과 전송 계층 보안

▣ SSL 레코드 프로토콜 서비스

12

응용 데이터

단편화

압축

MAC 첨부

암호화

SSL 레코드 해더 붙이기

SSL Record Protocol Operation

Page 13: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

Ⅱ. 안전 소켓 계층과 전송 계층 보안

▣ SSL Change Cipher Spec. Protocol

13

◈ SSL 레코드 프로토콜을 사용하는 3가지 SSL-시정 프로토콜 중 하나 ◈ 한 바이트로 구성 값1을 갖는 한 개의 메시지로 구성

Page 14: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

Ⅱ. 안전 소켓 계층과 전송 계층 보안

▣ SSL Alert Protocol.

14

◈ 대등 개체에게 SSL-관련 경고를 할 때 사용 ◈ SSL과 경고메시지는 압축되고 암호화 ◈ 메시지는 2바이트로 구성 - 첫번째 바이트 : 경고(warning1)와 심각(fatal1) 값을 가짐 - 두번째 바이트 : 특정 경고를 나타내는 코드가 있음

Page 15: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

Ⅱ. 안전 소켓 계층과 전송 계층 보안

▣ SSL Handshake Protocol(1/3)

15

◈ 모든 응용 데이터 전송 전에 사용 ◈ 서버와 클라이언트가 서로를 인증 ◈ 암호화 및 MAC 알고리즘을 협상 ◈ 사용되는 암호 키를 협상 ◈ 동작 - 보안 기능을 설정 - 서버 인증 및 키 교환 - 클라이언트 인증 및 키 교환 - 종료

Page 16: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

Ⅱ. 안전 소켓 계층과 전송 계층 보안

▣ SSL Handshake Protocol(2/3)

16

SSL Handshake Protocol Operation

Client Server

Phase1. 보안기능설정 Establish security capabilities, including

protocol version, session ID, cipher suite,

compression method, and initial random

numbers.

Phase2. 서버 인증과 키 교환 Server may send certificate, key exchange,

and request certificate. Server signals end

of hello message phase.

Page 17: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

Ⅱ. 안전 소켓 계층과 전송 계층 보안

▣ SSL Handshake Protocol(3/3)

17

SSL Handshake Protocol Operation

Client Server

Phase3. 클라이언트 인증 및 키 교환 Client sends certificate if requested. Client

sends key exchange. Client may send

certificate verification

Phase4. 암호 조합을 교환 후 종료 Change cipher suite and finish

handshake protocol.

Note: Shaded transfers are

optional or situation-dependent

messages that are not always sent.

Page 18: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

Ⅱ. 안전 소켓 계층과 전송 계층 보안

▣ 암호 계산

18

◈ Master secret creation - 안전한 키 교환 방법 - 일회용 48바이트 값 <- Free master secret - 보안 키 교환(RSA/디피-헬만)을 사용 ◈ 암호 명세 생성 - Master secret creation에 의해 생성 - client write MAC secret, server write MAC secret, client write key, server write key, client write IV, server write IV 차례로 생성 - Master secret을 해시 하여 충분한 길이의 바이트 열로 생성 - 알고리즘 구조의 결과는 의사랜덤 함수임

Page 19: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

19

TLS (Transport Layer Security)

Page 20: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

TLS(Transport Layer Security)

• SSL(Secure Sockets Layer)을 인터넷표준이 되도록

만든 IETF standard

• RFC 2246로 제안된 인터넷 표준

• TLS is similar to SSLv3

20

Page 21: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

SSL vs TLS

• with minor differences – in record format version number • SSL is ver. 3.0, TLS is ver. 1.0

– uses HMAC for MAC • MAC의 계산 범위의 차이

– a pseudo-random function expands secrets • based on HMAC using SHA-1 or MD5

– has additional alert codes – some changes in supported ciphers – changes in certificate types & negotiations – changes in crypto computations & padding

21

Page 22: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

HMAC(The Keyed-Hash Message Authentication Code)

22

• RFC 2104에 정의된 HMAC을 사용

• 기존의 HMAC 의 형태

Page 23: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

TLS 에서의 HMAC

23

|| = Concatenation

MAC_write_secret = shared secret key

Seq_num = the sequence number for this message

TLSCompressed.type = the higher-level protocol used to process

this fragment

TLSCompressed.version = the version of the protocol

TLSCompressed.length = the length of the compressed fragment

TLSCompressed.fragment = the compressed fragment (if compression

is not used, this is the plaintext fragment)

기존의 HMAC과의 차이점은 블록길이를 비밀키와 XOR하지 않고

패딩 바이트를 이어 붙이기 하는 것이 다른 점

Page 24: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

Pseudo-Random Function

• 의사난수함수 사용목적 – 비밀키의 생성이나 확인의 목적을 위해 데이터블록으로 확장시키

기 위해 사용

– 상대적으로 키의 크기가 작지만 해시함수나 MAC을 대상으로 하는

공격에 안전하도록 길이가 긴 데이터 블록을 생성

24

Page 25: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

Data expansion function

25

데이터 확장 함수의 HMAC은 MD5 or SHA-1를 사용함

Page 26: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

Alert Codes

• SSLv3.0 에서 지원하는 모든 경고 코드를 지원

• 아래의 경우는 심각한 경고 코드 – record_overflow : TLS의 레코드의 길이가 214+2048바이트를 초과

하거나, 암호문의 복호화 하였을 때 214+1024바이트보다 초과하였

을 경우 발생

– unknown_ca : 정확한 인증서 체인이나 부분체인이 수신되었지만,

CA 인증서를 찾을 수 없거나, 신뢰 CA가 아닌경우

– access_denied : 유효한 인증서가 수신되었지만, 접근통제시 수신

자가 negotiation을 거부한 경우

– decode_error : 레코드의 한 필드가 범위를 벗어낫거나 메시지의

길이가 부정확한 경우

– protocol_version : 송신자와 수신자가 negotiation 할 때, 레코드의

한 프로토콜의 버전이 부정확 할 경우

26

Page 27: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

Alert Codes

– insufficient_security : 서버가 클라이언트가 지원할 수 있는 암호보

다 더 안전한 암호를 요구할 경우 negotiation 실패 이전에는

handshake_failure 라 부름

– decrypt_error : 서명을 확인할 수 없거나, 키교환을 복호화 할 수

없거나, finished-message를 확인할 수 없는 경우

– user_canceled : 핸드쉐이크와 무관한 이유로 negotiation이 실패

할 경우

– no_renegotiation : 송신자가 다시 negotiation 할 수 없음을 나타내

는 경고 메시지

27

Page 28: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

Alert Codes

28

Page 29: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

Cipher Suites

• Key Exchange – TLS은 키 교환이나 암/복호화를 위한 Fortezza를 지원하지 않음

– SSLv3.0 의 모든 대팅 암호 알고리즘을 포함

29

Page 30: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

Finished Messages

30

Page 31: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

31

HTTPS (HTTP over SSL)

Page 32: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

HTTPS

• HTTP와 SSL의 결합

• 모든 웹브라우저에 내장되어 있음

• URL (uniform resource locator) addresses begin with

https://

• RFC 2818로 문서화됨

• HTTP over either SSL or TLS, and both implementations are

referred to as HTTPS

• A normal HTTP connection uses port 80. If HTTPS is

specified, port 443 is used, which invokes SSL

32

Page 33: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

Encrypted elements

• URL of the requested document

• Contents of the document

• Contents of browser forms (filled in by browser user)

• Cookies sent from browser to server and from server to

browser

• Contents of HTTP header

33

Page 34: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

34

SSH (Secure Shell)

Page 35: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

SSH

• 안전한 원격 로그인 기능을 제공 하기 위해 초기 개발됨

• 이전의 TELNET 등과 같은 보안이 적용되지 않는 원격 로그인

기능을 대체하기 위해 SSH1이 개발됨

• 이후 SSH2가 개발되고 IEFE RFC 4250~4256 문서에 표준으

로 제안

35

Page 36: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

SSH Protocol Stack

36

Page 37: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

SSH Protocol Stack

• Transport Layer Protocol – Provides server authentication, data confidentiality, and data

integrity with forward secrecy • forward secrecy : if a key is compromised during one session, the

knowledge does not affect the security of earlier sessions

• User Authentication Protocol – Authenticates the user to the server

• Connection Protocol – Multiplexes multiple logical communications channels over a

single, underlying SSH connection

37

Page 38: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

Transport Layer Protocol

• HOST KEYS – Server have multiple host keys using multiple different

asymmetric encryption algorithms

– Multiple hosts share the same host key

– client must have a priori the server’s public host key

• PACKET EXCHANGE – Client establishes a TCP connection to the server

– Once the connection is established, the client and server

exchange data, referred to as packets

38

Page 39: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

SSH Packet Formation

39

Page 40: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

SSH Packet Formation

• Packet length: 패킷의 길이(MAC의 길이는 미포함)

• Padding length: 랜덤 패팅의 길이

• Payload: 패킷의 대한 정보가 담겨있음. 어떤 암호화 알고리즘

을 사용할지 결정 후 압축

• Random padding : 암호화 알고리즘 결정 후, 랜덤 패팅 필드

를 추가, 임의의 바이트 길이이며 총 패킷 길이가 암호문 블록

크기의 배수가 되게 만듬, 스트림 암호의 경우 8바이트

• MAC : 메시지 인증 후 MAC 값이 추가, MAC 필드를 제외한 전

체 패킷과 Sequence Num.(32 bits) 에 대해 MAC 값을 계산 – Sequence Num. : 0부터 시작 후 1씩 증가

40

Page 41: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

SSH Packet Exchanges

41

Ex :

SSH-2.0-billsSSH_3.6.3q3

<CR><LF>

Page 42: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

SSH Packet Exchanges

• SSH_MSG_KEXINIT – 서버와 클라이언트 간 서로 지원할 수 있는 알고리즘을 선호도 순

으로 정렬한 목록을 전송 • 키교환

• 암호

• MAC 알고리즘

42

Page 43: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

SSH Packet Exchanges

• SSH_MSG_KEXINIT – 서버와 클라이언트 간의 키교환이 종료됨을 알림

• SSH_MSG_SERVICE_REQUEST – 서비스 요청

– REQUEST 패킷을 보내 연결 프로토콜을 요청

– 모든 데이터는 Payload에 실려 교환하고 암호화되어 MAC으로 보

27

Page 44: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

User Authentication Protocol

• 클라이언트가 서버에게 인증 받는 수단을 제공

28

Page 45: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

Connection Protocol

• 안전한 인증 연결(tunnel)이 되었다고 가정함

29

Page 46: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

PORT FORWARDING

• Convert in secure TCP connection

into a secure SSH connection => SSH Tunneling

30

Page 47: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

참고문헌

• William Stallings, “네트워크 보안 에센셜”

49

Page 48: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

Q & A

50

Page 49: Transport-Level Security · 2014. 3. 11. · 목 차. 웹 보안의 필요성 I.안전 소켓 계층과 전송 계층 보안 J. TLS(Transport Layer Security) K. HTTPS(HTTP over SSL

Thank You!

51