WebKnight.xml 설정

Posted at 2008/11/10 20:00 // in 서버™/보안 // by 블루비
Global Filter Capabilities
- IIS5 격리 모드 사용시
  • Is Installed As Global Filter > check
  • Deny Postdata SQL injection > check
Cookie
- Deny Cookie SQL Injection > check
ContentType
- multipart/form-data 추가
URL Scanning
- URL Allowd starts > 공백추가
Headers
- Deny Header SQL Injection > check
SQL Injection
- SQL Injection Keywords
  • ; 제거
  • <script 추가(POST 데이터 필터)
  • <form 추가
  • <object 추가
Referrer
- Referrer URL RFC Compliant > 체크해제(파라미터 값중 한글 차단)


2008/11/10 20:00 2008/11/10 20:00

댓글을 남겨주세요.

[로그인][오픈아이디란?]

웹방화벽 WebKnight

Posted at 2008/11/10 12:53 // in 서버™/보안 // by 블루비
http://www.aqtronix.com/

윈도우 서버용 무료 웹방화벽 WebKnight

AQTRONIX WebKnight - Application Firewall for Web Servers

What is it?

AQTRONIX WebKnight is an application firewall for IIS and other web servers and is released under the GNU General Public License. More particularly it is an ISAPI filter that secures your web server by blocking certain requests. If an alert is triggered WebKnight will take over and protect the web server. It does this by scanning all requests and processing them based on filter rules, set by the administrator. These rules are not based on a database of attack signatures that require regular updates. Instead WebKnight uses security filters as buffer overflow, SQL injection, directory traversal, character encoding and other attacks. This way WebKnight can protect your server against all known and unknown attacks. Because WebKnight is an ISAPI filter it has the advantage of working closely with the web server, this way it can do more than other firewalls and intrusion detection systems, like scanning encrypted traffic.

Features

These are some features of WebKnight.

  • Open Source
    WebKnight is free software under the terms of the GNU General Public License.
  • Logging
    By default all blocked requests are logged. In addition all allowed requests can be logged as well, or you can run WebKnight in logging only mode. This last operation mode allows you to see the attacks in the log files without blocking them. WebKnight can also prevent blocked attacks from being logged to the web server log files. This way your web server log files will be kept clean and accurate.
  • Customizable
    The firewall can be customized for any need, including blocking certain 0-day exploits before the vendor released a patch.
  • Compatible with Web-Based Applications
    WebKnight is compatible with Frontpage Extensions, WebDAV, Flash, Cold Fusion, Outlook Web Access, Outlook Mobile Access, SharePoint...
  • HTTP Error Logging
    WebKnight can be configured to log the HTTP errors from the web server. This way you can log common errors like '404 Not Found' or more severe ones like '500 Server Error' to the logfile. Doing so allows you to detect errors in scripts or attacks on them. You can also use it to simply find broken links in your web site or configuration mistakes.
  • SSL Protection
    Unlike traditional firewalls, WebKnight can protect encrypted sessions over HTTPS.
  • Third-Party Application Protection
    WebKnight not only protects the web server, but can also be configured to protect third-party web server applications, e-commerce web sites or your custom web site.
  • RFC compliant
    WebKnight is RFC compliant and also includes the ability to scan the requests for RFC compliance.
  • Low Total Cost of Ownership (TCO)
    WebKnight comes with a Windows Installer package and remote installation scripts making it easy to deploy WebKnight in your enterprise. WebKnight also comes with a graphical user interface for changing WebKnight settings.
  • Run-Time Update
    Changes to the settings of WebKnight do not require restarting the web server and can thus be done without disrupting any services for your users. For performance reasons, detecting these changes only occurs every 1 minute.
