88tcp/udp - Pentesting Kerberos

Reading time: 6 minutes

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 का समर्थन करें

Basic Information

Kerberos एक ऐसे सिद्धांत पर कार्य करता है जहाँ यह उपयोगकर्ताओं का प्रमाणीकरण करता है पर सीधे उनके संसाधनों तक पहुँच का प्रबंधन नहीं करता। यह एक महत्वपूर्ण भेद है क्योंकि यह प्रोटोकॉल की सुरक्षा ढाँचों में भूमिका को रेखांकित करता है।

Active Directory जैसे परिवेशों में, Kerberos उपयोगकर्ताओं की पहचान स्थापित करने में सहायक होता है, उनके गुप्त पासवर्ड को सत्यापित करके। यह प्रक्रिया यह सुनिश्चित करती है कि नेटवर्क संसाधनों के साथ इंटरैक्ट करने से पहले प्रत्येक उपयोगकर्ता की पहचान की पुष्टि हो। हालांकि, Kerberos किसी उपयोगकर्ता के विशेष संसाधनों या सेवाओं पर अधिकारों का मूल्यांकन या प्रवर्तन नहीं करता। इसके बजाय यह उपयोगकर्ताओं का सुरक्षित प्रमाणीकरण प्रदान करता है, जो सुरक्षा प्रक्रिया का एक महत्वपूर्ण पहला कदम है।

Kerberos द्वारा प्रमाणीकृत करने के बाद, संसाधनों तक पहुँच के बारे में निर्णय लेने की प्रक्रिया नेटवर्क की व्यक्तिगत सेवाओं को सौंप दी जाती है। ये सेवाएँ तब प्रमाणीकृत उपयोगकर्ता के अधिकारों और अनुमतियों का मूल्यांकन करने के लिये ज़िम्मेदार होती हैं, जो Kerberos द्वारा उपयोगकर्ता की विशेषताओं की जानकारी पर आधारित होती हैं। यह डिज़ाइन उपयोगकर्ता की पहचान प्रमाणीकृत करने और उनके पहुँच अधिकारों के प्रबंधन के बीच जिम्मेदारियों को अलग करने की अनुमति देता है, जिससे वितरित नेटवर्क में संसाधन प्रबंधन के लिये अधिक लचीला और सुरक्षित तरीका संभव होता है।

Default Port: 88/tcp/udp

PORT   STATE SERVICE
88/tcp open  kerberos-sec

Kerberos का दुरुपयोग कैसे करें यह जानने के लिए आपको Active Directory.

Kerberos-only environments: क्लाइंट की तैयारी और समस्या निवारण

जब domain services (SMB/WinRM/etc.) पर NTLM अक्षम होता है, तो आपको Kerberos के साथ प्रमाणीकृत होना होगा। सामान्य समस्याएँ और एक काम करने वाला वर्कफ़्लो:

  • समय समन्वयन अनिवार्य है। यदि आपके होस्ट की घड़ी कुछ मिनटों से अधिक गलत हो तो आपको KRB_AP_ERR_SKEW दिखाई देगा और सभी Kerberos प्रमाणीकरण विफल हो जाएंगे। DC के साथ समय सिंक करें:
bash
# 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 का परीक्षण करते समय आपके लिए एक फाइल उत्पन्न कर सकता है:
bash
# 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 सत्यापित करें:
bash
kinit <user>
klist
  • Kerberos का उपयोग SMB tooling के साथ करें (no passwords sent, uses your ccache):
bash
# 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 to Windows OpenSSH server):
bash
# 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>

टिप्स:

  • Ensure your /etc/hosts resolves the exact FQDN you will SSH/SMB to, and that it comes before any bare domain entries if you are overriding DNS. SPN mismatches break GSSAPI.
  • If NTLM is disabled on SMB you may see STATUS_NOT_SUPPORTED with NTLM attempts; add -k to force Kerberos.

और

Shodan

  • port:88 kerberos

MS14-068

MS14-068 flaw एक attacker को वैध उपयोगकर्ता के Kerberos लॉगिन टोकन में छेड़छाड़ करने की अनुमति देती है ताकि वह गलत तरीके से elevated privileges का दावा कर सके, जैसे कि being a Domain Admin. यह counterfeit claim गलती से Domain Controller द्वारा मान्य कर लिया जाता है, जिससे Active Directory forest में नेटवर्क संसाधनों तक अनधिकृत पहुँच संभव हो जाती है।

Kerberos Vulnerability in MS14-068 (KB3011780) Explained – Active Directory & Azure AD/Entra ID Security

अन्य exploits: https://github.com/SecWiki/windows-kernel-exploits/tree/master/MS14-068/pykek

संदर्भ

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 का समर्थन करें