首页 > 其他分享 >2022中国工业互联网安全大赛北京市选拔赛全国线上预选赛-md

2022中国工业互联网安全大赛北京市选拔赛全国线上预选赛-md

时间:2022-10-02 10:56:52浏览次数:56  
标签:md .. la cd etc 选拔赛 2022 php ls


title: 2022中国工业互联网安全大赛北京市选拔赛全国线上预选赛.md
date: 2022-09-23 22:19:12
tags:

ezRead

image-20220923162132216

一眼看到上面可能是存在任意文件读应该是base64加密过后的 确实 解密之后就是 ddl.txt

所以我们尝试读取一下 /etc/passwd 把 验证存在 任意文件读取

../../../../../../../../../etc/passwd
**Warning**: file_get_contents(books/etc/passwd): failed to open stream: No such file or directory in **/var/www/ctf/read.php** on line **9**

发现返回这个报错

books/etc/passwd 应该是把 ../过滤掉了

可以双写绕过

image-20220923162132216

验证我们 双写绕过和任意文件读取

那直接读flag把

image-20220923162301274

然后 发现读不到flag。。。

应该是没有/flag文件

然后就没思路了 (还是做的题太少了)一直局限在找flag(出题人是谁!!!!!!!!!!caimi是把)

那读一下 read.php把 不过也没啥用

<?php
error_reporting(2);
$file = base64_decode(isset($_GET['Book']) ? $_GET['Book'] : "");
if ($file == '') {
    header("location:index.html");
}
$file = str_replace(array("../", "..\""), "", $file);
$file = 'books/' . $file;
$final = file_get_contents($file);
echo $final;

然后尝试一下读取历史命令吧’

image-20220923163459226

cd /
ls -la
cd #
ps -elf
netstat -pantu
echo "127.0.0.1 V72J1dn23wjFrq" >> /etc/hosts
cat /etc/hosts
curl -v -k http://localhost/index.html
curl -v -k http://localhost/read.php
ls -la
cd #
cd /var/www
cd ctf
ls -la
cd V72J1dn23wjFrq
cat *
ls -la
ping -c 4 127.0.0.1
ps -elf
netstat -pantu
service apache2 status
service apache2 restart
service apache2 status
ps -elf
netstat -pantu
ls -la
clear
exit

然后看到进入了 V72J1dn23wjFrq目录 然后 进这个目录看看把

image-20220923163549945

有个demo.php 可以使用任意文件读取 读取 demo.php

<?php
error_reporting(0);
$file= $_GET['ops'];
$file = str_replace(array("../", "..\""), "", $file);
include_once($file);
?>

可以使用 zedd的 文件包含 rce

`

...题目环境 没了

这里就不打了

标签:md,..,la,cd,etc,选拔赛,2022,php,ls
From: https://www.cnblogs.com/kkkkl/p/16748374.html

相关文章

  • DDCTF2019-HOMEBREW-EVENT-LOOP-md
    title:DDCTF2019HOMEBREWEVENTLOOP.mddate:2022-09-2711:42:22tags:[DDCTF2019]homebreweventloop代码审计fromflaskimportFlask,session,request,Re......
  • SWPUCTF2018SimplePHP-md
    title:SWPUCTF2018SimplePHP.mddate:2022-06-2508:06:23tags:登陆进去之后发现上传文件这里我们试着上传一个shell试试发现过滤了应该直接上传shell不可以这......
  • ciscn2019华北赛区Day1-Web1dropbox-md
    title:ciscn2019华北赛区Day1Web1dropbox.mddate:2022-06-2620:56:10tags:进去之后呢看到一个登录框然后注册一个账号进去看到有上传文件的东西然后试试上传一个......
  • BJDCTF2020Cookie-is-so-stable-md
    title:BJDCTF2020Cookieissostable.mddate:2022-07-0718:45:14tags:进去之后发现这个好像ssti我们输入{{1+2}}返回这个应该时ssti了然后我们输入{{"".__c......
  • PHP伪协议总结-md
    title:PHP伪协议总结.mddate:2022-06-2321:35:32tags:php伪协议浅浅学习file://协议利用条件allow_url_fopen:off/onallow_url_include:off/on作用:访问本地......
  • 安洵杯2019——eazy——web-md
    title:安洵杯2019——eazy——web.mddate:2022-10-0210:11:51tags:[安洵杯2019]easy_web绷不住了。。。。看题把上面get这里应该是可以获取文件cmd是什么现在......
  • 2022-2023-1 20221304 《计算机基础与程序设计》第五周学习总结
    2022-2023-120221304《计算机基础与程序设计》第五周学习总结作业信息这个作业属于哪个课程https://edu.cnblogs.com/campus/besti/2022-2023-1-CFAP这个作业......
  • 2022/10/2
    #define_CRT_SECURE_NO_WARNING#include<stdio.h>intmain(){inta=0;intb=0;intsum=0;scanf("%d%d",&a,&b);sum=a+b;printf("%d\n",sum);  return 0;}......
  • 2022神经渲染的进展综述
    神经渲染的进展综述来源:​​https://zhuanlan.zhihu.com/p/567654308​​EuroGraphics‘2022综述论文“AdvancesinNeuralRendering“,2022年3月,作者来自MPI、谷歌研究、E......
  • 2022年10月2日学习笔记
       财富是一场英雄之旅!  要变好的路径是自律!  要获得长期成功的关键是养成好习惯!  要变得富有的方法是唤醒你的财富脑!    拥有幸福人生的方法:......