133
네트워크 해킹 네트워크 해킹 6. Switch Security 7. Spoofing Attacks 8. Sniffing Attacks 9. Hijacking Attacks 10. DoS & DDoS

네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

  • Upload
    vantu

  • View
    264

  • Download
    5

Embed Size (px)

Citation preview

Page 1: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

네트워크 해킹네트워크 해킹

6. Switch Security7. Spoofing Attacks8. Sniffing Attacks9. Hijacking Attacks10. DoS & DDoS

Page 2: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Chapter 6 : Switch Security

Page 3: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Switch Security 목차

Switch Infra 이해MAC Address학습기능Frame ForwardingSpanning-tree and VLAN

Forwarding Process 취약점MAC Flooding AttackMAC Flooding & Spoofing 방어g p g

Spanning Tree Protocol AttackingSTP OperationSTP AttackingSTP AttackingSTP 취약점 방어

Information Leaks with Cisco Ancillary ProtocolCDP Spoofing and Flooding AttackCDP Spoofing and Flooding AttackCDP 방어기법DTP 취약점 공격 및 방어기법VTP 취약점 공격 및 방어기법

Network Security - 3

VTP 취약점 공격 및 방어기법

Page 4: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Switch Security 목차 (계속)

DHCP 취약점DoS Attacks Against DHCPDHCP 취약점 방어

HSRP 취약점Attacking HSRPHSRP Attack 방어

VRRP 취약점취약

Discovering VRRPRisk Analysis for VRRPVRRP 공격 방어VRRP 공격 방어

Network Security - 4

Page 5: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

L2 Switch Hacking LAB Topology

Network Security - 5

Page 6: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Ethernet Switches and Bridges

Address learning

Forward/filter decision

L idLoop avoidance

Network Security - 6

Page 7: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

MAC Address Table

MAC Address Table

A B

MAC Address Table

0260.8c01.1111 0260.8c01.3333E0 E1

C D

0260 8c01 2222 0260 8c01 4444

E2 E3

초기에는 MAC Address Table이 비어 있다

0260.8c01.2222 0260.8c01.4444

Network Security - 7

Page 8: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Learning Addresses

MAC Address Table

A B

E0 : 0260.8c01.1111

MAC Address Table

0260.8c01.1111 0260.8c01.3333E0 E1

C D

0260.8c01.2222 0260.8c01.4444

E2 E3

Host A가 Host B에게 Frame을 전달한다

Switch는 MAC Address Table이 비어 있기 때문에 Frame을 모든 포트로 Flooding한다는 이 비어 있기 때문에 을 든 g한다

Host A에서 온 Frame을 Flooding하는 동안 스위치는 E0에 Host A의 MAC Address를 학습한다

Host A에 대한 MAC Address Table정보는 Cache에 저장된다 (Aging Time 300초)

Network Security - 8

Page 9: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Learning Addresses (Cont.)

MAC Address Table

A B

E0 : 0260.8c01.1111

E3 : 0260.8c01.4444

MAC Address Table

0260.8c01.1111 0260.8c01.3333E0 E1

C D

0260.8c01.2222 0260.8c01.4444

E2 E3

Host D가 Host C에게 Frame을 전달한다

Switch는 MAC Address Table에 목적지 MAC Address에 대한 정보가 없기 때문에 Frame을 전달는 에 목적지 에 대한 정 가 없기 때문에 을 전달된 포트를 제외한 모든 포트로 Flooding한다

Host D에서 온 Frame을 Flooding하는 동안 스위치는 E3에 Host D의 MAC Address를 학습한다

Host D에 대한 MAC Address Table 정보는 Cache에 저장된다 (Aging Time 300초)정 장 ( g g )

Network Security - 9

Page 10: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Filtering Frames

MAC Address Table

A B

MAC Address Table

E0 : 0260.8c01.1111

E2 : 0260.8c01.2222

E1 : 0260 8c01 3333

0260.8c01.1111 0260.8c01.3333

E1 : 0260.8c01.3333

E3 : 0260.8c01.4444E0 E1

C D

0260.8c01.2222 0260.8c01.4444

E2 E3

Host A가 Host C에게 Frame을 전달한다

Switch는 MAC Address Table에 목적지 MAC Address에 대한 정보를 찾아 해당하는 포트인 E2로Switch는 MAC Address Table에 목적지 MAC Address에 대한 정보를 찾아 해당하는 포트인 E2로Frame을 전달한다

E2에 대한 Aging Time이 초기화 된다

Network Security - 10

Page 11: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Filtering Frames (Cont.)

MAC Address Table

A

E0 : 0260.8c01.1111

E0 : 0260.8c01.4444

MAC Address Table

0260.8c01.1111

BE1E0

SwitchHub

0260.8c01.4444

Host A가 Host B에게 Frame을 보낸다Host A가 Host B에게 Frame을 보낸다

Switch는 MAC Address Table에 Host B의 MAC Address를 추가한다

Network Security - 11

Page 12: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Broadcast and Multicast Frames

MAC Address Table

A B

MAC Address Table

E0 : 0260.8c01.1111

E2 : 0260.8c01.2222

E1 : 0260 8c01 3333

0260.8c01.1111 0260.8c01.3333

E1 : 0260.8c01.3333

E3 : 0260.8c01.4444E0 E1

C D

0260.8c01.2222 0260.8c01.4444

E2 E3

Host D가 Broadcast또는 Multicast를 보낸다

Broadcast나 Multicast는 전달된 포트를 제외한 모든 포트로 Flooding 된다Broadcast나 Multicast는 전달된 포트를 제외한 모든 포트로 Flooding 된다

Network Security - 12

Page 13: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

MAC Flooding Attacking

Network Security - 13

Page 14: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Preventing MAC Flooding & Spoofing Attacks

