Deathnote0x01 信息收集

渗透的第一件事那就是信息收集,虚拟机启动起来,nmap扫一手,

192.168.56.101存在,并且开启了80和22端口,那么就访问页面。

但是页面返回的结果是没找到http://deathnote.vuln这个网址

那么根据我做题的经验,这应该是需要绑定域名的,意思就是192.168.56.101跟deathnote.vuln这个域名是绑定在一起的,访问192.168.56.101就会跳转到deathnote.vuln。

在windows上配置dns

C:\WINDOWS\system32\drivers\etc 的hosts文件加入如下字段(linux上是/etc/hosts)

192.168.56.101 deathnote.vuln

访问后就会是这个页面了

扫一下目录

200 -   68B  - /robots.txt200 -    2KB - /wordpress/wp-login.php200 -    6KB - /wordpress/

扫到一些比较有用的东西,先看看robots.txt

fuck it my dad added hint on /important.jpgryuk please delete it

有一个important.jpg文件,这边下载到本地看看。

图像是显示不出来的,用010 editor打开看看

i am Soichiro Yagami, light's fatheri have a doubt if L is true about the assumption that light is kirai can only help you by giving something importantlogin username : user.txti don't know the password.find it by yourself but i think it is in the hint section of site

这里的user.txt应该是指wordpress上的一些用户,这个网站的作者是kira,一会可以用这个尝试登陆后台。

那么问题来了,密码是什么呢?
于是在寻找中不不经意看到了一串话

这个 iamjustic3 猜测估计是密码没错了。于是访问 http://deathnote.vuln/wordpress/wp-login.php 尝试登录。

username: kirapassword: iamjustic3

0x02 登录后台

登录成功!登录到后台发现了一个 notes.txt(在前面的hint里有说有一个notes.txt文件)

打开后发现是一个密码本

death4death4lifedeath4udeath4everdeath4alldeath420death45death4lovedeath49death48death456death40141death4uyaydeath44thedeath4u2thedeath4ustickdeath420reddeath44megadeath44megadeath4killdeath405hot2death4shodeath4southdeath4nowdeath4l0vedeath4freedeath4elmodeath4blooddeath499Eyes301death498death4859death47death4545death445death444death4387ndeath4332387death42521439death42death4138death411death405death4me

先保存为了 passwd.txt ,应该是一会爆破ssh要用到的。

接下来找了半天发现没什么东西可以利用了(其实这个后台可以在页面写入后门,但是这里因为可以直接用ssh登录就没去尝试)

0x03 SSH登录

上面收集到了密码本,但是还差账户呀,账户不知道是什么。

通过上面的收集,猜测账户应该是 kira 和 l 之间的某一个,于是制作 user.txt

kiraKiraLl

注意:我就是栽在这里,因为当时试的是大写的,试了半天没想到是小写的,哭死。

利用 hydra 爆破

hydra -L user.txt -P passwd.txt ssh://192.168.56.101-L 账户本-P 密码本

这里也是成功的跑出来了,那么利用 ssh 登录l账户。

登录成功!

0x04 切换用户

在 /home/l 目录下发现了 user.txt,打开是一串brainfuck的加密字符串

解密得到如下字符

i think u got the shell , but you wont be able to kill me -kira

他似乎在挑衅我呀。

查看 /home,发现另一个账户 kira

有一个 kira.txt,但是没有权限无法访问。于是继续信息收集,在漫长的收集终于在 opt 下找到了一个 L 的目录。

先看看 kira-case 文件,里面有一个 case-file.txt 。 内容如下:

the FBI agent died on December 27, 20061 week after the investigation of the task-force member/head.aka.....Soichiro Yagami's family .hmmmmmmmmm......and according to watari ,he died as other died after Kira targeted them .and we also found something infake-notebook-rule folder .

有用的东西在 fake-notebook-rule 目录下,于是访问 fake-notebook-rule 目录。

有俩文件,hint 的内容是 “use cyberchef”。

然后查看了 case.wav 文件发现了如下字符串

63 47 46 7a 63 33 64 6b 49 44 6f 67 61 32 6c 79 59 57 6c 7a 5a 58 5a 70 62 43 41 3d

这不就是16进制吗?自己写一个脚本

a = [0x63 ,0x47, 0x46, 0x7a, 0x63 ,0x33 ,0x64 ,0x6b ,0x49 ,0x44 ,0x6f ,0x67, 0x61 ,0x32 ,0x6c, 0x79 ,0x59 ,0x57 ,0x6c ,0x7a, 0x5a, 0x58, 0x5a, 0x70, 0x62 ,0x43 ,0x41, 0x3d]b = []for i in a:    b.append(chr(i))import base64print(base64.b64decode("".join(b)))

结果是:passwd : kiraisevil,猜测是kira账户的密码。

尝试登录。

成功登录!

0x05 提升权限

kira 目录下有个 kira.txt 文件,内容如下:

cGxlYXNlIHByb3RlY3Qgb25lIG9mIHRoZSBmb2xsb3dpbmcgCjEuIEwgKC9vcHQpCjIuIE1pc2EgKC92YXIp

base64解得:

please protect one of the following1. L (/opt)2. Misa (/var)

应该是说L在opt目录下,Misa在/var下,但是当我去看Misa的时候他文件说的是这样的:

他说晚了。。。

既然登录 kira 了,尝试提个权吧。命令 sudo -l 查看一下 kira 的账户情况

(ALL : ALL)ALL,这种情况那就好办了,直接 sudo -i 输入密码就是 root 权限了。

完结撒花!!

0x06 总结

这道渗透其实是简单的,适合初学者,还是挺有意思的。