Vulnhub-MATRIX: 1
靶机描述:
下载地址:http://www.vulnhub.com/entry/matrix-1,259/级别:中级目标:得到root权限和打开flag.txt扫描靶机ip
arp-scan -l攻击机:192.168.86.138
靶机:192.168.86.162查看开放端口及版本信息
nmap -sV -p- 192.168.86.162_副本-olkw.png)
访问80端口页面,Follow the White Rabbit(跟随白色兔子),Welcome to the real world, Neo. I'm glad you're here(欢迎来到真实世界,尼奥。很高兴你能在这里)。(ps~黑客帝国帝国的片段)
http://192.168.86.162:80_副本-fivw.png)
查看网页源码时发现发现图片链接
_副本-pllu.png)
打开后是一只白兔,并图片命名为31337.png,根据提示那重要信息应该在31337端口中_副本-ecfn.png)
打开31337端口页面,Cypher(暗号),"You know.. I know this steak doesn't exist. I know when I put it in my mouth; the Matrix is telling my brain that it is juicy, and delicious. After nine years.. you know what I realize? Ignorance is bliss."(“我知道这块牛排不存在。我知道当我放进嘴里时,矩阵正在告诉我的大脑它是美味多汁的。九年之后,你知道我意识到什么了吗?无知是幸福的。”)
http://192.168.86.162:31337_副本-jsqv.png)
查看网页源码,找到用base64编码的一段话
_副本-hpby.png)
解码后,Then you'll see, that it is not the spoon that bends, it is only yourself.>Cypher.matrix(你将会看见,弯曲的不是汤勺,而是你的信念。)
https://base64.us/_副本-jjyf.png)
尝试以/Cypher.matrix为路径打开网页,出现了下载文件提示
http://192.168.86.162:31337/Cypher.matrix_副本-jusv.png)
下载文件查看,文件内容使用brainfuch编码加密,进行解码后得到提示,You can enter into matrix as guest, with password k1ll0rXX Note: Actually, I forget last two characters so I have replaced with XX try your luck and find correct string of password.(你可以以guest进入到矩阵,密码为k1ll0rXX 提示:事实上,我忘记了最后两个字符,所以我用XX替代了它们,你够幸运的话去找到正确的密码字符串)
https://www.splitbrain.org/services/ook_副本-ebzo.png)
使用crunch字典生成工具生成密码字典,选择要使用的字符集范围,选择使用lalpha-numeric字符集
文件路径:/usr/share/crunch/charset.lst_副本-dcue.png)
生成字符字典
crunch 8 8 -f /usr/share/crunch/charset.lst lalpha-numeric -t k1ll0r@@ > pwd.dic
8 8:表示密码的长度为8位
-f /usr/share/crunch/charset.lst lalpha-numeric:指定字符集
-t k1ll0r@@:指定模式,@@插入小写字符> pwd.dic:生成字典文件_副本-sqxh.png)
得到字典文件后使用hydra通过连接ssh进行密码破解
hydra -l guest -P pwd.dic -v 192.168.86.162 ssh
-l:指定用户
-P:指定字典
-v:显示爆破详细信息_副本-frih.png)
登录ssh成功
ssh guest@192.168.86.162 _副本-rrpp.png)
由于bash shell功能受限,所以采取rbash绕过方式
_副本-xfgi.png)
重新登录ssh,成功绕过rbash
ssh guest@192.168.86.162 -t "bash --noprofile"_副本-ufeo.png)
使用命令查看目前用户权限
sudo -l_副本-uztj.png)
成功切换到root用户,得到flag.txt
sudo su root_副本-tidt.png)