Enabling MAC Address Moves Alarms on Cisco Switch

Switch(config)# mac-address-table notification mac-move

Dec 23 12:22:12.100: %MAC_MOVE-SP-4-NOTIF : Host 0000.0903.0002 in VLAN 10 is flapping between port Fa0/2 and Port Gi1/1between port Fa0/2 and Port Gi1/1

Port Security

! Port-Security 활성화 하기

Switch(config-if)# switchport port-security

Switch(config-if)# switchport port-security maximum 3( g ) p p y

Switch(config-if)# switchport port-security violation restrict

Switch(config-if)# switchport port-security mac-address sticky

! 유해 트래픽 발생 MAC Address Filtering

Switch(config-if)# mac-address-table static 0050.bf82.dc32 vlan vlan_id drop

Network Security - 14

Page 15: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

6 LAN S it h S it6. LAN Switch Security6-1. Spanning Tree Protocol6-2. RSTP6-3. STP Attack

Page 16: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

What Is a Bridge Loop?

Bridge loops can occur any time there is a redundant path or loop in t

BCMSN v3.0 3-16

Bridge loops can occur any time there is a redundant path or loop in the bridge network.

Page 17: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Preventing Bridge Loops

Bridge loops can be prevented by disabling the redundant path

BCMSN v3.0 3-17

Bridge loops can be prevented by disabling the redundant path.

Page 18: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

802.1D STP

Configured root switch R d d i h li kRedundant switch linksOptimal path selection

BCMSN v3.0 3-18

Page 19: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

BPDU Packet Format

BCMSN v3.0 3-19

Page 20: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Bridge Protocol Data Unit

BPDUs provide for the exchange of information between switches.

BCMSN v3.0 3-20

Page 21: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Root Bridge Selection Criteria

BCMSN v3.0 3-21

Page 22: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Extended System ID in Bridge ID Field

Bridge ID Without the gExtended System ID

Bridge ID with the EBridge ID with the Extended System ID

BCMSN v3.0 3-22

Page 23: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

802.1D 16-bit Bridge Priority Field Using the Extended System ID

Only four high-order bits of the 16 bit Bridge Priority fie

4 bits 12 bits 20215the 16-bit Bridge Priority field carry actual priority.Therefore, priority can be incremented only in steps Priority Values (Hex) Priority Values (Dec)

Priority VLAN Number

incremented only in steps of 4096, onto which will be added the VLAN number.Example:

Priority Values (Hex) Priority Values (Dec)0 01 4096

For VLAN 11: If the priority is left at default, the 16-bit Priority field will hold 32768 + 11 = 32779

2 8192. .

32768 + 11 = 32779. . .8 (default) 32768. . . .F 61440

BCMSN v3.0 3-23

Page 24: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Configuring the Root Bridge

Switch(config)#spanning-tree vlan 1 root primary

• This command forces this switch to be the root.

Switch(config)#spanning-tree vlan 1 root secondary

• This command configures this switch to be the secondary root• This command configures this switch to be the secondary root.

Or

Switch(config)#spanning-tree vlan 1 priority priority

• This command statically configures the priority (in increments of y g p y (4096).

BCMSN v3.0 3-24

Page 25: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Root Bridge Selection

Which switch has the lowest bridge ID?

BCMSN v3.0 3-25

Page 26: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Spanning Tree Operation

• One root bridge per t knetwork

• One root port per nonroot bridge

• One designated port per segment

• Nondesignated ports g pare blocking

BCMSN v3.0

Page 27: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Spanning Tree Port States

Spanning tree transitions each port through several different states.

BCMSN v3.0 3-27

Page 28: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Local Switch Root Port Election

Link Speed Cost (Revised IEEE Spec) Cost (Previous IEEE Spec)

10 Gbps 2 1p

1 Gbps 4 1

100 Mbps 19 10

10 Mbps 100 100

BCMSN v3.0 3-28

10 Mbps 100 100

Page 29: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Spanning Tree Protocol Root Port Selection

BCMSN v3.0 3-29

Page 30: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Example: Layer 2 Topology Negotiation

BCMSN v3.0 3-30

Page 31: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Enhancements to STP

PortFastP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+)Rapid Spanning Tree Protocol (RSTP)Multiple Spanning Tree Protocol (MSTP)

l k l l ( ) l• MSTP is also known as Multi-Instance Spanning Tree Protocol (MISTP) on Cisco Catalyst 6500 switches and abovePer VLAN Rapid Spanning Tree (PVRST)

BCMSN v3.0 3-31

Page 32: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Describing PortFast

BCMSN v3.0 3-32

Page 33: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Configuring PortFast

Configuringspanning-tree portfast (interface command)

orspanning-tree portfast default (global command)

• enables PortFast on all nontrunking ports

Verifyingshow running-config interface fastethernet 1/1

BCMSN v3.0 3-33

Page 34: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

6 LAN S it h S it6. LAN Switch Security6-1. Spanning Tree Protocol6-2. RSTP6-3. STP Attack

Page 35: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Rapid Spanning Tree Protocol

BCMSN v3.0 3-35

Page 36: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

RSTP Port States

BCMSN v3.0 3-36

Page 37: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

RSTP Port Roles

BCMSN v3.0 3-37

Page 38: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

What Are Edge Ports?

• Will never have a switch connected to it• Immediately transitions to forwarding• Immediately transitions to forwarding• Functions similarly to PortFast• Configured by issuing the spanning-tree portfast command

BCMSN v3.0 3-38

Page 39: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

RSTP Link Types

BCMSN v3.0 3-39

Page 40: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

RSTP BPDU Flag Byte Use

BCMSN v3.0 3-40

Page 41: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

RSTP Proposal and Agreement Process