New in WebKnight 2.0
  • Improved scanning
    The scanning engine has been improved and extended. It is now also possible to scan the Referrer header and User Agent header for certain exploits or data.
  • Authentication scanning
    Authentication scanning allows to scan for brute force attacks on accounts or DoS attacks on system accounts. It can also scan for weak passwords.
  • Connection control/monitoring
    You can block or monitor traffic coming from certain ip addresses or ranges. You can also monitor access to certain important files or limit the number of requests coming from a single IP address.
  • Blocking robots
    A large robot database makes it possible for blocking or only allowing certain types of robots. It is also possible to set up a bot trap for bad robots and to block aggressive robots.
  • Prevent hot linking
    Hot linking or direct linking to certain types of files (like images or file downloads), can be prevented.
Download

WebKnight is a free open source tool that comes to the rescue in many occasions and it helps administrators in their jobs, but to keep up this good work, please consider a donation.

  • WebKnight 2.2 (Release date: 2008.09.02)
    This release is ready for IIS 7 and 64-bit. Fixed a few minor issues and extended scanning for SQL injection in the referrer, extended cookie scanning and certain XSS attacks. It is now also possible to monitor or block an IP address after an alert has been triggered. A new version of the config utility, log reader application and updated robots database is also included in this release.

  • Robots.xml: the latest version of the Robots.xml file used by WebKnight. Download and overwrite the existing file in your WebKnight folder to have the latest database of known robots. WebKnight will automatically detect the new file and load it.

  • Older WebKnight downloads
How to install

Installation in IIS with Windows Installer: (for IIS 6.0 see note below!) (for IIS 7.0 see note below!)

Double click the file WebKnight.msi. This will launch Windows Installer and install WebKnight on the local machine. This method will install WebKnight as a global filter on the local machine. If Windows Installer is not installed on your system, you can download it directly from Microsoft:
Windows Installer 2.0 Redistributable for Windows NT 4.0 and 2000
Windows Installer 2.0 Redistributable for Windows 95, 98, and Me

Installation in IIS with scripts:

To install/uninstall WebKnight on the local or remote machine you can use the file install.vbs/uninstall.vbs from the setup folder. This method will install WebKnight as a global filter on the selected host or localhost.

Manual installation as a global filter in IIS:

  1. Copy all the files in the Setup folder to a local folder on the server (e.g. C:\Program Files\AQTRONIX WebKnight).
  2. Open the IIS snap-in.
  3. Right-click the server name (not the site name) (in IIS 6 right-click Web Sites) under Internet Information Services in the MMC, and then select Properties.
  4. Verify that WWW Service is displayed in the Master Properties drop-down list, and click the Edit button. For IIS 6 go to next step.
  5. Choose the ISAPI Filters tab, and then click the Add button.
  6. In the Filter Properties window, type WebKnight, and enter the full path to WebKnight.dll in the Executable box.
  7. Select OK to close each dialog.
  8. Review any settings of WebKnight, by running config.exe that you copied locally.
  9. Restart IIS.

Manual installation as a site filter in IIS:

  1. Copy all the files in the Setup folder to a local folder on the server (e.g. C:\Program Files\AQTRONIX WebKnight\W3SVC1). Note: it is important to have a unique folder for each WebKnight installation!
  2. Open the IIS snap-in.
  3. Right-click the site name (not the server name) under Internet Information Services in the MMC, and then select Properties.
  4. Choose the ISAPI Filters tab, and then click the Add button.
  5. In the Filter Properties window, type WebKnight, and enter the full path to WebKnight.dll in the Executable box.
  6. Select OK to close each dialog.
  7. Review any settings of WebKnight, by running config.exe that you copied locally. (Make sure global filter capabilities are disabled: uncheck 'Is Installed As Global Filter')
  8. For IIS 6 you need to make sure that each site for which you installed WebKnight as a site filter, has its own application pool. This is because only one instance of WebKnight can be run in any application pool. By default all sites are run in the DefaultAppPool and can only contain one instance of WebKnight, so you can only have one site filter, unless you specify a different application pool for any additional site on which you are running WebKnight as a site filter.
  9. Restart IIS.

