一,搭建环境
本次测试使用hackme的靶机

攻击为kali(192.168.30.130)与物理机
二,信息收集
1.确定IP
先确定mac信息,再搭配主机扫描确定靶机的IP地址
00:0C:29:D0:F5:74

确定靶机地址为 192.168.30.133
2.扫描靶机的端口

22 80端口开放
尝试访问

默认端口是登录页面
3.目录信息收集
使用dirb扫描

尝试访问这三个目录

第二个为登录页面
第三个为一个上传页面(没找到上传按钮)

三,漏洞挖掘
1.登录页面
首先尝试弱口令破解
没有成功

先注册登录

2.用户页面
登录后发现有搜索框 尝试sql注入



确认存在sql注入
显而易见字段数为3
查看数据库 名称为webapphacking

查看表 -1' union select group_concat(table_name),2,3 from information_schema.tables where table_schema='webapphacking'#

查看user表中的数据
-1' union select group_concat(user),group_concat(pasword),3 from users#

密码为MD5加密 解密
登录其中的 superadmin Uncrackable

发现文件上传
尝试上传phpinfo
上传后回到该页面 尝试访问

成功访问

四,漏洞利用
依据上面上传phpinfo的步骤,上传一句话木马

尝试连接

连接成功 拿到shell