BCMSN v3.0 3-41

Page 42: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Downstream RSTP Proposal and Agreement

• Root and switch A synchronize. • Ports on A come out of sync.• Proposal or agreement takes

place between A and Bplace between A and B.

BCMSN v3.0 3-42

Page 43: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

RSTP Topology Change Mechanism

BCMSN v3.0 3-43

Page 44: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

PVRST Implementation Commands

Configuringspanning-tree mode rapid-pvst

Verifying show spanning-tree vlan 101

Debuggingdebug spanning-tree

BCMSN v3.0 3-44

Page 45: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

How to Implement Rapid PVRST

BCMSN v3.0 3-45

Page 46: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Verifying PVRST

Switch# show spanning-tree vlan 30

VLAN0030

Spanning tree enabled protocol rstp

Root ID Priority 24606

Address 00d0 047b 2800Address 00d0.047b.2800

This bridge is the root

Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 24606 (priority 24576 sys-id-ext g y p y y30)

Address 00d0.047b.2800

Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Aging Time 300Aging Time 300

Interface Role Sts Cost Prio.Nbr Type

-------- ----- --- --- -------- ----

Gi1/1 Desg FWD 4 128.1 P2p

Gi1/2 Desg FWD 4 128.2 P2p

Gi5/1 Desg FWD 4 128.257 P2p

BCMSN v3.0 3-46

Display spanning tree mode is set to PVRST.

Page 47: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

6 LAN S it h S it6. LAN Switch Security6-1. Spanning Tree Protocol6-2. RSTP6-3. STP Attack

Page 48: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

STP Attack Topology

STP Attack 취약점Taking Over the Root Bridgeg gDoS Using a Flood of Config BPDUSimulating a Dual-Homed Switch

Network Security - 48

Page 49: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Taking Over the Root Bridge

Network Security - 49

Page 50: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Yersinia 실행모드

# yersinia –G- GDK 기반 그래픽 모드 (아직 Alpha Version)

# yersinia –I- Interactive Mode (사용하기 편한 텍스트 그래픽 모드)Interactive Mode (사용하기 편한 텍스트 그래픽 모드)

# yersinia –D- Deamon Mode ( tcp:12000 포트로 활성화됨)

t l t l lh t 12000 으로 접속하여 사용- telnet localhost 12000 으로 접속하여 사용- user : root , password : root - enable password : tomac

Network Security - 50

Page 51: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Taking Over the Root Bridge

Network Security - 51

Page 52: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

공격 후 Switch STP 정보

Network Security - 52

Page 53: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

STP Attack 방어

Root GuideBPDU Guide

Network Security - 53

Page 54: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

6 LAN S it h S it6. LAN Switch Security6-4. VLAN & VTP & DTP 개요6-5. DTP 공격및방어6-6. VTP 공격및방어

Page 55: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

VLAN 개요

Network Security - 55

Page 56: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

VLAN Access Ports

VLAN VLANVLAN Access

Port

VLAN Access

Port

Configuring VLANsvlan 101switchport mode accessswitchport access vlan 101

Verifying VLANsshow interfacesshow vlan

Page 57: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

VLAN Trunking

Trunking VLAN1 and VLAN2 and VLAN3

802.1Q or ISL

Page 58: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

ISL Encapsulation

Page 59: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

The 802.1Q Tagging Process

Page 60: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

802.1Q Native VLAN

Native VLAN frames are carried over the trunk link untagged.

Page 61: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

VLAN Ranges

VLAN R UVLAN Range Use

0, 4095 Reserved for system use only

1 Ci d f lt1 Cisco default

2–1001 For Ethernet VLANs

1002 1005 Cisco defaults for FDDI and Token Ring1002–1005 Cisco defaults for FDDI and Token Ring

1006–4094 Ethernet VLANs only, unusable on specific legacy platforms

Page 62: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Switchport Mode Interactions

Dynamic Auto Dynamic Desirable Trunk Access

Dynamic A Access Trunk Trunk AccessAuto Access Trunk Trunk Access

Dynamic Desirable Trunk Trunk Trunk Access

Trunk Trunk Trunk Trunk Not recommended

Access Access Access Not recommended Access

Note: Table assumes DTP is enabled at both ends.

• show dtp interface – to determine current setting

Page 63: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Cisco DTP 취약점

• Cisco Dynamic Trunk Protocol 은 기본 값으로 Port 가 STP가 활성화y되어 있다. Desirable 상태이므로 자동으로 Trunk를 설정할 수 있다.

• Trunk가 설정되면, 후 VTP 취약점을 이용하여 VLAN을 생성, 제거 하는등에 공격을 수행 할 수 있다.

Page 64: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Yersinia 를 이용한 DTP Attacking

• yersinia를 시작한 후 g DTP 선택 enter x 1 enter l 을 누른 화면.

Page 65: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

DTP 공격을 받은 Switch 상태

ASW1#show debuggDTP events debugging is on00:16:40: DTP-event:Fa0/1:Received packet event ../dyntrk/dyntrk_process.c:220300:16:41: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to downg00:16:41: DTP-event:Fa0/1:Received packet event ../dyntrk/dyntrk_process.c:220300:16:42: DTP-event:Fa0/1:Received packet event ../dyntrk/dyntrk_process.c:220300:16:44: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

ASW1#sh int trunk

Port Mode Encapsulation Status Native vlanF 0/1 d i bl 802 1 ki 1Fa0/1 desirable 802.1q trunking 1

Port Vlans allowed on trunkFa0/1 1-4094

Port Vlans allowed and active in management domainFa0/1 1,10,20,30……

Page 66: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

DTP 취약점 대응방법

DTP 취약점 대응 방법은 Dynamic Trunk Protocol 기능을 해제하고 수동으로yAccess Link 와 Trunk Link를 구성한다.

