2020. 7. 13.

[Network] arp 스푸핑 대응 arpwatch 실습


  1.  구성과 계획
  • 네트워크 구성도

win10 - 192.168.10.146/AC-7B-A1-B2-3B-D0
공격자 att7 - 192.168.10.150/00:0c:29:a1:3f:e0
감시자 att6 - 192.168.10.149/00:0C:29:4F:41:6E
피해자 att5 - 192.168.10.148/00:0C:29:C6:9A:42
winXP - 192.168.10.147/00:0c:29:26:42:b6

  • 과정 정리
step1. 감시자 arpwatch 셋팅 구동
step2. 감시자 sendmail 셋팅 구동
step3. 공격자 arpspoof
step4. mail, arp 확인

  1. 관련내용정리
sendmail : arpwatch 이용하여 알림을 받기 위한 메일 프로그램이다.
arpwatch : arp 변경사항을 감지하여 메일로 보내주는 프로그램이다.

  1. 실습과정
step1. 감시자 arpwatch 셋팅 구동
// arpwatch 설치
yum -y install arpwatch

// arpwatch 셋팅
vi /etc/sysconfig/arpwatch
//7 이상
OPTIONS="-u arpwatch -i ens32
         -e '메일주소'
         -s 'arpwatch150'
         -n '192.168.10.0/24'"
//6 이하
OPTIONS="-u arpwatch -i eth0
         -e '메일주소'
         -s 'arpwatch149'
         -n '192.168.10.0/24'"
//7 이상 arpwatch 구동
systemctl stop arpwatch
systemctl start arpwatch
//6 이하 arpwatch 구동
service arpwatch stop
service arpwatch start

step2. 감시자 sendmail 셋팅 구동
// sendmail 설치
yum install -y install sendmail sendmail-cf
//7 이상 sendmail 구동
systemctl restart sendmail
//6 이하 sendmail 구동
service sendmail restart
// 메일 테스트
echo '149this is test.' | mail -s 'sendmail test' 메일주소
// 확인
sendmail test 
root<root@localhost.localdomain> 
01 O 
<body> 149this is test. 
</body> </html>

step3. 공격자 arpspoof
arpspoof -i ens32 -t 192.168.10.148 192.168.10.1
arpspoof -i ens32 -t 192.168.10.1 192.168.10.148
fragrouter -B1


step4. mail, arp 확인 비교
  • 피해자 arp 확인
? (192 
? (192 
? (192 
? (192 
? (192 
.168 
.168 
.168 
.168 
.168 
.1e.1se) at [ether) on ethe 
.113.149 at [ether) on ethe 
.1e.1) at [ether) on ethe 
.1e.147) at [ether) on ethe 
.1ø.146) at [ether) on ethe 
Croot@localhost ar 
? (192 
? (192 
? (192 
? (192 
? (192 
.168 
.168 
.168 
.168 
.168 
.1e.1se) at [ether) on ethe 
.113.149 at [ether) on ethe 
.113.1) at [ether) on ethe 
.1e.147) at [ether) on ethe 
.1e.146) at [ether) on ethe
공격 전과 후의 게이트웨이 mac 주소가 바뀌었다.

  • arpwatch 메일 확인
    • 새로운 Mac 주소가 추가될 경우 : new station
    • 기존 정보가 변경된 경우 : changed ethernet address
changed ethernet address 
<arpwatch 
[+21] 01 
<body> 
hostname: <unknown> 
ip address: 
182. 18B. 10. 14B 
ethernet address. 
ethernet vendor: VMware, Inc. 
old ethernet address: 
old ethernet vendor: VMware, Inc.
기존 정보가 변경된 것으로 150번의 mac 주소가 없을때 변경된것이다. 자세히 보면 150 공격자와 맥주소가 같다.

  • MAC주소가 중복된 경우 : flip flop
flip flop 
<arpwatch 
[+21] 01 
<body> 
hostname: <unknown> 
ip address: 
182. 18B. 10. 14B 
ethernet address: 
ethernet vendor: VMware, Inc. 
old ethernet address:
arp spoofing 징조로 150번과 중복되기 때문에 메일이 온것이다.

  1. 결론
원천적으로 arp spoofing 차단하기 어렵지만 이상한 징후를 메일로 알림을 받아 대응할 있는 arpwatch 사용함으로써 arp spoofing 탐지할 있다.

댓글 없음:

댓글 쓰기