If you want to import your settings from urlscan, you can do that by copying the file urlscan.ini to the WebKnight directory. Delete WebKnight.xml (or rename it) and your settings from urlscan.ini will be imported in a new WebKnight.xml file when you restart your web server. This can be useful if you experienced problems with your urlscan installation and you had to customize the settings of urlscan and want to keep using these settings. If you want to load the default settings again, you can do that by deleting the files WebKnight.xml and urlscan.ini in the directory WebKnight and a new WebKnight.xml will be made with the default settings when you restart your web server.

Installation is IIS 5 and previous: You don't need to do anything extra, just follow one of the installation methods above.

Installation in IIS 6.0: to run WebKnight as a global filter in IIS 6.0, you have two options:

  1. Run IIS in IIS 5.0 Isolation mode (recommended)
  2. Continue running IIS in worker process mode but without the global filtering capabilities of WebKnight, and you need a unique log file per process. So you have to make sure you:
    • uncheck 'Is Installed As Global Filter' under Global Filter Capabilities
    • check 'Per Process Logging' under Logging (each application pool will load its own instance of WebKnight, if you only have one pool, this is not required.)
    • Make sure the account NETWORK SERVICE (or whatever account(s) you set the application pool(s) to use) has change permission on the WebKnight folder and subfolders
    • Restart IIS after doing the above changes.
Warning: There is a known issue with running WebKnight 1.3 and previous versions in IIS 6. You need to uncheck "Change Server Header" and uncheck "Remove Server Header" (in "Headers" section). WebKnight 2.0 does not have this issue.

Installation in IIS 7.0

  • Allow ISAPI filters in IIS7 (by default this is not installed)
  • The MSI package provided with WebKnight 2.2 and later supports IIS 7 (do not use the install.vbs script). Previous versions of WebKnight can only be installed manually and also unless you uncheck "Is Installed As Global Filter" in the global filter capabilities. If in addition you want to install a 32-bit version of WebKnight on a 64-bit operating system, you need to set the 32bitness precondition for the isapi filter (see your IIS documentation).
  • The IIS account needs to have change permission on the WebKnight folder (see the install note for installing WebKnight in IIS6 when using Worker Process mode).
  • WebKnight is not yet ready for IPv6, but this is currently not a major issue because the Internet is still using IPv4 (only the localhost loopback uses IPv6)

Non-IIS: Look at the documentation of your web server (Note: only web servers with ISAPI filter support can run WebKnight).


Published: 20/08/2002Document Type: General
Last modified: 2/09/2008Target: General
Visibility: PublicLanguage: English
2008/11/10 12:53 2008/11/10 12:53

댓글을 남겨주세요.

[로그인][오픈아이디란?]

[linux]파일보안

Posted at 2005/09/05 12:17 // in 서버™/보안 // by 블루비
출처 : 상상공장 페이퍼

1.파일 및 디렉토리의 소유권 설정
파일 및 디렉토리에 대한 기본 소유권이 bin에서 root로 변경됨.
기본 권한이 775이던 파일 및 디렉토리는 755로 변경됨.
기본권한이 664이던 파일 및 디렉토리는 644로 변경됨.
기본 시스템 umask는 022로 설정됨.

2.RBAC(Role Based Access Control) 기능
일반사용자도 수퍼유저의 권한을 필요에 따라 적절히 배분해 준다. 그래서 일반 사용자도 프로그램 설치나 제거와 같은 작업을 허용하고 있다. 하지만 이런 경우 권한의 적절한 분배에 대한 철저한 제약이 있어야 한다.

3.Sun Enterprise Authentication Mechanism (SEAM)
SEAM은 네트웍상에서 KDC라는 제 3의 인증서버를 통하여 사용자 인증기능을 제공해주는 클라이언트/서버 구조의 보안기능이다. 네트웍상의 사용자의 인증,데이터의 무결성 및 기밀성도 보장을 제공한다.