Configuring a Trunkswitchport mode trunk

Configuring a Accessswitchport mode access

switchport nonegotiate switchport access vlan 10switchport nonegotiate

Page 67: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

The VTP Protocol

Page 68: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

VTP Operation

• VTP advertisements are sent as multicast frames.

VTP servers and clients are synchronized to the latest revision number• VTP servers and clients are synchronized to the latest revision number.

• VTP advertisements are sent every 5 minutes or when there is a change.

Page 69: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

VTP 취약점 및 공격

VTP는 Vlan 정보를 trunk 를 통해 스위치간 Update하는 프로토콜이다.VTP password를 설정하지 않는 경우 multicast를 통해 VLAN 정보를 추가및 제거가 가능하다.

Network Security - 69

Page 70: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Cisco Discovery Protocol

Network Security - 70

Page 71: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Network Security - 71

Page 72: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

6. LAN Switch Security6-7. DHCP 취약점6 8 HSRP취약점6-8. HSRP 취약점

Page 73: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

DHCP Operation

Network Security - 73

Page 74: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

DHCP 취약점

Hijacking Traffic Using DHCP Rogue ServersC 자원 고갈 공격DHCP 자원 고갈 공격

Network Security - 74

Page 75: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Network Security - 75

Page 76: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

6. LAN Switch Security6-7. DHCP 취약점6 8 HSRP취약점6-8. HSRP 취약점

Page 77: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

HSRP Packet Format

Version Op code State Hello time

Hold time Priority Group Reserved

Authentication Data

Authentication Data

Virtual IP Address

Verion : HSRP 메시지의 버전으로 0으로 설정되어 있음.

Op Code : Op Code는 메시지의 유형을 나타낸다. 0 (Hello)H ll HSRP 동작 중임을 나타내며 H ll 메시지로 A i 와 S db 라우터가 될 수 있다Hello : HSRP 동작 중임을 나타내며 Hello 메시지로 Active와 Standby 라우터가 될 수 있다.

Coup : 라우터가 Active Router가 되기 원할 때 보낸다.

Resign : Coup에 응답 메시지로 Active Rouer 역할을 넘겨준다.

St t 0 I iti l 1 L 2 Li t 4 S k 8 St db 16 A tiState : 0 : Initial, 1 : Learn, 2 : Listen, 4 : Speak, 8 : Standby, 16 : Active

Hello Time : Hello를 정기적으로 모든 라우터에게 알리는 시간 기본 3초

Priority : Default : 100 우선순위가 높은 라우터가 Active Router로 선출된다.

Network Security - 77

Page 78: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

HSRP Packet

Network Security - 78

Page 79: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

DoS Attack Against HSRP

#while (true) ; do (hsrp -d 224.0.0.2 -v 10.10.18.254 -a cisco -g 1 -i eth0 -S 10.10.18.1 ; sleep 3) ; done

#while [ 1 ]#while [ 1 ]

>do

>hsrp -d 224.0.0.2 -v 10.10.18.254 -a cisco -g 1 -i eth0 -S 10.10.18.1

>sleep 3

Network Security - 79

s eep 3

>done

Page 80: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

HSRP Attack 방어

강력한인증암호를 사용한다.

ACL을 이용한 HSRP router Filter를 사용한다.

Network Security - 80

Page 81: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

7. Spoofing Attack7-1. ARP 개요및취약점7 2 ARP Spoofing Attack7-2. ARP Spoofing Attack

Page 82: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Spoofing Attack 목차

ARP SpoofingLinux 기반 ARP Spoofing AttackingWindows 기반 ARP Spoofing AttackingARP Spoofing 방어

IP Spoofing IP Spoofing Attacking

DNS SpoofingDNS Spoofing Attacking

Network Security - 82

Page 83: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

3.1 ARP vulnerabilities(취약점) 분석

ARP Protocol은 3개의 취약점을 가지고 있다.No Authentication(무 인증)

Host는 ARP 응답에 상대방을 인증 할 수 있는 어떠한 요소도 없으며, 무결성도제공하지 않습니다.

Information Leak(정보 누수)같은 Ethernet VLAN의 모든 Host는 호스트의 매핑(IP:MAC)정보를 학습할 수 있습니다.

Availability issue(가용성)같은 Ethernet VLAN의 모든 Host는 ARP 요구를 수신하고 그것을 처리해야 합니다. 공격자는 초당 수천개의 ARP request 프레임을 생성하여 보낼 수 있으며, LAN위의 모든 호스트는 프레임 처리 과정을 거치게 됩니다.이것은 네트워크 대역폭과 CPU 성능을 낭비합니다.

Network Security - 83

Page 84: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

3.1 ARP vulnerabilities(취약점) 분석(Cont.)

Host B

IP : 10 0 0 2CAFÉ -> FFFF.FFFF.FFFF

Who is 10.0.0.2 ?

IP : 10.0.0.2

MAC

0000.C5C0.0000

Host A

IP : 10.0.0.1

MAC

0000.CAFÉ.0000

Host B

IP : 10.0.0.2

MAC

Network Security - 84

0000.C5C0.0000

Page 85: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

3.1 ARP vulnerabilities(취약점) 분석(Cont.)

MAC:C5C0 - > CAFÉ

10.0.0.2 is at C5CO

Host B

IP : 10 0 0 2IP : 10.0.0.2

MAC

0000.C5C0.0000

Host A

IP : 10.0.0.1

MAC

0000.CAFÉ.0000

Host B

IP : 10.0.0.2

MAC

Network Security - 85

0000.C5C0.0000

Page 86: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

3.1 ARP vulnerabilities(취약점) 분석(Cont.)

Host B

IP : 10 0 0 2IP : 10.0.0.2

