vulnhub covfefe靶场
1.信息收集
扫描出多个IP
![](https://img.shuduke.com/static_img/cnblogs/2023/12/11/thmeszgd_him2.png)
nmap只发现192.168.42.146有端口开放,为22,80,31337
![](https://img.shuduke.com/static_img/cnblogs/2023/12/11/dndqvsof_lm49.png)
扫描192.168.42.146的22,80,31337端口,看看开放的服务
![](https://img.shuduke.com/static_img/cnblogs/2023/12/11/tjaefopg_y3xg.png)
用dirb找找目录
![](https://img.shuduke.com/static_img/cnblogs/2023/12/11/twyxpqns_ryed.png)
2.资源分析
查看robots.txt,寻找目录
![](https://img.shuduke.com/static_img/cnblogs/2023/12/11/wuhyksye_xe2w.png)
访问taxes,拿到flag1
![](https://img.shuduke.com/static_img/cnblogs/2023/12/11/enaoicac_l04v.png)
进入ssh目录,下载rsa,pub
![](https://img.shuduke.com/static_img/cnblogs/2023/12/11/venvrbug_4esk.png)
3.漏洞利用
下载了ssh的公钥和私钥,开放了22端口,我们尝试ssh免密登录漏洞
id_rsa加密,尝试破解
发现它是rsa加密
![](https://img.shuduke.com/static_img/cnblogs/2023/12/11/xduyyfem_6mi0.png)
JOHN哈希破解密码 starwars
![](https://img.shuduke.com/static_img/cnblogs/2023/12/11/lqexutgm_bipr.png)
用id_rsa连接ssh,发现报错私钥权限过大
![](https://img.shuduke.com/static_img/cnblogs/2023/12/11/nwbndmts_b8kt.png)
权限更改为600,重新连接
![](https://img.shuduke.com/static_img/cnblogs/2023/12/11/bdmwpwap_1uy8.png)
![](https://img.shuduke.com/static_img/cnblogs/2023/12/11/itnfdlkc_ztqk.png)
ssh成功连接,查看ssh权限
![](https://img.shuduke.com/static_img/cnblogs/2023/12/11/xfsmdxgq_j0ep.png)
4.提升权限
权限不足,开始提权
![](https://img.shuduke.com/static_img/cnblogs/2023/12/11/asyivrwk_qtri.png)
发现/usr/local/bin/read_message有些少见,尝试利用
![](https://img.shuduke.com/static_img/cnblogs/2023/12/11/ostrxgxu_hjsf.png)
发现源代码,开始代码审计,找到flag2
![](https://img.shuduke.com/static_img/cnblogs/2023/12/11/kiopzvtg_dlqj.png)
代码审计发现buf存在缓冲区溢出
![](https://img.shuduke.com/static_img/cnblogs/2023/12/11/xvwujjxg_a657.png)
提权成功,找到flag3
![](https://img.shuduke.com/static_img/cnblogs/2023/12/11/jikgzvap_f9ke.png)