반응형

 [출처] [WASC-36] SSI Injection 번역|작성자 ezno

http://blog.naver.com/PostView.nhn?blogId=ezno&logNo=130142788938



WASC-36 의 번역입니다. 

http://projects.webappsec.org/w/page/13246964/SSI%20Injection )


SSI Injection

Page history last edited by Robert Auger 2 years, 6 months ago

Project: WASC Threat Classification

Threat Type: Attack

Reference ID: WASC-36


SSI Injection

 SSI Injection (Server-side Include)  server side exploit 기술로서공격자가 웹 애플리케이션으로 나중에 웹 서버에 의해 실행 될 수 있는 코드를 보낼 수 있다. SSI Injection server-side로 해석된 HTML file 삽입하기 전에 사용자 제공 데이터를 유용하게 보이기 위해 웹 애플리케이션의 오류를 악용한다

 

 HTML 웹 페이지를 제공하기 전에웹 서버는 아마 Server-side  Include된 구문을 사용자에게 제공하기 전에 분석하고 실행시킬지 모른다.( 예를 들면게시판방명록 혹은 관리 시스템 콘텐츠 등), 웹 애플리케이션은 사용자 제공데이터에 web page의 소스코드를 삽입할 것이다

 만약 공격자가 Server-side Include 구문을 실행시킨다면그는 아마 임의적으로 운영체제의 명령어 를 실행시키거나제한된 파일의 내용을 포함 시킬 수 있을 것이다이러한 명령은 웹 서버 사용자의 권한 level로 실행 될 것이다.


Example

 다음의 SSI tag는 공격자가 UNIX 기반의 시스템의 root 디렉토리 목록을 보여준다.

<!--#exec cmd="/bin/ls /" -->

  다음의 SSI tag는 공격자가 database 연결 string을 얻도록 하거나, .NET 설정 파일에 다른 중요한 데이터를 포함시킨다

<!--#INCLUDE VIRTUAL="/web.config"-->

 

Mitigation

다음의 체크항목을 확인해야 한다.

 

오직 페이지가 필요로하는 지정된 SSI만 실행가능하게 하고 나머지는 전부 실행할 수 없도록 한다

사용자가 제공한 HTML entity 를 인코딩하여 페이지에 전달하기 전에 SSI 실행 권한을 확인한다.

페이지가 웹 서버 유저가 아닌 파일의 소유주로서 실행시킬 수 있도록 SUExec[5] 를 사용한다   

 

References

"Server Side Includes (SSI)" - NCSA HTTPd

[1] http://hoohoo.ncsa.uiuc.edu/docs/tutorials/includes.html

 

"Security Tips for Server Configuration" - Apache HTTPD

[2] http://httpd.apache.org/docs/misc/security_tips.html#ssi

 

"Header Based Exploitation: Web Statistical Software Threats" - CGISecurity.com

[3] http://www.cgisecurity.net/papers/header-based-exploitation.txt

 

"A practical vulnerability analysis"

[4] http://hexagon.itgo.com/Notadetapa/a_practical_vulnerability_analys.htm

 

"Apache suEXEC Support"

[5] http://httpd.apache.org/docs/1.3/suexec.html http://httpd.apache.org/docs/2.0/suexec.html

 

"Apache Tutorial: Introduction to Server Side Includes"

[6] http://httpd.apache.org/docs/2.0/howto/ssi.html http://httpd.apache.org/docs/1.3/howto/ssi.html

 

"Testing for SSI Injection"

[7] http://www.owasp.org/index.php/Testing_for_SSI_Injection

 

Server Side Include (SSI) Injection

[8] http://capec.mitre.org/data/definitions/101.html

 


반응형

+ Recent posts