MAC

0000.C5C0.0000

É

Host A

IP : 10.0.0.1

MAC:0666 - > CAFÉ

10.0.0.2 is at 0666

MAC:0666 - > CAFÉ

10.0.0.2 is at 0666MAC

0000.CAFÉ.0000 BT3

Host B

IP : 10.0.0.2

MAC

Network Security - 86

0000.0666.0000

Page 87: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

3.1 ARP vulnerabilities(취약점) 분석(Cont.)

MAC CAFÉ 0666

Host B

IP : 10 0 0 2MAC:CAFÉ -> 0666

IP: 10.0.0.1 -> 10.0.0.2

Telnet : Password=xyz

IP : 10.0.0.2

MAC

0000.C5C0.0000

MAC:0666 - > C5C0

Host A

IP : 10.0.0.1IP: 10.0.0.1 -> 10.0.0.2

Telnet : Passoword = XYZMAC

0000.CAFÉ.0000

Host B

IP : 10.0.0.2

MAC

Network Security - 87

0000.0666.0000

Page 88: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

3.1 ARP vulnerabilities(취약점) 분석(Cont.)

ARP 정상 동작 #1

dd ddHost A ARP Table

IP Address MAC Address

Network Security - 88

Page 89: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

3.1 ARP vulnerabilities(취약점) 분석(Cont.)

ARP 정상 동작 #2

dd ddHost A ARP Table

IP Address MAC Address10.0.0.2 0000.C5C0.0000

Network Security - 89

Page 90: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

3.1 ARP vulnerabilities(취약점) 분석(Cont.)

ARP Spoofing 공격 #1

dd ddHost A ARP Table

IP Address MAC Address10.0.0.2 0000.C5C0.0000

Network Security - 90

Page 91: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

3.1 ARP vulnerabilities(취약점) 분석(Cont.)

ARP Spoofing 공격 #2

dd ddHost A ARP Table

IP Address MAC Address10.0.0.2 0000.C5C0.0000

Network Security - 91

Page 92: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

7. Spoofing Attack7-1. ARP 개요및취약점7 2 ARP Spoofing Attack7-2. ARP Spoofing Attack

Page 93: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

1.1 BT3 이용한 ARP Spoofing 공격

공격 대상 MAC 주소 속이기

Network Security - 93

Page 94: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

1.1 BT3 이용한 ARP Spoofing 공격

공격 대상 MAC 주소 알아 내기

Network Security - 94

Page 95: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

7. Spoofing Attack7-3. IP Spoofing 7 4 IP Spoofing Attack7-4. IP Spoofing Attack

Page 96: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

IP 주소를 속이고 통신하는 공격

IP Spoofing 을 통해 IP filter를 우회할 수 있다.

원격 IP Spoofing을 현실적으로 불가능 하다.

Network Security - 96

Page 97: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Local Network에서의 IP Spoofing

1. Host B가 Host A에게 ARP Cache

Host B

IP : 10 0 0 2

Poisoning 공격.

2. Host B가 IP spoofing을 이용하여 Host A에게 Syn 전송.

3 H t A는 H t B에게 S /A k 전송 IP : 10.0.0.2

MAC

0000.C5C0.0000

3. Host A는 Host B에게 Syn/Ack 전송.

MAC:CAFÉ -> 0666

IP: 10.0.0.1 -> 10.0.0.2

Telnet : Password=xyz

Host A

IP : 10.0.0.1Telnet : Password=xyz

MAC

0000.CAFÉ.0000

MAC:0666 - > CAFE

IP: 10.0.0.2 -> 10.0.0.1

Telnet : Passoword = XYZ

Host B

IP : 10.0.0.3

MAC

Network Security - 97

0000.0666.0000

Page 98: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

IP Spoofing 고려사항

IP Spoofing 공격시 고려사항ARP cache poisoning을 통해 Packet을 유도하더라도 실제 IP가 다르므로 TCP Protocol Suit는 Layer2에서 Layer3로 Packet이 올라가지 않는다.IP Spoofing을 이용하여 공격하기 위해서는 Layer3까지 올라가서 통신이 가능하도록 개죄돈 Application이 필요하다하도록 개죄돈 Application이 필요하다.

*** Telnet의 경우 www.oxid.it 의 sterm 이라는 공격툴이 있다.

Network Security - 98

Page 99: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

7. Spoofing Attack7-3. IP Spoofing 7 4 IP Spoofing Attack7-4. IP Spoofing Attack

Page 100: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

IP Spoofing을 이용한 Access-list 우회 공격

1. Router에 Telnet을 활성화 하고 Access-list를 생성하여 Backtrack 만 허용한다용한다.

Router(config)# username admin privilege 15 secret ciscoRouter(config)# access-list 10 permit 10.10.1.5 0.0.0.0.0Router(config)# access list 10 permit 10.10.1.5 0.0.0.0.0Router(config)# line vty 0 4Router(config-line)# login localRouter(config-line)# access-class 10 in

Network Security - 100

Page 101: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

IP Spoofing을 이용한 Access-list 우회 공격

2. Windows XP에서 sterm을 설치한 후 실행한다.sterm은 IP Spoofing ARP Poisoning MAC Spoofing을sterm은 IP Spoofing, ARP Poisoning, MAC Spoofing 을수행할 수 있는 툴이다.실제 MAC과 IP를 숨긴체 특정 IP로 위장하여통신이 가능함.

Network Security - 101

Page 102: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

7. Spoofing Attack7-5. DNS Spoofing Attack

Page 103: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

DNS Spoofing

DNS Spoofing 이란?클라이언트가 DNS Query를 할 때 DNS 서버보다 먼저 응답하여 Attacker가 의도한 IP를 알려주는 방법.

