728x90

검색엔진이 긁어가는 것 막기 (robots.txt 이용)

검색엔진이 자동으로 긁어가는 것을 막는 방법이다...

단순히 아래의 두 줄을 메모장 등에서 입력하고 파일명을 "robots.txt"로 저장해서 웹서버의 최상단 디렉토리에 올려놓기만 하면 된다.

robots.txt
-----------------------------------------------------------------------------------------------------------
User-agent: *
Disallow: /
--------------------------------------------------------------------------------------------
위의 두줄데로 설정하면 모든 검색엔진에 대해서 모든것을 막는다는 의미이다...



검색엔진별로 노출을 막고자 하면, 아래의 검색엔진별로 선택해서 사용하세요..^^

//모든 검색 엔진 막기
User-agent: *
Disallow: /

//네이버 로봇 막기
User-agent: cowbot
Disallow: /

//구글 로봇 막기
User-agent: Googlebot
Disallow: /
User-agent: Googlebot-Image
Disallow: /

야후 로봇 막기
User-agent: Slurp
Disallow: /
User-agent: Yahoo-MMCrawler
Disallow: /

엠파스봇 로봇 막기
User-agent: empas
Disallow: /

MSN
User-agent: MSNBot
Disallow: /

첫눈
User-agent: 1Noonbot 1.0
Disallow: /



검색엔진이 긁어가는 것 막기 (메타태그 이용법)

이 방법 외에도 html 페이지에 메타태그를 써서 검색엔진을 막을 수 있습니다.

[meta name="robots" content="noindex,nofollow"]

위 소스를 [head] 사이에 넣어주면 됩니다.


구글쪽에서 검색안된다고 메일 올경우는 아래와같이 바꿔주시면 됩니다.
User-agent: *
Disallow: /

User-agent: Googlebot
Disallow:

User-agent: cowbot
Disallow:

User-agent: Googlebot-Image
Disallow:

User-agent: Slurp
Disallow:

User-agent: empas
Disallow:

User-agent: MSNBot
Disallow:

User-agent: 1Noonbot 1.0
Disallow:



robots.txt 가 아닌 소스 하부페이지에서 검색을 차단하고 싶으면
소스 상단에 아래와같이 입력하면 된다.

<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW" >

 

[사이트보안] 1편 - 구글이나 네이버등 검색로봇 긁어가기 막는법


구글의 강력한 긁어가기식 로봇 검색으로 울산지역 ㅌ 케이블방송의

가입자현황이 담긴 XLS 파일이 유출되는 사고가 있었습니다.


구글이나 네이버 로봇들이 웹서버들의 인증이 안걸린 디렉토리들을

거의 다 뚫고들어오기때문인데요, 검색어로 "관리자모드"나

"회원명단" 등으로 검색해보면 심심치않게 개인정보들이 나타납니다.


주민번호가 담긴 신경외과협회 회원명단이나 포항시 공무원정보

주민번호등도 엄청나게 나타나기때문에 이런 긁어가기식의 검색 로봇을

사이트관리자로서 차단하는 방법을 찾아보고 소개합니다.


웹사이트 wwwroot 루트디렉토리에 robots.txt 파일을 하나 만듭니다.

내용에

User-agent: *
Disallow: /

라고 하시면 모든 긁어가기 검색에서 제외됩니다.


To allow all robots complete access (몽땅 긁어가기 허락)
User-agent: *
Disallow:

Or create an empty "/robots.txt" file. (빈파일 만들기로 해도 됨)

To exclude all robots from part of the server
(일부분 긁어가기 제외)

User-agent: *
Disallow: /cgi-bin/
Disallow: /tmp/
Disallow: /private/

To exclude a single robot (배드봇이란 검색로봇만 긁어가기 제외)
User-agent: BadBot
Disallow: /


To allow a single robot (웹크롤러 검색로봇만 긁어가기 허락)
User-agent: WebCrawler
Disallow:


To exclude all files except one (한군데 빼고 몽땅 긁어가기 허락)
This is currently a bit awkward, as there is no "Allow" field. The easy way is to put all files to be disallowed into a separate directory, say "docs", and leave the one file in the level above this directory:

User-agent: *
Disallow: /~joe/docs/

위 내용들은 http://www.robotstxt.org 참고하시구요



개인들은 웹페이지의 메타태그에다

META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"

라고 해서 그 웹페이지를 긁어가기로 부터 보호할수 있습니다.


In a nutshell, when a Robot vists a Web site, say
http://www.foobar.com/, it firsts checks for
http://www.foobar.com/robots.txt. If it can find this document, it will
analyse its contents for records like:

User-agent: *
Disallow: /

 

728x90

'프로그래밍' 카테고리의 다른 글

웹 보안 취약점 대응 방안  (0) 2014.03.25
robots.txt 설정하기  (0) 2013.07.28
XSS 기본 방어 방법  (0) 2013.04.19
초대장 필요하신 분 받아가세요. [마감되었습니다.]  (15) 2012.07.09
주민번호 알고리즘  (0) 2012.06.20

+ Recent posts