# mdm_server.py - Serves enrollment profile over plain HTTP
from flask import Flask, send_file
app = Flask(__name__)
@app.route('/enroll.mobileconfig')
def serve_profile():
# Vulnerability: profile delivered without HTTPS
return send_file('profile.mobileconfig', mimetype='application/x-apple-aspen-config')
if __name__ == '__main__':
app.run(host='0.0.0.0', port=80)
MDM 注册配置文件通过明文 HTTP 传输,没有加密或数字签名验证。同一网络上的攻击者可以拦截请求并将配置文件替换为恶意配置文件,从而获得设备管理权限。
启动攻击者的 HTTP 服务器:
python mdm_server.py
当受害者访问 http://attacker/enroll.mobileconfig 时,会下载恶意配置文件。