DNS 취약점DNS는 UDP 기반 이므로 Stateless 한 Protocol이다.Query시 인증을 수행하지 않는다.공격자가 Local에 존재하므로 실제 DNS 서버보다 빠르게 응답할 수 있다.클라이언트는 DNS Query를 수행한 후 먼저 응답한 IP를 수용한다.

Network Security - 103

Page 104: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

DNS Spoofing 공격

공격자는 DNS Query를 스니핑 해야함.Transaction ID 사용된, local Port, Name Server Address 등의 정보를 알아야하므로 주로 Local에서 공격하게됨.

S C hDNS Cache PoisoningDNS와 비슷한 공격 기법으로 공격 대상이 클라이언트가 아닌 DNS 서버가 대상이 되며, DNS 서버의 DNS Cache를 조작하는 공격기법이다.공격 성공률을 높이기 위해 Birthday Attack 기법이 적용됨.

Network Security - 104

Page 105: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

DNS Name Query 순서

Domain Name 해석 요구

Host file 확인

Domain Name 해석 요구

Windows

c:₩window₩system32₩drivers₩etc₩hosts

DNS Cache 확인

Unix/Linux

/etc/hosts

DNS Query

이름 해석 실패이름 해석 성공

Network Security - 105

Page 106: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

정상적인 DNS Query & Reply 과정

1. DNS Querywww.naver.com

Client

DNSServer2. DNS Reply

192 168 10 1192.168.10.1

3. Web Connection3. Web Connectionwww.naver.comIP =19.168.10.1

Network Security - 106

Page 107: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

DNS Spoofing 공격 시나리오

3. Web Connectionwww naver com

가짜 Web ServerDNS Cache 초기화Linux : nsdc 재시작

www.naver.comIP =10.10.10.1

Windows : ipconfig /flushdns

Client

DNSServer

1. DNS Querywww.naver.com

2. DNS Reply10.10.10.1

Attacker

www.naver.com192.168.10.1

1. 가짜 Web Server를 생성한다. (공격자 PC에 생성함.)2. ARP Spoofing을 이용하여 Gateway로 위장한다.3. dnsspoof –f <파일명> 을 입력한다.

Network Security - 107

3. dnsspoof f <파일명> 을 입력한다.4. 파일내용을 다음처럼 생성한다.

10.10.10.1 www.naver.com

Page 108: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Chapter 8 : Sniffing Attack

Network Security - 108

Page 109: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Sniffing Attack 목차

Sniffing AttackSniffing Attacking 개요Switch 환경에서의 Sniffing

• ARP SpoofingARP/ICMP R di• ARP/ICMP Redirect

• Macof를 이용한 Switch jamming• SPAN port 를 이용한 Monitoring (관리적인 스니핑)

Dsniff를 이용한 SniffingDsniff를 이용한 SniffingSniffing 공격 대응책

• ARP Watch를 이용한 MAC 변조 탐지• 암호화를 통한 Sniffing 방어암호화를 통한 Sniffing 방어

Network Security - 109

Page 110: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Sniffing 이란?

Sniffing 이란?통신망에서 돌아다니는 데이터를 몰래 훔쳐 보기위한 공격

Sniffing 용어?g도청 (eavesdropping)

• 타인의 통신내용을 당사자의 동의 없이 은밀히 청취, 녹음하는 것.와이어태핑 (Wire Tapping)pp g

• 기계적인 방법을 이용하여 유선으로부터 데이터를 도청하는 것.방사 (emanation)

• 전자파에 대한 도청템페스트 (tempest)

• 사용중인 전자파를 이용한 정보 도청에 대한 방지 기술 도는 장치

Network Security - 110

Page 111: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Sniffing 분류

Sniffing 분류Passive Sniffing

• hub와 같이 모든 노드에 동일한 전기적 신호가 복제되는 경우 Sniffing 가능• 단순히 스니퍼만 동작시키고 지나가는 패킷을 볼 수 있음.

A ti S iffiActive Sniffing• Switch 환경에서는 해당 포트로만 데이터가 전송되기 때문에 데이터 신호가 Sniffer가설치된 시스템을 경유하도록 유도해야 하는 방법

• 일종의 MITM (Man In The Middle)공격기법일종의 MITM (Man In The Middle) 공격기법

Network Security - 111

Page 112: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

NIC의 Promiscuous 모드

NIC의 기본적인 동작모드자신에게 도착한 패킷의 목적지 주소를 확인하여 목적지가 자신의 패킷과 브로드캐스트 패킷만을 받아들인다.

NIC의 Promiscuous 모드Promiscuous 모드는 Software적으로 만들어진다.하드웨어 방식으로 처리하는 것을 ByPass 모드라고 한다.자신에게 도착한 패킷의 주소값을 무시하고 모든 패킷을 받아들인다.Promiscuous 모드를 사용하려면 관리자 권한이 필요 한다.

Network Security - 112

Page 113: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Switch 환경에서의 Sniffing

Switch JammingARP RedirectARP SpoofingICMP RedirectC ed ect

Network Security - 113

Page 114: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Switch Jamming

Switch JammingSwitch에 MAC Table을 공격하여 MAC Table이 가득찬 경우 Flooding 하는 속성을 이용함.현재는 MAC Table 운영방법은 Switch Jamming 공격이 불가능함.

공격방법

랜덤하게 MAC Address를 생성하여 Frame을 스위치에 전송해서 MAC Addressf를 학습하게 하는 방법으로 Switch에 MAC Table을 Overflow 시킴.

공격툴 : macof , havoc

Network Security - 114

Page 115: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

ARP Redirect

ARP Redirect공격자가 MAC이 Router(Gateway)의 MAC이라고 위조하여 브로드캐스트함.Local Network의 System들의 Cache table이 변경된다.Local Network의 System이 외부와 통신하는 모든 패킷은 공격자를 경유하게 된다다.arpspoof 192.168.1.254