SetUID / SetGID
프로세스는 7개의 식별자를 가지고 있다. Real-UID, Real-GID, Effective-UID, Effective-GID, Additional-GID, Saves-SetUID, Saves-SetGID이다. Real-UID/GID는 실제로 이프로그램을 실행한 사용자의 ID를 가지고 있다. Effective-UID/GID는 이 프로세스가 다른 파일을 액세스할 때 사용할 ID이다.

"/usr/bin/passwd"파일의 퍼미션을 확인해 보자.

# ls -l /usr/bin/passwd

-r-sr-sr-x 3 root sys 104588 Aug 10 10:00 /usr/bin/passwd

# ls -l /etc/shadow
-r-------- 1 root sys 2048 Aug 10 10:00 /etc/shadow

/etc/shadow파일 입장에서는 "root"가 파일을 읽고 쓴다고 생각하고 파일을 읽거나 쓸수있도록 허용한다. 하지만 이미 "passwd" 프로그램 자체에서 일반 사용자는 자신의 UID에 대해서만 변경할수 있도록하는 제약을 가지고 있다.

그러면 어떻게 SetUID라는 설정이 시스템 보안에 치명적인 영향을 미칠수 있는지 예제로 작업을 해보자. 어떤 일반 사용자가 운 좋게 root의 패스워드를 구했다고 치자. 하지만 시스템 관리자는 침입흔적이 있으면 즉각 패스워드를 변경해 버릴 것이다. 이 사용자는 패스워드를 관리자가 바꾸기전에 다음에 들어와서 자신이 "root"의 권한을 얻을수 있는 작업을 해두게 될 것이다. 그런작업중 가장 손쉽게 할수 있는 작업이 shell에 setUID를 설정하는 방법이다.

# cp /bin/sh hello

# chmod ug+s hello

# ls -l hello

-r-sr-sr-x 1 root sys 401024 Aug 20 11:00 hello

# su - user01

$ hello
$ vi shadow

hello 라는 프로그램을 실행하게 되면 실제로 새로운 쉘을 하나 할당받게 되는것이고, 그 새로 할당 받은 쉘은 "root"의 이름으로 모든 파일에 접근할수 있게 된다.

그럼 시스템 관리자는 이렇게 불법적으로 설정된 SetUID 퍼미션을 어떻게 찾아야 할까. find 라는 명령을 사용하여 간단하게 검색할수 있다.

# find / -user root -perm -4000


위의 명령은 root의 권한으로 SetUID가 설정된 파일을 검색하는 명령이다.


Sticky bit
스티키비트 라고 부르는 이 퍼미션은 "/var/tmp"와 같은 공용 디렉토리 안의 파일을 보호하는데 사용되는 설정이다. sticky bit가 설정된 디렉토리안에 있는 모든 파일이나 디렉토리는 실제 소유자 또는 root만이 그 파일이나 디렉토리를 삭제할수 있다.

umask
파일이나 디렉토리를 생성하게 대한 각각 파일은 파일에 대한 기본 퍼미션(666), 디렉토리는 디렉토리에 대한 기본퍼미션(777)이 할당된다. 하지만 이 퍼미션들은 모든 사용자가 다 사용할수 있는 권한을 설정하는 허용치이다. 그래서 사용자가 파일이나 디렉토리를 생성할 때 자동적으로 폐쇄적인 권한을 설정하고 싶을 때 사용할수 있는 명령이다. 아무런 옵션없이 "umask"라는 명령을 사용하면 지금 현재 설정되어 있는 "umask"값이 출력된다.

$ umask

022

$ touch file1
-rw-r--r-- 1 user01 other 0 11월1일 10:00 file1

쉽게 생각하면 기본퍼미션값에 umask 값을 빼주면 파일이나 디렉토리에 설정된 퍼미션을 알수 있다. (666-022=644(rw-r--r--))

umask값에 따라 파일과 디렉토리에 대한 퍼미션

umask 파일 퍼미션 디렉토리 퍼미션
022 644(rw-r--r--) 755(rwxr-xr-x)
077 600(rw-------) 700(rwx------)
026 640(rw-r-----) 751(rwxr-x---x)
027 640(rw-r-----) 750(rwxr-x---)

