当前位置:网站首页>Intranet learning notes (6)
Intranet learning notes (6)
2022-06-25 02:08:00 【seven six nine】
Domain controller security
- 1. Use shadow copy services ntds.dit
- 2. export ntds.dit Hash value in
- 3. utilize dcsync Get the domain hash value
- 4. Use MSF Get the domain hash value
- 5. Use vshadow.exe and QuarksPwDump.exe Export domain account and domain hash value
- 6. Kerberos Analysis and prevention of domain user privilege raising vulnerability
In general 、 Even with administrator rights , Cannot read from the domain controller C:\Windwos\NTDS\ntds.dit file ( The active directory always accesses this file , So the file is forbidden to read ). Use Windows The local volume shadow copy service can obtain a copy of the file .
1. Use shadow copy services ntds.dit
In the active directory , All the data is stored in ntds.dit In file .ntds.dit It's a binary file , The storage location is... Of the domain controller %SystemRoot%ntds\ntds.dit.ntds.dit Contained in the ( But not limited to, ) user name 、 Hash value 、 Group 、GPP、OU And other information related to the active directory . It and SAM file , Be being Windows Operating system locked . This section describes how to export... From the system ntds.dit, And how to read ntds.dit Information in . In general , The system operation and maintenance personnel will use the volume shadow copy service (Volume Shadow Copy Service, VSS) Implement these operations .VSS It's essentially a snapshot (Snapshot) A kind of technology , Mainly used for backup and recovery ( Even if the target file is locked ).
1.1 adopt ntdsutil.exe extract ntds.dit
ntdsutil.exe Is a command line tool that provides a management mechanism for the active directory . Use ntdsutil.exe, You can maintain and manage the active directory database 、 Control the operation of a single host 、 Create application directory partition 、 Remove the installation wizard from an unused Active Directory (DCPromo.exe) The metadata left by the successfully degraded domain controller . The tool is installed on the domain controller by default 、 You can operate directly on the domain controller , You can also operate remotely on the domain controller through machines in the domain .ntdsutil.exe The supported operating systems are Windows Server 2003、 Windows Server 2008、 Windows Server 2012.
1.2 utilize vssadmin extract ntds.dit
vssadminn yes Windows Server 2008 & Windows 7 Provided VSS Management tools , Can be used to create and delete shadow copies 、 List information about shadow copies ( Can only manage the system Provider Shadow copies created )、 Displays all shadow copy writers installed (writers) And providers (providers), And changing the storage space of shadow copies ( That is to say “diff Space ”) And so on .vssadminn Operation process and ntdsutil similar
1.3 utilize vssown.vbs Script extraction ntds.dit
vssown.vbs Script functions and vssadmin similar .vssown.vbs The script was created by Tim Tomes Developed , Can be used to create and delete shadow copies , And start and stop the shadow copy service . You can execute the script in a command line environment .
1.4 Use ntdsutil Of IFM Create shadow copies
In addition to extracting by executing commands as described above ntds dit, You can also use to create a IFM Way to obtain nsdi. In the use of ntdsutil establish IFM when , Snapshot generation is required 、 load 、 take ntds. dit And computer SAM Copy the file to the destination folder . These operations can also be done through PowerShell or WMI Remote execution
1.5 Use diskshadow export ntds.dit
There is such a description in Microsoft's official documents :“diskshadow.exe This tool can use volume shadow copy services (VSS) Multiple functions provided . In the default configuration ,diskshadow.exe An interactive command interpreter is used , And DiskRaid or DiskPart similar .” in fact , because diskshadow The code is signed by Microsoft , and Windows Server 2008、Windows Server 2012 and Windows Server 2016 All default to include diskshadow, therefore ,diskshadow It can also be used to operate the volume shadow copy service and export ntds dit.diskshadow With the function of vshadow similar , And also located in C:windows\system32\ Under the table of contents . however ,vshdow Is contained in Windows SDK Medium , In practical application, it may be necessary to upload it to the target machine .
diskhadow There are interactive and non interactive modes . When using interactive mode , You need to log in to the graphical management interface of the remote desktop . Whether interactive or non interactive , You can use exee Call a script File to execute related commands .
1.6 Monitor volume shadow copy service usage
By monitoring the usage of volume shadow copy services , It can discover some malicious operations of the attacker in the system in time .
- Monitor the volume shadow copy service and any active directory database files involved (ntds.dit) Suspicious operation behavior .
- monitor System Event ID 7036( The flag that the volume shadow copy service enters the running state ) Suspicious instances of , And how to create vssvc.exe Process events .
- Monitoring creates dkshndko.exe And related child processes .
- Monitor the data in the client device diskshadow.exe Instance creation event . Unless the business needs , stay Windows Should not appear in the operating system diskshadow.exe. If you find that , It should be deleted immediately .
- Monitor emerging logical drive mapping events through logs .
2. export ntds.dit Hash value in
2.1 Use esedbexport recovery ntds.dit
download libesedb
2.2 Use impacket The toolkit exports hash values
2.3 stay windows Next analysis ntds.dit And export the domain account number and domain hash value
Use NTDSDumpex.exe You can export hash values .NTDSDumpex take ntds.dit、SYSTEM and NTDSDumpex.exe Record on the same day , Open the command line environment , Enter the following command , Export domain account and domain hash value
3. utilize dcsync Get the domain hash value
3.1 Use mimikatz Dump domain hash values
mimikaz There is one deyne function , You can use the volume shadow copy service to read directly ntds.dit File and retrieve the city hash value . It should be noted that , You must run with domain administrator privileges mimikatz Before it can be read ntds.dit.
3.2 Use dcsync Get the domain account and domain hash value
Invoke _DCSync.ps1 You can use desync Direct reading ntds.dit, To get the domain account and domain hash value
4. Use MSF Get the domain hash value
It uses psexec_ntdsgrab modular
5. Use vshadow.exe and QuarksPwDump.exe Export domain account and domain hash value
In a normal domain environment ,ntds.dit The file contains a lot of information , It's bigger , Inconvenient to save to local . If anti-virus software is not installed on the domain controller , An attacker can enter the domain controller directly , export ntds.dit And obtain the domain account and domain hash value , And there's no need to ntds.dit Save to local .
QuarksPwDump Can quickly 、 Security 、 Fully read all domain accounts and domain hash values .
ShadowCopy Is a free enhancement Type file copying tool .ShadowCopy Using Microsoft's shadow copy technology , Can copy locked files and files opened by other programs .
vshdow.exe It's from Windows SDK Extracted from . In this experiment , install vshadow.exe after , Will be in VSSDK72\TestApps\vshadow Create one in the directory bin file vshadow.xce ( This file can be extracted separately for use ) Put all the documents in domainhash In the folder
stay shadowcopy.bat Set the working directory to C:Windows\Temp( The catalog can be found in shadowcopy.bat Set up your own )
perform shaowopba Script ( The script uses vshadow.exe Generate snapshot ), Copy ntds.dit. then , Use QuarksPwDump Repair ntds.dit And export the domain hash value . After running the script , The exported... Will be stored in the working directory just set ntds.dit and hash.txt( Contains all domain accounts and their hash values in the domain ).
This section lists several ways to export user hash values . After getting the hash value , You can use local tools or online tools to crack it . If the local cracking method is adopted , have access to Cain LC7、Opherack、SAMInside、Hashal Tools such as . If online cracking is adopted , in the light of NTLM Hash Our online cracking website is aimed at LM Hash Online cracking website
6. Kerberos Analysis and prevention of domain user privilege raising vulnerability
Microsoft is in 2014 year 1 month 18 An emergency supplement was issued on the th , Repair the Kerhers The right of urban users is leaked (MS14-068 CVE201462424) all Windwos The server operating system will be affected by this vulnerability , Include WindowsServer2003、Windows Server 208 Windows Sever 2008 R2、Windows Server 2012 and Win2012R2. This vulnerability can affect the overall permission control of the active directory , Allows an attacker to elevate the privileges of any user in the city to the domain management level . informally , If the attacker gets the of any computer in the city Shell jurisdiction , Also know the user name used in any city 、SID、 password , You can obtain the permission of city administrator , Then control the domain controller , Finally get domain permissions .
The cause of this vulnerability is : The user is asking Kerberos Miming Distribution Center ( KDC) apply TGT Identity documents generated by the ticket authorization service ) when , You can forge your own Kerberos Notes . If the ticket declares that it has domain administrator privileges , The signature of the bill is not verified when the bill is processed , Then return to the user TGT Let the common domain manage user permissions . The user can put TGT Send to KDC, KDC Of TGS ( Bill authorization service ) In the verification of TGT after , Service ticket (Service Ticket) Send to the user , The user has access to any of the services , This allows attackers to access resources within the domain .
6.1 PyKEK tool kit
pyKEK (Pybon Kerberos Expoiation Kit) It's using Kerberos A toolkit for protocol penetration testing , Use PyKEK You can generate a high authority service ticket , And pass mimikatz Inject the service ticket into memory .
PyKEK Only need to be configured in the system Python 2.7 You can run the environment . Use PyKEK, Can be Python File to executable
6.2 goldenPac.py
goldenPac.py It's a tool for Kerberos Tools for testing , It's integrated in impacket/examples Next .
边栏推荐
- 当人们用互联网式的思维和视角来看待产业互联网的时候,其实已陷入到了死胡同
- Unity C # e-learning (VI) -- FTP (I)
- 内网学习笔记(6)
- Which account is safer and better for access letter
- PS5连接OPPO K9电视不支持2160P/4K
- O (log (min (m, n))
- write a number of lines to a new file in vim
- MeterSphere开源持续测试平台与阿里云云效DevOps的集成
- 創新藥二級市場審餅疲勞:三期臨床成功、產品獲批也不管用了
- 02 common codes for Epicor secondary development
猜你喜欢

内网学习笔记(7)

左手梦想 右手责任 广汽本田不光关注销量 还有儿童安全

文件系统 -- 磁盘基础知识和FAT32文件系统详细介绍

入职一家新公司,如何快速熟悉代码?

非凸联合创始人李佐凡:将量化作为自己的终身事业

Hashcat 的使用

谈谈飞书对开发工作的优势 | 社区征文

Experience of epidemic prevention and control, home office and online teaching | community essay solicitation

EasyCVR国标协议接入的通道,在线通道部分播放异常是什么原因?

The ecosystem of the yuan universe
随机推荐
Some Modest Advice for Graduate Students - by Stephen C. Stearns, Ph.D.
IPC mechanism
保险APP适老化服务评测分析2022第06期
获取图片外链的方法–网易相册[通俗易懂]
Elastase instructions in Chinese and English
MCN机构遍地开花:博主和作者要谨慎签约、行业水很深
Cake review fatigue in the secondary market of innovative drugs: phase III clinical success and product approval
beescms网站渗透测试和修复意见「建议收藏」
String common methods
Do you know your ABC
字符串数组转换为list集合
多模态数据也能进行MAE?伯克利&谷歌提出M3AE,在图像和文本数据上进行MAE!最优掩蔽率可达75%,显著高于BERT的15%
Listen to the markdown file and hot update next JS page
Is CICC securities reliable? Is it safe to open a securities account?
中文地址与英文地址
2022-06-24:golang选择题,以下golang代码输出什么?A:1;B:3;C:4;D:编译失败。 package main import ( “f
Beescms website penetration test and repair comments "suggestions collection"
Day 04 - file IO
O (log (min (m, n))
当一个接口出现异常时候,你是如何分析异常的?