当前位置:网站首页>ThinkPHP show method parameter controllable command execution
ThinkPHP show method parameter controllable command execution
2022-06-30 14:20:00 【Ff. cheng】
Vulnerability Details
show Method parameter controllable rce
Loophole recurrence
Controller write demo
<?php
namespace Home\Controller;
use Think\Controller;
class IndexController extends Controller {
public function index($n){
$this->show($n);
}
}
When template engine (TMPL_ENGINE_TYPE) There are not two cases at the same time 1.php 2. Think
One 、php
Pass in Utilization mode :eval Execute code
url/?n=<?php system('whoami');?>
Two 、Think
Pass in Utilization mode : Subsequent generation of cache file utilization include Execute code
?n=<?php system('whoami');?> or /?n=<php>phpinfo();</php>

Vulnerability analysis
When the template is php:
Get into display Method $countent Is the command code

Get into fetch Method 
stay fetch In the method if Judge Because the template is php So do the following eval Code 
When the template is Think:
Still enter fetch Method
Merge variables into an array $params Then enter listen Method 
listen Method $name$tag Take us $params Pass in exec Method

here $tag Set to run End up in ParseTemplateBehavior Class run Method

Run In the method , First, check whether the cache is valid , For the first time , So to enter else Branch

To follow up Template Class fetch Method , call loadTemplate Method

loadTemplate Middle pass compiler Generate cache code after , call put Method

call File Class put Method , Write code

All the way back to Template Class fetch Method to call load
Storage::load($templateCacheFile,$this->tVar,null,'tpl');

include Cache file Execute code , When the same code is executed , Because of the same content md5 identical , So the cache file exists , So I'm entering run In the method , Call directly load

That is, when the command is called for the first time , Generate a cache file and include it , When called again , Include files directly
边栏推荐
- I love network security for new recruitment assessment
- 可觀測,才可靠:雲上自動化運維CloudOps系列沙龍 第一彈
- This editor will open source soon!
- Configuration of headquarters dual computer hot standby and branch infrastructure for firewall Foundation
- 提权扫描工具
- QQ was stolen? The reason is
- Impersonate server and client using message queuing
- 想請教一下,我在佛山,到哪裏開戶比較好?手機開戶是安全麼?
- 深入理解.Net中的线程同步之构造模式(二)内核模式3.内核模式构造物Mutex
- Go common lock mutex and rwmutex
猜你喜欢

Jetpack Compose 实现完美屏幕适配
![[scientific research data processing] [basic] category variable frequency analysis chart, numerical variable distribution chart and normality test (including lognormal)](/img/70/8bf226964118efb324ca4d339df654.png)
[scientific research data processing] [basic] category variable frequency analysis chart, numerical variable distribution chart and normality test (including lognormal)

深入理解.Net中的线程同步之构造模式(二)内核模式2.内核模式构造物Semaphone

单元测试效率优化:为什么要对程序进行测试?测试有什么好处?
![【科研数据处理】[实践]类别变量频数分析图表、数值变量分布图表与正态性检验(包含对数正态)](/img/5a/eaa845f4332f0b8ee8b6409d6a79e8.png)
【科研数据处理】[实践]类别变量频数分析图表、数值变量分布图表与正态性检验(包含对数正态)

Crypto questions

go channel && select

"Persistent diseases" that cannot be solved in IM application development

可觀測,才可靠:雲上自動化運維CloudOps系列沙龍 第一彈

Lifting scanning tool
随机推荐
Go language mutex lock
Crypto questions
(8) JMeter component detailed once only controller
Why is the resolution of the image generated by PHP GD library 96? How to change it to 72
Deep understanding Net (2) kernel mode 4 Summary of kernel pattern constructs
Advanced usage of go language for loop break and continue
单元测试效率优化:为什么要对程序进行测试?测试有什么好处?
PHP excel export function encapsulation (based on phpexcel class)
Wuenda 2022 machine learning special course evaluation is coming!
Laravel configures passport and returns token using JWT
Introduction to reverse commissioning - VA and RVA conversion in PE 04/07
Laravel upload error
Google Earth engine (GEE) -- converts string to number and applies it to time search (ee.date.fromymd)
數據恢複軟件EasyRecovery15下載
Observable, reliable: the first shot of cloudops series Salon of cloud automation operation and maintenance
JMeter transaction controller
The JSON data returned from the control layer to JS has a "\" translator. How to remove it
智慧运维:基于 BIM 技术的可视化管理系统
Project management - common English vocabulary I
Flat shading with unity