ACL(Access Control List)
ACL은 일반적인 유닉스 파일 권한 설정방법에 추가적인 설정을 할수 있도록 지원한다. Auser 의 "A"라는 파일에 대해 모든 사용자가 읽기만 할수 있지만 Buser는 이파일에 쓸수 있도록 허용하고싶은 경우 이런 설정을 가능하게 해주는 기능이다. 즉 ACL은 3가지의 퍼미션에 특정 사용자에 대한 특정 그룹에 대해 2가지의 퍼미션을 더 설정해 줄수 있다.

ACL 엔트리는 파일의 ACL을 규정하는 방법이며, "setfacl"명령을 사용하여 설정할 수 있다.

ACL엔트리 형식: entry_type:[uid|gid]:perms

실제 파일에 대해 ACL을 설정해 보자. sample1 이라는 파일은 파일의 소유자에게는 읽기/쓰기를 허용한다. 그룹에게는 읽기 권한만, 기타 사용자에게는 아무권한도 허용하지 않도록 설정되어 있다.

# ls -l sample1
-rw-r----- 1 user01 other 1024 11월10일 10:00 sample1


먼저 이 sample1파일에 대해 "user02" 라는 사용자에게만 읽기/쓰기를 허용하도록 설정해보자. 소유자가 아니어도 읽기/쓰기 권한을 가질수 있도록 매스크를 설정한다.(다른 사용자에게 파일에 대한 허용기준은 이 mask값 범위안에서만 할당 가능하다)

ACL 설정이되어 있는 파일에 대해 "ls -l"을 실행해 보면 파일 퍼미션 옆에 "+" 표시를 볼수가 있다. 파일에 설정된 ACL정보를 보기위해서는 "getfacl" 명령을 사용할 수 있다.

# setfacl -s user::rw-,group::r--,other::---,mask:rw-,user:user02:rw- sample1

# ls -l sample1

-rw-r-----+ 1 user01 other 1024 11월10일 10:00 sample1

# getfacl sample1

# file: sample1

# owner: user01

# group: other

user::rw-

user:user02:rw- #effetive:rw-

group::r-- #effective:r--

mask:rw-
other::---


파일에 설정된 ACL값을 다른 파일에 복사해 줄수도 있다 sample1에 설정된 ACL값을 sample2에 설정해보자. 다음 명령실행결과를 보면 sample1의 ACL값이 그대로 sample2에 설정된 것을 확인할 수 있다.





# getfacl sample1 | setfacl -f sample2

# getfacl sample2

# file: sample2

# owner: user01

# group: other

user::rw-

user:user02:rw- #effetive:rw-

group::r-- #effective:r--

mask:rw-
other::---


이렇게 설정된 ACL값을 변경할때는 "-m" 옵션을 사용할 수 있고 "-d"옵션을 사용하여 ACL값을 삭제할수도 있다.

# setfacl -m user:user02:4 sample1

# getfacl sample1

# file: sample1

# owner: user01

# group: other

user::rw-

user:user02:r-- #effetive:rw-

group::r-- #effective:r--

mask:rw-
other::---



# setfacl -d user:user02 sample1

# file: sample1

# owner: user01

# group: other

user::rw-

group::r-- #effective:r--

mask:rw-
other::---


출처 : 상상공장 페이퍼
2005/09/05 12:17 2005/09/05 12:17

댓글을 남겨주세요.

[로그인][오픈아이디란?]

[펌] 전산망 해킹 침해 사고시 처리절차 설명

Posted at 2005/08/28 01:16 // in 서버™/보안 // by 블루비
전산망 해킹 침해 사고시 처리절차 설명


서 론

이 문서는 당신의 시스템이 침입을 이미 당했을때 유닉스 기계의 보안을 위해
무엇을 할 것인가를 보이고 있다. 이문서는 아직 침입을 당하지 않은 상태라
할지라도 도움이 된다.
※ 이문서는 Compromise FAQ (Version: 2.0 , Christopher William Klaus/
ISS) 을 분석한 내용이다.

