好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

绝色美图小偷漏洞 - 网站安全 - 自学php

利用条件:缓存开启 漏洞 文件:./ html .php 漏洞代码:   show sourceif ($_GET ['page'] == '') {         $html = $_GET ['id'] . '.html'; } else {         $html = $_GET ['id'] . '_' . $_GET ['page'] . '.html'; } if ($cache == 'on')//缓存开启{         define ( 'CACHE_FILE',VV_CACHE . "/" . $news . $html );// cache/p/          //构造?id=a.php; 形成a.php;.html  文件生成在/cache/p/a.php;.html     //apache iis6可利用 略鸡肋         $filem = @filemtime ( CACHE_FILE );         if (! file_exists ( CACHE_FILE ) or ($filem + ($htmlcache * 3600)) <= time ()) {                 if (! file_exists ( VV_CACHE )) {                         chmod ( 'cache', 0777 ); //生成一级缓存目录                         mkdir ( 'cache', 0777 );                 }                 if (! file_exists ( VV_CACHE ."/".$news )) {                         chmod ( VV_CACHE ."/".$news, 0777 );//生成二级缓存目录                         mkdir ( VV_CACHE ."/".$news, 0777 );                 }                 ob_start ();                 include_once (VV_RULE ."/html.php");                 include_once (VV_TEMP ."/$template/html.tpl");                 $contents = ob_get_contents ();                 ob_end_clean ();                 if(!empty($body)){                 file_put_contents ( CACHE_FILE, $contents );                 //这里是写文件 文件名我们已经可以控制了 那么内容呢                 //$contents要写的内容就是ob_start ob_end_clean之间的包含                 //那么这个包含的内容是什么呢,其实就是小偷调用的来源地址 然后替换成自己的一个模板                 //远程地址就是鸡肋的条件之二了 官方包括程序都是用的一个地址 如果修改了地址,一样可以在首页查看到                 //现用的地址HdhCmsTest2cto测试数据 程序是织梦的 如果取得这个站的权限就可以控制内容了 所以肯定很多人觉得这个属于迂回了                 //条件就是这么让人蛋疼                  echo file_get_contents ( CACHE_FILE );                 }         } else {                 echo file_get_contents ( CACHE_FILE );          } } 漏洞利用:   HdhCmsTest2cto测试数据 /html.php?id=a.php;  日下远程调用的地址内容和url参数可控制 小BUG 真正条件达到了还是可以getshell 可以无视!   本文来自Frandy's Blog 作者:flower 出处:t00ls  

查看更多关于绝色美图小偷漏洞 - 网站安全 - 自学php的详细内容...

  阅读:44次