Network Security - 115

Page 116: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

ARP Spoofing

ARP Spoofing 공격Sniffing 하고자 하는 두 개의 System을 선택한 후 서로의 MAC 주소를 공격자의 MAC 주소로 위조하여 보냄.두 시스템이 통신할 때 공격자를 경유하여 통신하게 됨.

( h ddl ) 형태가 됨MITM(Man In The Middle) 형태가 됨.서로에게 공격자가 상대방인 것으로 속이기 위해 ARP Spoofing을 한다.

arpspoof –t 10.10.1.2 10.10.1.254arpspoof –t 10.10.1.254 10.10.1.2

Network Security - 116

Page 117: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

ICMP Redirect

ICMP Redirec네트워크에 Router나 Gateway를 두 개 이상 운영하는 경우 최적 경로로 전달을위해 Route 정보를 변경하는 기능.

Client는 Default 경로로 R1을 지정하고 있음Client는 Default 경로로 R1을 지정하고 있음.

Client가 Net-B로 Data를 전송함.

1. Route Table에 의해 R1으로 전송됨.

2 R1은 Net-B에 Data를 전송하기 위해Net-A

R1

1

4

Client

2. R1은 Net B에 Data를 전송하기 위해R2로 전송함.

3. R2는 Net-B로 Data를 전송함.

4. R1은 Client에게 ICMP Redirec를 전송

R1

5 2

하여 Net-B는 R2를 이용하도록 Route Table 변경을 요구함.

Client는 Route Table에 Net-B로 가는 경로를 R2로 추가함.Net-BR2

3

5. Client는 Net-B에게 Data를 보내기 위해 R2로 전송함…

Net BR2

Network Security - 117

Page 118: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

ICMP Redirect Attack

icmpushicmpush –vv –red –sp 10.10.1.254 –gw 10.10.1.5 –dest 100.10.10.0 –c host 10.10.1.2- vv : 자세히 보기

d ICMP R di- red : ICMP Redirect- sp : 원래 Gateway 주소- gw : 변경할 Gateway 주소- dest : 라우팅 테이블에 등록할 목적지 네트워크- c : code

** ICMP Redirect 공격은 ICMP Redirect 기능이 꺼져있는 호스트는 공격이 불가능한다.

** Windows, Cisco Router, BSD 등은 기본적으로 켜져 있으나, Linux는 꺼져있다., , ,

Network Security - 118

Page 119: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Sniffer 의 탐지

Sniffer 의 탐지NIC가 Promiscuous 모드로 작동 중인지 검사Etherping을 이용

• 의심스런 Host에 네트워크 존재하지 않는 MAC 주소를 Dst MAC으로 설정하여 Ping을보낸다보낸다.

• arping –T 10.10.1.5 11:22:33:44:55:66– 요청 MAC과수신 MAC이다르므로응답이 보이지않음.– wireshark 등으로 확인

ARP ping을 이용• 의심가는 Host나 Broadcast로 확인• arping –t 11:22:33:44:55:66 10.10.1.5

h k등으 확인• Wireshark등으로 확인

Network Security - 119

Page 120: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Sniffer 의 탐지 (Cont)

ARP watch, sentinel, sniffdet promiscan 등의 툴을 이용한다.t h• arpwatch

– MAC과 IP의 매치이변경되면관리자에게메일로 통보한다.– arpwatch

» root 계정에게 mail로 통보– arpwatch –d

» 디버깅 모드로 실시간으로 보여줌.• Promiscan

– 윈도우즈용툴, IP와 MAC 주소를 가짜로기입– http://www.securityfriday.com/products/promiscan.html

Network Security - 120

Page 121: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Sniffing 방지

데이터 암호화

SSLPGP and S/MIMESSHVPN

스위치 환경 구성

스위치 환경에서는 ARP Spoofing 공격 방어를 위한 Port Security를 구성한다.p g y

Network Security - 121

Page 122: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Chapter 9 : Hijacking Attacks

Network Security - 122

Page 123: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Session Hijacking Attacks 목차

HTTP Session Hijacking AttackHTTP Session Hijacking 개요Paros를 이용한 Web Mail hijacking Attack

Network Security - 123

Page 124: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

HTTP Protocol의 특성

HTTP 프로토콜의 특성

HTTP는 기본적으로 비연결유지(stateless) 프로토콜이다. 반면, telnet과 ftp와 같은 프로토콜은 클라이언트와 서버 사이에 하나의 연결(session)이 성립되어 통신하는 프로토콜이다. 따라서, 우리가보통 웹 브라우저를 열어 URL을 입력하고 해당 홈페이지에 들어간다는 것은 해당 홈페이지에 포함되어 있는 페이지(html), 그림(jpg, gif 등), 자바스크립트(js) 등을 다운받기 위해 개별적인 여러 개의80 요청(request)을 발송한 후 서버로부터 각각의 응답(reply)을 받는 것을 의미한다.

이러한 일련의 요청과 응답이 이루어진 후 해당 서버와의 통신은 다시 종료된다. 위와 같은 기본적인지식을 알고 있다면 다음과 같은 질문을 할 수 있다. HTTP는 비연결유지 프로토콜이라고 하였는데Session Hijacking 이란 공격은 어떻게 가능한 것인가? 이는 HTTP 세션 관리를 위해 사용되는Session ID를 통해서 가능하다.

Network Security - 124

Page 125: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Session ID란 ?

