标签 ‘PHP’ 下的日志
php create_function commond injection vulnerability
php use create_function function to CREATE an anonymous function like below(stolen from php_manual):
————————————————–
Description
string create_function ( string args, string code )
Creates an anonymous function from the parameters passed, and returns a unique name for it. Usually the args will be passed as a single quote delimited string, and this is also recommended for the code. The reason for using single quoted strings, is to protect the variable names from parsing, otherwise, if you use double quotes there will be a need to escape the variable names, e.g. \$avar.
阅读全文 »
[Tips]关于PHP的本地包含
Author: Ryat
利用本地包含时常常需要用%00来截断后面的字符串,但在GPC为ON时%00是会被转义的,那么还有其他方法么?
其实以前就有人提到过用一定数量的/突破操作系统对文件名的长度限制来截断后面的字符串,详见:http://cloie.it580.com/?p=51
文里提到只可以在WIN下利用,其实部分Linux主机下也可以,只是/的数量要更多些(要使文件路径名长度大于4096字节),看看下面的代码片断:
阅读全文 »
PHP字符编码绕过漏洞总结
作者:Safe3
其实这东西国内少数黑客早已知道,只不过没有共享公布而已。有些人是不愿共享,宁愿烂在地里,另外的一些则是用来牟利。
该漏洞最早2006年被国外用来讨论数据库字符集设为GBK时,0xbf27本身不是一个有效的GBK字符,但经过 addslashes() 转换后变为0xbf5c27,前面的0xbf5c是个有效的GBK字符,所以0xbf5c27会被当作一个字符0xbf5c和一个单引号来处理,结果漏洞就触发了。
mysql_real_escape_string() 也存在相同的问题,只不过相比 addslashes() 它考虑到了用什么字符集来处理,因此可以用相应的字符集来处理字符。在MySQL 中有两种改变默认字符集的方法。
阅读全文 »