88tcp/udp - Pentesting Kerberos
Tip
AWS ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training AWS Red Team Expert (ARTE)
GCP ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:HackTricks Training GCP Red Team Expert (GRTE)
Azure ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.
Basic Information
Kerberos๋ ๋ฆฌ์์ค ์ ๊ทผ์ ์ง์ ๊ด๋ฆฌํ์ง ์์ผ๋ฉด์ ์ฌ์ฉ์๋ฅผ ์ธ์ฆํ๋ ์์น์ผ๋ก ๋์ํฉ๋๋ค. ์ด ์ ์ ํ๋กํ ์ฝ์ด ๋ณด์ ํ๋ ์์ํฌ์์ ๋งก๋ ์ญํ ์ ๊ฐ์กฐํ๋ ์ค์ํ ๊ตฌ๋ณ์ ๋๋ค.
In environments like Active Directory, Kerberos is instrumental in establishing the identity of users by validating their secret passwords. This process ensures that each userโs identity is confirmed before they interact with network resources. However, Kerberos does not extend its functionality to evaluate or enforce the permissions a user has over specific resources or services. Instead, it provides a secure way of authenticating users, which is a critical first step in the security process.
After authentication by Kerberos, the decision-making process regarding access to resources is delegated to individual services within the network. These services are then responsible for evaluating the authenticated userโs rights and permissions, based on the information provided by Kerberos about the userโs privileges. This design allows for a separation of concerns between authenticating the identity of users and managing their access rights, enabling a more flexible and secure approach to resource management in distributed networks.
๊ธฐ๋ณธ ํฌํธ: 88/tcp/udp
PORT STATE SERVICE
88/tcp open kerberos-sec
Kerberos๋ฅผ ์ ์ฉํ๋ ๋ฐฉ๋ฒ์ ๋ฐฐ์ฐ๋ ค๋ฉด Active Directory.
Kerberos-only ํ๊ฒฝ: ํด๋ผ์ด์ธํธ ์ค๋น ๋ฐ ๋ฌธ์ ํด๊ฒฐ
When NTLM is disabled on domain services (SMB/WinRM/etc.), you must authenticate with Kerberos. Common pitfalls and a working workflow:
- Time synchronization is mandatory. If your host clock is skewed by more than a few minutes you will see
KRB_AP_ERR_SKEWand all Kerberos auth will fail. Sync against the DC:
# quick one-shot sync (requires sudo)
sudo ntpdate <dc.fqdn> || sudo chronyd -q 'server <dc.fqdn> iburst'
- ๋์ realm/domain์ ๋ํ ์ ํจํ krb5.conf๋ฅผ ์์ฑํ์ธ์.
netexec(CME fork)๋ SMB ํ ์คํธ ์ค์ ์ด๋ฅผ ์ถ๋ ฅํด์ค ์ ์์ต๋๋ค:
# Generate krb5.conf and install it
netexec smb <dc.fqdn> -u <user> -p '<pass>' -k --generate-krb5-file krb5.conf
sudo cp krb5.conf /etc/krb5.conf
- TGT๋ฅผ ์ป๊ณ ccache๋ฅผ ํ์ธ:
kinit <user>
klist
- Kerberos๋ฅผ SMB tooling๊ณผ ํจ๊ป ์ฌ์ฉ(๋น๋ฐ๋ฒํธ๊ฐ ์ ์ก๋์ง ์์, ccache ์ฌ์ฉ):
# netexec / CME
netexec smb <dc.fqdn> -k # lists shares, runs modules using Kerberos
# impacket examples also support -k / --no-pass to use the ccache
smbclient --kerberos //<dc.fqdn>/IPC$
- GSSAPI SSH single sign-on (OpenSSH์์ Windows OpenSSH server๋ก):
# Ensure krb5.conf is correct and you have a TGT (kinit)
# Use the FQDN that matches the host SPN. Wrong names cause: "Server not found in Kerberos database"
ssh -o GSSAPIAuthentication=yes <user>@<host.fqdn>
ํ:
- SSH/SMB๋ก ์ ์ํ ์ ํํ FQDN์
/etc/hosts๊ฐ ํด์ํ๋๋ก ์ค์ ํ๊ณ , DNS๋ฅผ ์ค๋ฒ๋ผ์ด๋ํ๋ ๊ฒฝ์ฐ ์ด ํญ๋ชฉ์ด ๋ฒ ์ด ๋๋ฉ์ธ ํญ๋ชฉ๋ณด๋ค ๋จผ์ ์ค๋๋ก ํ์ธ์. SPN ๋ถ์ผ์น๋ GSSAPI๋ฅผ ๊นจ๋จ๋ฆฝ๋๋ค. - SMB์์ NTLM์ด ๋นํ์ฑํ๋ ๊ฒฝ์ฐ NTLM ์๋ ์
STATUS_NOT_SUPPORTED๊ฐ ํ์๋ ์ ์์ต๋๋ค; Kerberos๋ฅผ ๊ฐ์ ํ๋ ค๋ฉด-k๋ฅผ ์ถ๊ฐํ์ธ์.
์ถ๊ฐ
Shodan
port:88 kerberos
MS14-068
MS14-068 ์ทจ์ฝ์ ์ ๊ณต๊ฒฉ์๊ฐ ์ ๋นํ ์ฌ์ฉ์์ Kerberos ๋ก๊ทธ์ธ ํ ํฐ์ ๋ณ์กฐํ์ฌ Domain Admin ๊ฐ์ ๊ถํ ์์น์ ํ์๋ก ์ฃผ์ฅํ๊ฒ ํ ์ ์์ต๋๋ค. ์ด๋ฌํ ์์กฐ๋ ์ฃผ์ฅ์ Domain Controller์ ์ํด ์๋ชป ๊ฒ์ฆ๋์ด Active Directory ํฌ๋ฆฌ์คํธ ์ ๋ฐ์ ๋คํธ์ํฌ ๋ฆฌ์์ค์ ๋ํ ๋ฌด๋จ ์ ๊ทผ์ ํ์ฉํฉ๋๋ค.
Other exploits: https://github.com/SecWiki/windows-kernel-exploits/tree/master/MS14-068/pykek
References
- NetExec (CME) wiki โ Kerberos and krb5.conf generation
- OpenSSH GSSAPIAuthentication
- MIT Kerberos โ Using Kerberos on UNIX
- 0xdf โ HTB: TheFrizz
HackTricks ์๋ ๋ช ๋ น
Protocol_Name: Kerberos #Protocol Abbreviation if there is one.
Port_Number: 88 #Comma separated if there is more than one.
Protocol_Description: AD Domain Authentication #Protocol Abbreviation Spelled out
Entry_1:
Name: Notes
Description: Notes for Kerberos
Note: |
Kerberos operates on a principle where it authenticates users without directly managing their access to resources. This is an important distinction because it underlines the protocol's role in security frameworks.
In environments like **Active Directory**, Kerberos is instrumental in establishing the identity of users by validating their secret passwords. This process ensures that each user's identity is confirmed before they interact with network resources. However, Kerberos does not extend its functionality to evaluate or enforce the permissions a user has over specific resources or services. Instead, it provides a secure way of authenticating users, which is a critical first step in the security process.
https://book.hacktricks.wiki/en/network-services-pentesting/pentesting-kerberos-88/index.html
Entry_2:
Name: Pre-Creds
Description: Brute Force to get Usernames
Command: nmap -p 88 --script=krb5-enum-users --script-args krb5-enum-users.realm="{Domain_Name}",userdb={Big_Userlist} {IP}
Entry_3:
Name: With Usernames
Description: Brute Force with Usernames and Passwords
Note: consider git clone https://github.com/ropnop/kerbrute.git ./kerbrute -h
Entry_4:
Name: With Creds
Description: Attempt to get a list of user service principal names
Command: GetUserSPNs.py -request -dc-ip {IP} active.htb/svc_tgs
Tip
AWS ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training AWS Red Team Expert (ARTE)
GCP ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:HackTricks Training GCP Red Team Expert (GRTE)
Azure ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.