1. 침입자의 흔적과 출발지를 다음을 이용하여 분석한다.

===============================================================
1. who ;
사용자 및 사용자의 컴퓨터 확인
2. w ;
사용자 및 사용중인 명령의 확인
3. last ;
사용자들의 로그인/로그아웃 일시 기록 확인
4. lastcomm ;
사용자들의 시스템 명령 및 프로세스 기록 확인
5. netstat ;
네트워크 접속 현황 확인
6. snmpnetstat ;
네트워크관리 시스템에서의 현황
7. 라우터 정보 ;
라우터의 라우팅 및 접속 등의 현황 확인
8. /var/adm/messages ;
전자우편 송수신 현황 기록 확인(많은 침입자들이 자신의 기계로
전자우편 송신)
9. syslog ;
시스템 로그 확인(다른 기계로도 로그를 보낸다)
10. wrapper 로그 ;
외부 시스템 접속 차단 프로그램의 연결
11. 기계의 모든 사용자에게 finger를 하여 어디서 왔는지 점검
===============================================================

참고 : who, w, last, lastcomm은 /var/pacct, /usr/adm/wtmp 의 기
록에 의해보고하는데, 침입자들은 뒷문(Backdoor Program)을 이용하
여 이 로그들을 수정하여 자신의 흔적을 지울 수 있다. 그리고 침입
자가 아직 이런 뒷문이 없다하더라도 아주 쉽게 이로그들을 수정하거
나 지울 수 있다. 하지만 가끔 침입자들은 모든 로그삭제를 잊어버릴
수도 있으며, 특히 비 표준 유닉스 로그를 설치한 경우에 더욱 그렇
다.

2. xinetd나 tcp_wrapper는 당신이 원한다면 외부에서의 모든 접속에
대해 로그를 남길 수 있으며, 침입자가 로그를 수정하거나 지울 수
없도록 이 로그들을 다른 기계에 옮겨두는 것이 좋다 netlog는 다음
에서 가져올 수 있다. 적절한 대책을 세우기 전에 침입자가 ethernet
sniffer로 다른 기계에 어떻게 침입하는지를 모니터링하는 것이 좋다.

3. 외부로 부터 접속하는 기계들을 막고 특히 침입자의 접근을 막기 위
해 네트워크를 중지시킨다. 만약 침입자가 눈치챈다면 당신의 기계에
"rm -rf /"을 실행하여들지 모른다.

4. 시스템 실행 파일의 변경 유무룰 점검하는데, 특히 뒷문프로그램으로
잘 이용되는 다음 프로그램들을 중점 점검한다.

1. /bin/login
2. 모든 /usr/etc/in.* files (예: in.telnetd)
3. /lib/libc.so.* (on Suns).
4. inetd에서 호출되는 모든 것

기타 잘 교체되는 것으로서는 다음과 같은 것이 있다.

1. netstat - 정보를 감추게 한다
2. ps - 프로세스를 감추게 한다 (예: Crack)
3. ls - 디렉토리를 감춘다
4. ifconfig - 이더넷에 대한 promiscuity mode 를 감춘다
5. sum - sum을 수정하지 않고도 실행파일의 체크썸을 올르게 위장
할 수 있으므로 더 이상 교체하지는 않는다. sum 을 믿어
서는 안된다.

파일의 실제 수정 시간을 알기 위해서는 "ls -lac"를 사용한다.
/etc/wtmp 를 점검하여 시스템 시간을 체므하고 CD나 테이프의 원
본과 비교하거나 MD5 체크썸이 이전의 체크썸과 다른지 비교하며,
흔히 off-line으로 저장된 미리 만들어진 체크썸과 cmp 명령으로 비
교한다. 또 흔히 사용되는 뒷문으로서 /bin/time과 같은 setuid 프로그
램인데, 이들은 일반 사용자가 root로 실행할 수 있게 해준다. 이런
프로그램을 찾기 위해서는 다음 명령을 이용하면 된다.

