UNCTF2020记录+复现

前言 最后几天都没登进去。。。这验证码河里 🐎 Web easy_ssrf 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 <?php echo'<center><strong>welc0me to 2020UNCTF!!</strong></center>'; highlight_file(__FILE__); $url = $_GET['url']; if(preg_match('/unctf\.com/',$url)){ if(!preg_match('/php|file|zip|bzip|zlib|base|data/i',$url)){ $url=file_get_contents($url); echo($url); }else{ echo('error!!'); } }else{ echo("error"); } ?> 本来以为是利用bypass技巧达到php伪协议嵌套一层unctf.com的,但是bypass不了,僵了好久。。。

ByteCTF2020-easy_scrapy复现

题目描述 hint1: Try to read the spider source code, maybe you can test it locally hint2: How to attack distributed system and get rce on the spider node?

西湖论剑2020FlagShop复现

FlagShop F12查看源码,发现一段js代码 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 setInterval(function() { $.get("backend.php", { readfile: "data/FakeCTFer.txt" }, function(data, status) { $('#fake').html(data); }); $.get("backend.php", { readfile: "data/RealCTFer.txt" }, function(data, status) { $('#real').html(data); }); }, 1000); $('#real-sub').click(function() { $.get("backend.php", { writefile: "data/RealCTFer.txt", buffer: $('#real-text').val()+ "\n\n", offset: $('#real').html().length }); $('#real-text').val(""); }); $('#fake-sub').click(function() { $.get("backend.php", { writefile: "data/FakeCTFer.txt", buffer: $('#fake-text').val() + "\n\n", offset: $('#fake').html().length }); $('#fake-text').val(""); }); 大概就是GET传参readfile或writefile访问/backend.php路由读写文件,此处存在一个任意文件读取漏洞,通过readfile可以读取backend.php内容: