当前位置:网站首页>ctf-pikachu-RCE
ctf-pikachu-RCE
2022-07-18 18:25:00 【vigoroth 】
List of articles
RCE(remote command/code execute, Remote system commands / Code execution )
RCE Loophole , It allows attackers to inject operating system commands or code directly into the background server , To control the background system .
reason : The application system is designed to provide users with specified remote commands or interfaces for remote code to perform operations , If the designer designs this function again , There is no strict security control , It may cause an attacker to submit “ beat all ” The order of , So that the background can be executed , So as to control the whole background server .
1.exec “ping”
Submit normal ip Address , Such as 127.0.0.1

Submit ip Query command
127.0.0.1 & ipconfig
The discovery was carried out ping At the same time, it also implemented ipconfig command , Got the target ip Address .
2.exec “eval”
Enter any string .

Try entering a php Code .
such as :phpinfo();

summary
Some dangerous functions , To quote : Remote command / Code Execution Vulnerability (RCE) summary
system() :
string system ( string $command [, int &$return_var ] )shell_exec():
shell_exec — adopt shell Environment execution order ( This means that this method can only be used in linux or mac os Of shell Running in the environment ), And return the complete output as a string . If an error occurs during execution or the process does not produce output , Then return to NULL.
exec():
string exec ( string $command [, array &$output [, int &$return_var ]] )exec perform command command , But it doesn't output all the results , It's the last line of the result , If you want to get all the results , You can use the second parameter , Let it output to an array , Each record in the array represents each row of output , If the output result has 10 That's ok , Then the array has 10 Bar record . So if you need to repeatedly output the results of calling external commands of different systems , You'd better clear this array when outputting the results of each external command of the system , In case of confusion . The third parameter is used to get the status code of the command execution , Usually, the successful execution returns 0
passthru():
void passthru ( string $command [, int &$return_var ] )And exec The difference between :passthru Output the result directly , No results returned , No use echo View results .
边栏推荐
猜你喜欢
![[动态规划]DP20 计算字符串的编辑距离-中等](/img/89/9c56bc84e07f0c253a66b837f14232.png)
[动态规划]DP20 计算字符串的编辑距离-中等

Leetcode45. 跳跃游戏 II

【產品人衛朋】2022年產品人必備的13個設計類網站(1.0版)

P1789 【Mc生存】插火把【入门】

Unity游戏文件大,如何缩小游戏文件

Use plt When the savefig() method saves the drawing, the picture is all white or all black

New exploration of Ali mother's display advertising engine: towards the overall optimal allocation of computing power

走不下去恶补基础呢--C#线程开发输出字符串程序

C#网络应用编程,实验5:数据流练习

華為影像XMAGE:求盡世間像,終見菩提心
随机推荐
【实战】快来和我一起开发一个在线 Web 代码编辑器
rman异机恢复后,报错ora-01017
腾讯四面面经,问傻了
10个第一、2个第二,达摩院NLP团队在SemEval 2022的夺冠之旅
C # basic practice of network application programming and asynchronous programming
阿里达摩院TableQA技术让表格说话
[product people Wei Peng] 13 design websites necessary for product people in 2022 (version 1.0)
C#网络应用编程,实验4:线程管理练习
串的概念相关及模式匹配
華為影像XMAGE:求盡世間像,終見菩提心
PNAS | 南农张瑞福组揭示了微生物肥料功能菌根际趋化的信号识别新机制
New exploration of Ali mother's display advertising engine: towards the overall optimal allocation of computing power
sqlmap语法介绍
数字金字塔(PTA)
[PaddleSeg源码阅读] 关于PaddleSeg模型返回的都是list这件小事
Leetcode48. 旋转图像
IDEA安装、配置、测试
An interesting keyboard bug debugging experience (I want to break my colleagues' legs)
1.创建Prism项目
【C#】正序、逆序、最大值、最小值和平均值