find / -type f -perm -4000 -ls

하다보면 OS 전체를 다시 설치해야될지도 모른다. Tripwire 는 관
리자 몰래 실행파일을 수정하거나 inetd.conf와 같은 시스템파일을 수
정을 방지할 수있다.

5. 사용자들이 자주 자신의 패스워드를 바꿀 수 있도록 해주는 passwd
프로그램으로 교체한다. anlpasswd, npasswd 혹은 passwd+ 등을 설
치하여 적절한 패스워드를 만들 수 있도록 하며, Crack 를 주기적으
로 실행한다. 이것은 ftp://ftp.cert.org/pub/tools.crack에서 가져올 수
있으며, 이 Crack 을 이용하여 사용자들이 어려운 패스워드를 만들도
록 한다. 네트워크에서 평문 패스워드가 전달되는 것이 문제이다.
Smart Hub는 LAN에서 sniffer가 모든 LAN을 도청하는 것을 막을
수 있으며, 혹은 일회용 패스워드를 사용한다.

6. 모든 사용자의 .rhosts, .forward 등을 점검한다. 만약 .rhosts가 "+"
를 가지고 있으면 어떤한 시스템에서도 패스워드 체크 없이접근할 수
있다. COPS는 다음 과 같은 체킹 스크립트를 가지고 있다.

find / -name .rhosts -ls -o -name .forward -ls

의심스러운 모든 파일의 생성 및 수정 시간을 점검하는데 다음을 이
용한다.

find / -ctime -2 -ctime +1 -ls

이것은 이틀전 에서 하루 이후 에 수정된 파일을 찾아준다.

