RadarURL

조회 수 2104 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

제가 적용해보고 일주일 본 상태인데 1건도 스팸 등록되지 않았습니다.

당연히 스팸 공격이 자주당했던 곳을 비회원 작성으로 풀었는데도 입니다.

준비물

xe/modules/board/board.controller.php

xe/modules/editor/skins/스킨명/editor.html

사용하시는, 스팸 등록이 이루워지는 모듈의 에디터 스킨을 무엇으로 설정하셨는지 확인하신후 해당 폴더로 이동해서 editor.html 파일을 편집기로 엽니다.

제일 최상줄에 아래를 추가합니다.

1
<input type="hidden" name="{base64_encode($request_uri.date('Ymd'))}" value="Y" />


board.controller.php 파일을 편집기로 엽니다.

procBoardInsertDocument(), procBoardInsertComment() 함수를 검색합니다.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/**
* @brief 문서 입력
**/
function procBoardInsertDocument() {
// 권한 체크
if($this->module_info->module != "board") return new Object(-1, "msg_invalid_request");
if(!$this->grant->write_document) return new Object(-1, 'msg_not_permitted');
$logged_info = Context::get('logged_info');
// 글작성시 필요한 변수를 세팅
$obj = Context::getRequestVars();
/* 스팸 대응 2010.08.05 */
if($obj->{strtolower(base64_encode(Context::getRequestUri().date('Ymd')))} != 'Y') return new Object(-1, 'msg_not_permitted');
$obj->module_srl = $this->module_srl;
if($obj->is_notice!='Y'||!$this->grant->manager) $obj->is_notice = 'N';
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/**
* @brief 코멘트 추가
**/
function procBoardInsertComment() {
// 권한 체크
if(!$this->grant->write_comment) return new Object(-1, 'msg_not_permitted');
$logged_info = Context::get('logged_info');
// 댓글 입력에 필요한 데이터 추출
/* 스팸 대응 2010.08.05 */
$obj = Context::gets('document_srl','comment_srl','parent_srl','content'+
','password','nick_name','member_srl','email_address','homepage','is_secret','notify_message',strtolower(base64_encode(Context::getRequestUri().date('Ymd'))));
$obj->module_srl = $this->module_srl;
/* 스팸 대응 2010.08.05 */
if($obj->{strtolower(base64_encode(Context::getRequestUri().date('Ymd')))} != 'Y') return new Object(-1, 'msg_not_permitted');
// 원글이 존재하는지 체크
$oDocumentModel = &getModel('document');
$oDocument = $oDocumentModel->getDocument($obj->document_srl);
if(!$oDocument->isExists()) return new Object(-1,'msg_not_permitted');


스팸 대응이라는 주석문 바로 밑에 것들을 추가 또는 수정하세요.

테스트는 위 내용을 모두 적용 후 캐쉬 재생성 하시고 테스트하려는 모듈로 가셔서 에디터 스킨을 위 내용 추가하지 않은 에디터로 임시로 바꾸세요. 그리고 로그인 상태로 글 등록을 하세요.

권한에 의한 오류 팝업이 나오면 성공입니다.

XML, BlogApi도 권한 오류를 내뿜습니다.

XML, BlogApi에서 본인의 홈페이지로 글을 써야겠다고 하시는 분들은 어쩔 수 없어요.

board.controller.php 수정 어려우신 분들은 첨부파일로 올려두겠습니다.

꼭 미리 기존에 있던 파일을 백업 받으신 후 덮어씌워주세요.

-- 2010.08 16 추가 --
-- 2011.05 09 수정 --

회원 가입 부분에도 추가합니다.

./modules/member/skins/스킨명/signup_form.html

id가 fo_insert_member로 되어있는 <form> 태그 바로 밑에 아래를 추가하세요.

1
<input type="hidden" name="{base64_encode($request_uri.date('Ymd'))}" value="Y" />

./modules/member/member.controller.php

procMemberInsert() 함수안에 스팸 대응이라는 주석문이 있는곳을 추가, 수정하세요.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/**
* @brief 회원 가입
**/
function procMemberInsert() {
if(Context::getRequestMethod() == "GET") return new Object(-1, "msg_invalid_request");
$oMemberModel = &getModel('member');
$config = $oMemberModel->getMemberConfig();
// before 트리거 호출
$trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'before', $config);
if(!$trigger_output->toBool()) return $trigger_output;
// 관리자가 회원가입을 허락하였는지 검사
if($config->enable_join != 'Y') return $this->stop('msg_signup_disabled');
// 약관에 동의하였는지 검사 (약관이 있을 경우만)
if($config->agreement && Context::get('accept_agreement')!='Y') return $this->stop('msg_accept_agreement');
// 필수 정보들을 미리 추출
/* 스펨 대응 2010.08.13 */
$args = Context::gets('user_id','user_name','nick_name','homepage','blog','birthday','email_address','password','allow_mailing','find_account_question','find_account_answer',strtolower(base64_encode(Context::getRequestUri().date('Ymd'))));
/* 스펨 대응 2010.08.13 */
if($args->{strtolower(base64_encode(Context::getRequestUri().date('Ymd')))} != 'Y') return new Object(-1, 'msg_invalid_request');
$args->member_srl = getNextSequence();
// 넘어온 모든 변수중에서 몇가지 불필요한 것들 삭제

 

출처 : http://www.xpressengine.com/tip/19069968

?

공부 게시판

공부에 도움되는 글을 올려주세요.

  1. [공지] 공부 게시판 입니다.

    Date2003.08.18 By처누 Views931494
    read more
  2. 홍콩 보내주다를 뜻하는 영어 표현 한가지를 노래를 통해 배워보자

    Date2025.10.28 Category연애 ByJaeSoo Views8
    Read More
  3. 향수 잔향 기간별 구분

    Date2025.10.28 Category생활 ByJaeSoo Views7
    Read More
  4. Question about Korean - What does 홍콩을 보내다 mean?

    Date2025.10.28 Category생활 ByJaeSoo Views7
    Read More
  5. 리눅스 서버 설치 중 에러 "Failed to find a suitable stage1 device"

    Date2025.10.03 Category유닉스/리눅스 ByJaeSoo Views41
    Read More
  6. Linux 11 . Linux 설치 시 lvm 수동설정

    Date2025.10.03 Category유닉스/리눅스 ByJaeSoo Views31
    Read More
  7. [Rocky Linux] 누구나 쉽게 따라하는 Rocky Linux 9.0 OS 다운로드 및 설치 방법~!!

    Date2025.10.03 Category유닉스/리눅스 ByJaeSoo Views48
    Read More
  8. Linux/Rocky Linux Rocky Linux : Composer 설치

    Date2025.09.29 Category유닉스/리눅스 ByJaeSoo Views46
    Read More
  9. [Rocky Linux] 록키 리눅스 최신 업데이트 적용 방법

    Date2025.09.29 Category유닉스/리눅스 ByJaeSoo Views47
    Read More
  10. rocky linux 커널 업데이트

    Date2025.09.29 Category유닉스/리눅스 ByJaeSoo Views41
    Read More
  11. [Windows] OWASP ZAP 사용법

    Date2025.09.29 Category웹서버,WAS ByJaeSoo Views53
    Read More
  12. [웹 취약점] 웹서버 디렉토리 리스팅 방지

    Date2025.09.29 Category웹서버,WAS ByJaeSoo Views57
    Read More
  13. Clonezilla(클론질라) 백업파일 하드디스크로 복구 방법

    Date2025.09.28 Category유닉스/리눅스 ByJaeSoo Views47
    Read More
  14. 클론질라 사용 방법 - OS 이미지 백업 CloneZilla

    Date2025.09.28 Category유닉스/리눅스 ByJaeSoo Views62
    Read More
  15. [Linux / Rocky] FTP 접속 관련 설정 실습 예제

    Date2025.09.23 Category유닉스/리눅스 ByJaeSoo Views79
    Read More
  16. Could not reliably determine the server's fully qualified domain name

    Date2025.09.23 Category유닉스/리눅스 ByJaeSoo Views77
    Read More
  17. [아파치] 아파치 웹서버에 .htaccess 파일 설정하는 방법

    Date2025.09.23 Category유닉스/리눅스 ByJaeSoo Views66
    Read More
  18. [Linux] Apache web server의 rewrite module 사용하기 [출처] [Linux] Apache web server의 rewrite module 사용하기|작성자 g00dmoney

    Date2025.09.23 Category유닉스/리눅스 ByJaeSoo Views62
    Read More
  19. 록키 리눅스 9.1에서 apache, mysql, PHP 설치

    Date2025.09.23 Category유닉스/리눅스 ByJaeSoo Views68
    Read More
  20. [권한문제] 라이믹스 Fatal error: Uncaught Rhymix\Framework\Exception: Cannot write template cache file

    Date2025.09.23 Category유닉스/리눅스 ByJaeSoo Views59
    Read More
  21. 라이믹스 php 에러 표시

    Date2025.09.23 Category유닉스/리눅스 ByJaeSoo Views54
    Read More
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 126 Next
/ 126


즐겨찾기 (가족)

JAESOO's HOMEPAGE


YOUNGAE's HOMEPAGE


장여은 홈페이지


장여희 홈페이지


장여원 홈페이지


즐겨찾기 (업무)

알리카페 홀릭

숭실대 컴퓨터 통신연구실 (서창진)

말레이시아 KL Sentral 한국인 GuestHouse


즐겨찾기 (취미)

어드민아이디

유에코 사랑회

아스가르드 좋은사람/나쁜사람

JServer.kr

제이서버 메타블로그

재수 티스토리


즐겨찾기 (강의, 커뮤니티)

재수 강의 홈페이지


한소리


VTMODE.COM


숭실대 인공지능학과


숭실대 통신연구실


베너