사이트 내 전체검색
[linux] 아파치에서 서버정보 숨기기
로빈아빠
https://cmd.kr/server/270 URL이 복사되었습니다.

본문

아파치에서 서버정보 숨기기

먼저, 아무런 설정을 하지 않았을때, 웹서버가 어떤 정보를 보여주는지
다음과 같이 telnet 접속을 해보지요. GET / HTTP/1.0 를 입력해줍니다.

gate@silver> telnet localhost 80 Trying 127.0.0.1... Connected to gate.eunjea.org. Escape character is '^]'. GET / HTTP/1.0 HTTP/1.1 200 OK Date: Sat, 25 Nov 2000 16:04:47 GMT Server: Apache/1.3.14 (Unix) PHP/4.0.3 Last-Modified: Thu, 16 Mar 2000 22:05:43 GMT ETag: "12aee-524-38d15ab7" Accept-Ranges: bytes Content-Length: 1316 ..... ..... ..... Connection closed by foreign host.

위와 같이 아파치 1.3.14와 php 4.0.3 을 사용하고 있다는 것을 보여줍니다.

이런 정보들을 보여 주고 싶지 않다면 아파치 설정파일에 (아파치 설정 파일
은 httpd.conf를 말함)

ServerTokens Prod[uctOnly]
([] 안은 생략될수 있음)를 넣어주면 됩니다.

몇가지 다른 키워드가 있는데 다음과 같습니다.

ServerTokens Prod[uctOnly]
: Apache 만 보여줌
ServerTokens Min[imal]
: Apache 버젼만 보여줌
ServerTokens OS
: 아파치 버젼과 운영체제를 보여줌
ServerTokens Full (또는 지시하지 않았을때)
: 모두 보여줌

ServerTokens 옵션은 아파치 1.3 이후 버젼에서 사용할수 있으며,
ProductOnly 키워드는 1.3.12 이후 버젼에 추가되었습니다.

#####################################################################
#####################################################################

WebServer 정보 숨기기(Apache)

웹서버에 보통 접속하면 웹서버의 버전 및 설치된 모듈정보를 쉽게 알아볼 수 있습니다.
이를 통해 해커가 취약점을 알아내어 공격할 수 있습니다.

$ telnet attack.interpia98.net 80 Trying 123.123.123.123... Connected to attack.interpia98.net. Escape character is '^]'. GET / HTTP/1.0 HTTP/1.1 403 Forbidden Date: Thu, 22 Feb 2001 11:51:41 GMT Server: Apache/1.3.17 (Unix) PHP/4.0.4pl1 Connection: close Content-Type: text/html; charset=iso-8859-1

위에서 버시면 attack.interpia98.net이란 서버가 Apache 1.3.17을 사용하고
PHP 4.0.4pl1을 사용하는 것을 알 수 있습니다.

httpd.conf에 아래와 같은 키워드를 사용하면 웹서버 정보 변경 및 숨길 수 있습니다. 아래에서 []표시는 생략 가능

ServerTokens Prod[uctOnly] Server sends (e.g.): Server: Apache ServerTokens Min[imal] Server sends (e.g.): Server: Apache/1.3.0 ServerTokens OS Server sends (e.g.): Server: Apache/1.3.0 (Unix) ServerTokens Full (or not specified) Server sends (e.g.): Server: Apache/1.3.0 (Unix) PHP/3.0 MyMod/1.2

위 옵션은 1.3.x 이 후 버전에서 사용합니다.

위 옵션 중 ServerTokens Prod를 추가해 보고 다시 접속해 보면 아래와 같습니다.

$ telnet attack.interpia98.net 80 Trying 123.123.123.123... Connected to attack.interpia98.net. Escape character is '^]'. GET / HTTP/1.0 HTTP/1.1 403 Forbidden Date: Thu, 22 Feb 2001 11:56:34 GMT Server: Apache Connection: close Content-Type: text/html; charset=iso-8859-1

댓글목록

등록된 댓글이 없습니다.

1,139 (10/23P)

Search

Copyright © Cmd 명령어 3.14.133.126