로그인
Sign in
1. tcp_wrapper란 무엇인가?

  tcp_wrapper는 systat, finger, ftp, telnet, rloginrsh, exec,
  tftp,talk등을 모니터링하고 filtering을 할 수 있는 프로그램이다.

  [user] --> [telnet client] --> [inetd] --> [telnet server] --> [login]

  tcp_wrapper적용후

  [user]-->[telnet server]-->[tcp Wrapper]-->[login]

  tcp_wrapper는 외부에서 들어오는 호스트를 방어하는의미를 가지고 있
  는 것으로 IP address를 체크하여 관리자가 접속을 허용한 호스트들만을
  접속하기 때문에 외부로의 크래킹 으로부터 방어를 할 수 있다.

2. TCP_Wrapper 백도어 버전 체크.

  누군가 tcp_wrapper의 백도어 버전을 올려 놓았다구 하는군요.
  421번 포트를 통하여 특정권한을 얻을 수 있도록 변형된 버전입니다.
  
  backdoor version:
  # ls -l tcp_wrappers_7.6.tar.gz
    -r--r--r-- 1 root 99186 jan 21 07:16 tcp_wrappers_7.6.tar.gz

  Restored version:
  # ls -l tcp_wrappers_7.6.tar.gz
   -r--r--r-- 1 root 99438 Jan 21 16:29 tcp_wrapper_7.6.tar.gz
   -r--r--r-- 1 root 360448 Jan 21 16:29 tcp_wrapper_7.6.tar
99438이 정확한 파일 사이즈입니다.
만약 99186이라면 의심을 한번 해보시기 바랍니다.

3. TCP_Wrapper 설치 방법

  RedHat linux라면 tcp_wrapper가 기본적으로 설치되어있다.
  tcp_wrapper를 ftp.initdata.co.kr/pub/solaris/security/tcp_wrapper/src
  에서 받는다.
  # gzip -d   tcp_wrapper_7.6.tar.gz
  # tar xvf tcp_wrapper_7.6.tar
  or
  # zcat tcp_wrapper_7.6.tar.Z | tar xvf -
  # cd tcp_wrapper_7.6
  # uname -a로 자신의 시스템 명을 알아낸다.
  # make REAL_DAEMON_DIR=/usr/sbin sunos5 (Solaris 2.x)

  만약 gcc를 사용할 경우

  # make REAL_DAEMON_DIR=/usr/sbin CC=gcc sunos5
  컴파일이 정상적으로 끝나면 tcpdchk, safe_finger, try-from,
  tcpdmatch, tcpd등 5개의 실행화일이 생성된다.
  tcpd를 REAL_DAEMON_DIR로 복사한다.
  # cp tcpd /usr/sbin
  # cp tcpdmatch tcpdchk safe_finger try-from /usr/local/bin
  /etc/inetd.conf화일의 수정 외부연결로부터 보호할 서비스를 골라
  tcpd가 보호하도록 수정한다.

  ftp stream tcp nowait root /usr/sbin/in.ftpd in.ftpd
  telnet stream tcp nowait root /usr/sbin/in.telnetdin.telnetd  

  수정후

  ftp stream tcp nowait root /usr/sbin/tcpd in.ftpd
  telnet stream tcp nowait root /usr/sbin/tcpd in.telnetd

  /etc/hosts.deny화일을 만들고 그 내용을 ALL:ALL함으로서 모든
  호스트의 접근을 통제한다.
  예외의 사용은 /etc/hosts.allow에 적어 넣습니다.
  tcp_wrapper는 처음에 hosts.deny를 참조하여 접근정책을 수립하고
  hosts.allow를 참조하여조정한다.
  그래서 hosts.deny에서 all을 hosts.allow에서 허가를해주면
  예외사항으로 처리되지요.
  /etc/hosts.allow
  all:127.0.0.1 ->이것은 자기자신을 나타낸다.
  all:210.219.210. ->이것은 210.219.210.1 - 254까지 가능
  all:210.219.210.221 -> 이것은 210.219.210.221 사용자만 가능
  in.telnetd:210.219.210. ->이것은 210.219.210.1 - 254은 telnet을 사용
  in.ftpd:ALL EXCEPT 210.219.210. 147.46.10.10
  -> 이것은 210.219.210번대와 147.46.10.10번 사용자를 제외
  허고 모든 호스트에게 ftp를 허용
  불법침입에 대해서 특정 id로 mail을 보내도록 하기위해서는
  다음과 같이 /etc/hosts.deny file을 수정한다.

  /etc/hosts.deny
  ALL:ALL:(/usr/local/bin/safe_finger -l @%h | \
  /usr/bin/mail -s %d-%h root)&
  
  or

  /etc/hosts.deny
  ALL: ALL : ((/usr/local/bin/safe_finger -l @%h;echo "----- \
  USERS LIST-------";/usr/bin/rusers -l -i %h) | \
  /usr/bin/mailx -s "불법침입" root)                    


tcpdchk를 실행하여 환경설정에 문제가 있는지 체크한다.
tcpdmatch로 환경화일 체크
예) # tcpdmatch in.ftpd mit.edu
     # tcpdmatch in.telnetd mit.edu

  inetd의 재가동

  # ps -ef | grep inetd
    388 ?? | 0:08.56 /usr/sbin/inetd
  # kill -HUP 388

4. 참조
http://baikdou.kaist.ac.kr/tips/tcpwrapper/TCP_Wrapper.htm
http://admin.snu.ac.kr/Docs/program/tcp_wrapper.php3
http://www.bigcom.co.kr/tech/admin/tcpwrapper.htm  

조회 수 :
608
추천 수 :
32 / 0
등록일 :
2003.12.13
16:41:09 (*.193.52.140)
엮인글 :
http://bestceok.com/xe/index.php?mid=sun_faq&document_srl=2920&act=trackback&key=4dc
게시글 주소 :
http://bestceok.com/xe/index.php?mid=sun_faq&document_srl=2920
List of Articles
번호 제목 글쓴이 날짜 조회 수
51 chmod 명령어 사용법 하록 2003-12-13 1017
50 Solaris 2.X signals and their meanings 하록 2003-12-13 612
49 Mount 되어 있는 CD-ROM을 강제로 꺼내기 하록 2003-12-13 664
48 CDE : X - server can not be started on display 하록 2003-12-13 1419
47 Timeout waiting for ARP/RARP packet 하록 2003-12-13 978
46 vi 에서 입력시 한글이 깨지는 현상 하록 2003-12-13 696
45 다양한 플랫폼의 SNMP 취약점 하록 2003-12-13 1541
44 buffer overflow를 방지하는 방법 하록 2003-12-13 489
43 Carko 관련 해킹 방지 방법(정보보호센터자료) 하록 2003-12-13 1028
» tcp_wrapper 설치 하록 2003-12-13 608
41 Componet Manager 2.1 설치 하록 2003-12-13 457
40 T3 Array 재구성 하록 2003-12-13 609
39 A1000 장비에 디스크 추가 하록 2003-12-13 535
38 A5000 어레이에서 디스크 장착 위치 하록 2003-12-13 481
37 Volume manager에서 rootdg volume 만드는 방법 하록 2003-12-13 629
36 Solaris 업그레이드 후 Volume Manager 복구 하록 2003-12-13 453
35 자주 쓰이는 RAID 레벨의 종류 하록 2003-12-13 557
34 Exceed에서 Openwindows 한글 폰트 설치법 하록 2003-12-13 1150
33 메세지가 콘솔창에 뜨지 않고 화면에 직접 나타날 때 하록 2003-12-13 562
32 Unable to get pty! 하록 2003-12-13 528