Cops 열기
COPS(Computerrized Oracle and Passward System)는 UNIX system 의 보안점검 프로그램이다. COPS 패키지는 보안을 조사해 주는 실제 프로그램들과 설치방법&작동방법&결과를 해석하는 도큐먼트들로 구성되어 있다. COPS는 root가 아닌 일반user도 사용할 수 있으며 또한 COPS는 단지 보안문제에 대하여 알려주기만 할 뿐 수정을 해 주지는 않는다.
Cops의 능력
Cops는 root 상황에서 실행되며, 아래의 사항들을 check하여 시스템 관리자에게 security vulnerability의 가능성이 있다는 것을 알려줄 뿐이며 실제의 correction은 관리자가 직접 행하여야 한다.
- root suid file들의 리스트와 write 가능 여부,shell script 여부
- crack 으로 발견되기 쉬운 password
- 주요 system file, directory, device의 owner 와 permission
- password file 과 group file의 format 상의 vulnerability
- /etc/rc*.d/* 에 의해 수행되는 program 들과 cron daemon 에 의해 수행되는 프로그램들의 vulnerability
- 주요 binary file들의 CRC check하여 변동시 시스템 관리자에게 통보
- unsecure anonymous ftp setup
- unsecure tftp, sendmail alias, SUID uudecode problem
- /etc/inetd.conf 에 의해 감추어져 있을지 모를 hidden shell
- 각 사용자들의 home directory의 .cshrc, .profile permisson
- /etc/hosts.equiv 의 '+' 여부 (없어야 함)
- unrestricted NFS mount setup
- /etc/ftpuser 에 root 가 들어 있는지 여부(들어 있어야 함)
- CERT 에 의한 보고된 파일의 patch 여부
cops의 특징
Cops는 shell상태에서 check할 수 있는 많은 부분을 모두 check해 줌으로서
시스템 관리자는 최종적으로
나온 결과물을 보고 자기의 기호에 따라 수정을 해주면 된다. 반면 이것은 일일이 손으로 다 해줘야 하므로 오히려 어려울 수가
있다.
Cops이후에 나온 도구들 대부분이 checking과 함께 수정 기능도 같이 제공해 주는데도 불구하고 Cops가 쓰이는 이유는 설치와 사용
이 손쉽기 때문이다.
cops의단점
Cops는 network security에 대해서는 전혀 check하지 못한다.
UNIX시스템이 바로 network computer라는 개념
에 비추었을 때, 어떤 한 시스템의 security점검을 cops만으로 한다는 것은 부족한 감이 있다. 이런 점들은 다른 점검도구들과 같이 사용
함으로써 system의 security를 꾀한다.
Cops를 깔아보자...
Cops는 shell/perl script이므로 특별한 컴파일 과정이 필요 없다. 단지 awk,sed,grep 등의 utility들이 제대로 갖추어져 있는
유닉스 시스템이면 족하다.
kus.kaist.ac.kr(sparc20,SunOS5.4)의 file system을 예로 들어 본다.
ftp://ftp.cert-kr.or.kr/pub/Security/tool/cops_104.tar.Z
위의 주소 말고도 Cops를 구할 수 있다.
click!
$ pwd
/kus/security_tools
$ zcat cops_104.tar.Z : tar fx -
$ cd cops_104
INSTALL_DIR=/kus/security_tools/cops_104 -> current directory
#
#Where the programs are....
#
CHMOD=/bin/chmod
TEST=/usr/ucb/test
MKDIR=/bin/mkdir
CP=/bin/cp
CC=/usr/ucb/cc
RM=/bin/rm
$ make all
$ make install
vi cops
########################
# Change these lines!
########################
SECURE=/kus/security_tools/cops_104
SECURE_USERS="[email protected]"
Cops는 어디에 있을까?
ftp://ftp.cert-kr.or.kr/pub/Security/tool/cops_104.tar.Z
ftp://ftp.kaist.ac.kr/.1/Linux/system/Admin/cops.104.tgz (Linux)
ftp://ring.kotel.co.kr/pub/security/doc/COPS.PS
ftp://ring.kotel.co.kr/pub/security/doc/cops.tar.Z
Cops Source
- README.* : README file 들
- cops : main program으로 다른 모든 프로그램을 실행하는 shell script 로 되어 있다.
- bug.chk.{aix, apollo, dec, next, sgi, sun, svr4} : 각 OS 에 관련된 bug check list 이다.
- chk_strings : binary file 안에 root executed file 이 있는데 strings 를 통해 check하는 shell script 프로그램
- crc.chk : crc checking 프로그램
- cron.chk : crontab 의 file 들의 vulnerability check program
- ftp.chk : anonymous ftp 가 secure하게 setup되었는지 check 하는 프로그램
- group.chk : group file check
- dev.chk : /etc/fstab 에 있는 device들의 permission check
- init_kuang : kuang 초기화 프로그램
- is_able.chk : is_able.lis에 있는 모든 file 과 디렉토리의 permission check
- misc.chk : miscellaneous potential security problem check
- pass.words : dummy password 를 check 할 때 쓰이는 data 단어들
- rc.chk : /etc/rc*.d/* 에 있는 file check
- root.chk : root 의 resource file들, 즉 /.* 의 permission check
- suid.chk : suid, agid program check
- yp_pass.chk : Yellow Pages/NIS 를 사용하는 시스템의 password problem check
- cops_filter : warning messages를 filtering 하는 awk program
- cover_letter : 저자서문
- reconfig : 각종 shell script 에 쓰이는 unix program들이 path가 틀릴 때 새로 path를 confug 하는 script
- arp/ : COPS Analysis and Report Program
- checkacct/ : account 의 security problem을 check 하기 위한 부속 프로그램
- kuang/ : Rule based computer security checker 프로그램 일반적으로 거의 쓰이지 않는다.
- docs/ : 각종 shell script 들의 해설 문서
- extensions/ : 앞으로 나올 cops new version 에고
- src/ : cops source
- extra_src : 기타 잡다한 source
- perl/ : perl script 로 된 cops
Cops의 사용법
$ pwd
kus/security_tools/cops_104
$ cops <--- 시간이 많이 걸림
$ ls -al result*
-rw-r--r-- 1 root other 953 11월 29일 22:58 result.5011
$ cat result.5011
arning! /etc/security is _World_ readable!
Warning! /etc/mnttab is _World_ writable!
Warning! /etc/named.boot is _World_ writable!
Warning! /usr/adm/spellhist is _World_ writable!
Warning! /usr/adm/vold.log is _World_ writable!
Warning! /usr/local/bin/screen-3.6.2 is _World_ writable!
Warning! /usr/local/bin/screen.old is _World_ writable!
Warning! File /etc/mnttab (in /etc/rc2.d/SO1MOUNTFSYS) is _World_ writable!
Warning! File /var/adm/log/asppp.log (in /etc/rc.d/S47asppp) is _World_ writable!
Warning! File /dev/ip (in /etc/rc2.d/S69inet) is _World_ writable!
Warning! File /dev/tcp (in /etc/rc2.d/S69inet) is _World_ writable!
Warning! File /etc/named.boot (in /etc/rc2.d/S72inetsvc) is _World_ writable!
Warning! User nuucp's home directory /var/spool/uucppublic is _World_ writable!
Warning! Password file, line 7, user smtp has uid = 0 and is not root smtp:x:0:0:mail daemon user:/:/bin/false
Warning! /etc/ftpusers should exist!