2020. 7. 13.

[Network] S04_01 스푸핑 대응


// ARP 스푸핑을 방지하는것은 장비를 두는것이 제일 좋다.
하지만 그렇게하기 어려운 경우는 static 설정이나 arpwatch 이용해 감시한다.

*ARP 스푸핑 대처-1
ARP를 정적으로 수정한다.
  • arp -s 명령을 이용 IP MAC을 직접 등록
  • 직접 등록된 MAC arp응답에 의해서 수정되지 않는다.
root@server:- 
[rooteserver arp —a 
XP (192. 168.11 .9) at [ether] on ethO 
gateway (192.168 .11 . 1) at 5F:58 [ether] on etho 
attacker (192.168.11 .91) at [ether] on etho 
winlO (192.168.11 .3) at 00:50: [ether] on ethO 
[rooteserver

. WDocuments and Sett ings%b 
rochya>arp -s 
: WDocuments and Sett ings%b 
rochya>arp —a 
Interface: 192 168.11 .9 Ox 0003 
nternet Address 
92 . 1 
Phys i cal Address 
00-50-56-e3-5f-58 
192 16B. Il .1 00-50-56-e3-5f-58 
Type 
static
  • 등록이후 send_arp를 이용 잘못된 정보를 전달하고 arp 테이블의 변화를 확인

Windows 7 이후 버전에서 맥 주소의 정적 등록은 netsh 명령을 이용했으나 현재 arp -s 명령도 사용 가능하다.
netsh interface ip add neighbors interface" "IP" "맥주소 "

운영 체제 별 interface
Windows7 : 로컬 영역 연결
Windows10 : 이더넷
Ex) Windows 10
netsh interface ip add neighbors "이더넷" "192.168.10.1" "00:0a:21:ab:d3:98"
또는
arp -s 192.168.10.1 00:0a:21:ab:d3:98

// 인터페이스 여러개일경우 문제 있을 있다.

*ARP 스푸핑 대처-2
arpwatch를 이용 네트워크상에 IP MAC 주소 변경을 감시한다.
CentOS(fedora)의 경우 yum을 이용 설치한다.
  • 기본 레파지토리에 제공된다.
  • 이외 리눅스는 arpwatch-****.rpm을 설치한다.
중요파일
  • /usr/lib/systemd/system/arpwatch.service : 스크립트 파일 - 7.x 버전
(/etc/rc.d/init.d/arpwatch) - 6.x 버전
  • /etc/sysconfig/arpwatch : 환경 설정 파일
  • /usr/sbin/arpwatch : 바이너리 명령어
  • /var/lib/arpwatch/arp.dat : IP/MAC 주소, 시간저장 파일
    • 시간은 unixtime 형식이므로 date –d@<시간> 으로 변경이 가능하다.

// 리소스를 적게 먹기 떄문에 서버마다 설치하는것을 권장한다.

/etc/sysconfig/arpwatch 환경 설정
-u <username> : defines with what user id
-e <email> : 메일 수신처
-s <from> : 보내는 사람
-n <ip> : 감시할 네트워크
OPTIONS="-u arpwatch -i eht0
-e '계정@naver.com'
-s 'arpwatch'
-n '192.168.10.0/24'"

실행
# systemctl start arpwatch
  • arpwatch 데몬을 실행한다.
  • 메일 수신처에서 수신된 메일을 확인한다.
    • 새로운 Mac 주소가 추가될 경우 : new station
    • 기존 정보가 변경된 경우 : changed ethernet address
    • MAC주소가 중복된 경우 : flip flop
    • 메일은 대부분 스펨 메일함에 저장된다.
// arp spoofing 증조
flip flop, changed ethernet address
// icmp spoofing 증조
new station

Arpwatch@itclas 
Arpwatch@itclas 
Arpwatch@itclas 
flop (gateway) Q 
new Station 
AE-Tæg changed ethernet address (gateway) Q 
15:40 
15:39 
2.8 KB 
2.6 KB 
2.8 KB
sendmail이 실행되지 않으면 메일이 전달되지 않는다.



댓글 없음:

댓글 쓰기