모든 .login, .logout, .profile, .cshrc 들도 적어도 수정일 및 시간 등을
점검 하며, .rhosts 파일이 잠궈진 것은 없는지, news, sundiag, sync
등의 계정에 대한 쉘이 보다 안전을 위해 "/bin/false"로 되어 있어야
하며 "/bin/sh" 등으로 되어 있어서는 안된다. 또한 ". ", ".. " 등의
디렉토리가 없는지 점검하는데 대부분 /tmp,/var/tmp, /usr/spool/* 나
공개적으로 쓰기 할 수 있는 디렉토리에서 많이 발견된다.

7. NFS가 외부에 널리 공개된것은 아닌지 점검한다.
ftp://harbor.ecn.purdue.edu/pub/davy에서 가져올 수 있는 NFSwatch
는 NFS트랜잭션에 대해 로그를 만들어주며, "showmount -e" 를 하
여 적절하게 개방한대로 구성되어 있는지 점검할 수 있다. 256 바이
트를 넘긴 경우에 nfsd는 버그를 가지고 있으며, 또한 당신이 마운트
하고 있는 시스템에 대한 점검도 중요하다. 가능한 "nosuid"플래그를
사용하기 바라며, 다른 호스트나 침입자가 실행하는 NFS마운트된
suid 프로그램을 실행하는 sysadm에의해 침입되기를 바라지는 않는
것이다.

8. 가장 최근의 sendmail을 설치한다. 이전 버젼의 sendmail은 원격지
명령을 실행하도록 한다.

9. 가장 새로운 패치를 설치하도록 한다.

10. 시스템이 취약점이 있는지 점검하는 리스트가 있다.

(1) 원하지 않은 프로세스가 없는지, "rpcinfo -p"를 이용하여 점검한다.

(2) hosts.equiv 에 "+" 가 없는지 점검한다.

(3) tftp를 사용하지 않든가, 사용하기를 원한다면 "-s" 플래그를 사용한다.
이 경우는 대부분 디스크없는 워크스테이션을 위한 경우인데, 적절하게
NFS를 이용할수도 있다. 이것을 root 로 실행하지 않도록 하며,
/etc/inetd.conf에서 다음과 같이 바꾼다.

tftp dgram udp wait nobody /usr/etc/in.tftpd in.tftpd -s /tftpboot

혹은 원치 않는 곳에서의 접근을 막기 위해 tcp_wrapper에서 tftpd에 대
한 부분을 고치고 모든 접속 상황을 로그로 남긴다.

tftp dgram udp wait nobody /usr/etc/tcpd in.tftpd -s /tftpboot

혹은 /etc/hosts.allow 에서 정의된 허용한 곳에서만 접근할 수 있도록
조정한다.

(4) crontab과 at-vobs 를 점검한다. 침입자가 남긴 모든 것을 정리했다고
생각한 후 이것이 어떤 작업을 할 수 있다.

(5) rc.boot, rc.local(SYSV : /etc/rc?.d/*)나 기타 시스템 시작시 실행 파일
들을 점검한다. 가장 좋은 방법은 off-line으로 저장했다가 주기적으로
점검하는 것이며, sendmail.cf, hosts.allow, at.allow, at.deny, cron.allow,
hosts, hosts.lpd 등의 시스템 구성파일들을 점검한다. "aliases"는 메일
확장을 위한 것인데, "uudecode" 등과 같은 것을 가지고 있을 수 있다.
(6) inetd.conf 와 /etc/services 파일에서 침입자가 추가한 불법 프로그램 서
비스가 있는 지 점검한다.

(7) 현재 가지고 있는 모든 로그 파일(pacct, wtmp, lastlog, sulog, syslog,
authlog 등)들을 다른 안전한 곳으로 옮긴다. /tmp/* 파일들을 먼저 살
펴 본 후 재시동(Reboot) 한다.

(8) /etc/passwd 파일의 여벌파일을 가능한 디스켓 등으로 저장한 후 su 및
passwd 프로그램이 뒷문(Backdoor) 가 아님을 확인한 후 root 패스워
드를 바꾼다. 만약 침입자가 su 나 passwd 뒷문을 설치하였다면
/etc/passwd 파일의 패스워드 부분을 모두 "*"로 바꾼다. 또한 침입자
가 패스워드 파일을 가지고 있다면 모든 사용자들의 패스워드를 알아낼
가능성이 있으며, 장기간 사용하지 않는 사용자의 패스우드를 바꿀 수
도 있다. NIS서버에서는 단순히 /etc/passwd 뿐 아니라 NIS 맵에 해
당하는 것들도 점검해야 한다.

(9) 익명FTP나 다른 네트워크 서비스 시스템들이 적절하게 구성되어 있는
지 점검한다.

(10) inetd를 다시 설치한다.

(11) 콘솔 만이 "secure" 단말로 정의하여 다른 단말에서 root 로 로그인할
수 없도록 한다.
(12) hosts.equiv, .rhosts, hosts.lpd 에 "#" 이 있는지 점검한다. 만약 침입자
가 "#" 을 기계이름으로 정의하였다면 누구나 신뢰하는 호스트로 정의
된다.
(13) 침입자에 대한 경각심을 늦추지 않는다.

11. 침입자가 경유한 모든 기관의 시스템에 전자우편을 보내고
cert@certcc.or.kr 로도 메일을 보내 협조를 요청한다.


12. 침임자들의 시도를 방지하는 좋은 방법은 방화벽이라는 전산망 침입
차단시스템을 설치 운영하는 것이다. 하지만 방화벽은 가격이 비싸고
필터링에 따른 네트워크의 속도가 저하될 가능성이 크다. 라우터에서
NFS(2049/UDP), portmap(111/UDP) 를 막아야 한다. DNS 와 NTP
포트만 제외하고 모든 패킷을 막고, 출발지라우팅(Source Routing),
모든 IP-Forwarding 패킷을 사용하지 않는다.

출처 : 솔실대 수원남자님
2005/08/28 01:16 2005/08/28 01:16

댓글을 남겨주세요.

[로그인][오픈아이디란?]