public void UrlReferrerCheck(string refferUrl) { if (Request.UrlReferrer == null) { string script = "< script>alert('직접 접근할 수 없습니다!!');" +"location.href='/Default.aspx'; "; Page.RegisterClientScriptBlock(" done ", script); //Response.Redirect(refferUrl); } else { string refer = Request.UrlReferrer.ToString(); string ServerPath = Request.Url.ToString(); ServerPath = ServerPath.Substring(0, ServerPath.LastIndexOf(" / ")); if (refer.IndexOf(ServerPath) == -1) { string script = " < script> alert('직접 접근할 수 없습니다!!'); " + " location.href = '/Default.aspx'; "; Page.RegisterClientScriptBlock(" done ", script); //Response.Redirect(refferUrl); } } }
2003/10/24
Referrer값 체크로 특정파일에 직접 접근 거부
레퍼러값을 체크하는 방법 2가지 입니다. 먼저, 레퍼러값이 null 값일경우 Default.aspx 페이지로 리다이렉팅. 만일 레퍼러값이 있을경우 현재, 사이트의 도메인과 레퍼러주소의 도메인이 다를경우 다시 Redirect 를 합니다. 바로 Redirect 를 해도 되지만, 자바스크립트로 Alert 를 띄운후 처리..
가장 많이 본 글
-
일반적인 원인 : 장치 드라이버에서 읽기 전용 메모리에 쓰기를 시도했습니다. 이 문제는 업그레이드에만 제한된 문제는 아니지만 업그레이드 중에 발생할 수 있습니다. 해결 방법 : 1. Microsoft 웹 사이트에 있는 Online Crash...
-
고가용 SQL Server 데이터베이스 미러링은, SQL Server 2005 에서 새롭게 지원하는 기능입니다. 데이터베이스 미러링은, 마이크로소프트에서 홍보를 하기는 하지만 정식적인 기술지원은 하지 않는다고 합니다. 필요하면 장애를 감수하고서라도 설...
-
WINS의 취약점으로 인한 권한 상승 문제점 (943485) http://www.microsoft.com/korea/technet/security/bulletin/MS08-034.mspx 이 보안 업데이트는 비공개적으로 보고된 WINS(Windows...
댓글 없음:
댓글 쓰기