当前位置:网站首页>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
边栏推荐
- 想請教一下,我在佛山,到哪裏開戶比較好?手機開戶是安全麼?
- Introduction to the construction and development of composer private warehouse
- Go language mutex lock
- Details of gets, fgetc, fgets, Getc, getchar, putc, fputc, putchar, puts, fputs functions
- Wuenda 2022 machine learning special course evaluation is coming!
- [Title brushing] coco, who likes bananas
- Go common lock mutex and rwmutex
- What is erdma as illustrated by Coptic cartoon?
- ot initialized – call ‘refresh’ before invoking lifecycle methods via the context: Root WebApplicati
- Laravel8 custom log directory, rename
猜你喜欢
【观察】智能产业加速,为何AI算力要先行?
Deep understanding Net (2) kernel mode 2 Kernel mode construct semaphone
Laravel upload error
Geoffreyhinton: my 50 years of in-depth study and Research on mental skills
Race of golang
Go language mutex lock
Google Earth engine (GEE) - ghsl: global human settlements layer, built grid 1975-1990-2000-2015 (p2016) data set
What is erdma as illustrated by Coptic cartoon?
MFQE 2.0: A New Approach for Multi-FrameQuality Enhancement on Compressed Video
[redis series] redis learning 16. Redis Dictionary (map) and its core coding structure
随机推荐
深入理解.Net中的线程同步之构造模式(二)内核模式4.内核模式构造物的总结
PHP multidimensional array sorting
LeetCode_ Stack_ Medium_ 227. basic calculator II (without brackets)
Wuenda 2022 machine learning special course evaluation is coming!
JMeter transaction controller
MFQE 2.0: A New Approach for Multi-FrameQuality Enhancement on Compressed Video
數據恢複軟件EasyRecovery15下載
"Persistent diseases" that cannot be solved in IM application development
[scientific research data processing] [basic] category variable frequency analysis chart, numerical variable distribution chart and normality test (including lognormal)
Talk about Vue's two terminal diff algorithm, analysis of the rendering principle of the mobile terminal, and whether the database primary key must be self incremented? What scenarios do not suggest s
Lifting scanning tool
go time. after
Observable, reliable: the first shot of cloudops series Salon of cloud automation operation and maintenance
单元测试效率优化:为什么要对程序进行测试?测试有什么好处?
Comprehensively analyze the basic features and summary of free and paid SSH tools
The programming competition is coming! B station surrounding, senior members and other good gifts to you!
想請教一下,我在佛山,到哪裏開戶比較好?手機開戶是安全麼?
PHP recursive multi-level classification, infinite classification
Geoffreyhinton: my 50 years of in-depth study and Research on mental skills
Why does the folder appear open in another program