IP Spoofing 공격. 포항공과대학교 PLUS 오태호 (PLUS015) ohhara@postech.ac.kr. 목차 (1). IP Spoofing 이란 ? TCP/IP Packet 의 구조 IP Header 의 구조 TCP Header 의 구조 TCP Connection Connect with IP Spoofing. 목차 (2). IP Spoofing 의 종류 Non Blind IP Spoofing hunt 를 이용한 IP Spoofing Blind IP Spoofing
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation
Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement.Téléchargez la présentation en cliquant sur ce lien.Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.
F I N
Plus de contenu associé
Transcription de la présentation
IP Spoofing공격 포항공과대학교 PLUS 오태호 (PLUS015) ohhara@postech.ac.kr
목차(1) • IP Spoofing이란? • TCP/IP Packet의 구조 • IP Header의 구조 • TCP Header의 구조 • TCP Connection • Connect with IP Spoofing
목차(2) • IP Spoofing의 종류 • Non Blind IP Spoofing • hunt를 이용한 IP Spoofing • Blind IP Spoofing • mendax를 이용한 IP Spoofing • mendax의 IP Spoofing과정 • Sequence Number Guessing • IP Spoofing을 막기 위한 대책
IP Spoofing이란? • TCP/IP의 구조적인 허점을 이용한 공격 • 자신의 IP를 속여서 접속하는 공격 • IP로 인증하는 서비스를 무력화 시킬 수 있음 ( ex. rlogind, rshd ) • 1985년 Morris가 IP Spoofing공격의 가능성에 대해 예견 • 1995년 Kevin Mitnick이 처음으로 IP Spoofing공격을 시도
IP Header TCP Header Application Data 20 bytes 20 bytes TCP/IP Packet의 구조
IP Header의 구조(1) struct ip { u_int8_t ip_hl:4; /* header length */ u_int8_t ip_v:4; /* version */ u_int8_t ip_tos; /* type of service */ u_short ip_len; /* total length */ u_short ip_id; /* identification */ u_short ip_off; /* fragment offset field */ u_int8_t ip_ttl; /* time to live */ u_int8_t ip_p; /* protocol */ u_short ip_sum; /* checksum */ struct in_addr ip_src, ip_dst;/* source and dest address */ }; * Redhat Linux 5.1의 /usr/include/netinet/ip.h에서 발췌 ( endian과 ip_off관련 내용은 생략 )
IP Header의 구조(2) • ip_hl • IP Header의 길이를 double word단위로 나타낸다. 보통 5를 사용한다. • ip_v • IP의 Version이다. 보통 IPVERSION을 사용한다. • ip_tos • service의 type을 나타낸다.
IP Header의 구조(3) • ip_len • 현재 packet의 전체 크기를 나타낸다. • ip_id • 각각의 packet을 구분할 때 사용하는 id이다. 보통 packet을 하나 보낼 때 마다 1씩 증가한다. • ip_off • fragment offset field이다.
IP Header의 구조(4) • ip_ttl • time to live를 나타낸다. packet이 router를 최대 몇 개까지 거칠 수 있는지 한계를 설정한다. • ip_p • protocol을 나타낸다. TCP를 사용하는 경우에는 IPPROTO_TCP를 사용한다.
IP Header의 구조(5) • ip_sum • IP Header의 checksum값이다. • ip_src, ip_dst • source IP와 destination IP이다.
TCP Header의 구조(2) • th_sport, th_dport • source port와 destination port이다. • th_seq • 전송하는 packet의 순서를 나타내는 번호이다. • th_ack • 다음에 받을 것으로 예상되는 packet의 번호이다.
TCP Header의 구조(3) • th_off • TCP Header의 길이를 double word단위로 나타낸다. 보통 5를 사용한다. • th_flags • 현재 packet의 flag들을 나타내며 flag에는 URG, ACK, PSH, RST, SYN, FIN이 있다. • th_win • window size이다.
TCP Header의 구조(4) • th_sum • 전송된 packet이 제대로 전송되었는지 알아보기 위한 checksum값이 저장된다. • th_urp • urgent pointer이다. 긴급한 데이터를 전송할 때 사용된다.
TCP Connection • TCP 3 way handshake Host A Host B SYN(1000) SYN(4000) , ACK(1001) ACK(4001) Connection Established
Connect with IP Spoofing(1) • Connect to Host B with IP Spoofing Hacker Host A Host B Denial of Service attack Send SYN Packet ( src = Host A, dest = Host B ) Send SYN, ACK Packet Send RST Packet Send gussed SYN, ACK Packet( src = Host A, dest = Host B ) Send data ( ex. echo “+ +” > .rhosts ) Send RST Packet
Connect with IP Spoofing(2) • Send guessed ACK, SYN Packet • Host B가 Host A로 보낸 Packet의 Sequence number를 알아야 Packet을 보낼 수 있다. • Non Blind IP Spoofing • Host A와 Host B가 주고받는 Packet을 볼 수가 있다면 Sequence number를 쉽게 알 수 있다.
IP Spoofing의 종류(1) • Non Blind IP Spoofing • Host A와 Host B가 주고받는 Packet을 볼 수 있는 상태이다. • Sequence number를 알 수 있기 때문에 쉽게 공격이 가능하다. • Connection을 계속 유지할 수 있다.
IP Spoofing의 종류(2) • Blind IP Spoofing • Host A와 Host B가 주고받는 Packet을 볼 수 없는 상태이다. • Sequence number를 추정해야 되기 때문에 공격이 어렵다. • Connection을 계속 유지하기가 곤란하다.
Non Blind IP Spoofing • Connect가 되어 있는 상태를 살피고 있다가 중간에 끼어 드는 Connection Hijacking할 때 흔히 사용함 • Connection을 끊어 버리거나 중간에 해커가 원하는 명령을 수행하게 할 수 있음 • One time password를 무력화 시킬 수 있음 • Hunt라는 프로그램을 사용해 쉽게 할 수 있음
hunt를 이용한 IP Spoofing(4) • 141.223.163.40에서 두 user가 서로 대화를 하고 있음 • 현재 hunt를 이용해 141.223.163.30 141.223.163.40을 hijack하려고 준비하고 있음 • 141.223.163.30->141.223.163.40은 현재 guest가 사용하고 있음
hunt를 이용한 IP Spoofing(8) • guest는 이유없이 connection이 끊어짐 • ohhara는 guest가 이상한 말을 하는 것으로 느낌 • guest가 한 이상한 말은 실은 hacker가 connection을 hijacking 해서 입력한 것
Blind IP Spoofing • Sequence number가 추측이 가능한 경우에만 공격이 가능하다. • rsh, rlogin과 같은 IP를 가지고 인증하는 서비스를 공격할 때 사용한다. • Denial of Service공격이 우선적으로 필요하다. • mendax 프로그램을 사용해 rsh, rlogin의 인증을 쉽게 무력화 시킬 수 있다.
mendax를 이용한 IP Spoofing(1) • mendax의 사용 방법 Usage: mendax [OPTIONS] <source> <target> [<gateway>] -p PORT first port on localhost to occupy -s PORT server port on <source> to swamp -l USERNAME user on <source> -r USERNAME user on <target> -c COMMAND command to execute -w PORT wait for a TCP SYN packet on port PORT -d read data from stdin and send it. -t test whether attack might succeed -L TERM spoof rlogind instead of rshd. -S PORT port from which to sample seq numbers.
mendax를 이용한 IP Spoofing(3) • 141.223.94.22에 있는 plus사용자는 141.223.163.23의 ohhara사용자를 신뢰함 • 공격 방법 • mendax -l plus -r ohhara -c “echo + + >> .rhosts” 141.223.163.23 141.223.94.22 • .rhosts에 + +를 추가해서 누구나 로그인을 할 수 있게 된다.
mendax의 IP Spoofing과정(2) • 위와 같은 packet을 20개 보냄 • ip_id를 packet마다 1을 더한다. • th_seq를 packet마다 64000을 더한다. • th_sport를 packet마다 1을 더한다. • 143.209.4.3에서 응답이 없으므로 141.223.163.23은 일시적으로 서비스 불능상태가 된다. • 흔히 SYN Flooding이라 불린다.
mendax의 IP Spoofing과정(4) • 위와 같은 packet을 4개 보냄 • ip_id를 packet마다 1을 더한다. • th_sport를 packet마다 1을 더한다. • th_seq를 packet마다 64000을 더한다. • 돌아오는 packet의 sequence number를 분석해 어떤 규칙이 있는지 알아낸다.
mendax의 IP Spoofing과정(6) • 위와 같은 packet을 보냄 • 141.223.94.22는 위의 packet을 받고 141.223.163.23으로 packet을 보내지만 서비스 불능상태이기 때문에 응답이 없다. • 여기서 141.223.94.22가 보낸 packet의 sequence number를 방금 전의 분석을 토대로 추정한다.
mendax의 IP Spoofing과정(14) • 위와 같은 packet을 20개 보냄 • ip_id를 packet마다 1을 더한다. • th_seq를 packet마다 64000을 더한다. • th_sport를 packet마다 1을 더한다. • RST packet을 141.223.163.23으로 보낸다. • 141.223.163.23은 서비스 불능상태에서 서비스 가능상태로 바뀐다.
Sequence Number Guessing(1) • Blind IP Spoofing공격은 sequence number를 얼마나 정확히 추정하느냐에 따라 공격의 성공여부가 결정됨 • 대부분의 OS가 sequence number를 너무 간단한 규칙하에 발생시킴
Sequence Number Guessing(2) • 64K Rule • SYN packet을 하나 받을 때마다 sequence number를 64000씩 증가 시킴 • HP-UX all versions • IRIX 5.3 and before • OSF 3.2 and before • SunOS 5.4 and before • AIX 3 and before
Sequence Number Guessing(3) • Time relation • 시간에 비례해서 sequence number를 증가 시킴 • IRIX 6.2 and after • OSF 4.0 and after • SunOS 5.5 and after • Microsoft Windows all versions • Linux 1.x and before • FreeBSD
Sequence Number Guessing(4) • Random • sequence number의 규칙을 알 수 없다. 비교적 안전하다. • AIX 4 and after • Linux 2.x and after
Connexion au compte
Connectez-vous pour publier votre contenu sur SlideServe.