朋友给我一个ASP网站的后台登陆∶ad_login.asp,但密码不对,不知如何进入后台,怎么改?请高手指教,如下:
<!--#includefile="conn.asp"--><!--#includefile="MD5.asp"--><%ifRequest.Cookies("vensh...
<!--#include file="conn.asp"-->
<!-- #include file="MD5.asp" -->
<%if Request.Cookies("venshop")("admin_name")<>"" and Request.Cookies("venshop")("admin_pass")<>"" and Request.Cookies("venshop")("admin_class")<>"" then response.redirect "ad_manage.asp"%>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href=inc/css.css rel=STYLESHEET type=text/css>
<script language="JavaScript">
<!--
function check_null(){
if (document.form1.admin_name.value==""){
alert("请输入用户名!");
return false;
}
if (document.form1.admin_pass.value==""){
alert("请输入密码!");
return false;
}
if (document.form1.admin_yz.value==""){
alert("请输入验证码!");
return false;
}
return true;
}
// -->
</script>
<%
if request("action")="login" then
admin_name=DelStr(request("admin_name"))
admin_pass=md5(DelStr(request("admin_pass")))
admin_yz=DelStr(request("admin_yz"))
if InStr(admin_name,"'") > 0 or InStr(admin_pass,"'") >0 then
response.write "请不要使用非法字符,<a href=ad_login.asp><font color=#ff0000>返回</font></a>!"
Session("GetCode")=""
response.end
end if
if request("admin_name")="" or request("admin_pass")="" then
response.write "请输入用户和密码,<a href=ad_login.asp><font color=#ff0000>返回</font></a>!"
Session("GetCode")=""
response.end
end if
if request("admin_yz")="" then
response.write "请输入验证码,<a href=ad_login.asp><font color=#ff0000>返回</font></a>!"
Session("GetCode")=""
response.end
end if
if int(admin_yz)<>int(Session("GetCode")) then
response.write "错误的验证码,<a href=ad_login.asp><font color=#ff0000>返回</font></a>!"
Session("GetCode")=""
response.end
end if
set rs=server.createobject("adodb.recordset")
sql="select * from venshop_admin where admin_name='"&admin_name&"' and admin_pass='"&admin_pass&"'"
rs.open sql,conn,1,3
if rs.eof then
response.write "操作有误,请检查用户密码,<a href=ad_login.asp><font color=#ff0000>返回</font></a>!"
Session("GetCode")=""
response.end
elseif not rs.eof then
lastip = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If lastip = "" Then lastip = Request.ServerVariables("REMOTE_ADDR")
rs("lastip")=lastip
rs("lasttime")=now()
rs("landtimes")=rs("landtimes")+1
rs.update
Session("GetCode")=""
Response.Cookies("venshop")("admin_name")=trim(rs("admin_name"))
Response.Cookies("venshop")("admin_pass")=trim(rs("admin_pass"))
Response.Cookies("venshop")("admin_class")=trim(rs("admin_class"))
response.redirect "ad_manage.asp"
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
else
l_text1=" "
l_text2="用户名:"
l_text3="密 码:"
l_text4="验证码:"
l_text5=" 管理员登录 "
response.write "<title>管理员登陆</title>"
response.write "<br>" 展开
<!-- #include file="MD5.asp" -->
<%if Request.Cookies("venshop")("admin_name")<>"" and Request.Cookies("venshop")("admin_pass")<>"" and Request.Cookies("venshop")("admin_class")<>"" then response.redirect "ad_manage.asp"%>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href=inc/css.css rel=STYLESHEET type=text/css>
<script language="JavaScript">
<!--
function check_null(){
if (document.form1.admin_name.value==""){
alert("请输入用户名!");
return false;
}
if (document.form1.admin_pass.value==""){
alert("请输入密码!");
return false;
}
if (document.form1.admin_yz.value==""){
alert("请输入验证码!");
return false;
}
return true;
}
// -->
</script>
<%
if request("action")="login" then
admin_name=DelStr(request("admin_name"))
admin_pass=md5(DelStr(request("admin_pass")))
admin_yz=DelStr(request("admin_yz"))
if InStr(admin_name,"'") > 0 or InStr(admin_pass,"'") >0 then
response.write "请不要使用非法字符,<a href=ad_login.asp><font color=#ff0000>返回</font></a>!"
Session("GetCode")=""
response.end
end if
if request("admin_name")="" or request("admin_pass")="" then
response.write "请输入用户和密码,<a href=ad_login.asp><font color=#ff0000>返回</font></a>!"
Session("GetCode")=""
response.end
end if
if request("admin_yz")="" then
response.write "请输入验证码,<a href=ad_login.asp><font color=#ff0000>返回</font></a>!"
Session("GetCode")=""
response.end
end if
if int(admin_yz)<>int(Session("GetCode")) then
response.write "错误的验证码,<a href=ad_login.asp><font color=#ff0000>返回</font></a>!"
Session("GetCode")=""
response.end
end if
set rs=server.createobject("adodb.recordset")
sql="select * from venshop_admin where admin_name='"&admin_name&"' and admin_pass='"&admin_pass&"'"
rs.open sql,conn,1,3
if rs.eof then
response.write "操作有误,请检查用户密码,<a href=ad_login.asp><font color=#ff0000>返回</font></a>!"
Session("GetCode")=""
response.end
elseif not rs.eof then
lastip = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If lastip = "" Then lastip = Request.ServerVariables("REMOTE_ADDR")
rs("lastip")=lastip
rs("lasttime")=now()
rs("landtimes")=rs("landtimes")+1
rs.update
Session("GetCode")=""
Response.Cookies("venshop")("admin_name")=trim(rs("admin_name"))
Response.Cookies("venshop")("admin_pass")=trim(rs("admin_pass"))
Response.Cookies("venshop")("admin_class")=trim(rs("admin_class"))
response.redirect "ad_manage.asp"
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
else
l_text1=" "
l_text2="用户名:"
l_text3="密 码:"
l_text4="验证码:"
l_text5=" 管理员登录 "
response.write "<title>管理员登陆</title>"
response.write "<br>" 展开
4个回答
展开全部
用户名和密码是存到服务器里的吧,这是jsp页面貌似不能改
select * from venshop_admin where admin_name='"&admin_name&"' and admin_pass='"&admin_pass&"'"
他访问的是数据库里的venshop_admin表,你要有后台数据库可以去这找找
select * from venshop_admin where admin_name='"&admin_name&"' and admin_pass='"&admin_pass&"'"
他访问的是数据库里的venshop_admin表,你要有后台数据库可以去这找找
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
去venshop_admin数据库里把密码那个地方的数值删除,毕竟MD5加密的,不太容易知道密码,从数据库可以看到用户名等信息,直接输入用户名回车就行了,密码就当清空了~~~~~ 从conn.asp里找到数据源,一般应该是access的吧,如果后缀改成.asp了,那就把.asp改成.mdb就可以看到具体信息了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
要去数据库里找venshop_admin 这张表里的账号和密码,光给ASP代码是不可能知道用什么密码登陆的
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询