웹 서버는 다수의 웹 페이지 요청자를 구별하기 위하여 각각의 사용자의 세션에 대해서 임의의 긴 문자열 값인 Session ID를 부여한다. 사용자가 홈페이지 방문시 혹은 인증 로그인시에 생성된다. 이러자열 값인 Session ID를 부여한다. 사용자가 홈페이지 방문시 혹은 인증 로그인시에 생성된다. 이러한 Session ID는 사용자의 계정, 암호, 그 밖의 IP 주소, timestamp 등의 여러 파라미터들을 조합하여 생성할 수 있다.

Session ID는 사용자와 일련의 웹 서핑 동작을 연결시켜줌으로써 웹 사이트 로그인 후 다른 페이지방문시마다 매번 로그인을 하지 않아도 되는 편리함을 제공해준다. 방문시마다 매번 인을 하지 않아 되는 편리함을 제공해준다

우리가 신문 홈페이지나 포털 사이트에 들어갈 때 광고 배너가 자동으로 바뀐다던지, 쇼핑몰이나 인터넷 서적몰에서 구매 카트의 목록이 유지되는 것은 모두 이러한 원리이다. 즉, Session ID를 통해 인증넷 서적몰에서 구매 카 의 목록이 유지되 것 두 이러 리이다 즉, 를 통해 증과 인가(authentication

& authorization)라는 세션 관리를 수행할 수 있다.

Network Security - 125

Page 126: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Session ID의 위치?

Session ID는 우리가 흔히 듣는 쿠키(cookie)라는 곳에 저장되는 것이 일반적이다. 그( )러나 가끔은 웹 브라우저 주소창 URL이나 HTML 페이지 폼 소스 상의 hidden 필드에포함되어 드러나기도 한다.

1. 쿠키 (cookie)

2. 웹 브라우저 주소창의 URL

3. 웹 페이지 폼 소스 상의 Hidden field3. 웹 페이지 폼 소스 상의 Hidden field

Network Security - 126

Page 127: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Session ID 취약점

웹 서버에서의 Session ID 췽약점

강력하지 못한 알고리즘(Weak Algorithm) : session ID 스트링 값을 생성함에 있어서 공격자가reverse 엔지니어링이 가능한 쉬운 알고리즘으로 생성될 경우 cracking이나 brute-force guessing 공격의 위험이 있다.

길이가 짧은 S i ID 강력한 암호 알고리즘을 사용하더라도 그 길이가 충분하지 않고 짧은 경길이가 짧은 Session ID : 강력한 암호 알고리즘을 사용하더라도 그 길이가 충분하지 않고 짧은 경우에는 cracking이나 brute-force guessing 공격의 위험이 있다.

계정 잠금 기능 미비 : 로그인 패스워드의 특정 회수 실패에 대해서는 보통 계정잠금 기능이나 해당IP 차단 기능을 구현하지 않는 경우 brute-force guessing 공격의 위험이 있다. 차단 기능을 구현하지 않는 경우 g g 공격의 위험이 있다

무한 만료의 Session ID : 사용자의 로그 아웃 이후에도 서버측에서 해당 세션 ID값을 폐기하지 않고 무한정 유효 인정한다면 cookie sniffing이나 프락시 서버의 로그 취득을 통하여 session ID 공격이 가능하다.

평문으로 전달되는 Session ID : 서버에서 클라이언트로의 session ID 쿠키 전달 방식이 비암호화 방식일 경우

Network Security - 127

Page 128: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Session ID 공격 유형

직접적인 Cookie S iffi 을 통한Sniffing을 통한Session ID 도용

간접 우회 공격을 통한Session ID 도용Session ID 도용

Brute-force guessing을 통한Session ID 도용

Network Security - 128

Page 129: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Session ID Hijacking 대응방안

1. Session ID는 가능한 한 추측 불가능(random)하게 생성한다.

과2. Session Timeout 기능과 Session ID 재생성 기능을 사용한다.

3. 무작위 추측 대입(Brute-force Guessing)에 대비하여 일정 회수 이상의 인증 실패시에는 사용자 잠금 기능을 구현한다.

인 이후에 중요한 서비스 이용시에는 사용자 인 을 통하여 인가된 사용자만이 해당 서비4. 로그인 이후에도 중요한 서비스 이용시에는 사용자 인증을 통하여 인가된 사용자만이 해당 서비스를 이용할 수 있도록 통제한다.

5. Cookie 내용 안의 Session ID와 기타 변수값 자체를 암호화한다.

6 웹 서비스 자체의 중요성에 따라 C ki 가 전달되는 방식을 SSL로 구현함으로써 S iffi6. 웹 서비스 자체의 중요성에 따라 Cookie가 전달되는 방식을 SSL로 구현함으로써 Sniffing공격에 대응할 수도 있다.

7. 웹 서비스 상에 공격자가 HTML 공격 코드 삽입이 가능한 페이지가 있는지 점검한다. 직접적인공격 코드 삽입을 차단할 수 있도록 특수 문자 및 스크립트 코드를 필터링 하여야 한다.공격 코드 삽입을 차단할 수 있도록 특수 문자 및 스크립트 코드를 필터링 하여야 한다.

Network Security - 129

Page 130: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

LAB – HTTP Session ID Hijacking

1. ARP Spoofing 공격을통한 Packet 모니터링 – 사용자 쿠키획득2. Paros를 이용한 Proxy 구성3. Web Browser에 연결을 paros proxy를 통해 Access하도록설정4. Paros에 Filter를 이용하여획득한 cookie로 변환 후 웹 접속

Network Security - 130

Page 131: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Network Security - 131

Page 132: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Network Security - 132

Page 133: 네트워크해킹ccnp.tistory.com/attachment/lk6.pdfP VLAN S i T (PVST )Per VLAN Spanning Tree+ (PVST+) Rapid Spanning Tree Protocol (RSTP) Multiple Spanning Tree Protocol (MSTP)

Network Security - 133